I'm upgrading an iPhone application which is based on Apple's Open GL sample application, GLPaint.
I need to implement undo/redo functionality to my app, but I'm totally new to OpenGL.
I would like you to implement sample undo/redo function added on top of the GLPaint sample app, to help me how to do the job.
- Undo means to cancel the last stroke. Multi-level undo is nice. Erasing the whole screen is not an undo.
- Redo is the opposite, to replay strokes.
Modified sample app is hopefully able to:
- run on iOS3 or later.
- draw almost as quick as the original sample app.
- undo one level or more. Redo is not a must.
- No need to be the fastest in the world, but faster is better.
- leaks no memory. no errors, no warnings.
- more comments is better.
Please use Objective-C or C to write the code. I have 6 months experience Objective-C programming, released 3 apps so far, but I cannot call myself an expert. So please write not too much advanced/complicated code.