Kendall Bennett wrote:
> 
> Hi Guys,
> 
> One problem I just came across with the latest Mesa sources is that
> the Mesa version of GL/gl.h includes function prototypes for all the
> extension functions. Ie there is the:
> 
> GLAPI void GLAPIENTRY glBlendEquationEXT( GLenum mode );
> 
> It is a bad thing for the OpenGL headers to be declaring extension
> functions directly (and especially to be exported!), because that
> allows application developers to circumvent the proper extension
> mechanism. This can lead to portability problems down the trace.

Well, putting prototypes for extension function in gl.h has a
long history on Unix systems.

Removing them at this point would cause a lot of problems/complaints.


> What is needed is to define function *pointer* prototypes in the
> GL/gl.h header file, which will be used by apps to declare pointers
> to the functions that it will be calling. In our header files we
> include the following (not found in the Mesa headers):
> 
> typedef void (APIENTRYP  PFNGLBLENDEQUATIONEXTPROC)(GLenum mode);
> 
> The above macros are taken from the way that the SGI and Microsoft
> headers define this stuff in their header files.

Yup, we should have those too.


> Hence I proprose that we have a GL/gl_ext.h header file that contains
> all the internal prototypes for extension functions. Obviously it is
> important for binary compatibility that all implementations declare
> and export functions that have the same prototypes for common
> extensions.

The Linux/OpenGL standards effort has proposed a GL/glext.h header
for this purpose.  I think the SGI NT systems were the first to
ship such a file.

I anticipate moving all the extension tokens/prototypes into a
new glext.h file in the near future.


> There is also the need for vendor specific OpenGL extensions to be
> included, that should not be in the common header files. Hence I also
> propose that the last line of GL/gl.h should go ahead and include
> GL/gl_vendor.h. The default provided with Mesa should be either
> empty, or contain Mesa specific stuff. We will have a version that we
> ship that does stuff we need to allow for auto-switching of OpenGL
> implementations under Windows at runtime.


For more info about the proposed glext.h file visit
http://reality.sgi.com/opengl/linux/linuxbase.html

The mailing list archive is at
http://www.mail-archive.com/oglbase-discuss%40corp.sgi.com/
Some of the early posts discuss this subject.

-Brian


_______________________________________________
Mesa-dev maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev

Reply via email to