iphone Programming Glossary: glenableclientstate
Drawing into OpenGL ES framebuffer and getting UIImage from it on iPhone http://stackoverflow.com/questions/10936157/drawing-into-opengl-es-framebuffer-and-getting-uiimage-from-it-on-iphone red line float line 0.5f 0.5f 0.5f 0.5f glBindRenderbufferOES GL_RENDERBUFFER_OES colorRenderbuffer should I do this glEnableClientState GL_VERTEX_ARRAY glVertexPointer 2 GL_FLOAT 0 line glColor4f 1.0 0.0 0.0 1.0 glLineWidth 10 glDrawArrays GL_LINES 0 2 draw..
OpenGL ES render to texture, then draw texture http://stackoverflow.com/questions/1649222/opengl-es-render-to-texture-then-draw-texture contentDelegate draw glBindFramebufferOES GL_FRAMEBUFFER_OES oldFBO glClear GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT glEnableClientState GL_TEXTURE_COORD_ARRAY glEnable GL_TEXTURE_2D glColor4f 1 1 1 1 texture drawInRect CGRectMake 0 0 320 480 glDisableClientState..
OpenGL ES iPhone - drawing anti aliased lines http://stackoverflow.com/questions/1813035/opengl-es-iphone-drawing-anti-aliased-lines GL_ONE_MINUS_SRC_ALPHA glEnable GL_BLEND glEnable GL_LINE_SMOOTH glLineWidth 2.0f glVertexPointer 2 GL_FLOAT 0 points glEnableClientState GL_VERTEX_ARRAY glDrawArrays GL_LINE_STRIP 0 num_points glDisableClientState GL_VERTEX_ARRAY It looks good in the iPhone.. is a pointer to unsigned bytes 4 per color . Should alternate in opacity. glColorPointer 4 GL_UNSIGNED_BYTE 0 colors glEnableClientState GL_COLOR_ARRAY points is a pointer to floats 2 per vertex glVertexPointer 2 GL_FLOAT 0 points glEnableClientState GL_VERTEX_ARRAY.. glEnableClientState GL_COLOR_ARRAY points is a pointer to floats 2 per vertex glVertexPointer 2 GL_FLOAT 0 points glEnableClientState GL_VERTEX_ARRAY glDrawArrays GL_TRIANGLE_STRIP 0 points_count glDisableClientState GL_VERTEX_ARRAY glDisableClientState..
Draw to offscreen renderbuffer in OpenGL ES (iPhone) http://stackoverflow.com/questions/1853551/draw-to-offscreen-renderbuffer-in-opengl-es-iphone offscreenFramebuffer GLfloat vc 0.0f 0.0f 0.0f 10.0f 10.0f 10.0f 0.0f 0.0f 0.0f 10.0f 10.0f 10.0f glLoadIdentity glEnableClientState GL_VERTEX_ARRAY glVertexPointer 3 GL_FLOAT 0 vc glDrawArrays GL_LINES 0 4 glDisableClientState GL_VERTEX_ARRAY glBindRenderbufferOES..
How do I create blurred text in an iPhone view? http://stackoverflow.com/questions/227305/how-do-i-create-blurred-text-in-an-iphone-view glEnable GL_TEXTURE_2D glClientActiveTexture GL_TEXTURE1 glTexCoordPointer 2 GL_FLOAT sizeof V2fT2f tmpquad 0 .s glEnableClientState GL_TEXTURE_COORD_ARRAY glBindTexture GL_TEXTURE_2D tex glTexEnvi GL_TEXTURE_ENV GL_TEXTURE_ENV_MODE GL_COMBINE glTexEnvi..
Why is this OpenGL ES code slow on iPhone? http://stackoverflow.com/questions/450042/why-is-this-opengl-es-code-slow-on-iphone 10.0f 10.0f glMatrixMode GL_MODELVIEW glClearColor 0.3f 0.0f 0.0f 1.0f glVertexPointer 2 GL_FLOAT 0 spriteVertices glEnableClientState GL_VERTEX_ARRAY glTexCoordPointer 2 GL_SHORT 0 spriteTexcoords glEnableClientState GL_TEXTURE_COORD_ARRAY sprite data is.. 2 GL_FLOAT 0 spriteVertices glEnableClientState GL_VERTEX_ARRAY glTexCoordPointer 2 GL_SHORT 0 spriteTexcoords glEnableClientState GL_TEXTURE_COORD_ARRAY sprite data is preloaded. 512x512 rgba8888 glGenTextures 1 spriteTexture glBindTexture GL_TEXTURE_2D..
Getting a Maya Model into the iPhone http://stackoverflow.com/questions/4675475/getting-a-maya-model-into-the-iphone a one dimensional array of floats but is mapped out like above. Once you have a float array it's simple to render. glEnableClientState GL_VERTEX_ARRAY glEnableClientState GL_NORMAL_ARRAY glVertexPointer 3 GL_FLOAT sizeof vertices 0 6 vertices 0 glNormalPointer.. but is mapped out like above. Once you have a float array it's simple to render. glEnableClientState GL_VERTEX_ARRAY glEnableClientState GL_NORMAL_ARRAY glVertexPointer 3 GL_FLOAT sizeof vertices 0 6 vertices 0 glNormalPointer GL_FLOAT sizeof vertices 0 6 vertices..
Explain how OpenGL ES background images work http://stackoverflow.com/questions/4820372/explain-how-opengl-es-background-images-work CGContextRelease context free imageData image release static const GLfloat texCoords 0.0 1.0 1.0 1.0 0.0 0.0 1.0 0.0 glEnableClientState GL_TEXTURE_COORD_ARRAY glTexCoordPointer 2 GL_FLOAT 0 texCoords glEnableClientState GL_VERTEX_ARRAY glEnableClientState.. 0.0 1.0 1.0 1.0 0.0 0.0 1.0 0.0 glEnableClientState GL_TEXTURE_COORD_ARRAY glTexCoordPointer 2 GL_FLOAT 0 texCoords glEnableClientState GL_VERTEX_ARRAY glEnableClientState GL_NORMAL_ARRAY glEnableClientState GL_TEXTURE_COORD_ARRAY static const GLfloat vertices.. GL_TEXTURE_COORD_ARRAY glTexCoordPointer 2 GL_FLOAT 0 texCoords glEnableClientState GL_VERTEX_ARRAY glEnableClientState GL_NORMAL_ARRAY glEnableClientState GL_TEXTURE_COORD_ARRAY static const GLfloat vertices 1.0 1.0 0.0 1.0 1.0 0.0 1.0 1.0..
Overlay Color Blend in OpenGL ES / iOS / Cocos2d http://stackoverflow.com/questions/8771413/overlay-color-blend-in-opengl-es-ios-cocos2d 2 GL_FLOAT 0 poli if closePolygon glDrawArrays GL_TRIANGLE_FAN 0 points else glDrawArrays GL_LINE_STRIP 0 points glEnableClientState GL_COLOR_ARRAY glEnableClientState GL_TEXTURE_COORD_ARRAY glEnable GL_TEXTURE_2D And here some results As you can see is.. glDrawArrays GL_TRIANGLE_FAN 0 points else glDrawArrays GL_LINE_STRIP 0 points glEnableClientState GL_COLOR_ARRAY glEnableClientState GL_TEXTURE_COORD_ARRAY glEnable GL_TEXTURE_2D And here some results As you can see is a good approximation but this two..
Save OpenGL Drawn item as a Image http://stackoverflow.com/questions/9660723/save-opengl-drawn-item-as-a-image 0 frame.size.width scale frame.size.height scale glMatrixMode GL_MODELVIEW glDisable GL_DITHER glEnable GL_TEXTURE_2D glEnableClientState GL_VERTEX_ARRAY glEnable GL_BLEND Set a blending function appropriate for premultiplied alpha pixel data glBlendFunc GL_ONE..
Record the drawing as a m4v video file - OpenGL http://stackoverflow.com/questions/9661259/record-the-drawing-as-a-m4v-video-file-opengl 0 frame.size.width scale frame.size.height scale glMatrixMode GL_MODELVIEW glDisable GL_DITHER glEnable GL_TEXTURE_2D glEnableClientState GL_VERTEX_ARRAY glEnable GL_BLEND Set a blending function appropriate for premultiplied alpha pixel data glBlendFunc GL_ONE..
Draw a straight line using OpenGL ES in iPhone? http://stackoverflow.com/questions/9736887/draw-a-straight-line-using-opengl-es-in-iphone GL_DEPTH_BUFFER_BIT const GLfloat line 0.5f 0.5f point A 0.5f 0.5f point B glVertexPointer 2 GL_FLOAT 0 line glEnableClientState GL_VERTEX_ARRAY glDrawArrays GL_LINES 0 2 When i run the project only the gray color only appearing in the screen the line..
|