Hi,

I have been able to compile it for GL3 (both in 3.0 and 3.1 branches). I did the following modifications:

1) In GL I add two includes, three defines for missing symbols and an ifdef __APPLE__

    #if defined(OSG_GL3_AVAILABLE)
    #ifdef __APPLE__
#include <OpenGL/OpenGL.h> 
#include <OpenGL/gl3.h> 
#define GLint64EXT GLint64
#define GLuint64EXT GLuint64
#define GL_BGRA_EXT GL_BGRA
#else
      #include <GL3/gl3.h>
       #define GL3_PROTOTYPES 1
#endif

2) When compiling my original cmake line lacks extra defines (as seem in osgsimplegl3.cpp). The right line is:

/usr/bin/cmake -G Xcode -D OSG_COMPILE_FRAMEWORKS:BOOL=1 -D OSG_WINDOWING_SYSTEM:STRING=Cocoa \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=0 -D CMAKE_OSX_ARCHITECTURES:STRING=x86_64 \
-D OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX:STRING=imageio -D CMAKE_OSX_SYSROOT:STRING=/Developer/SDKs/MacOSX10.7.sdk  \
-D OSG_GL3_AVAILABLE::BOOL=1 -D OSG_GL1_AVAILABLE::BOOL=0 -D OSG_GL2_AVAILABLE::BOOL=0 \
-D OSG_GLES1_AVAILABLE::BOOL=0 -D OSG_GLES2_AVAILABLE::BOOL=0 \
-D OSG_GL_DISPLAYLISTS_AVAILABLE::BOOL=0 -D OSG_GL_FIXED_FUNCTION_AVAILABLE::BOOL=0 \
-D OSG_GL_MATRICES_AVAILABLE::BOOL=0 -D OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE::BOOL=0 \
-D OSG_GL_VERTEX_FUNCS_AVAILABLE::BOOL=0 .

3) Setting the pixel format as Stephan suggests.

In bool GraphicsWindowCocoa::realizeImplementation():
   attr[i++] = NSOpenGLPFAOpenGLProfile;
   attr[i++] = NSOpenGLProfileVersion3_2Core;

In bool PixelBufferCocoa::realizeImplementation() 
    attr[i++] = NSOpenGLPFAOpenGLProfile;
    attr[i++] = NSOpenGLProfileVersion3_2Core;


4) The osg ffmpeg pluging meeds /usr/lib/libbz2.dylib (this is not related to GL3 and probably is due to how I compiled my copy of ffmpeg)


By the way, executing osgsimplegl3 I got lots of errors:
Warning: detected OpenGL error 'invalid enumerant' at Before Renderer::compile
Warning: Material::apply(State&) - not supported.
Warning: TexGen::apply(State&) - not supported.
Warning: Material::apply(State&) - not supported.
Warning: TexGen::apply(State&) - not supported.

Salut,

   David


On Mar 1, 2012, at 23:19 , Stephan Huber <[email protected]> wrote:

Hi,

Am 01.03.12 21:45, schrieb Paul Martz:
But to my knowledge no one has contributed code to make it work on OS X
or Linux. Please do so, if you need that functionality.

Besides the specific CMAKE_VARIABLES to get Open GL 3 support on OS X
GraphicsWindowCocoa needs some love when creating a graphics context.

Just setting the NSPixelFormat to

NSOpenGLPixelFormatAttribute pixelFormatAttributes[] =
{
   NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
   0
};

when compiling for Open GL 3 should help.

cheers,
Stephan


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


David Garcia
 
Technical Director 

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

Reply via email to