Re: [hatari-devel] Feedback SDL2 support

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


----- Thomas Huth wrote:
> Am Fri, 23 Oct 2015 20:31:28 +0200
> schrieb Thomas Huth <th.huth@xxxxxx>:
> 
> > Am Thu, 22 Oct 2015 06:11:45 -0600 (MDT)
> > schrieb David Savinkoff <dsavnkff@xxxxxxxxx>:
> > [...]
> > > > > > > Hi Thomas,
> > > > > > > 
> > > > > > > Here is a patch that gets Fullsrceen/Windowed toggling (F11)
> > > > > > > to work significantly better on my CentOS 5 computer. The
> > > > > > > FULLSCREEN and BORDERLESS flags are necessary to fix
> > > > > > > two separate problems.
> > > > > > > 
> > > > > > > Please try this patch on your system to investigate how
> > > > > > > things change for you.
> > > > > > > 
> > > > > > > Thank You,
> > > > > > > David Savinkoff
> > > 
> > > screen.c.2.diff is the best I can do tonight.
> > 
> >  Hi David,
> > 
> > thanks for the testing! ... however, the SDL_WINDOW_FULLSCREEN_DESKTOP
> > has been used there on purpose - some people (especially Mac OS X
> > guys) wanted to have that feature with SDL2. But I think I could make
> > it optional, i.e. selectable with an option in the GUI. I'll try to
> > come up with a patch when I've got some spare time for this (but I
> > want to work on the 8-bit rendering removal first).
> 
> Done, now it's possible to use resolution switching with SDL2 in
> fullscreen, too. Please have a look whether it is working as expected.
> 
>  Thomas
> 
> 

Hi Thomas,

There is a small error in your patch, which if corrected should
make my system work better.

Included is an attachment with further explanation.

Sincerely,
David Savinkoff
# HG changeset patch
# User Thomas Huth
# Date 1448716137 -3600
# Node ID 4838ccc01514292412865e04cbf03f1a9ff28011
# Parent  df8f14e3558227903baa1b79427e45607a6c8c0a
Allow host screen resolution switching in SDL2 fullscreen mode, too

****************
sdlVideoFlags is overwritten when, possibly, it should be OR'd as in |=

see /**/ below

Note that I need sdlVideoFlags to ultimately be:
sdlVideoFlags = SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_GRABBED;

I don't know if the MAC people want SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_GRABBED
However I don't think they want SDL_WINDOW_FULLSCREEN
****************


*** One Suggestion ***

diff -r df8f14e35582 -r 4838ccc01514 src/screen.c
--- a/src/screen.c	Sat Nov 21 18:54:27 2015 +0100
+++ b/src/screen.c	Sat Nov 28 14:08:57 2015 +0100
@@ -308,7 +308,11 @@
 	/* SDL Video attributes: */
 	if (bInFullScreen)
 	{
-		sdlVideoFlags  = SDL_WINDOW_FULLSCREEN_DESKTOP;
+		sdlVideoFlags = SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_GRABBED;
+		if (ConfigureParams.Screen.bKeepResolution)
+	/**/		sdlVideoFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
+		else
+	/**/		sdlVideoFlags |= SDL_WINDOW_FULLSCREEN;
 	}
 	else
 	{



*** Another Suggestion ***


diff -r df8f14e35582 -r 4838ccc01514 src/screen.c
--- a/src/screen.c	Sat Nov 21 18:54:27 2015 +0100
+++ b/src/screen.c	Sat Nov 28 14:08:57 2015 +0100
@@ -308,7 +308,10 @@
 	/* SDL Video attributes: */
 	if (bInFullScreen)
 	{
-		sdlVideoFlags  = SDL_WINDOW_FULLSCREEN_DESKTOP;
+		if (ConfigureParams.Screen.bKeepResolution)
+			sdlVideoFlags = SDL_WINDOW_FULLSCREEN_DESKTOP | SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_GRABBED;
+		else
+			sdlVideoFlags = SDL_WINDOW_FULLSCREEN | SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_GRABBED;
 	}
 	else
 	{



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/