Re: [hatari-devel] SDL2 support

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


Am Sun, 3 Aug 2014 11:20:39 -0500
schrieb Bob Carpenter <hatari@xxxxxxxxxx>:

> Thomas,
> 
> Unfortunately, I can’t compile an OS X bundle with SDL 2 support
> enabled.

Ah, yes, sorry, I forgot to mention that. I did (of course) not touch
the OS X code since I am running Linux only. So one of the Mac guys got
to fix these problems...

> First, I received an error in doFullScreen in SDLMain.m. It
> said that which is not an element of the SDL_KeyboardEvent structure.
> I tried to replace the entire logic with a call to
> Screen_EnterFullScreen since the comment stated that the logic was
> written this way to avoid a bug in SDL 1.2.11. Unfortunately, once I
> did that, I found a number of errors in PrefsController.m. The first
> error states that SDLKey is an unknown type. After that, it does not
> like the definition of a number of the elements in the
> Preferences_KeysForJoysticks structure. The errors start with
> SDLK_KP0 that it suggests should be SDLK_KP_0 and continues on into
> SDLK_RMETA, SDLK_LSUPER, among others.

Some of the keyboard related problems can be solved with simple defines.
I did some of them already in keymap.h, e.g:

#define SDLKey SDL_Keycode
#define SDLK_LMETA SDLK_LGUI
#define SDLK_RMETA SDLK_RGUI

And your compiler (clang?) is right, SDLK_KP0 should be defined to
SDLK_KP_0 instead for SDL2 (don't ask my why they changed that, maybe
for consistency with the other keyboard definitions?).

> I was finally able to compile Hatari with no OS X support by
> commenting out the if(APPLE) block in CMakeLists.txt. As you
> mentioned, the desktop resolution code is disabled so going to full
> screen just shows you the same size screen. You also mentioned that
> keyboard mapping is not currently functional with SDL 2. Except for
> the problems you have already mentioned, I have not found anything
> new.

The (technically) interesting part here is that with SDL1, the
"scancode" mapping never worked with OS X, if I remember clearly
(i.e. you had to use the symbolic mapping and adapt non-english
keyboards with keymapping files).
Now with SDL2, they've changed pretty everything related to scancodes,
and the scancodes have now propper fixed names and location, i.e. there
might not be the need anymore for keymapping files in the future (at
least not such an urgent need than we had in the past). Anyway, the
keymapping code for SDL2 is still in a rough shape, so don't expect
miracles there yet...

 Thomas



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