I noticed that by default the sample app GLPaint comes with a recorded data in binary and it loads up on start, it is what is used to display the “Shake me” text.
I’m creating a similar painting app and I was just wondering what is the best way to actually record these strokes and load them up next time.
Currently I tried saving the location of every vertex using Core Data, then upon start it reads and renders all the points again, however I found this too slow.
Is there a better/more efficient method of doing this? Can the entire viewBuffer be saved as binary and then loaded back up?
If you look at the Recording.data you will notice that each line is its own array. To capture the ink and play it back you need to have an array of arrays. For purposes of this demo – declare a mutable array – writRay
Capture the ink
Playback the ink.
For best effect shake the screen to clear and call playRay from changeBrushColor in the AppController.