Capture 8bpp error

BlitzPlus Forums/BlitzPlus Programming/Capture 8bpp error

DrMartin(Posted 2003) [#1]
I'm working on a game in B+, it can be run either in a window or in fullscreen mode. If I try to run my B+ game on a computer that has 8bpp (256 colors) on the desktop, I get a directdraw error (Unrecognized DirectDraw pixel format: bpp=8 yadda yadda) and the app quits.
I want to capture this error, look for a fullscreen mode with more than 8bpp and automaticly switch to that, it would be so much nicer than just giving the user a weird message. Is this possible? The error message pops up before my code is touched at all, so it doesn't seem like there's an awful lot for me to do.
Any ideas are appreciated. It's of course not vital for the game, but it would be a nice addition.

--
Martin


rdodson41(Posted 2003) [#2]
You might want to post your code. That is always helpful and may solve your problem faster.
-Rich05


GfK(Posted 2003) [#3]
You can determine the colour depth by using the GraphicsDepth() function. In windowed mode, it should return the colour depth of the desktop.

My graphics card doesn't do 8-bit so I can't test it (its possible that GraphicsDepth() will never return a value lower than 16), but in theory you can check to see if GraphicsDepth() returns 8, and if so, go to fullscreen.

Might be worth a go, anyway...


TheMan(Posted 2003) [#4]
Blitz+ dont support 256 colour depth (8bit) supports only 16bit or and 32Bit colour depth