[GEM-dev] debug idea

chris clepper cgc at humboldtblvd.com
Wed Nov 19 07:34:15 CET 2003


I'm looking over the changes made for pix_texture concerning the 
'debug' post() statements, and think I have a solution to the 
problem.  While post() is great for debugging and giving info about 
various internal states in GEM objects, it becomes annoying and in 
some cases highly objectionable to have all this data spewed out into 
the terminal window.  What if we make a debug function part of the 
pix base class that would dump the state info on request?  This way 
if a user wants to find out what the heck is going on in their chain 
and perhaps figure out why it's not working, they could send a 
'debug' message to the object.

Here's some code to illustrate:

void pix_texture :: doDebug(GemState *state){

if ( GemMan::texture_range_supported && 
GemMan::texture_rectangle_supported && m_mode){
	    post("pix_texture:  using glTextureRangeAPPLE()");
	}
	else
	{
	  post("pix_texture: using TEXTURE_2D");
	}
}

There would be a m_doDebug that would trigger with the 'debug' 
message and be reset in the post render to prevent endless retriggers.

This would help reduce code clutter and also allow for errors and 
checks that occur render pass to be managed without throwing one 
every single time the render function is called.  Also, if an entire 
chain is sent 'debug' messages then the user would have a good set of 
info to trace problems with and also post to the list for help.

This will probably require a few more member variables in each class, 
but it might provide a much more elegant solution to our post() and 
debug problems.

cgc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20031119/072a1f69/attachment.htm>


More information about the GEM-dev mailing list