Hi Paul, J-S

I applied 2 modifications, and it nearly works:

Mod 1: your suggested CMAKE modification
Mod 2: I extended the osg/GL includefile to define some windows constants 
before including GL3/gl3.h to aviod the name confilcts in the same way like it 
is done prior to the GL2 include:

Code:

#elif defined(OSG_GL3_AVAILABLE)
        // Under Windows avoid including <windows.h>
    // to avoid name space pollution, but Win32's <GL/gl.h> 
    // needs APIENTRY and WINGDIAPI defined properly. 
    // XXX This is from Win32's <windef.h> 
    #ifndef APIENTRY
        #define GLUT_APIENTRY_DEFINED
        #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
            #define WINAPI __stdcall
            #define APIENTRY WINAPI
        #else
            #define APIENTRY
        #endif
    #endif

     // XXX This is from Win32's <windef.h> 
    #ifndef CALLBACK
        #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
            #define CALLBACK __stdcall
        #else
            #define CALLBACK
        #endif
    #endif

    // XXX This is from Win32's <wingdi.h> and <winnt.h> 
    #ifndef WINGDIAPI
        #define GLUT_WINGDIAPI_DEFINED
        #define DECLSPEC_IMPORT __declspec(dllimport)
        #define WINGDIAPI DECLSPEC_IMPORT
    #endif
    
    // XXX This is from Win32's <ctype.h>
    #if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&((__GNUC__ == 
3)||(__GNUC__ == 4)))
        typedef unsigned short wchar_t;
        #define _WCHAR_T_DEFINED
    #endif




    #define GL3_PROTOTYPES 1
    #include <GL3/gl3.h>

    #ifndef GL_APIENTRY
        #define GL_APIENTRY APIENTRY
    #endif // GL_APIENTRY

#else




No the compile works, and most of the linking as well.

Only the Qtosg Module faisl to link, because it includes Qts OpenGL module, 
wich includes gl.h

The resulting definition conflict of gl3.h and gl.h ends in a lot of compile 
errors in osgQt.

What would be the approriate way to solve this issue?  According to this Qt 
issue report http://bugreports.qt.nokia.com/browse/QTBUG-8611 Qt currently does 
not support gl3.h usage.

So currently the only option is to disable osgQt while using GL3.

I'll submit my two modified files, afterwards the following steps are required 
for windows+MSVC users:
1. Download gl3.h from www.opengl.org/registry and put it into <your 
DevEnvIncludeDir>/GL3/gl3.h
2. Configure CMake to disable all OSG_GLx_AVAILABLE
3. Configure CMake to disable OSG_GL_DISPLAYLISTS_AVAILABLE
4. Configure CMake to disable OSG_GL_FIXED_FUNCTION_AVAILABLE
5. Configure CMake to disable OSG_GL_MATRICES_AVAILABLE
6. Configure CMake to disable OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE
7. Configure CMake to disable OSG_GL_VERTEX_FUNCS_AVAILABLE
8. Configure CMake to ENable OSG_GL3_AVAILABLE
9. Configure CMake to disable Qt usage, because currently Qt is not GL3 capable.

Cheers,
Torben

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





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to