PDA

View Full Version : GLIntercept v0.1 is available..(a GLTrace like program)



sqrt[-1]
08-10-2003, 11:51 PM
Get it Here: http://groups.yahoo.com/group/glintercept/files/GLintercept_v01.zip
If the above does not work try: http://benturk.customer.netspace.net.au/GLintercept_v01.zip

Just what is GLIntercept?

GL Intercept is (another) OpenGL call interceptor. However, with one difference. GL Intercept is 90% data driven and logs ALL OpenGL calls. (extensions and core methods)

Skeptic: But what about GL_ARB_uber_direct3d_beater extension? (from 2005)?
Reply: Look I said it logs all and it LOGS ALL. As long as extensions still need to be loaded via wglGetProcAddress(..) it will continue to work. (it works by wrapping the returned function in some ASM and returning a pointer to that)

While GLIntercept may log all, I have not managed to make it psychic. (This is where the data driven part comes in)

If you run GLIntercept with no config files you will see out put like this:
glColor4ubv ( ??? )
glClear( ??? )
glGetError( ???)

as GLIntercept has no idea what parameters or return types are involved. If you cut and paste your GL header files into the config *.h files however:
(ie
void glColor4ubv (const GLubyte *v);
void glClear(GLbitfield mask);
GLenum glGetError( void );
)

The output becomes:

glColor4ubv ( 0x01256)
glClear( 0x2456 )
glGetError( ) = 0x000

Which is better, however if you just provide a little more information (ie
(ie


enum Main_Error {

GL_NO_ERROR = 0x0,
GL_INVALID_VALUE = 0x0501,
GL_INVALID_ENUM = 0x0500,
GL_INVALID_OPERATION = 0x0502,
GL_STACK_OVERFLOW = 0x0503,
GL_STACK_UNDERFLOW = 0x0504,
GL_OUT_OF_MEMORY = 0x0505,

};
enum Mask_Attributes {

GL_CURRENT_BIT = 0x00000001,
GL_POINT_BIT = 0x00000002,
GL_LINE_BIT = 0x00000004,
GL_POLYGON_BIT = 0x00000008,
GL_POLYGON_STIPPLE_BIT = 0x00000010,
GL_PIXEL_MODE_BIT = 0x00000020,
GL_LIGHTING_BIT = 0x00000040,
GL_FOG_BIT = 0x00000080,
GL_DEPTH_BUFFER_BIT = 0x00000100,
GL_ACCUM_BUFFER_BIT = 0x00000200,
GL_STENCIL_BUFFER_BIT = 0x00000400,
GL_VIEWPORT_BIT = 0x00000800,
GL_TRANSFORM_BIT = 0x00001000,
GL_ENABLE_BIT = 0x00002000,
GL_COLOR_BUFFER_BIT = 0x00004000,
GL_HINT_BIT = 0x00008000,
GL_EVAL_BIT = 0x00010000,
GL_LIST_BIT = 0x00020000,
GL_TEXTURE_BIT = 0x00040000,
GL_SCISSOR_BIT = 0x00080000,
};

void glColor4ubv (const GLubyte v[4]);
void glClear(GLbitfield[Mask_Attributes] mask);
GLenum[Main_Error] glGetError( void );
)

The output becomes:

glColor4ubv ( [0,128,128,255])
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT )
glGetError( ) = GL_NO_ERROR

Which is much nicer to read. (There are many other things you can do in the config files like merging enum namespaces and using #include directives.)

I provide sample GL core 1.1 and 1.2 config files (so reference them for other “tricks”)
( I will get around to most of the ARB extensions when I have more time)

I have also added the ability to call a glGetError() after each (appropriate) OpenGL call automatically. (Don’t worry, I save the GL error state internally – so app issued glGetErrors get the correct value) There is also the option to issue a int 3 (breakpoint) if an error occurs if used with the above option. (see the .ini file for details)

Long term I aim to morph this into a debug tool to flag silly mistakes that new OpenGL people may make. (ie using MicroSoft renderer, GL_CLAMP/GL_CLAMP_TO_EDGE, internal formats of textures etc)

To head off some questions:-
-Yes this will be GPL (version 0.2 onwards as I need to do some code cleaning)
-Yes I will do a linux version once I hit the 1.0 milestone. (A while off yet. People may want to port earlier versions. (I also have much linux coding to learn))
-Yes this more or less a hyped GLTrace (although GLTrace can currently do a few things I have yet to add)


Any comments /questions can be posted below or emailed to:
glintercept@yahoogroups.com

(this may only be checked infrequently – This project probably needs a “proper” home. Would Nutty,NitroGL,Humus or other established GL sites be willing to host?(or have ideas for a good place?))

Edit:
Updated URL to exclued the session info (opps)

Edit: stupid URLs


[This message has been edited by sqrt[-1] (edited 08-11-2003).]

Martin Kraus
08-11-2003, 02:08 AM
Hi ,
sounds very interesting , especially the fact that it doesn`t need to be updated whenever a new extension becomes available ,
but i can`t get the link to work http://www.opengl.org/discussion_boards/ubb/frown.gif

Nutty
08-11-2003, 02:48 AM
I can host it for you, free. I can give you a subdomain if ya want.. glintercept.nutty.org ?

mail me if you want.

sqrt[-1]
08-11-2003, 04:16 AM
Updated the URL above to exclude session info. People that tried the old link may want to try again.