So I found the keys that generate mouse buttons (like scroll wheel) and I guess middle click is how to activate the user block cube; but the only way I found to close that is to hit escape which is save and exit... can escape be pre-empted by gui screens to close?
SDL2... I grabbed this, only took them 10 years to come out with it
Not a lot changes... have to change the type of 'GameEnv::screen' and use a different function to open the window; and unfortunatly the display info stuff is different, ended up just chopping that out for a fixed value from the settings file.... the swap call takes the GameEnv->screen(window) variable...
#define SDL_GL_SwapBuffers() SDL_GL_SwapWindow( GameEnv->screen )
/* .... in ZGame... */
#ifdef SDL1
SDL_Surface * screen;
#else
SDL_Window * screen;
#endif
The sound system is different I guess; the last buffer is never cleared,
at the end of ZSound::MixAudio....
if (nSounds) for (i = 0; i < Buffer_Len / 2; i++) ((Short *)stream)[i] = (Short)(SoundBuffer[i]);
else
memset(stream, 0, len);
otherwise stream is not cleared when there were no sounds to mix, and that block keeps looping.
---------
removed a lot of references to including SDL, since it's included in ZGame.h anyway and seems most everything ends up including that.
----------
how do I exit a gui dialog? is it easy to add a X button?
----------
The method for the mouse is different; but a simple define can fix that
#define SDL_WM_GrabInput SDL_SetRelativeMouseMode
#define SDL_GRAB_ON SDL_TRUE
#define SDL_GRAB_OFF SDL_FALSE
// otherwise warp mouse takes the window/screen as parameter
#define SDL_WarpMouse SDL_WarpMouseGlobal
----------
Some missing/modified keyboard handling/mapping. Have to take the sym & 0xFF a lot of places because they set a high-bit in it (1<<30)
#define SDLK_KP0 SDLK_KP_0
#define SDLK_KP1 SDLK_KP_1
#define SDLK_KP2 SDLK_KP_2
#define SDLK_KP3 SDLK_KP_3
#define SDLK_KP4 SDLK_KP_4
#define SDLK_KP5 SDLK_KP_5
#define SDLK_KP6 SDLK_KP_6
#define SDLK_KP7 SDLK_KP_7
#define SDLK_KP8 SDLK_KP_8
#define SDLK_KP9 SDLK_KP_9
---------------
SDL2 also changes how the scroll wheel is handled, instead of passing it as a button it's an axis, and they support horizontal/vertical scroll... so my scroll wheel is broken for changing items, but I found the keys for now.