--TheGoop
Some questions about 8-bit mode...
And further, it's VB so I don't know
------------------
Dance with me......
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.peRed = i;<BR> pal.peGreen = i;<BR> pal.peBlue = i;<BR> pal.peFlags = PC_NOCOLLAPSE;<BR>}<P>lpdd->CreatePalette(DDPCAPS_8BIT |<BR> DDPCAPS_INITIALIZE | DDPCAPS_ALLOW256,<BR> pal, &lpddpal, NULL);<P>lpddsprimary->SetPalette(lpddpal);<P>Jim<BR>
__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).]
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
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?
Oh, btw, setting the font to 0 (black) will work just great...