Damn lack of PyOpenGL feedback.....

So, I have a 'font' texture that Ive made and loaded and it seems to be working fine on constant text. Excellent

Lets make an FPS counter. Ill just make a draw method that actually draws the texture, rather than makes a display list. Easy, right?

Ok, code that up. Put it in my scene graph.. excellent. Seems ok.

So, lets put it on the HUD..

All my fonts turn into opaque squares. Huh? Weird.

Um. Well I did some changes to allow render time displaying (rather than making a scenegraph model), maybe I didnt turn something on. Nope. That code all looks fine. Um....

So, _Lots_ of code checking later... I finally discover that the glGenTextures call is returning a texture_id for the font of 24837324 (or something huge). Hmmm. Ok, thats before Ive loaded the font image... Um.

My _other_ textures still work fine (and have numbers like 1, 2, 3, 4).

Ok, so what if I call glGenTextures ore than once... 24837324, 0, 0. Hmmm.

3 Hours later... It seems that I initialised my textpage class _BEFORE_ calling mygame init, so opengl cant render a texture.

Augh!

I think thats my problem. Its not that I consentrate on graphics too much, its that I cant let bugs go without working out _why_ they dont work. And it just so happens that my newbieness to opengl translates into lots of bugs. :)

(log in to comment)

Comments

And before you all comment, yes, I should have been checking the textureid for being zero (although the weird inital value confused me.... but in hind sight maybe thats just its way of saying "Im not initalised yet, loser")
It's so much nicer when it just raises an exception in your face, isn't it? :(
Given that if you put something bad in between a glBegin / glEnd it barfs, then yes, I had expected it to. :)
i've been there.. dude.. there were times when i actually deleted everything and started all over again... just to trace the error :)) i guess its' part of every opengl programmers' life :D
I so wish there was a opengl.force_barfing()

Had another bug I needed to trace, but I cant blame opengl for that... it was a '-' instead of a '+'.

Eeep. 1am here... looks like an all nighter... :-/

Maybe the ctypes bindings will be better in error reporting
opnegl errors? I dont get them much its mostly the logical and network thigs!