i having issue opengl view not updating while window being resized, not changing size of window. if window size changed continuously, redraw happen. have method animate on timer in nsrunloopcommonmodes. timer firing normal, call setneedsdisplay in animate method not cause redraw.
understanding during resize, main run loop not run, , assume setneedsdisplay checked during main run loop, makes sense me why doesn't work, i'm not sure it.
have "fixed" checking inliveresize in animate method , calling display if so: code:
if ([self inliveresize]) { [self display]; } else { [self setneedsdisplay]; }
but i'm not sure optimal solution. seems places online avoid using display, can't find other way make display happen.
right way deal this? know of better solution?
after thinking bit decided change code in animate this: code:
[self setneedsdisplay]; if ([self inliveresize]) { [[nsoperationqueue mainqueue] addoperationwithblock:^{ [self displayifneeded]; }]; }
this seems better me, in theory, since setneedsdisplay can called multiple times different timers in 1 loop, , still cause 1 render happen.
Forums Macs Mac Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment