[osg-users] [build] How to properly use the OSG_GL3_AVAILABLE CMake option?

Robert Osfield robert.osfield at gmail.com
Tue Nov 24 02:22:00 PST 2009


Hi John,

I haven't tried GL3 yet - this work was done by Paul Martz, but I did
the GLES work which served as ground work for the GL3 support so I'll
have bash at an answer:

On Mon, Nov 23, 2009 at 10:58 PM, John Price <john.price00 at gmail.com> wrote:
> My nVidia graphics driver supports GL 3.2. So I enabled OSG_GL3_AVAILABLE and got hundreds of errors about gl3.h. I downloaded gl3.h from OpenGL.org and placed it where it would be found, and got hundreds of new errors.
>
> I know I am doing something wrong and was wondering if someone would be kind enough to provide a quick tutorial. I don't need complete newbie instructions, just the necessary steps to compile OSG with gl3.

My guess is the the GL compile errors are down to you not disabling
the the build of the GL1/GL2 features at the same time as enable the
GL3 build as the GL3 header doesn't contain these features.  Using
ccmake/CMakeStup you can adjust the following entries (mostly setting
them all to OFF) :

OSG_GLU_AVAILABLE OFF
OSG_GL1_AVAILABLE OFF
OSG_GL2_AVAILABLE OFF
OSG_GL3_AVAILABLE  ON
OSG_GLES1_AVAILABLE OFF
OSG_GLES2_AVAILABLE OFF
OSG_GL_DISPLAYLISTS_AVAILABLE OFF
OSG_GL_MATRICES_AVAILABLE OFF
OSG_GL_VERTEX_FUNCS_AVAILABLE OFF
OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE OFF
OSG_GL_FIXED_FUNCTION_AVAILABLE OFF

This is obviously a bit of pain right now, but my plan is to do some
further work on the CMake scripts to set all this automatically
depending upon your GL target.  I haven't tackled this up to now as
getting the code base portable across all these targets has been my
priority.

FYI, you can actually simulate what it's like just having GL3.2 or
GLES 2 by disabling these features even when building against GL2.

Robert.


More information about the osg-users mailing list