[osg-users] OpenGL Extension definition in OSG Headers

2007-09-11 Thread David Callu
Hi Robert,

   After seen and changed the patch provide by Art Tevs on the
GL_EXT_gpu_shader4 extension.
   I have remarked that the extension guard
 #ifndef GL_EXT_gpu_shader4
   don't do
 #define GL_EXT_gpu_shader4


   I go through the glext.h and I see that it is define with the extension
functions definition.



ex of the Nvidia glext.h:

#ifndef __glext_h_
#define __glext_h_

#ifdef __cplusplus
extern C {
#endif

/* blablabla */

... lot of define ...


#ifndef GL_EXT_gpu_shader4
#define GL_SAMPLER_1D_ARRAY_EXT   0x8DC0
#define ...
#endif

... lot of define ...

#ifndef GL_EXT_gpu_shader4
#define GL_EXT_gpu_shader4 1
#ifdef GL_GLEXT_PROTOTYPES
extern void APIENTRY glGetUniformuivEXT (GLuint program, GLint location,
GLuint *params);
extern void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint
color, const GLchar *name);
extern GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar
*name);
extern void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
...


So, to keep OSG consistent, we need to add
   #define GL_EXT... 1
after each
   #ifndef GL_EXT...

concerned file are FragmentProgram, VertexProgram, GL2Extensions,
PointSprite,



Thought ?

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


Re: [osg-users] OpenGL Extension definition in OSG Headers

2007-09-11 Thread Robert Osfield
Hi David,

We don't need to import all the extension prototypes and defines
provided in glext.h, only the ones that the code uses.   We also
aren't trying to #define everything as per glext.h to work as a
replacement, so its not required to do a #define GL_extension_name
within each block of defines.

What you see in the OSG headers works pretty well, you do get little
hiccups like we've seen today, but in these are typically pretty easy
to fix once the correct defines are set.

Robert.

On 9/11/07, David Callu [EMAIL PROTECTED] wrote:
 Hi Robert,

After seen and changed the patch provide by Art Tevs on the
 GL_EXT_gpu_shader4 extension.
I have remarked that the extension guard
  #ifndef GL_EXT_gpu_shader4
don't do
  #define GL_EXT_gpu_shader4


I go through the glext.h and I see that it is define with the extension
 functions definition.



 ex of the Nvidia glext.h:

 #ifndef __glext_h_
 #define __glext_h_

 #ifdef __cplusplus
 extern C {
 #endif

 /* blablabla */

 ... lot of define ...


 #ifndef GL_EXT_gpu_shader4
 #define GL_SAMPLER_1D_ARRAY_EXT   0x8DC0
  #define ...
 #endif

 ... lot of define ...

 #ifndef GL_EXT_gpu_shader4
 #define GL_EXT_gpu_shader4 1
 #ifdef GL_GLEXT_PROTOTYPES
 extern void APIENTRY glGetUniformuivEXT (GLuint program, GLint location,
 GLuint *params);
 extern void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint
 color, const GLchar *name);
 extern GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar
 *name);
 extern void APIENTRY glUniform1uiEXT (GLint location, GLuint v0);
 ...


 So, to keep OSG consistent, we need to add
#define GL_EXT... 1
 after each
#ifndef GL_EXT...

 concerned file are FragmentProgram, VertexProgram, GL2Extensions,
 PointSprite,



 Thought ?

 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