- trying to fix issue #71 alt-enter toggle

This commit is contained in:
SoftCoder
2015-10-28 16:07:15 -07:00
parent 8499d25bde
commit d5edf6f973
6 changed files with 70 additions and 10 deletions

View File

@@ -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__);

View File

@@ -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,