[visionegg] Re: GL state responsibility (warning: may contain theory)

  • From: Tony Arkles <tony@xxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Thu, 14 Jul 2005 09:46:51 -0600



Why don't you have a look at this, and if it works for you, I'll check it in. I think the change to people's programs will be fairly painless, although please speak up if not -- we can probably accommodate you somehow. It certainly won't affect anyone using 2D-only stimuli.


I've read through it a fair bit, and I think it looks great! I'm pretty confident that it should maintain backwards compatibility. Now I just have to track down a copy of Visual Studio 6 so that I can recompile _lib3ds.c with its glLoadIdentity() call removed to fix my specific problem :D.


One thing that *may* simplify things a bit more would be to have the glPushMatrix() and glPopMatrix() calls in Viewport.draw() (wrapping stimulus.draw() on line 1352) instead of inside each stimuli. This would be a little less efficient, but would pretty much guarantee that one stimulus couldn't screw up the environment for the next one. I think the only way then for a stimulus to screw things up would be to maliciously call glPopMatrix(), change things, and then push it back onto the stack. I hope that's not too much of a concern though. Just throwing that wrapper idea out there, although I'm not sure if the overhead would be worth it or not.



Great job! I'm quite impressed at how quick this whole thing went from "I think I might see a problem" to "Try this out and see if it's better". Much appreciated :)



Tony ====================================== The Vision Egg mailing list Archives: //www.freelists.org/archives/visionegg Website: http://www.visionegg.org/mailinglist.html

Other related posts: