Is there any chance for a separation of enum/data types from
function prototypes, header-wise? E.g. a GL/gltypes.h and
GL/glfunc.h, both of which just included by GL/gl.h? 

This would be completely transparent to any regular application,
but it would make life easier for those of us on the (lunatic)
fringe. Mind you, not a problem, just an inconvenience.

Example: the Quake-style approach of loading libGL.so as a module. 

#ifdef USE_SWITCHABLE_GL
  extern void ( APIENTRY * qglAccum )(GLenum op, GLfloat value);
#else
  GLAPI void GLAPIENTRY glAccum( GLenum op, GLfloat value );
#endif

Ideally, we could instead use 

  GLAPI void ( GLAPIENTRY * glAccum)( GLenum op, GLfloat value );

in our gl.h replacement, and assign the pointer either by
dlopen/[dlsym|glxGetProcAddress]/dlclose, or just link to 
libGL.so by compile time switch (thus becoming well behaved L
inux OpenGL Base ABI citizens some way down the road). 

Ideally, we would not have to duplicate enum/typedefs and would
just combine our glfunc.h with the "official" gltypes.h.

The above switchable GL built also works for logging, profiling,
and (where appropriate) per-call glGetError asserts, selectable
at runtime on a per-frame basis. Reason enough to make it more
convenient even if you believe dlopen("libGL.so") is nuts. 


GL/glext.h could also be included w/o GL core prototypes.

I see a log/trace package (with glfuncp.h generated from
GL/glfunc.h e.g. by script) as a nice generic tool. Of course,
we could dynamically generate gltypes.h, too :-/.



                                              b.



-- 

"Problem solving is hunting. It is savage pleasure,
  and we are born to it."      Thomas Harris, Silence of the Lambs

Reply via email to