I\'m using Apple\'s sample application GLPaint as a basis for an OpenGL ES painting application, but I can\'t figure out how to implement undo functionality within it.
Either you can use NSUndoManager, class provided by iOS
Or you can save current state of screen area by:
CGContextRef current = UIGraphicsGetCurrentContext();
You can have one array as stack with screen image objects and on undo action you can pop value from stack and on each change push value into the stack.