Palette Question
Ok I have a primary surface with an attached backbuffer, and offscreen surface containing a bitmap, and a ''supposedly'' set Palette. I set all the entries to 0 like this cuz I wanted to see if it would work right:
PALETTEENTRY pe[256];
for(i=0;i<256;i++){
pe.peBlue=pe.peRed=pe.peGreen=0;
pe.peFlags=PC_NOCOLLAPSE;
}
Im assuming the above sets every entry to black. Then I attached a created palette to my primary surface. I blitted my bitmap to the backbuffer and flipped and….
it wasn''t all black. The palette didn''t work. What am I doing wrong? I have it in 8-bit… </i>
I just quickly read throguh a section of the DX documentation today, and it said something and I think that all surfaces have their own palettes. So when you set a palette to the back buffer, it retains that information. And when you flip pages, the palette for the primary surface is the one that is used. Try setting the primary surface palette to black and see if that works.
---Will DDR for food.
What I''m geting is this: You attached a black palette to the offscreen surface, loaded a bitmap, then attached another palette to the primar surface. Or is it just one palette you have? Perhaps you are loading the palette of the bitmap instead, and leaving it unchanged. Maybe you should change the entries after you load the bitmap. I''m scraping the bottom of the barrel of ideas with a plastic sandcastle shovel. (Running out of ideas)
---Will DDR for food.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement