¡@

Home 

2014/10/15 ¤U¤È 10:13:17

iphone Programming Glossary: rendertextures

How can I crop an Image with mask and combine it with another image (background) on iPhone? (OpenGL ES 1.1 is preferred)

http://stackoverflow.com/questions/5299452/how-can-i-crop-an-image-with-mask-and-combine-it-with-another-image-background

project and then move that code over to your iOS project. The renderMask call is where the most interesting part is. renderTextures draws the sample textures in the top row. static GLuint color_texture static GLuint mask_texture static GLuint background_texture.. y 512.0 glTexCoord2f texture_x texture_y 1.0 glVertex2f x y 512.0 glEnd Draw small versions of the textures. void renderTextures float texture_x 0 texture_y 0 float x 0 y 532.0 float size 128 glBindTexture GL_TEXTURE_2D mask_texture glDisable GL_BLEND.. glEnable GL_TEXTURE_2D void draw glClear GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT glColor3f 1.0 1.0 1.0 renderMask renderTextures void reshape int width int height glViewport 0 0 width height glMatrixMode GL_PROJECTION glLoadIdentity gluOrtho2D 0.0 width..