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: Troy Rollins <troy at rpsystems dot net>
Date: Mon, 27 Jun 2005 10:36:47 -0400
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <BEE5084A dot DD9D%larsjensen at rcn dot com>

On Jun 27, 2005, at 1:35 AM, Lars Jensen wrote:

OS X already does this automatically, so AutoBufferingCanvas is smart enough not to do all this on OS X, because it would just slow things down. That's
why it's called AutoBufferingCanvas instead of just BufferingCanvas.

Does all that make sense?

OK, yes. All that does make sense. Thanks for that detailing.

However, it still leaves me wondering if I am taking the wrong approach. Let me describe what I am doing, and how I am laying it out to work, and please tell me if I have taken the wrong direction considering how RB works.

My program uses two windows. One of them is a control system window, it and one module contain the entire program logic. The other window has one control - the autoBufferingCanvas, which fills the window.

Certain events occur within the control window which dictate that the canvas window's content must be updated. At those points I call "updateGameScreen" which is a method belonging to the master control module. The updateGameScreen method writes many things to the graphics property of the canvas - including refilling the background image, lots of text things (drawstring and drawStyledText), etc. At the end of this large method which determines what to paint and where, I call PaintBuffered() on the canvas.

There is no implementation of the paint event for either the canvas or its containing window. In fact, there is no code at all in that window. I had considered putting "updateGameScreen" into the paint event, but then thought that might cause some circular thing to happen with the window attempting to redraw continuously. Is it important to implement the paint event? What is it about "returning true" if seen about a lot of things regarding painting?

And, in general, does this sound like a system that can work? Am I using the canvas and its events in the wrong way? As a Director user, RB's code language is quite similar to what I know, but the controls and the way things are painted to the screen are VERY different. Its a little bit of a speed bump in an otherwise smooth transition.

Much appreciation for your patience.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net

_______________________________________________
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>