I am working on a game for the iPhone that uses the drawing / drawing mechanism, and I am having problems trying to create a tool that will erase already painted things.
The main problem is that the drawn background is not a solid color, but a static image or animation. I tried using different blending options and logical drawing operations, but nothing worked. I am new to OpenGL, so something is missing me.
Any tips?
EDIT. To give a little more information, I use textures for my brushes and using glVertexPointer () and glDrawArrays () to render them. For instance:
glBindTexture(GL_TEXTURE_2D, circleBrush); glVertexPointer(3, GL_FLOAT, 0, verts); glTexCoordPointer(2, GL_FLOAT, 0, coords); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
EDIT 2: Unfortunately, stencil buffers on the iPhone are not available .:(
EDIT 3: Framebuffer objects are available on the iPhone, and that was the road I took. I have not fully implemented it yet, but so far it is similar to how I did it. Thanks everyone!
source share