This might sound obsolete these days as all graphics are at least 24bit. I have ported one of my old games to windows some time back, it worked really well under full screen. Now I wanted to allow the windowed mode. I have come across a problem when I try to display the 8bit images on higher color depth mode nothing appears on the screen (under windowed mode).
This what I have tried so far
- Switching to 8bit mode (windowed): This works but I don’t want to use that cause windows look really ugly under 8bit colors and the user will be really irritated if the game switches them to lower color mode.
- Create 8bit surface (Video/back buffer) under 16/24 bit mode: The causes the initialization to fail i.e. the mode is sent but when I try to createsurface with the DD interface it fails.
I am using DDSDPIXELFORMAT flag and dwRGBBitCount to set the bitmap color depth in the surface description structure.
- Create 24bit surface (Video/back buffer) under 24 bit mode but creating 8bit surface to load my sprites:
With this the initialization has no issues the front & back buffers are created successfully, I am also able to create off-screen 8bit buffers and load sprites. But the actual blit fails to draw anything on the screen. My understanding was the directX should be able to handle the surfaces with different color depths.
Does any one knows how to handle this, the next step is palette handling which also works fine under full screen but how to set the palette for 16/24 bit modes as these mode do not require a palette.
PS: Please don’t suggest to convert the loaded 8bit surfaces to higher depth as runtime, I don’t think it’s a good solution (it could work but I just don’t like it). It should be handled by DirectX somehow.