[comp.sys.mac.programmer] LSC and ColorWindows

mikeoro@hubcap.clemson.edu (Michael K O'Rourke) (06/15/89)

I am using LSC for the first time, so this may be a stupid question.  I
am trying to get a color window. However, LSC doesn't recognize that type.
I looked at the sample code TubeTest on AppleLink and they got a color window
using GetCWindow into a regular WindowPtr.  Should i do the same?  If so,
how can i access the CWindowPtr specific fields like the pixel map and
background color?  I tried typecasting, but it diddn't seem to like that.

--Michael O'Rourke

oster@dewey.soe.berkeley.edu (David Phillip Oster) (06/15/89)

In article <5767@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes:
>I am using LSC for the first time, so this may be a stupid question.  I
>am trying to get a color window. However, LSC doesn't recognize that type.
>I looked at the sample code TubeTest on AppleLink and they got a color window

read the example program I posted not more than 3 days ago in this very
newsgroup. It takes the datafile that was included in the recent
ray-tracing binary, and draws it correctly and much faster than the drawer
in the ray-tracing posting.  It gives examples of dealing with color
windows, color tables, palettes, and pixmaps. all in Lightspeed C.

--- David Phillip Oster            --"Unix Version 7 was an improvement not
Arpa: oster@dewey.soe.berkeley.edu --only over its predeccessors, but also its
Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu --successors."

d88-jwa@nada.kth.se (Jon W{tte) (06/16/89)

In article <5767@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes:
>am trying to get a color window. However, LSC doesn't recognize that type.

>using GetCWindow into a regular WindowPtr.  Should i do the same?  If so,

CwindowPtr's and WindowPtrs have to be the same in some instances for some
reasons. LSC should be able to handle casting them when you want to. Get
an upgrade, if you are using an older version than 3.0. Good Luck, anyway,
the Color Manager's a tough one !

-- 
 __       Jon W{tte (The dread Smiley Shark) email:h+@nada.kth.se
/  \      (+46 (0) 8 258 268)
   /---   (c) 1989 Yessbox Allright Professional Products Inc. - Y.A.P.P.I.
  /       -- No More --

awd@dbase.UUCP (Alastair Dallas) (06/18/89)

In article <1193@draken.nada.kth.se>, d88-jwa@nada.kth.se (Jon W{tte) writes:
> In article <5767@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes:
> >am trying to get a color window. However, LSC doesn't recognize that type.
> 
> CwindowPtr's and WindowPtrs have to be the same in some instances for some
> reasons. LSC should be able to handle casting them when you want to. Get
> an upgrade, if you are using an older version than 3.0. Good Luck, anyway,
> the Color Manager's a tough one !

Figuring out what could be wrong based on what people post is a lot like
debugging code without a debugger.  Very challenging.  Here's my guess about
Michael's problem: I think he's relying on <MacHeaders> rather than including
all the .h files and since color.h isn't in MacHeaders, LSC doesn't recognize
color windows.  But my solution does assume LSC 3.0, so I could be wrong.

/alastair/