by VoidMage » Wed Jan 28, 2015 2:22 am
OK, good catch - I didn't know about vid_renderer (thought the whole software mode was removed).
Anyway, software mode isn't affected.
So, which part of GL code does the stretching ?
...
Thanks to some helpful people on #SDL I've made some progress.
glViewport in SDL1 worked under assumption that for a fullscreen window size (GetWidth(), GetHeight(), GetTrueHeight) == resolution.
With SDL_WINDOW_FULLSCREEN_DESKTOP, that's by no means true, though I'm not quite sure yet how to properly query for SDL_GetDesktopDisplayMode in relevant files; also, best I get now is partial screen due to borders getting cleared to window size.
...
This is how far I got in the meanwhile. The patch is *obviously* incorrect, but there is some significant progress.
- initial screen is still broken, but the top left corner seems to be in its proper place and the texture, while clipped, seems right size
- load/save screens are almost completely messed up
- in-game, there's no sky/hud and it *might* not be stretched to the correct ratio, but the scene takes most of the screen; the menu is still clipped
- the changes were done mostly blind, so some might be redundant; couldn't figure the difference between GetHeight and GetTrueHeight, but it seemed to be no difference between them in linux code (also, there might not be any while fullscreen);
- the change in gl/system/gl_framebuffer.cpp is completely bogus, as it seems that either screen can't be queried at that point or is yet uninitialized,
so IsFullscreen() didn't seem to work (I need to recheck that...OK, retested, seems IsFullscreen() is OK there after all; not updating the patch yet though)
- Attachments
-
gzdoom-sdl2-desktop-fullscreen.patch.gz
- preliminary patch
- (1.16 KiB) Downloaded 40 times
OK, good catch - I didn't know about vid_renderer (thought the whole software mode was removed).
Anyway, software mode isn't affected.
So, which part of GL code does the stretching ?
...
Thanks to some helpful people on #SDL I've made some progress.
glViewport in SDL1 worked under assumption that for a fullscreen window size (GetWidth(), GetHeight(), GetTrueHeight) == resolution.
With SDL_WINDOW_FULLSCREEN_DESKTOP, that's by no means true, though I'm not quite sure yet how to properly query for SDL_GetDesktopDisplayMode in relevant files; also, best I get now is partial screen due to borders getting cleared to window size.
...
This is how far I got in the meanwhile. The patch is *obviously* incorrect, but there is some significant progress.
- initial screen is still broken, but the top left corner seems to be in its proper place and the texture, while clipped, seems right size
- load/save screens are almost completely messed up
- in-game, there's no sky/hud and it *might* not be stretched to the correct ratio, but the scene takes most of the screen; the menu is still clipped
- the changes were done mostly blind, so some might be redundant; couldn't figure the difference between GetHeight and GetTrueHeight, but it seemed to be no difference between them in linux code (also, there might not be any while fullscreen);
- the change in gl/system/gl_framebuffer.cpp is completely bogus, as it seems that either screen can't be queried at that point or is yet uninitialized,
so IsFullscreen() didn't seem to work (I need to recheck that...OK, retested, seems IsFullscreen() is OK there after all; not updating the patch yet though)