Login  Register

Re: glDrawElements() and glColorPointer()

Posted by gmseed on Dec 06, 2011; 4:50pm
URL: https://forum.jogamp.org/glDrawElements-and-glColorPointer-tp3564836p3564876.html

Hi

Found the problem but don't know why.

I have the following code to turn on/off glColorMaterial() to preserve assigned colours to mesh triangles.

        // material colour tracking
        if (mMaterialColourTrackCurrentColour)
        {
            // needed so material for triangles will be set from colour map
            glv.glColorMaterial( GL.GL_FRONT_AND_BACK, GL2.GL_AMBIENT_AND_DIFFUSE ); // call glColorMaterial before enabling GL_COLOR_MATERIAL
            glv.glEnable( GL2.GL_COLOR_MATERIAL );
        }

It would appear that this is conflicting when I call glDrawElements() but is fine when I use glDrawArrays()??

Graham