<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type="text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>debug idea</title></head><body>
<div>I'm looking over the changes made for pix_texture concerning the
'debug' post() statements, and think I have a solution to the
problem.&nbsp; 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.&nbsp; What if we make a debug function part
of the pix base class that would dump the state info on request?&nbsp;
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.</div>
<div><br></div>
<div>Here's some code to illustrate:</div>
<div><br></div>
<div>void pix_texture :: doDebug(GemState *state){</div>
<div><br></div>
<div><font color="#760F50">if</font><font color="#000000"> (
GemMan::texture_range_supported &amp;&amp;
GemMan::texture_rectangle_supported &amp;&amp; m_mode){</font></div>
<div><font
color="#000000"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>&nbsp;&nbsp;&nbsp; post(</font><font
color="#891315">&quot;pix_texture:&nbsp; using
glTextureRangeAPPLE()&quot;</font><font
color="#000000">);</font></div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>}</div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>else</div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>{</div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>&nbsp;
post(&quot;pix_texture: using TEXTURE_2D&quot;);</div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </x-tab>}</div>
<div>}</div>
<div><br></div>
<div>There would be a m_doDebug that would trigger with the 'debug'
message and be reset in the post render to prevent endless
retriggers.</div>
<div><br></div>
<div>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.&nbsp; 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.</div>
<div><br></div>
<div>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.</div>
<div><br></div>
<div>cgc</div>
</body>
</html>