Added internal context object retrieval method

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Made backend specific code more generic and not depend on OpenGL

At some places where a check native vs other backend was requried, there
were erroneous checks for native vs OpenGL. Those checks were made more
generic.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Added Direct3D 9 support

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>