Hi,
I am currently porting an application so that it uses the OpenGL core profile, 
mainly in order to gain access to modern OpenGL features under OS X. I had to 
make some changes to osg so that it does not use deprecated functions:

Texture::getModeUsage now only adds the texture mode if 
FIXED_FUNCTION_AVAILABLE is defined
PolygonMode::apply now can still be used to achieve wireframe rendering in GL3 
core profile (previously it was ignored completely)
State::initializeExtensionProcs now only queries GL_MAX_TEXTURE_COORDS if 
FIXED_FUNCTION_AVAILABLE is defined
Texture::applyTexParameters: CLAMP is translated to CLAMP_TO_EDGE if 
OSG_GL3_AVAILABLE is defined
Texture::applyTexParameters: GL_DEPTH_TEXTURE_MODE_ARB is not set if neither 
GL1 nor GL2 is available

I also made a change that is completely unrelated to core profile compatibility 
in State.cpp. Previously, State created a GLExtensions object in its 
constructor and deleted it in its destructor. It also called GLExtensions::Set 
when creating and deleting the extension object, which in my opinion is 
problematic because it may delete an extension object that was not created by 
the State object. I changed State so that it simply uses 
GLExtensions::Get(_contextID, true) to get its extension object and removed the 
calls to GLExtensions::Set. I did this because I had a strange and 
unpredictable problem with the extension object in another part of my code and 
wanted to simplify the initialization process.

My patch is based on the current github repository (osg116).

My application also uses osgText, which required much more changes to work with 
the core profile. Most notably I had to change the Glyph class so that it uses 
VBOs. It was also necessary to change the font texture format, because GL_ALPHA 
is deprecated. You probably do not want to merge my changes to osgText yet, 
because additional testing is required under different platforms. I could 
submit the files later after additional testing.

Cheers,
Andreas

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62285#62285




Attachments: 
http://forum.openscenegraph.org//files/glcorefixes_855.zip


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to