Another bug

When switching between full-screen and windowed mode under Windows 95, a key
can get “stuck” so that, although I’ve released the key, my program keeps
receiving key press events (with key repeat enabled).–
Rainer Deyke (root at rainerdeyke.com)
Shareware action/role-playing games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor

I’m having trouble with display depths of 15 or 16 set with
SDL_SetVideoMode under Windows NT. This happens whether in full
screen or windowed mode.

15 bpp: Returns “Couldn’t create DIB section”. Stepping through the
code this is exactly what happens - the call to the Windows API
function CreateDIBSection returns NULL, with an error code of zero as
well.

16 bpp: Returns OK, but

I’ve updated the drivers on my graphics card

Any help or debugging tips appreciated!

Francis

I’m having trouble with display depths of 15 or 16 set with
SDL_SetVideoMode under Windows NT. This happens whether in full
screen or windowed mode.

It happens with our game, and also with the fireworks SDL demo
application:

15 bpp: SDL fails to open the display device, returning “Couldn’t
create DIB section”. Stepping through the code this is exactly what
happens - the call to the Windows API function CreateDIBSection
returns NULL, with an error code of zero as well.

16 bpp: Returns OK, but the colours are distorted, like 565 pixels are
being displayed in 555 mode or vice versa.

I’ve updated the drivers on my graphics card.

I’m not sure where to go now, but I can run it in the debugger and do
any tests. Any help or debugging tips appreciated!

This is with the latest CVS version of SDL.

Francis

Francis Irving wrote:

I’m having trouble with display depths of 15
or 16 set with SDL_SetVideoMode under Windows
NT. This happens whether in full screen or
windowed mode.

I am seeing this problem as well. I saw it a while back but then ignored it
and then forgot about it. I can look at the problem but Sam usually fixes
things before I can get a debug version built :slight_smile:

  • Randi

Regimental Command
Generic Armored Combat System
http://regcom.sourceforge.net

Francis Irving wrote:

I’m having trouble with display depths of 15
or 16 set with SDL_SetVideoMode under Windows
NT. This happens whether in full screen or
windowed mode.

I am seeing this problem as well. I saw it a while back but then ignored it
and then forgot about it. I can look at the problem but Sam usually fixes
things before I can get a debug version built :slight_smile:

I don’t have an NT system to check this on.

-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Francis Irving wrote:

I’m having trouble with display depths of 15 or 16 set with
SDL_SetVideoMode under Windows NT. This happens whether in full
screen or windowed mode.

It happens with our game, and also with the fireworks SDL demo
application:

15 bpp: SDL fails to open the display device, returning “Couldn’t
create DIB section”. Stepping through the code this is exactly what
happens - the call to the Windows API function CreateDIBSection
returns NULL, with an error code of zero as well.

Might be worth plonking a GetLastError() call in there for extra
diagnostic goodness. As far as I can tell, CreateDIBSection will set the
error code under NT/2000 (but not 95/98).

Next time you fire up the debugger, can you note down the values used in
the BITMAPINFOHEADER struct passed into CreateDIBSection? (Or just come
and grab me to have a look :slight_smile:

The biBitCount field should be 16, even for 555 mode. Maybe SDL is
setting it to 15? It’s quite possible that win95/98 would let this
through where NT might choke.
Just a wild guess. I don’t have an NT box either.

16 bpp: Returns OK, but the colours are distorted, like 565 pixels are
being displayed in 555 mode or vice versa.

I’ve updated the drivers on my graphics card.

I had to downgrade the directx drivers in my machine to get it working
:slight_smile:

Ben.–
Ben Campbell
Programmer, Creature Labs
ben.campbell at creaturelabs.com
http://www.creaturelabs.com