Re: [hatari-devel] OS X SDL2 fixes

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


Am Wed, 20 Aug 2014 21:35:23 -0500
schrieb Bob Carpenter <hatari@xxxxxxxxxx>:

> I have downloaded the latest development code and here is what I see
> in the OS X version when I use SDL2.
> 
> 1. As I enter fullscreen mode, I see the New Floppy Image window
> appear next to the Hatari window. I have tried to determine when it
> appears by putting in an NSAlert at the beginning of the doFullScreen
> function (class?), but the alert does not appear. I assume I did
> something wrong. I wanted to see if the alert appeared prior to the
> New Floppy Image window or not. 

You are talking about the OS X dialog, not the SDL dialog, right?
Is there maybe a shortcut key is listed for this dialog when you browse
through the OS X menu? (i.e. could it be that the shortcut activates
two menu items?)

> 2. I could stop the OS from intercepting keys like Cmd-M and Cmd-F
> simply by removing the keyboard shortcuts in the NIB file. Once I did
> that, Hatari stopped crashing when I used the Cmd-F shortcut for
> fullscreen mode since OS X was not attempting to do the fullscreen
> logic itself.

Sounds good. Alternatively, I think we could also map the Hatari
shortcuts to other keys on OS X ?

> 3. Most times, when entering full screen mode, Hatari will only
> occupy the upper left corner of the screen until I move the mouse.
> Then, Hatari takes up the entire window.

That's certainly a bug in the SDL library. Could you maybe report the
problem at the libsdl.org project?

> 4. The SDL2 fullscreen mode appears to be more “jaggy” than the SDL1
> fullscreen mode. However, I did not notice it when playing a game. It
> was definitely noticeable when looking at the desktop.

You mean the zooming creates block pixels? Well, that's kind of
expected: With SDL1, there was a resolution change when going to
fullscreen, so your monitor likely scaled up the screen in a smooth way.
With SDL2, there is no resolution change anymore, the screen is scaled
up by your graphics card or by a SDL software function.
You can go back to the old behaviour with the resolution change by
replacing SDL_WINDOW_FULLSCREEN_DESKTOP with SDL_WINDOW_FULLSCREEN
in screen.c.

Alternatively, you could also try to change the scaling mode by setting
an SDL hint. I think you can do this by setting an environment variable
- or for OS X it is maybe easier to do this directly in the source
code, somewhere before the screen is initialized:

SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");

Instead of "linear" you can also try "best".

(BTW, I am away from my laptop right now, so I can currently not test
this on my own)

> 5. Sometimes, but not always, the host (OS X) mouse pointer will stay
> on the screen in fullscreen mode along with the Atari mouse pointer.
> The OS X mouse pointer won’t move and only the Atari mouse pointer
> works in fullscreen. 

That sounds like another SDL bug, so you should maybe report it on
libsdl.org, too. Can you determine a pattern when it stays enabled?
E.g. does it make a difference whether the host mouse pointer was in the
Hatari window before you changed to fullscreen or not?

Another thing to try: When you enable the SDL GUI in fullscreen (F12)
and leave it again, is the host mouse pointer gone?

> I do not know how many of these problems affect any version besides
> OS X.

I didn't experience any of these problems with SDL2 on Linux.

> At this point, actually playing a game appears to work without a
> problem.

So is Hatari running smoother/faster with SDL2 on OS X or is still SDL1
the better choice?

 Thomas



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