#128508 - goruka - Sat May 12, 2007 3:16 am
Hi! Techie question over here...
I am drawing objects that both intend (and don't intend) to use texture mapping.
I just:
// for texture mapping
glEnable( GL_TEXTURE_2D ); / / DISP3DCNT |= 1
glBegin(GL_TRIANGLES) // BEGIN_VTXS=0
//set texcoord vertex
//draw vertex
//set texcoord vertex
//draw vertex
//set texcoord vertex
//draw vertex
glEnd();
now, i want to draw without texture...
glBegin(GL_TRIANGLES) // BEGIN_VTXS=0
//draw vertex
//draw vertex
//draw vertex
glEnd();
But this doesn't work! it keeps the last texture coordinate for the previous begin/end, so the whole object is painted with that texel color.
Normally, under opengl you do glDisable( GL_TEXTURE_2D) , but if i do this on the DS,
it disables textures for the whole frame (the bit 1 DISP3DCNT on the register is not state-machine based, just works for the entire frame, unlike POLYGON_ATTR register ), so this is obviously not good. So, how is this done?
Thanks in advance!
I am drawing objects that both intend (and don't intend) to use texture mapping.
I just:
// for texture mapping
glEnable( GL_TEXTURE_2D ); / / DISP3DCNT |= 1
glBegin(GL_TRIANGLES) // BEGIN_VTXS=0
//set texcoord vertex
//draw vertex
//set texcoord vertex
//draw vertex
//set texcoord vertex
//draw vertex
glEnd();
now, i want to draw without texture...
glBegin(GL_TRIANGLES) // BEGIN_VTXS=0
//draw vertex
//draw vertex
//draw vertex
glEnd();
But this doesn't work! it keeps the last texture coordinate for the previous begin/end, so the whole object is painted with that texel color.
Normally, under opengl you do glDisable( GL_TEXTURE_2D) , but if i do this on the DS,
it disables textures for the whole frame (the bit 1 DISP3DCNT on the register is not state-machine based, just works for the entire frame, unlike POLYGON_ATTR register ), so this is obviously not good. So, how is this done?
Thanks in advance!