3
\$\begingroup\$

i try to make a textured object then draw other without (only colored).

i had tried to play with glEnable/Disable(GL10.GL_TEXTURE_2D) , gl.glEnable/DisableClientState(GL10.GL_COLOR_ARRAY/GL10.GL_TEXTURE_COORD_ARRAY);

But i never get the result i expect.

(first colored + textured then others textured and colored too) (first colored and not textured then other colored and not textured)

i don't know if this is because i don't disable some things at the good place or if i missing something.

\$\endgroup\$

2 Answers 2

3
\$\begingroup\$

glBindTexture(GL_TEXTURE_2D, 0) switches to the default texture; unless you've changed the default, that should do what you want.

\$\endgroup\$
0
3
\$\begingroup\$

glDisable(GL_TEXTURE_2D) should do it, unless you have other texture targets enabled (eg. GL_TEXTURE_1D, GL_TEXTURE_3D or GL_TEXTURE_CUBE_MAP)

As a debugging mechanism, try use glPushAttrib(GL_ALL_ATTRIB_BITS) before setting up any state for your textured rendering, then use glPopAttrib() afterwards. Move the push and pop down/up until you find out what state is causing your subsequent objects to be textured incorrectly, and then fix it and remove the push/pops.

Failing that, use gDEBugger, an OpenGL debugger to try narrow down your problem. This debugger was recently made free! (see: http://www.gremedy.com/purchase.php)

\$\endgroup\$
1
  • \$\begingroup\$ when i use glDisable(GL_TEXTURE_2D) after drawing the object that need texture , all the scene is without texture . I don't have glPush/PopAttrib() (i'm using opengl es 1.0) \$\endgroup\$
    – eephyne
    Dec 11, 2010 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .