¡@

Home 

2014/10/15 ¤U¤È 10:09:45

iphone Programming Glossary: gl_dst_color

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

code let me know and I'll update my answer. Draw the mask with blending disabled. Enable blending set the GLBlendFunc GL_DST_COLOR GL_ZERO and draw the bleed through texture. My mask is white where it should bleed through. In your question it was black... In your question it was black. Now to draw the background set the blend function to glBlendFunc GL_ONE_MINUS_DST_COLOR GL_DST_COLOR and draw the background texture. EDIT Here is the code I describe above. Please note that this will not work on iOS since.. texture_y 1.0 glVertex2f x y 512.0 glEnd glBindTexture GL_TEXTURE_2D color_texture glEnable GL_BLEND glBlendFunc GL_DST_COLOR GL_ZERO glBegin GL_QUADS glTexCoord2f texture_x texture_y glVertex2f x y glTexCoord2f texture_x 1.0 texture_y glVertex2f..