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 |
Mode switching test program and/or reference design |
eric.w
|
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:
|
|||||||||||||
|
AntTheAlchemist
|
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:
-- 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 |
|||||||||||||
|