Re: [Plib-devel] GL_COLOR_MATERIAL pitfall
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-04-28 18:18:43
|
Wolfram Kuss wrote: > > BTW, regarding the GL_COLOUR_MATERIAL problem: > Steve said some time ago that the next thing to do would be to write > a program that has the same problem as PLIB/PPE, but is as simple as > possible. > > I think I read a long time ago about people "logging" OpenGL > calls with some tool and think the easiest way would be to log > them and throw out everything unneeded. Since you mention it...I have been writing exactly such a thing over the past couple of days. I have written a header file containing about a gazillion things like: #ifdef OPENGL_DEBUG #define glBegin debug_glBegin extern void debug_glBegin ( GLenum type ) ; #endif ...then an executable containing: void debug_glBegin ( GLenum type ) { if ( logging ( "glBegin" ) ) fprintf ( debug_stderr, "glBegin ( %s ) ;\n". enum_to_string ( type ) ) ; if ( executing ( "glBegin" ) ) glBegin ( type ) ; } ...the result (when it works) will be that you can compile your opengl program with all your files #including the debugging header file...then link to the executable and turn debug tracing on and off either under program control or with a 'signal' from outside. That should precisely enable me to do what you say. > However, I neither found a "generic OpenGL command recorder" > nor a "Windows-dll-function-call-logger".Does anyone know of such a > beast? There are some around - but none that are portable (that I know of). I've used 'ogldebug' on Silicon Graphics machine, under Linux, you have a way to compile Mesa to make it trace execution. But mine will be more flexible and let you do things like telling the library to record everything from the next swapbuffers to the one after that to get an entire frame's worth of data. > If not, I could rename opengl.dll and write a new dll, that simply > calls the old one and logs all calls. Yep - that would prevent you from having to mess around with header files - but forces you to trace calls made by other libraries like GLU...I can see uses for both approaches. -- Steve Baker http://web2.airmail.net/sjbaker1 sjb...@ai... (home) http://www.woodsoup.org/~sbaker sj...@ht... (work) |