[futurebasic] RE [FB] PLOT and COLOR in GWORLDS

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 1998 : Group Archive : Group : All Groups

From: Pritchard Andy <pritcharda@...>
Date: Wed, 29 Apr 1998 15:40:00 +0100
If anyone's interested, I think I've solved my problem when copying
gworlds and its pretty wierd!!!

The original problem:
>>I'm not getting a reliable copy - its frequently blank space.

Mel said:
>Sounds like the handle to the gWorld is not pointing at exactly what it
>should be. You're getting a blank. So either nothing was drawn in the
>gWorld or the pointer to it was bad. Perhaps using Macsbug to find the
>gWorld in memory and seeing if anything is there might help...

Well I didn't use Macsbug but by re-ordering the code I did get to find
that I was writing to the gworld successfully. The problem came when I
did the last copybits to the screen. I could use a complex routine or
simple routine  - it didn't matter, still that last copybits failed.
Remembering the comments about not using BASIC commands in gworlds I
removed a routine which appeared to me to be completely irrelevant to
the problem - its function was to clear the edges of the screen where
the scroll bars would sit (if I had scroll bars). It used the BASIC
command BOX FILL. So this is the sequence:

FN makegworlds 'Also saves the Oldport and Olddevice
FN clearedges
FN doOffscreengymnastics 'All the setports and copybits in this routine
FN disposegworlds

Removing the FN clearedges solved the problem!!! I can only assume that
my BOX command in the scroll area somehow affected the Oldport
datablock. Can't say I understand why. I just know its sorted the
problem.

BTW, the tip that Mars suggested using the _useTempMem in flag (value 4)
in the last parameter of the NewGWorld call, works just fine. This
should mean that my program can use the largest of windows on large
monitors without the user having to mess around with the program GET
INFO memory allocation (providing there is enough RAM, of course).

Incidently if I want to copy a "DIM rect.8" defined rectangle, I just go
"rect=grect" or do I have to BLOCKMOVE all the bytes?

Andy