OpenGL ES Simple Undo Last Drawing

Posted by Erika on Stack Overflow See other posts from Stack Overflow or by Erika
Published on 2010-04-25T11:38:46Z Indexed on 2010/04/25 11:43 UTC
Read the original article Hit count: 649

Filed under:
|
|
|
|

Hi Everyone,

I am trying to figure out how to implement a simple "undo" of last drawing action on the iPhone screen. I draw by first preparing the frame buffer:

[EAGLContext setCurrentContext:context];
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);

I then prepare the vertex array and draw this way:

glVertexPointer(2, GL_FLOAT, 0, vertexBuffer);
glDrawArrays(GL_POINTS, 0, vertexCount);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context presentRenderbuffer:GL_RENDERBUFFER_OES];

How do I simple undo this last action? There has to be a way to save previous state or an built-in OpenGL ES function, I would think.

Thanks

© Stack Overflow or respective owner

Related posts about opengl

Related posts about iphone