/** ** Resize the video screen. ** ** @return True if the resolution changed, false otherwise */ bool CVideo::ResizeScreen(int w, int h) { if (VideoValidResolution(w, h)) { #if defined(USE_OPENGL) || defined(USE_GLES) if (UseOpenGL) { FreeOpenGLGraphics(); FreeOpenGLFonts(); UI.Minimap.FreeOpenGL(); } #endif TheScreen = SDL_SetVideoMode(w, h, TheScreen->format->BitsPerPixel, TheScreen->flags); #if defined(USE_OPENGL) || defined(USE_GLES) ViewportWidth = w; ViewportHeight = h; if (ZoomNoResize) { ReloadOpenGL(); } else { Width = w; Height = h; SetClipping(0, 0, Video.Width - 1, Video.Height - 1); if (UseOpenGL) { ReloadOpenGL(); } } #else Width = w; Height = h; SetClipping(0, 0, Video.Width - 1, Video.Height - 1); #endif return true; } return false; }
/** ** Resize the video screen. ** ** @return True if the resolution changed, false otherwise */ bool CVideo::ResizeScreen(int w, int h) { if (VideoValidResolution(w, h)) { Width = w; Height = h; TheScreen = SDL_SetVideoMode(w, h, TheScreen->format->BitsPerPixel, TheScreen->flags); SetClipping(0, 0, Video.Width - 1, Video.Height - 1); return true; } return false; }
/** ** Resize the video screen. ** ** @return True if the resolution changed, false otherwise */ bool CVideo::ResizeScreen(int w, int h) { if (VideoValidResolution(w, h)) { if (UseOpenGL) { FreeOpenGLGraphics(); FreeOpenGLFonts(); UI.Minimap.FreeOpenGL(); } Width = w; Height = h; TheScreen = SDL_SetVideoMode(w, h, TheScreen->format->BitsPerPixel, TheScreen->flags); SetClipping(0, 0, Video.Width - 1, Video.Height - 1); if (UseOpenGL) { ReloadOpenGL(); } return true; } return false; }