Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

Some questions about 8-bit mode...

This topic is 6677 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Guest Anonymous Poster
I used the allow256 (or whatever the exact syntax is) flag...so shouldn't I be able to use these?

Share this post


Link to post
Share on other sites
The first 10 en last 10 colors are reserved for windows....that's what I know.

And further, it's VB so I don't know

------------------
Dance with me......

Share this post


Link to post
Share on other sites
As long as you define the PC_NOCOLLAPSE inside you palette entries and use DDPCAPS_ALLOW256, you have the full range to use with no problem.

Try using this method to create the palette:

/*
lpdd
= DirectDraw Interface
lpddpal
= DirectDraw Palette Interface
lpddsprimary
= DirectDraw Primary Buffer Interface
*/

PALETTEENTRY pal[256];

memset(pal, 0, sizeof(PALETTEENTRY) * 256);
for(i=0;i<256;i++) {
pal[i].peRed = i;
pal[i].peGreen = i;
pal[i].peBlue = i;
pal[i].peFlags = PC_NOCOLLAPSE;
}

lpdd->CreatePalette(DDPCAPS_8BIT |
DDPCAPS_INITIALIZE | DDPCAPS_ALLOW256,
pal, &lpddpal, NULL);

lpddsprimary->SetPalette(lpddpal);

Jim

Share this post


Link to post
Share on other sites
__So, you're trying to map a different value of gray to each of the 256 colors. I think you might have a samll problem.
__When running in ture 8-bit color there are only 262,144 colors to work with (an 18-bit pallette.) If I'm correct, you'll see banding in gradients.
__Does anyone know more about how this works in Windows?

[This message has been edited by SonicSilcion (edited October 06, 1999).]

Share this post


Link to post
Share on other sites
If you use the windows palette manager, then it would try to dither it or something to make it look right.

In his case, he couldn't get a full white color, but rather a grayish one when using palette register 255 that he setup previously to a white value.

The thing that I don't know is, with DOS, you have to scale the 8bit value down to 6bit, but I guess DirectX does that automatically when you try to set an 8bit value.

Jim

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
When I do a bltcolorfill, it look fine (white), but when I try to changed the font color to 255...it is still a greyish color. Are fonts restricted in their color? Or should I ideally be able to set it as any color?

Oh, btw, setting the font to 0 (black) will work just great...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I've been playing around with 8-bit mode, and I've got a few questions. First off let me just say that I was playing with a palette that was made by just looping from 0 to 255 and assigning the 0-255 value to each red, green, and blue value. So I basically made a grey-scale palette. Also, I'm using VB 5.0 if that molds your answer any...

1) When I'm calling a function that requires a color value, do I give it a 0-255 value representing an entry in my palette? I did this and it seemed to work, but I just want to make sure I'm not doing it wrong.

2) When I set the backbuffer's forecolor property, I get mixed results using the method in number 1. When I set the color to 0 (black in my palette) it will have black text, yet when i use 255 (white in my palette) I get a grayish color. Any ideas why this happens?

3) How could I go about using a bitmap that has 256 total pixels, each pixel having a particular color i want in my palette, and use that to make a palette in DirectX?

Share this post


Link to post
Share on other sites