OpenGL ES 2.0 and glPushMatrix, glPopMatrix

后端 未结 1 1067
走了就别回头了
走了就别回头了 2020-12-05 08:21

Does OpenGL ES 2.0 still support glPushMatrix and glPopMatrix? I\'m currently using these in the following way:

glPushMatrix();
glTranslatef(xLoc, yLoc, 0);         


        
相关标签:
1条回答
  • 2020-12-05 08:47

    Nope, OpenGL ES 2.0 uses a programmable pipeline instead of the fixed function pipeline found in earlier versions. You can't use immediate mode commands (glVertex, glNormal, etc) or the matrix stack. You should implement your own matrix stack data structure instead (which is preferable anyway because the fixed function matrix stack had implementation dependent depth) and send the current matrix to shader programs.

    For a good introduction to modern OpenGL check out these tutorials from Durian Software. They are based on OpenGL 2.0 but the concepts will map directly to the ES 2.0 spec.

    0 讨论(0)
提交回复
热议问题