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
 Wednesday, April 25 2018 @ 08:02 AM BST

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 © 2018 MacOSX Guru Site
 All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.06 seconds