Mercurial > fife-parpg
comparison engine/core/video/sdl/renderbackendsdl.cpp @ 653:01acc9fc35ea
* Moved getCurrentScreenMode() to the renderbackend as renderbackend is what initializes the screen.
* Updated the Color masks to follow the integer standards
* Added some new SDL modes (HW Surface and double buffer) to check for in DeviceCaps.
* RenderBackend now saves the actual flags used to initialize the screen.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 15 Oct 2010 18:54:34 +0000 |
parents | 6e2151325017 |
children | 5d6b1820b953 |
comparison
equal
deleted
inserted
replaced
652:da9c4cfe8f8e | 653:01acc9fc35ea |
---|---|
78 SDL_SetClipRect(m_screen->getSurface(), &rect); | 78 SDL_SetClipRect(m_screen->getSurface(), &rect); |
79 SDL_FillRect(m_screen->getSurface(), 0, 0x00); | 79 SDL_FillRect(m_screen->getSurface(), 0, 0x00); |
80 } | 80 } |
81 | 81 |
82 Image* RenderBackendSDL::createMainScreen(const ScreenMode& mode, const std::string& title, const std::string& icon){ | 82 Image* RenderBackendSDL::createMainScreen(const ScreenMode& mode, const std::string& title, const std::string& icon){ |
83 m_screenMode = mode; | |
83 unsigned int width = mode.getWidth(); | 84 unsigned int width = mode.getWidth(); |
84 unsigned int height = mode.getHeight(); | 85 unsigned int height = mode.getHeight(); |
85 unsigned char bitsPerPixel = mode.getBPP(); | 86 unsigned char bitsPerPixel = mode.getBPP(); |
86 bool fs = mode.isFullScreen(); | 87 bool fs = mode.isFullScreen(); |
87 Uint32 flags = mode.getSDLFlags(); | 88 Uint32 flags = mode.getSDLFlags(); |
126 screen = SDL_SetVideoMode(width, height, bitsPerPixel, flags); | 127 screen = SDL_SetVideoMode(width, height, bitsPerPixel, flags); |
127 } | 128 } |
128 FL_LOG(_log, LMsg("RenderBackendSDL") | 129 FL_LOG(_log, LMsg("RenderBackendSDL") |
129 << "Videomode " << width << "x" << height | 130 << "Videomode " << width << "x" << height |
130 << " at " << int(screen->format->BitsPerPixel) << " bpp"); | 131 << " at " << int(screen->format->BitsPerPixel) << " bpp"); |
132 | |
133 //update the screen mode with the actual flags used | |
134 | |
135 m_screenMode = ScreenMode(m_screenMode.getWidth(), | |
136 m_screenMode.getHeight(), | |
137 m_screenMode.getBPP(), | |
138 screen->flags); | |
131 | 139 |
132 SDL_WM_SetCaption(title.c_str(), NULL); | 140 SDL_WM_SetCaption(title.c_str(), NULL); |
133 | 141 |
134 if (!screen) { | 142 if (!screen) { |
135 throw SDLException(SDL_GetError()); | 143 throw SDLException(SDL_GetError()); |