Congrats on the release of 2.0!
Anyway… a few comments / issues.
One, let’s say we have this from our old code:
Code:
screen = SDL_SetVideoMode(width, height, bpp, flags);
it is suggested that the new way is to do:
Code:
screen = SDL_CreateWindow(“My Game Window”, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, flags);
This is not really the same, since in the old API call, we specified a bpp (bit depth), and the new way don’t have that option at all.
We don’t call SDL_ListModes() anymore. There’s an equivalent function in SDL2, but instead we’re going to use a new feature called
You should mention what SDL_ListModes() maps to, since people still need to know what are the available resolutions / bit depths the user has, so we can populate a menu with the correct choices. I don’t see a easy way to tell what bit depth is available now, besides checking the current.format from a call to SDL_GetCurrentDisplayMode(0, ¤t); but current.format is much more fine grain compared to just bit depth.
The good news: the 1.2 SDL_Surface API mostly still exists. So change your screen surface from this:
Code:
SDL_Surface *screen = SDL_SetVideoMode(640, 480, 32, 0);…to this…
Code:
// if all this hex scares you, check out SDL_PixelFormatEnumToMasks()!
SDL_Surface *screen = SDL_CreateSurface(0, 640, 480, 32,
0x00FF000,
0x0000FF00,
0x000000FF,
0xFF000000);
I assume you meant to type SDL_CreateRGBSurface(), the one you used is from SDL 1.2
On the input stuff, not sure about these, SDLK_RMETA, SDLK_RSUPER, SDLK_LMETA, SDLK_LSUPER… I assume the SDLK_R/LMETA maps to SDLK_R/LGUI but what does SDLK_RSUPER map to ?
And finally (well, not really, since I got more debugging to do on the conversion), you have:
Now there’s SDL_ShowSimpleMessageBox(). You’re welcome!
Yes!, finally! WooHoo!
Small problem, it isn’t listed anyplace, except the source.
http://wiki.libsdl.org/moin.fcg/CategoryAPI not found at all ?
Now, back to converting my app to make it work on SDL 2.0…