[futurebasic] Re: [FB] Re: Graphic Techniques (FB2)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2000 : Group Archive : Group : All Groups

From: Sean <mclaugh@...>
Date: Sat, 05 Feb 2000 15:46:01 +0000
One more question:

In the FB2 Examples folder: Handbook: Offscreen GWorlds, there is a
function which copies a gworld to the screen. Basically, it locks the
pixelmap of the gworld, then does a _scrCopy copybits to the screen. If
there was no error, it unlocks the pixelmap and the function ends.

However, I thought I remembered hearing something about locking the
pixelmap before any drawing is done -- not just when using copybits. So,
should I do #1 or #2?

FN CopyGWorldToScreen
'lock, copybits, then unlock
END FN

Method 1)
'get a new gworld, set it to the current port
box 1,1 to 4,4
'set the port to the screen
FN CopyGWorldToScreen

Method 2)
'get a new gworld, set it to the current port, and lock the pixelmap
box 1,1 to 4,4
'set the port to the screen and unlock the pixelmap
FN CopyGWorldToScreen

Regards,
Sean

PRITCHA@... wrote:
> This is a difficult subject to write about, even code example go on and you
> can't see the wood
> for the trees... I usually plan all my graphic operations as a series of
> sketches and I've never
> got them to work first time or second or third (you get the picture).
> 
> Optimisation tricks... here's some notes:
> -multiple, permanent gworlds (or any size) seem to work better than trying to
> dispose and recreate
> worlds on the fly.
> - use the smallest rectangle to do the COPYBITs that you can. I always find it
> tricky getting the
> coordinates right but hey that's just me :-)
> - Copying of complex shapes can be done quite easily using a b&w gworld and
> using COPYMASK
> - COPYMASK also allows you to retain an irregular frame around the picture like
> a view
> through an aircraft cockpit.
> 
> I'm always amazed how fast these 3D graphics are engines - I wish I knew the
> tricks used there
> to... anyone got a good beginner's guide?
> 
> Andyd