Contribute  :  Calendar  :  Advanced Search  :  Site Statistics  :  Directory  :  Files to download  :  Links for developers  :  Privacy policy  :  Web Resources  :  Polls  
    MacOSX Guru Site Information, tips and tricks, FAQ for Mac OS X developers    
 Welcome to MacOSX Guru Site
 Saturday, March 23 2019 @ 11:26 PM UTC

My drawings don't show up in my window?!

Carbon Development FAQDoes your drawing code draw lots'a stuff, but nothing shows up on screen? Does your animation only show its last frame, and none of the intermediate steps? Chances are, you forgot to flush.

Very likely, you forgot to flush your window buffer. On MacOS X, windows are buffered. That means MacOS X records all your drawings, but only displays the changed contents on screen when all drawing has finished. This minimizes the "stacking" and "flashing" effects you sometimes get when drawing overlapping objects.

But since MacOS X can not know when you are finished drawing, it simply applies drawings whenever you return control to MacOS after processing an event. Most of the time this is right, but if you're trying to do animations and effects, you have to explicitly tell the OS that you really want it to redraw your stuff now. To achieve that, you call QDFlushPortBuffer() or CGContextFlush().

What's Related

Story Options

My drawings don't show up in my window?! | 0 comments | Create New Account
The following comments are owned by whomever posted them. This site is not responsible for what they say.
 Copyright © 2019 MacOSX Guru Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.07 seconds