OpenGL state dump tool wanted

Moderator
Posts: 434
Joined: 2002.09
Post: #1
I'm having a problem that seems like a classic case of not (re)setting OpenGL's state correctly. The first time through my render loop I get the correct result, but subsequent times through I do not. I've had no luck spotting the problem by examining the code, and it seems to me I could probably solve it easily if I just had a quick-n-dirty way to dump or log OpenGL's state before each run through the loop.

I seemed to recall someone posting that they had such a coded function written already on the Mac-OpenGL mailing list, but Apple's mailing list archive no longer appears to allow searching(!) so I couldn't find it.

I then spent 20 minutes experimenting with OpenGL Profiler this morning because I recalled that it exposes OpenGL's state while your app is running. While this is true, it does not seem to have a way to write out the results for DIFF'ing. Rather, you have to click on twisties to interactively view small groupings of the OpenGL attributes. I also can't find a way to open multiple snapshots of the state for side-by-side comparisons.

If anyone could point me to a tip or code, it would save me some time. Thanks!

Measure twice, cut once, curse three or four times.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #2
There's a short bit of code dumping some state here. You'll have to add in whatever else you're using.

GL Profiler does highlight any changed state in red, but I completely agree that it needs to be able to save everything to a plain text file for easier comparison. Time for Ye Olde Feature Request.
Quote this message in a reply
Moderator
Posts: 434
Joined: 2002.09
Post: #3
I'd noticed OpenGL Profiler's coloring of changed state last night when I used it again. That's given me some clues already, but I think the code for logging state on demand will be very handy. Thanks!

Measure twice, cut once, curse three or four times.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Effifcient State Changing Nick 7 3,384 Apr 6, 2006 06:33 AM
Last Post: TomorrowPlusX