ios - Objective-C OpenGL Animation in Sample GLPaint code -
i digging sample project created apple: https://developer.apple.com/library/ios/samplecode/glpaint/introduction/intro.html
it demonstrates how use opengl in objective-c.
when start app "shake me" graph drawn stroke stroke, animation. want modify project make own app, in paintingview.m
, want know how disable animation whenever call renderlinefrompoint:topoint:
method (specifically, in playback:
function, because in touchesmoved:withevent:
animation unnoticeable).
that is, want write renderlinefrompoint:topoint:animated:
method such that, if put no
after animated:
, line drawn instantly.
found it.
all have is, in
- (void)renderlinefrompoint:(cgpoint)start topoint:(cgpoint)end
silence 2 lines @ end:
// display buffer // glbindrenderbuffer(gl_renderbuffer, viewrenderbuffer); // [context presentrenderbuffer:gl_renderbuffer];
and after whole graph drawn onto buffer, call 2 lines display whole graph; appear instantly.
Comments
Post a Comment