-//! \return Pointer to a list with all video modes supported\r
-video::IVideoModeList* CIrrDeviceSDL::getVideoModeList()\r
-{\r
-#ifdef _IRR_EMSCRIPTEN_PLATFORM_\r
- os::Printer::log("VideoModeList not available on the web." , ELL_WARNING);\r
- return VideoModeList;\r
-#else // !_IRR_EMSCRIPTEN_PLATFORM_\r
- if (!VideoModeList->getVideoModeCount())\r
- {\r
- // enumerate video modes.\r
- const SDL_VideoInfo *vi = SDL_GetVideoInfo();\r
-\r
- SDL_PixelFormat pixelFormat = *(vi->vfmt);\r
-\r
- core::array<Uint8> checkBitsPerPixel;\r
- checkBitsPerPixel.push_back(8);\r
- checkBitsPerPixel.push_back(16);\r
- checkBitsPerPixel.push_back(24);\r
- checkBitsPerPixel.push_back(32);\r
- if ( pixelFormat.BitsPerPixel > 32 )\r
- checkBitsPerPixel.push_back(pixelFormat.BitsPerPixel);\r
-\r
- for ( u32 i=0; i<checkBitsPerPixel.size(); ++i)\r
- {\r
- pixelFormat.BitsPerPixel = checkBitsPerPixel[i];\r
- SDL_Rect **modes = SDL_ListModes(&pixelFormat, SDL_Flags|SDL_FULLSCREEN);\r
- if (modes != 0)\r
- {\r
- if (modes == (SDL_Rect **)-1)\r
- {\r
- core::stringc strLog("All modes available for bit-depth ");\r
- strLog += core::stringc(pixelFormat.BitsPerPixel);\r
- os::Printer::log(strLog.c_str());\r
- }\r
- else\r
- {\r
- for (u32 i=0; modes[i]; ++i)\r
- VideoModeList->addMode(core::dimension2d<u32>(modes[i]->w, modes[i]->h), vi->vfmt->BitsPerPixel);\r
- }\r
- }\r
- }\r
- }\r
-\r
- return VideoModeList;\r
-#endif // !_IRR_EMSCRIPTEN_PLATFORM_\r
-}\r
-\r