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.

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.

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.

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.

Regards,

+---------------------------------------------------------------+
|   SciTech Software - Building Truly Plug'n'Play Software!     |
+---------------------------------------------------------------+
| Kendall Bennett          | Email: [EMAIL PROTECTED]    |
| Director of Engineering  | Phone: (530) 894 8400              |
| SciTech Software, Inc.   | Fax  : (530) 894 9069              |
| 505 Wall Street          | ftp  : ftp.scitechsoft.com         |
| Chico, CA 95928, USA     | www  : http://www.scitechsoft.com  |
+---------------------------------------------------------------+



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

Reply via email to