Palette question
Hi, I recently asked a question about bitmaps on this forum and got help so im gonna ask another question!
I am still writing my 8 bpp DirectDraw engine. I have now written a function that loads bitmaps, bitblt them on a surface and then bltfast them on the backbuffer. The problem is I can`t get the bitmap palette to work, I have tried 2 ways of accomplishing this, but none of them were sucessful. Im pretty sure the palette is loaded into bitpalette[256], but I cant seem to be able to swap the palette.
I would appreciate any help or suggestions.
WHO DO THEYTHINK THEY'REFOOLING : YOU ?
Check out the ddutils.cpp there''s a function there which does it (DDLoadPalette() i think)
//--- Created by Tom Oram ---
// tom.oram@vodafone.net

//--- Created by Tom Oram ---
// tom.oram@vodafone.net
What do you mean by trying to swap the palette?
I'm not sure exactly where you are swapping palettes, but maybe this can help:
If you aren't getting the colors on screen that are defined in the bitmap (I think what you mean), then you can set the primary surface's palette to be the one you loaded from your bitmap by doing something like this:
Then you can do your bltfast, and the colors should match those from the loaded bitmap.
Hope that helps some.
Where's my Golden Fleece?
Edited by - Aeetes on 3/2/00 1:30:12 PM
I'm not sure exactly where you are swapping palettes, but maybe this can help:
If you aren't getting the colors on screen that are defined in the bitmap (I think what you mean), then you can set the primary surface's palette to be the one you loaded from your bitmap by doing something like this:
IDirectDrawPalette7 *pDDP; PALETTEENTRY pe[256]; // TODO HERE: load the palette from your bitmap into the entries lpDD->CreatePalette(DDPCAPS_8BIT, pe, &pDDP, NULL); lpDDSPrimary->SetPalette(pDDP);
Then you can do your bltfast, and the colors should match those from the loaded bitmap.
Hope that helps some.
Where's my Golden Fleece?
Edited by - Aeetes on 3/2/00 1:30:12 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement