Merge pull request #187 from alexey-lysiuk/sdl2_add

[SDL2] Minor fixes and cleanup
This commit is contained in:
Braden Obrzut 2014-12-13 12:09:00 -05:00
commit 0cf8c1baea
2 changed files with 10 additions and 70 deletions

View file

@ -1725,72 +1725,6 @@ int SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode *mode)
return 0;
}
SDL_Rect** SDL_ListModes(SDL_PixelFormat* format, Uint32 flags)
{
ZD_UNUSED(format);
ZD_UNUSED(flags);
static std::vector<SDL_Rect*> resolutions;
if (resolutions.empty())
{
#define DEFINE_RESOLUTION(WIDTH, HEIGHT) \
static SDL_Rect resolution_##WIDTH##_##HEIGHT = { 0, 0, WIDTH, HEIGHT }; \
resolutions.push_back(&resolution_##WIDTH##_##HEIGHT);
DEFINE_RESOLUTION( 640, 480);
DEFINE_RESOLUTION( 720, 480);
DEFINE_RESOLUTION( 800, 480);
DEFINE_RESOLUTION( 800, 600);
DEFINE_RESOLUTION(1024, 600);
DEFINE_RESOLUTION(1024, 640);
DEFINE_RESOLUTION(1024, 768);
DEFINE_RESOLUTION(1152, 720);
DEFINE_RESOLUTION(1152, 864);
DEFINE_RESOLUTION(1280, 720);
DEFINE_RESOLUTION(1280, 768);
DEFINE_RESOLUTION(1280, 800);
DEFINE_RESOLUTION(1280, 854);
DEFINE_RESOLUTION(1280, 960);
DEFINE_RESOLUTION(1280, 1024);
DEFINE_RESOLUTION(1366, 768);
DEFINE_RESOLUTION(1400, 1050);
DEFINE_RESOLUTION(1440, 900);
DEFINE_RESOLUTION(1440, 960);
DEFINE_RESOLUTION(1440, 1080);
DEFINE_RESOLUTION(1600, 900);
DEFINE_RESOLUTION(1600, 1200);
DEFINE_RESOLUTION(1680, 1050);
DEFINE_RESOLUTION(1920, 1080);
DEFINE_RESOLUTION(1920, 1200);
DEFINE_RESOLUTION(2048, 1080);
DEFINE_RESOLUTION(2048, 1536);
DEFINE_RESOLUTION(2560, 1080);
DEFINE_RESOLUTION(2560, 1440);
DEFINE_RESOLUTION(2560, 1600);
DEFINE_RESOLUTION(2560, 2048);
DEFINE_RESOLUTION(2880, 1800);
DEFINE_RESOLUTION(3200, 1800);
DEFINE_RESOLUTION(3440, 1440);
DEFINE_RESOLUTION(3840, 2160);
DEFINE_RESOLUTION(3840, 2400);
DEFINE_RESOLUTION(4096, 2160);
DEFINE_RESOLUTION(5120, 2880);
#undef DEFINE_RESOLUTION
resolutions.push_back(NULL);
}
return &resolutions[0];
}
int SDL_ShowCursor(int)
{
// Does nothing
return 0;
}
static SDL_PixelFormat* GetPixelFormat()
{
@ -2205,10 +2139,6 @@ DarwinVersion GetDarwinVersion()
const DarwinVersion darwinVersion = GetDarwinVersion();
#ifdef main
#undef main
#endif // main
int main(int argc, char** argv)
{
gettimeofday(&s_startTicks, NULL);

View file

@ -148,6 +148,7 @@ static MiniModeInfo WinModes[] =
{ 720, 480 }, // 16:10
{ 720, 540 },
{ 800, 450 }, // 16:9
{ 800, 480 },
{ 800, 500 }, // 16:10
{ 800, 600 },
{ 848, 480 }, // 16:9
@ -162,13 +163,18 @@ static MiniModeInfo WinModes[] =
{ 1152, 720 }, // 16:10
{ 1152, 864 },
{ 1280, 720 }, // 16:9
{ 1280, 854 },
{ 1280, 800 }, // 16:10
{ 1280, 960 },
{ 1280, 1024 }, // 5:4
{ 1360, 768 }, // 16:9
{ 1366, 768 },
{ 1400, 787 }, // 16:9
{ 1400, 875 }, // 16:10
{ 1400, 1050 },
{ 1440, 900 },
{ 1440, 960 },
{ 1440, 1080 },
{ 1600, 900 }, // 16:9
{ 1600, 1000 }, // 16:10
{ 1600, 1200 },
@ -177,8 +183,12 @@ static MiniModeInfo WinModes[] =
{ 2048, 1536 },
{ 2560, 1440 },
{ 2560, 1600 },
{ 2560, 2048 },
{ 2880, 1800 },
{ 3200, 1800 },
{ 3840, 2160 },
{ 3840, 2400 },
{ 4096, 2160 },
{ 5120, 2880 }
};