Subject: Re: LC3 Color bug?
To: Rick C. Petty <pett0019@gold.tc.umn.edu>
From: Julian Bean <jelibean@jmlbhome.demon.co.uk>
List: port-mac68k
Date: 11/08/1995 18:17:11
>Sorry it took so long to reply.  I had to search through piles of source
>code to find it.  I found this extra line of code somewhere when spending
>a year trying to get a simple offscreen pixmap call to work.  When I
>found it, I was thoroughly disgusted.  It wasn't in any of my references,
>and I have lots of them.
>
>Basically when you create an offscreen pixmap (probably onscreen, too)
>you create a new pixmap and open a new color port and set the port's
>portPixMap to that new pixmap, then:
>
>Rect anotherRect; /* rectangle depicting size of port (0,0)-(ht,wd) */
>CGrafPtr anotherPort;  /* I'm assuming this is already setup */
>...
>(**anotherPort->visRgn).rgnBBox = anotherRect;
>...
>
>I don't know why the LC's require setting up the visible region, but I
>tried a program both with and without this code on my LCIII and it only
>worked with the code.  I don't even know why/if it doesn't work on
>non-LC's but I'm assuming that the code can't hurt.
>
>If somebody can explain this, go right ahead.  I've spent two years
>trying to do animation and other "game" graphics on my LC3 and so far,
>nothing works!

Um..  why are you doing this?

I am a little unfamiliar with the 'correct' way to do offscreen graphics
back in the 'olden' days - but now we have GWorlds, you should be using
them.

I have succesfully used GWorlds loadsa times on various machines -
including my LCIII - with no trouble at all.  If you want some sample code
which uses them, then mail me.  But check out Dev CDs - I'm sure they have
'correct' uses of Gworlds on them in plenty.

I even set up a pretty damn simple C++ object to hand offscreen graphics,
so you could basically write:

OffscreenGWorld *myOSGW = new OffscreenGWorld(...);
        // Can't quite remember the params, but they were things like rect and
        // pixel depth.

...

myOSGW->Set();
// draw in GWorld
myOSGW->Restore();
//back in onscreen world

and so on.

Mystified,

Jules

>
>BTW:  GIve me one more week, and I'll have BSD on my mac... just about
>the time I'm considering buying a workstation!  I'll never win.  :(
>
>--Rick C. Petty,  aka Snoopy
>__________________________________________________________
> email: pett0019@gold.tc.umn.edu, pett0019@itlabs.umn.edu
>   WWW:     http://www.itlabs.umn.edu/~pett0019/


/----------------+---------------------------------+-----------------------\
|  Jelibean aka  |                                 |  6 Evelyn Road        |
|  Jules aka     |  jelibean@jmlbhome.demon.co.uk  |  Richmond, Surrey     |
|  Julian Bean   |                                 |  TW9 2TF    *UK*      |
+----------------+---------------------------------+-----------------------+
|  Three things hold a secret: A lady riding in a dream, the dog that      |
|  sounds no warning, and the maid who does not scream.                    |
\--------------------------------------------------------------------------/