gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > randomly failing glEnable( GL_TEXTURE_2D ) ?

#127638 - goruka - Thu May 03, 2007 7:01 pm

Hi! I'm drawing a ton of geometry to the scene, depending the object, and before each glBegin/glEnd, I glEnable or glDisabe textures using libnds call, depending on wether what i'm going to draw has textures or not.

The crap in this case is that in some frames, texture is enabled, and in other frames it's not and it shows everything in plain gray (what i assigned before in glMaterial colors). I even foreced glEnable( GL_TEXTURE_2D ) right before the call to glBegin so anything has texture, but this behavior still persists.. i may move the camera around and all, and suddendly I get flashes (of 1 frame or more) of the texture being disabled. Texture is enabled most of the time, but it gets disabled by few frame-intervals.

So, is there anything that may be going on in here that I dont know, that can possibly disable textures randomly?

Thanks!

#127664 - goruka - Thu May 03, 2007 11:48 pm

In reply to myself...

i found out what was happening, glEnable( GL_TEXTURE_2D ) and glDisable (GL_TEXTURE_2D ) don't work like in OpenGL at all!

it just changes a register that takes place at rendering time!

This isnt mentioned in any docs i've seen, so it would be good to add it...