[osg-users] OSG using OpenGL 3.2 in Mac OS X 10.7 (Lion)

2012-09-25 Thread Paul Martz
Hi David -- I posted your change #1 to osg-submissions. (To refresh your memory, 
this is the fix for how OpenGL.h is included by the include/osg/GL header.)


With this change, we (at least) have OSG trunk building for GL3 on OSX 10.7. To 
actually get it running (i.e., support for forward compatible / core profile, 
vertex array objects, etc), that can be a follow-on submission.

   -Paul



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


Re: [osg-users] OSG using OpenGL 3.2 in Mac OS X 10.7 (Lion)

2012-03-02 Thread Robert Osfield
HI David,

The OSG is designed to check for extensions at runtime, so even if you
compile the OSG against OpenGL 1.1 it will still be able to load up
OpenGL 3.2 features at runtime and use them.

The CMake option to compile specifically against OpenGL 3 is for when
you want to compile against OpenGL 3 without the backwards
compatibility to OpenGL 2.x, this disables all the fixed function
pipeline.  This is something you might want, but it's mostly not
necessary.

Robert.

On 1 March 2012 20:27, David Garcia da...@aimsun.com wrote:

 Hi,

 I'm trying to compile an application in Mac that requires OpenGL 3.2. The
 app starts but fails when compiling the shaders and seems that, by default,
 OSG 3.0.1 compiles without OpenGL 3 support.

 My next step was to recompile OSG with these settings:
 /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 .

 And seems that this time uses GL3 as it fails to compile with the error:
 include/osg/GL:109:18: fatal error: 'GL3/gl3.h' file not found [2]

 Then I add the missing includes to the path and I got a lot of errors:

 /usr/include/GL3/gl3.h:85:9: warning: 'GL3_PROTOTYPES' macro redefined [2]
  #define GL3_PROTOTYPES
          ^
 OpenSceneGraph/include/osg/GL:108:17: note: previous definition is here
          #define GL3_PROTOTYPES 1
                  ^
 OpenSceneGraph/include/osg/GL:130:50: error: use of undeclared identifier
 'glLoadMatrixf'; did you mean 'glLoadMatrix'? [3]
      inline void glLoadMatrix(const float* mat) {
 glLoadMatrixf(static_castconst GLfloat*(mat)); }
                                                   ^
                                                   glLoadMatrix
 fix-it:OpenSceneGraph/include/osg/GL:{130:50-130:63}:glLoadMatrix
 OpenSceneGraph/include/osg/GL:130:17: note: 'glLoadMatrix' declared here [3]
      inline void glLoadMatrix(const float* mat) {
 glLoadMatrixf(static_castconst GLfloat*(mat)); }
                  ^
 OpenSceneGraph/include/osg/GL:131:50: error: use of undeclared identifier
 'glMultMatrixf'; did you mean 'glMultMatrix'? [3]
      inline void glMultMatrix(const float* mat) {
 glMultMatrixf(static_castconst GLfloat*(mat)); }
                                                   ^
                                                   glMultMatrix
 … and more …

 The question is now, can OpenGL 3.2 be use in Mac OS X? I'm doing something
 wrong?

 Thanks a lot,

   David



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

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


[osg-users] OSG using OpenGL 3.2 in Mac OS X 10.7 (Lion)

2012-03-01 Thread David Garcia

Hi,

I'm trying to compile an application in Mac that requires OpenGL 3.2. The app 
starts but fails when compiling the shaders and seems that, by default, OSG 
3.0.1 compiles without OpenGL 3 support.

My next step was to recompile OSG with these settings:
/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 .

And seems that this time uses GL3 as it fails to compile with the error:
include/osg/GL:109:18: fatal error: 'GL3/gl3.h' file not found [2]

Then I add the missing includes to the path and I got a lot of errors:

/usr/include/GL3/gl3.h:85:9: warning: 'GL3_PROTOTYPES' macro redefined [2]
 #define GL3_PROTOTYPES
 ^
OpenSceneGraph/include/osg/GL:108:17: note: previous definition is here
 #define GL3_PROTOTYPES 1
 ^
OpenSceneGraph/include/osg/GL:130:50: error: use of undeclared identifier 
'glLoadMatrixf'; did you mean 'glLoadMatrix'? [3]
 inline void glLoadMatrix(const float* mat) { 
glLoadMatrixf(static_castconst GLfloat*(mat)); }
  ^
  glLoadMatrix
fix-it:OpenSceneGraph/include/osg/GL:{130:50-130:63}:glLoadMatrix
OpenSceneGraph/include/osg/GL:130:17: note: 'glLoadMatrix' declared here [3]
 inline void glLoadMatrix(const float* mat) { 
glLoadMatrixf(static_castconst GLfloat*(mat)); }
 ^
OpenSceneGraph/include/osg/GL:131:50: error: use of undeclared identifier 
'glMultMatrixf'; did you mean 'glMultMatrix'? [3]
 inline void glMultMatrix(const float* mat) { 
glMultMatrixf(static_castconst GLfloat*(mat)); }
  ^
  glMultMatrix
… and more …

The question is now, can OpenGL 3.2 be use in Mac OS X? I'm doing something 
wrong?

Thanks a lot,

  David


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


Re: [osg-users] OSG using OpenGL 3.2 in Mac OS X 10.7 (Lion)

2012-03-01 Thread Paul Martz
Since release 3.0.0, OSG has supported OpenGL versions 3.0 on Windows. On svn 
trunk, see the example 'osgsimplegl3', especially the comment block at the end 
of the file that discusses building OSG for GL3 use.


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.

   -Paul


On 3/1/2012 1:27 PM, David Garcia wrote:


Hi,

I'm trying to compile an application in Mac that requires OpenGL 3.2. The app
starts but fails when compiling the shaders and seems that, by default, OSG
3.0.1 compiles without OpenGL 3 support.

My next step was to recompile OSG with these settings:
/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 .

And seems that this time uses GL3 as it fails to compile with the error:
include/osg/GL:109:18: fatal error: 'GL3/gl3.h' file not found [2]

Then I add the missing includes to the path and I got a lot of errors:

/usr/include/GL3/gl3.h:85:9: warning: 'GL3_PROTOTYPES' macro redefined [2]
#define GL3_PROTOTYPES
^
OpenSceneGraph/include/osg/GL:108:17: note: previous definition is here
#define GL3_PROTOTYPES 1
^
OpenSceneGraph/include/osg/GL:130:50: error: use of undeclared identifier
'glLoadMatrixf'; did you mean 'glLoadMatrix'? [3]
inline void glLoadMatrix(const float* mat) { glLoadMatrixf(static_castconst
GLfloat*(mat)); }
^
glLoadMatrix
fix-it:OpenSceneGraph/include/osg/GL:{130:50-130:63}:glLoadMatrix
OpenSceneGraph/include/osg/GL:130:17: note: 'glLoadMatrix' declared here [3]
inline void glLoadMatrix(const float* mat) { glLoadMatrixf(static_castconst
GLfloat*(mat)); }
^
OpenSceneGraph/include/osg/GL:131:50: error: use of undeclared identifier
'glMultMatrixf'; did you mean 'glMultMatrix'? [3]
inline void glMultMatrix(const float* mat) { glMultMatrixf(static_castconst
GLfloat*(mat)); }
^
glMultMatrix
… and more …

The question is now, can OpenGL 3.2 be use in Mac OS X? I'm doing something 
wrong?

Thanks a lot,

David

*
*


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

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


Re: [osg-users] OSG using OpenGL 3.2 in Mac OS X 10.7 (Lion)

2012-03-01 Thread Stephan Huber
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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG using OpenGL 3.2 in Mac OS X 10.7 (Lion)

2012-03-01 Thread David Garcia
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	#endif2) When compiling my original cmake line lacks extra defines (as seem inosgsimplegl3.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.Inbool GraphicsWindowCocoa::realizeImplementation():	  attr[i++] = NSOpenGLPFAOpenGLProfile;	  attr[i++] = NSOpenGLProfileVersion3_2Core;Inbool 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, executingosgsimplegl3 I got lots of errors:Warning: detected OpenGL error 'invalid enumerant' at Before Renderer::compileWarning: Material::apply(State) - not supported.Warning: TexGen::apply(State) - not supported.Warning: Material::apply(State) - not supported.Warning: TexGen::apply(State) - not supported.Salut, DavidOn Mar 1, 2012, at 23:19 , Stephan Huber ratzf...@digitalmind.de 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 Xor Linux. Please do so, if you need that functionality.Besides the specific CMAKE_VARIABLES to get Open GL 3 support on OS XGraphicsWindowCocoa needs some love when creating a graphics context.Just setting the NSPixelFormat toNSOpenGLPixelFormatAttribute pixelFormatAttributes[] ={ NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, 0};when compiling for Open GL 3 should help.cheers,Stephan___osg-users mailing listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
David GarciaTechnical Director

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


Re: [osg-users] OSG using OpenGL 3.2 in Mac OS X 10.7 (Lion)

2012-03-01 Thread Paul Martz

On 3/1/2012 5:11 PM, David Garcia wrote:

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



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;


When you have tested and are satisfied with the changes mentioned in items 1 and 
3, I hope you'll submit them to osg-submissions. It will be nice to have GL 3 
support on something other than MS Windows.



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.


If you attempt to render a scene graph that uses functionality that is 
deprecated in GL3, such as Material and TexGen StateAttributes, then OSG 
displays warnings so that you (or your app) can take steps to address that 
situation.

   -Paul

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