nanogui: GrReadArea return MWPF_PIXELVAL instead MWPF_RGB


Previous by date: 8 Dec 2006 02:24:21 +0000 Re: Problem installing nxlib, Greg Haerr
Next by date: 8 Dec 2006 02:24:21 +0000 Re: transparent support of PNG image, Greg Haerr
Previous in thread: 8 Dec 2006 02:24:21 +0000 GrReadArea return MWPF_PIXELVAL instead MWPF_RGB, roberto\.bielli\.inwind\.it
Next in thread:

Subject: Re: GrReadArea return MWPF_PIXELVAL instead MWPF_RGB
From: "Greg Haerr" ####@####.####
Date: 8 Dec 2006 02:24:21 +0000
Message-Id: <0a9701c71a6f$ef27e650$6401a8c0@winXP>

> I have a problem on GrReadArea. I found that this function returns only
the 16bit color instead of 32 rgb and i won't make a conversion in my
application, i want to get RGB for GrReadArea.

You'll need to modify nanox/client.c::GrReadArea(),
and have it translate all the pixels from 5/6/5 to
RGB before returning to the application.

Although tedious, some examples near what you're
going to need to do are:

1. check out engine/devdraw.c::GdArea().  The
last while() loop basically pulls out R,G,B values
from pixels using predefined macros and the current
hw format.  You'll then re-assemble them and write
them sequentially in an output buffer.  It would be nice
to handle other than just your specific case,
that's what the switch() statement is for.

2. The file i_video.c in nxdoom-src.gz contains code
that rewrites pixels in an output buffer.  I had to do this since
Doom only operates in 8bpp mode, but I was running in
5/6/5 truecolor.

Hope this helps.

Regards,

Greg


Previous by date: 8 Dec 2006 02:24:21 +0000 Re: Problem installing nxlib, Greg Haerr
Next by date: 8 Dec 2006 02:24:21 +0000 Re: transparent support of PNG image, Greg Haerr
Previous in thread: 8 Dec 2006 02:24:21 +0000 GrReadArea return MWPF_PIXELVAL instead MWPF_RGB, roberto\.bielli\.inwind\.it
Next in thread:


Powered by ezmlm-browse 0.20.