1
0
Fork 0

Use old style call to get window resolution on windows, fixes part of fullscreen being too large with no manifest and dpiscaling active. Can still go wrong though. dpiscaling is just bad news for dosbox overall. disabling it gives bad results as well for big screens..... Add opengl window centering for fullresolution=original..

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4147
This commit is contained in:
Peter Veenstra 2018-08-28 08:30:44 +00:00
parent 97ac94d222
commit 01e0a45694

View file

@ -704,7 +704,14 @@ dosurface:
sdl.opengl.framebuf=malloc(width*height*4); //32 bit color
}
sdl.opengl.pitch=width*4;
glViewport(sdl.clip.x,sdl.clip.y,sdl.clip.w,sdl.clip.h);
if(sdl.clip.x ==0 && sdl.clip.y ==0 && sdl.desktop.fullscreen && !sdl.desktop.full.fixed && (sdl.clip.w != sdl.surface->w || sdl.clip.h != sdl.surface->h)) {
// LOG_MSG("attempting to fix the centering to %d %d %d %d",(sdl.surface->w-sdl.clip.w)/2,(sdl.surface->h-sdl.clip.h)/2,sdl.clip.w,sdl.clip.h);
glViewport((sdl.surface->w-sdl.clip.w)/2,(sdl.surface->h-sdl.clip.h)/2,sdl.clip.w,sdl.clip.h);
} else {
glViewport(sdl.clip.x,sdl.clip.y,sdl.clip.w,sdl.clip.h);
}
glMatrixMode (GL_PROJECTION);
glDeleteTextures(1,&sdl.opengl.texture);
glGenTextures(1,&sdl.opengl.texture);
@ -1239,7 +1246,7 @@ static void GUI_StartUp(Section * sec) {
}
}
sdl.desktop.doublebuf=section->Get_bool("fulldouble");
#if SDL_VERSION_ATLEAST(1, 2, 10)
#if SDL_VERSION_ATLEAST(1, 2, 10) && !defined(WIN32)
if (!sdl.desktop.full.width || !sdl.desktop.full.height){
//Can only be done on the very first call! Not restartable.
const SDL_VideoInfo* vidinfo = SDL_GetVideoInfo();