glMaterial and Print3D

This topic contains 2 replies, has 2 voices, and was last updated by  Gordon 9 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29596

    Dark
    Member

    Ran into a problem and didn’t find anything on the web, so posting here for anyone who runs into it again.

     

    Noticed that after calling glMaterialf my calls to Print3D.Flush() would cause an error

     

    <code>

    glDrawElements(GL_TRIANGLES, (VertexCount/2)*3, GL_UNSIGNED_SHORT, m_pFacesFont); failed

    </code>

     

    After a couple of hours the solution was the GL flag passed to glMaterialfv.

    I was passing GL_FRONT. The problem went away after I passed it GL_FRONT_AND_BACK

     

     

     

    #32312

    Gordon
    Moderator

    Thanks for reporting this issue and the workaround. Obviously this shouldn’t be breaking Print3D so we’ll have a look at what’s going on and I’ll post here when I know more.

    #32313

    Gordon
    Moderator

    What is happening is this:

    According to the OpenGL ES spec, the only legal value to pass to the glMaterialf function is GL_FRONT_AND_BACK. Anything else will cause glGetError() to return a value.

    Print3D calls glGetError() after its call to glDrawElements() and if it is a value it gives out the message that you’ve seen. But if glError is already set by the call to glMaterialf then the message will appear anyway, even if Print3D is fine and so it does.

    This would happen if any of the GL calls in your program fail. You’re solution is correct, but the message from Print3D is misleading and I’ll look at improving this.

    Gordon2008-09-30 11:28:28

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.