Aaron,
Once again you come through. Wonderful help.
Now do you happen to know if there is a function or macro in the Palm OS
headers that does this?
UInt16 RGB16;
RGB16 = ((RGBColor.r & 0xF8) << 8) + ((RGBColor.g & 0xFC) << 3) +
((RGBColor.b & 0xF8) >> 3);
I just want to use as many standard API stuff as possible.
What I am trying to do is have a faster version of
WinSetForeColorRGB(&RGBColor, NULL);
WinDrawPixel(topLeft.x, topLeft.y);
since these API calls are extremely slow.
Thanks,
Mike McCollister
> -----Original Message-----
> From: Aaron Ardiri [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, January 18, 2001 3:31 PM
> To: Palm Developer Forum
> Subject: Re: WinCreateOffscreenWindow question
>
> > When I create an offscreen window using WinCreateOffscreenWindow, is the
> > handle created locked? I am assuming that it is since I get a bus error
> when
> > I try to lock the handle.
> >
> > Now the real question is how do I get the pointer for the offscreen
> data?
> > For example, the call below I get a handle called hOffscreen.
> >
> > hOffscreen = WinCreateOffscreenWindow(COLORS_WIDTH, COLORS_HEIGHT,
> > screenFormat, &error);
>
> hOffscreen is a handle to the WindowType structure :))
>
> > I want to do something like
> >
> > UInt8 *pScreen = (UInt8 *)(*hOffscreen);
>
> ---
> /**
> * Determine the pointer to the bitmap data chunk for a specific window.
> *
> * @param win the window.
> * @return a pointer to the bitmap data chunk.
> */
> void *
> DeviceWindowGetPointer(WinHandle win)
> {
> void *result = NULL;
>
> // palmos 3.5 - use BmpGetBits()
> if (DeviceSupportsVersion(romVersion3_5)) {
> result = BmpGetBits(WinGetBitmap(win));
> }
>
> // palmos pre 3.5 - use standard technique
> else
> result = (void *)win->displayAddrV20;
>
> return result;
> }
> ---
>
> straight from the Cube3D sources :)
>
> // az
> [EMAIL PROTECTED]
> http://www.ardiri.com/ <--- free games!
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/