iphone - OpenGL to OpenGL-ES - glRectf() -


OpenGL is trying to learn on iPhone I understand that the function is not available later. What is the alternative approach? Any relevant conceptual information will be appreciated.

An alternative approach is to draw a triangle strip:

  GLfloat Texture [] = {0, 0, 0, 1, 1, 0, 1, 1}; GLfloat model [] = {0, 0, // lower left 0, h, // upper left w, 0, // lower right w, h // upper right}; GlEnableClientState (GL_VERTEX_ARRAY); GlEnableClientState (GL_TEXTURE_COORD_ARRAY); GlVertexPointer (2, GL_FLOAT, 0, model); GlTexCoordPointer (2, GL_FLOAT, 0, Texture); GlDrawArrays (GL_TRIANGLE_STRIP, 0, 4);  

This width is w and height h . Draws a textured rectangle with


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -