The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Mode switching test program and/or reference design
Timon
Guest

Hi,

We're writing a game with support for in-game switching between
windowed/fullscreen/fake_fullscreen, display selection, alt+tabbing,
etc, and we're running into various issues.

Some of these are our fault, some are issues in sdl, window managers,
macos (especially 10.11). It's always really hard to tell which, and a
tremendous cost to test anything with the full game. Not to mention when
it's a wm misbehaving it's hard to explain to devs what the exact
problem is and for them to fix anything without a test case.

So I'm gonna propose making some kind of reference design & test program.
Basically it would create a window, with some simple (probably opengl)
rendering to verify everything works and provide some shortcuts and/or
simple UI to change all of the options (also command line parameters
and/or a simple config file).

The main benefits I see would be:
-game devs would know what the "best" way of using the API is (e.g.
having to call SDL_SetWindowSize after SDL_SetWindowDisplayMode in
fullscreen is not obvious).
-window manager devs have a simple test program they can use to verify
their code isn't completely broken
-everyone has some simple common ground to refer to
-sdl devs could say (if they want to be nasty) "if the reference works
you're doing something wrong";p

There are further useful features to extend the program with e.g.:
- semi-automatic testing, where it goes through the various combinations
of transitions asking each time if everything looks ok (unfortunately
that would just cover a small subset of issues but still better than
nothing)
- event logging and assertion (e.g. assert that there are no resize
events when switching from fake_fullscreen to native fullscreen).

Anyone else thinks this is a good idea? I'm willing to grab our code and
strip it to something minimal as a start.

-Timon

P.S. of course now you'll tell me that something like this already exists;p

--
Best Regards

Tomasz Borowik, Programmer

EGOSOFT GmbH, Heidestrasse 4, 52146 Würselen, Germany
Tel: +49 2405 4239970, www.egosoft.com
Geschäftsführer: Bernd Lehahn, Handelsregister Aachen HRB 13473

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Mode switching test program and/or reference design
Michael Labbé
Guest

Quote:
Anyone else thinks this is a good idea? I'm willing to grab our code and strip it to something minimal as a start.

Hi Timon,

Providing no one else has done this already, I think coming up with a set of hard and fast rules here is a worthwhile effort. I would be willing to test a stripped down program on various platforms I have access to and provide results.

It should be noted that some of the problems you see here are due to driver interactions. For instance, I’ve seen an ATI card on Windows Vista with default drivers crash when ctrl-alt-del was pressed and the game doesn’t explicitly handle that case.

I would also add testing with Direct3D, and, separately, ctrl-alt-delete on Windows into the mix.

Michael Labbé
Quote:
On Jan 11, 2016, at 6:19 AM, Timon wrote:
Hi,We're writing a game with support for in-game switching between windowed/fullscreen/fake_fullscreen, display selection, alt+tabbing, etc, and we're running into various issues.Some of these are our fault, some are issues in sdl, window managers, macos (especially 10.11). It's always really hard to tell which, and a tremendous cost to test anything with the full game. Not to mention when it's a wm misbehaving it's hard to explain to devs what the exact problem is and for them to fix anything without a test case.So I'm gonna propose making some kind of reference design & test program.Basically it would create a window, with some simple (probably opengl) rendering to verify everything works and provide some shortcuts and/or simple UI to change all of the options (also command line parameters and/or a simple config file).The main benefits I see would be:-game devs would know what the "best" way of using the API is (e.g. having to call SDL_SetWindowSize after SDL_SetWindowDisplayMode in fullscreen is not obvious).-window manager devs have a simple test program they can use to verify their code isn't completely broken-everyone has some simple common ground to refer to-sdl devs could say (if they want to be nasty) "if the reference works you're doing something wrong";pThere are further useful features to extend the program with e.g.:- semi-automatic testing, where it goes through the various combinations of transitions asking each time if everything looks ok (unfortunately that would just cover a small subset of issues but still better than nothing)- event logging and assertion (e.g. assert that there are no resize events when switching from fake_fullscreen to native fullscreen).Anyone else thinks this is a good idea? I'm willing to grab our code and strip it to something minimal as a start.-TimonP.S. of course now you'll tell me that something like this already exists;p-- Best RegardsTomasz Borowik, ProgrammerEGOSOFT GmbH, Heidestrasse 4, 52146 Würselen, GermanyTel: +49 2405 4239970,://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Mode switching test program and/or reference design
eric.w


Joined: 12 Feb 2014
Posts: 38
This is a great idea.The test programs in test/ already have some of this functionality. If you're on OS X, just open the XCode/SDLTest/SDLTest.xcodeproj in the SDL source code to play with them.


See SDLTest_CommonEvent() in SDL_test_common.c for the keyboard shortcuts.
Ctrl+Enter = toggle real fullscreen
Alt+Enter = toggle "fullscreen desktop"
Ctrl+plus = double window size (didn't know this existed until you mentioned it :-)
Ctrl+minus = half window size


However, it looks like there is no way to interactively call SDL_SetWindowDisplayMode.


The test programs also support a bunch of command line flags for starting up in a specific mode. 


Also for automatic testing I'd check out testautomation_video.c (never tried running it unfortunately.)


Cheers,
Eric




On Mon, Jan 11, 2016 at 7:19 AM, Timon wrote:
Quote:

Hi,

We're writing a game with support for in-game switching between windowed/fullscreen/fake_fullscreen, display selection, alt+tabbing, etc, and we're running into various issues.

Some of these are our fault, some are issues in sdl, window managers, macos (especially 10.11). It's always really hard to tell which, and a tremendous cost to test anything with the full game. Not to mention when it's a wm misbehaving it's hard to explain to devs what the exact problem is and for them to fix anything without a test case.

So I'm gonna propose making some kind of reference design & test program.
Basically it would create a window, with some simple (probably opengl) rendering to verify everything works and provide some shortcuts and/or simple UI to change all of the options (also command line parameters and/or a simple config file).

The main benefits I see would be:
-game devs would know what the "best" way of using the API is (e.g. having to call SDL_SetWindowSize after SDL_SetWindowDisplayMode in fullscreen is not obvious).
-window manager devs have a simple test program they can use to verify their code isn't completely broken
-everyone has some simple common ground to refer to
-sdl devs could say (if they want to be nasty) "if the reference works you're doing something wrong";p

There are further useful features to extend the program with e.g.:
- semi-automatic testing, where it goes through the various combinations of transitions asking each time if everything looks ok (unfortunately that would just cover a small subset of issues but still better than nothing)
- event logging and assertion (e.g. assert that there are no resize events when switching from fake_fullscreen to native fullscreen).

Anyone else thinks this is a good idea? I'm willing to grab our code and strip it to something minimal as a start.

-Timon

P.S. of course now you'll tell me that something like this already exists;p

--
Best Regards

Tomasz Borowik, Programmer

EGOSOFT GmbH, Heidestrasse 4, 52146 Würselen, Germany
Tel: [url=tel:%2B49%202405%204239970]+49 2405 4239970[/url], www.egosoft.com
Geschäftsführer: Bernd Lehahn, Handelsregister Aachen HRB 13473

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
AntTheAlchemist


Joined: 13 Feb 2015
Posts: 60
Location: UK
I think many of us have implemented games that handle this behaviour, with varying success. It'd be a good idea if we all shared our results and methods. I've done this and it works very well on the Windows platform from what I gather.
Mode switching test program and/or reference design
Timon
Guest

Ok I'll take a look at that SDLTest (though I'm on linux btw;).
I'll try to mash something up over the weekend.

-Timon

P.S. Sorry if the email doesn't get threaded properly, the emails got
deleted as soon as I read them (I'm guessing I had too many unread ones).

On 01/11/2016 03:19 PM, Timon wrote:
Quote:

Hi,

We're writing a game with support for in-game switching between
windowed/fullscreen/fake_fullscreen, display selection, alt+tabbing,
etc, and we're running into various issues.

Some of these are our fault, some are issues in sdl, window managers,
macos (especially 10.11). It's always really hard to tell which, and a
tremendous cost to test anything with the full game. Not to mention
when it's a wm misbehaving it's hard to explain to devs what the exact
problem is and for them to fix anything without a test case.

So I'm gonna propose making some kind of reference design & test program.
Basically it would create a window, with some simple (probably opengl)
rendering to verify everything works and provide some shortcuts and/or
simple UI to change all of the options (also command line parameters
and/or a simple config file).

The main benefits I see would be:
-game devs would know what the "best" way of using the API is (e.g.
having to call SDL_SetWindowSize after SDL_SetWindowDisplayMode in
fullscreen is not obvious).
-window manager devs have a simple test program they can use to verify
their code isn't completely broken
-everyone has some simple common ground to refer to
-sdl devs could say (if they want to be nasty) "if the reference works
you're doing something wrong";p

There are further useful features to extend the program with e.g.:
- semi-automatic testing, where it goes through the various
combinations of transitions asking each time if everything looks ok
(unfortunately that would just cover a small subset of issues but
still better than nothing)
- event logging and assertion (e.g. assert that there are no resize
events when switching from fake_fullscreen to native fullscreen).

Anyone else thinks this is a good idea? I'm willing to grab our code
and strip it to something minimal as a start.

-Timon

P.S. of course now you'll tell me that something like this already
exists;p


--
Best Regards

Tomasz Borowik, Programmer

EGOSOFT GmbH, Heidestrasse 4, 52146 Würselen, Germany
Tel: +49 2405 4239970, www.egosoft.com
Geschäftsführer: Bernd Lehahn, Handelsregister Aachen HRB 13473

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org