This adds a GLSupport module that includes the platform specific parts that are needed to create a GL Context. (i.e. GLX, WGL, Cocoa)
They had been copy/ pasted but stayed largely the same across the different GL Rendersytems.
The result is the GLNativeSupport API that can be plugged in the exiting GL*Support classes (e.g. GL3PlusSupport) to handle the context creation.
Furthermore the API was extended to allow specifying a context profile. This way the GL3Plus RS creates a core profile, while the old GL RS uses the compatibility profile.
The advantage
The obvious one is that we do not have duplicated GL context code any more. However we can now also easily create a GLES2 context using GLX/WGL on the desktop. A change of the GLES2 RS to do so is in the making.
you can find the code here:
https://github.com/OGRECave/ogre/pull/182
Relation to the Windowing Plugin Work ( http://www.ogre3d.org/forums/viewtopic.php?f=4&t=84022)
the idea behind both solutions is simililar, namely to share the window creation logic between the render systems. However the aim is much smaller - instead of providing plugins for all possible libraries to create a window, this one just provides one library that implements the platform native context creation. Consequently the SDL and GTK based GLSupport classes are gone now. You have to use the externalWindowHandle in these cases.
The advantage of this approach is much simpler code. As you can see from the PR stats we have 90 changed lines vs. 9100 removed lines.
GLSupport Module / Windowing Plugin Reloaded
-
- OGRE Team Member
- Posts: 2142
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1151