realbasic-games
[Top] [All Lists]

Re: Canvases sometimes black

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Canvases sometimes black
From: Lars Jensen <larsjensen at rcn dot com>
Date: Mon, 27 Jun 2005 12:36:13 -0400
Delivered-to: realbasic-games at lists dot realsoftware dot com
>> This works as long as your Paint event completely redraws the entire visible
>> rectangle...
> 
> ...which could be a serious problem for games.

Yes. And I should have said "as long as your Paint event doesn't leave any
unwanted old pixels around". If you keep track of dirty rects and use them
in your Paint event, then AutoBufferingCanvas will slow things down overall,
because it will transfer the entire picture to the canvas after you've done
your painting.

AutoBufferingCanvas exemplifies the "optimize only when needed" philosophy
-- it takes almost no time to implement and doesn't encourage changes in
your code structure (assuming your code is structured like typical Canvas
code, some high-performance games excluded), so you can get the benefits now
and then blithely toss it away later if it's too slow.

Perhaps by mentioning it on the Games list I gave the impression that it's
designed for use in games. It's not; I just thought it made sense in
response to a particular post.

lj
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>