Fullscreen problem with SDL-1.1.7

Hi!

Two bugs/misbehaviours I found with fullscreen and SDL 1.1.7:

(1)
There are still a few problems with fullscreen under Win32
(tested with Windows 98SE and 2000). The video surface is
aligned with the top and left screen border where it should
be centered when using a non-standard size of e.g. 672x560,
resulting in physical resolution 800x600. When moving the
mouse, the screen under the mouse pointer gets redrawed in the
middle of the screen (which means you can “paint” the surface to
the right position by moving the mouse), but UpdateRect then
again refreshed the surface in the upper left corner.

This is especially bad because surface and mouse position are
not aligned, but shifted against each others, which makes
mouse navigation nearly impossible.

This behaviour has been reported on different graphic cards,
but only under Win32.

An example to study this is my game “Rocks?n?Diamonds” which
uses the above mentioned window size.
(http://www.artsoft.org/rocksndiamonds/)

(2)
Another behaviour (that I would consider misbehaviour) is the
fact that if I use a window size of 640x400 and switch to
fullscreen, the video mode is set to VGA mode 640x400, resulting
in a vertically stretched screen (instead of using 640x480 and
adding “CinemaScope” bars). Maybe this was intended behaviour
to use this VGA mode and I should just use 640x401 resolution to
force 640x480 mode (haven?t tried this yet).
(Under Linux this can be avoided by not having 640x400 modelines,
but this does of course not work with Win32.)

This can be studied with Mirror Magic
(http://www.artsoft.org/mirrormagic/)
which uses a 640x400 window.

Kind regards,
Holger–
holger.schemel at mediaways.net

Another behaviour (that I would consider misbehaviour) is the
fact that if I use a window size of 640x400 and switch to
fullscreen, the video mode is set to VGA mode 640x400, resulting
in a vertically stretched screen (instead of using 640x480 and
adding “CinemaScope” bars).

“this is what I asked for, but it is not what I want” :slight_smile:
use SDL_ListModes() to see what dimensions are available

Mattias Engdeg?rd wrote:

Another behaviour (that I would consider misbehaviour) is the
fact that if I use a window size of 640x400 and switch to
fullscreen, the video mode is set to VGA mode 640x400, resulting
in a vertically stretched screen (instead of using 640x480 and
adding “CinemaScope” bars).

“this is what I asked for, but it is not what I want” :slight_smile:
use SDL_ListModes() to see what dimensions are available

Oops – thanks a lot for this hint.

Any idea about the other thing with the shifted display?

I also noticed (when switching to fullscreen under Windows 2000)
that I get a fullscreen resolution of about 1600x1200 (with the
smaller surface in the top left corner), although the Windows
desktop resolution is only 1024x768 (and the surface only 672x560,
therefore something like 800x600 would be appropriate).

Maybe an explicit use of SDL_ListModes helps here, too (although
I think that the closest resolution should be determined automatically).

Kind regards,
Holger–
holger.schemel at mediaways.net … ++49 +5241 80 1438

I also noticed (when switching to fullscreen under Windows 2000)
that I get a fullscreen resolution of about 1600x1200 (with the
smaller surface in the top left corner), although the Windows
desktop resolution is only 1024x768 (and the surface only 672x560,
therefore something like 800x600 would be appropriate).

Maybe an explicit use of SDL_ListModes helps here, too (although
I think that the closest resolution should be determined automatically).

It should. I wonder why it’s not seeing the correct resolutions.
What’s the output of the testvidinfo test program on your system?
What version of SDL are you using? Are you using prebuilt binaries or
building them yourself?

Thanks,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam Lantinga wrote:

I also noticed (when switching to fullscreen under Windows 2000)
that I get a fullscreen resolution of about 1600x1200 (with the
smaller surface in the top left corner), although the Windows
desktop resolution is only 1024x768 (and the surface only 672x560,
therefore something like 800x600 would be appropriate).

Maybe an explicit use of SDL_ListModes helps here, too (although
I think that the closest resolution should be determined automatically).

It should. I wonder why it’s not seeing the correct resolutions.
What’s the output of the testvidinfo test program on your system?

I’ll check this later at home, where I have installed the SDL stuff.

What version of SDL are you using?

The actual 1.1.7, of course. :wink:

Are you using prebuilt binaries or
building them yourself?

I’ve built all libraries from source, using the current xmingw32
cross-compiler under Linux, which (compiling them) works without
errors.

But I’ll also check the behaviour using your pre-built SDL libs
and report what happens.

BTW:
Could you also provide a prebuilt Win32 version of SDL_mixer on
your library page? I would like to test if I could fix the problems
I have described with it in another article on this list by using
a precompiled SDL_mixer.dll.

Best regards,
Holger–
holger.schemel at mediaways.net … ++49 +5241 80 1438

Check http://sdl.schartung.com for the binary. SDL_Mixer is currently the
only library I have up in both Debug and Release form, so please excuse the
mess while I find time to recompile the other libraries.> BTW:

Could you also provide a prebuilt Win32 version of SDL_mixer on
your library page? I would like to test if I could fix the problems
I have described with it in another article on this list by using
a precompiled SDL_mixer.dll.

Sam Lantinga wrote:

I also noticed (when switching to fullscreen under Windows 2000)
that I get a fullscreen resolution of about 1600x1200 (with the
smaller surface in the top left corner), although the Windows
desktop resolution is only 1024x768 (and the surface only 672x560,
therefore something like 800x600 would be appropriate).

Maybe an explicit use of SDL_ListModes helps here, too (although
I think that the closest resolution should be determined automatically).

It should. I wonder why it’s not seeing the correct resolutions.
What’s the output of the testvidinfo test program on your system?

This is the output under Windows 2000 using an S3 Savage 3D graphic
card:

---------- snip 8< ----------
Current display: 16 bits-per-pixel
Red Mask = 0x0000f800
Green Mask = 0x000007e0
Blue Mask = 0x0000001f
Fullscreen video modes:
1920x1440
640x400
512x384
400x300
320x240
320x200
1600x1200
1280x1024
1152x864
1024x768
800x600
640x480
A window manager is available
Hardware surfaces are available (46884K video memory)
Copy blits between hardware surfaces are accelerated
Colorkey blits between hardware surfaces are accelerated
Copy blits from software surfaces to hardware surfaces are accelerated
Colorkey blits from software surfaces to hardware surfaces are
accelerated
Color fills on hardware surfaces are accelerated
---------- snip 8< ----------

My game requests 672x560 and should get 800x600 (which works under Linux
and on a Windows 98 PC with an at the moment unknown graphic card).
Instead, it gets the first resolution in the list: 1920x1440!
(And even worse, as described: While the mouse input is correctly
centered on the screen, the UpdateRect output goes in the upper left
corner of the screen. :frowning: )

What version of SDL are you using? Are you using prebuilt binaries or
building them yourself?

As said, I use self-built (cross-compiled) SDL 1.1.7.

Best regards,
Holger–
holger.schemel at mediaways.net