mirror of
https://github.com/glest/glest-source.git
synced 2025-08-17 21:51:17 +02:00
- trying to fix issue #71 alt-enter toggle
This commit is contained in:
@@ -617,16 +617,8 @@ void Window::toggleFullscreen() {
|
||||
|
||||
Window::isFullScreen = !Window::isFullScreen;
|
||||
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
||||
//SDL_Surface *cur_surface = SDL_GetVideoSurface();
|
||||
if(sdlWindow != NULL) {
|
||||
if(isFullScreen){
|
||||
SDL_SetWindowFullscreen(sdlWindow,SDL_WINDOW_FULLSCREEN);
|
||||
}
|
||||
else {
|
||||
SDL_SetWindowFullscreen(sdlWindow,0);
|
||||
}
|
||||
}
|
||||
if(global_window) {
|
||||
global_window->eventToggleFullScreen(Window::isFullScreen);
|
||||
}
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
@@ -96,6 +96,38 @@ void WindowGl::swapBuffersGl(){
|
||||
context.swapBuffers();
|
||||
}
|
||||
|
||||
void WindowGl::eventToggleFullScreen(bool isFullscreen) {
|
||||
Window::eventToggleFullScreen(isFullscreen);
|
||||
|
||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
||||
//SDL_Surface *cur_surface = SDL_GetVideoSurface();
|
||||
if(getScreenWindow() != NULL) {
|
||||
if(getIsFullScreen()){
|
||||
SDL_SetWindowFullscreen(getScreenWindow(),SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
}
|
||||
else {
|
||||
SDL_SetWindowFullscreen(getScreenWindow(),0);
|
||||
}
|
||||
}
|
||||
|
||||
if(isFullscreen) {
|
||||
changeVideoModeFullScreen(isFullscreen);
|
||||
ChangeVideoMode(true, getScreenWidth(), getScreenHeight(),
|
||||
true,context.getColorBits(), context.getDepthBits(), context.getStencilBits(),
|
||||
context.getHardware_acceleration(),context.getFullscreen_anti_aliasing(),
|
||||
context.getGammaValue());
|
||||
|
||||
}
|
||||
else {
|
||||
changeVideoModeFullScreen(false);
|
||||
ChangeVideoMode(true, getDesiredScreenWidth(), getDesiredScreenHeight(),
|
||||
false,context.getColorBits(), context.getDepthBits(), context.getStencilBits(),
|
||||
context.getHardware_acceleration(),context.getFullscreen_anti_aliasing(),
|
||||
context.getGammaValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// changes display resolution at any time
|
||||
bool WindowGl::ChangeVideoMode(bool preserveContext, int resWidth, int resHeight,
|
||||
bool fullscreenWindow,
|
||||
|
Reference in New Issue
Block a user