dhewm3 icon indicating copy to clipboard operation
dhewm3 copied to clipboard

Linux - 1366x768 doesn't seems to be allowed for full screen by SDL

Open BielBdeLuna opened this issue 3 years ago • 10 comments

I got my Ubuntu laptop set to 1366x768 but SDL seems unable recognize this resolution and forces Dhewm3 to revert to 640x480 windowed, I just got spoiled by RBDoom3BFG super-duper resolution independence, there seems to be a mode in engine for this resolution to go tough, but SDL still seems to refuse to allow for it. Is there a way for SDL to allow the resolution at r_mode 10? or even better: Can the super-duper resolution independence be implemented?

here is the warning message:

----- Initializing OpenGL -----
Initializing OpenGL subsystem
Will create a fullscreen-window with resolution 1366x768 (r_mode = 10)
SDL detected 1 displays: 
 0: 1360x768 at (0, 0) to (1360, 768)
Will use display 0 because mouse cursor is at (905, 43).
WARNING: Current display mode isn't requested display mode

WARNING: Likely SDL bug #4700, trying to work around it..

WARNING: Can't get display mode: Couldn't find display mode match

Initializing OpenGL subsystem
Will create a window with resolution 640x480 (r_mode = 3)
SDL detected 1 displays: 
 0: 1360x768 at (0, 0) to (1360, 768)
Will use display 0 because mouse cursor is at (905, 43).
Requested 8 color bits per chan, 8 alpha 24 depth, 8 stencil
Got 8 stencil bits, 24 depth bits, color bits: r8 g8 b8 a8

BielBdeLuna avatar Jun 17 '22 09:06 BielBdeLuna

RBDoom3BFG also uses SDL? It's weird that SDL doesn't detect the resolution correctly.

Which SDL version are you using? Which desktop? Wayland or X11? What GPU (+driver)? Can you post the output of xrandr? (And maybe the complete output of dhewm3, or just ~/.local/share/dhewm3/dhewm3log.txt)

DanielGibson avatar Jun 17 '22 18:06 DanielGibson

~~oh, it's true, RBDoom3BFG might be using GLEW for the windowing system, and SDL just for the input?~~ no, RBDoom3BFG might use indeed SDL2 as it's the first thing it imports in /OpenGL/RenderBackend_GL.cpp

the GPU is a Vega10 ( Zen+ soc ) of a laptop, the drivers are the ones coming with Ubuntu, the ones already in the Kernel, so no special drivers.

libSDL2 is version: 2.0.20+dfsg-2build1

I'm currently using Wayland:

Click here to expand/collapse xrandr.

$ xrandr
Screen 0: minimum 16 x 16, current 1366 x 768, maximum 32767 x 32767
XWAYLAND0 connected 1360x768+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
   1360x768      59.80*+
   1024x768      59.92  
   800x600       59.86  
   640x480       59.38  
   320x240       59.52  
   720x480       59.71  
   640x400       59.95  
   320x200       58.96  
   1280x720      59.86  
   1024x576      59.90  
   864x486       59.92  
   720x400       59.55  
   640x350       59.77  

BielBdeLuna avatar Jun 17 '22 22:06 BielBdeLuna

so xrandr reports the wrong resolution.

you could try to force dhewm3 (or more specifically SDL) to use wayland, like SDL_VIDEODRIVER=wayland ./dhewm3, maybe that works better

DanielGibson avatar Jun 18 '22 00:06 DanielGibson

Now it goes into 1366x768 fullscreen but look:

Captura de pantalla de 2022-06-18 10-54-49

this fullscreen seems to be displaced to where the Ubuntu menu and top bar meet, so it's not covering the whole screen, although it renders the Ubuntu menu invisible, the mouse when not captured by the 3d engine (so in the main menu) can still click outside the engine! It seems to be working more like it was windowed borderless and displaced from 0,0, like not trully fullscreen. r_fullscreen is 1

Click here to expand/collapse the full console log.

$ SDL_VIDEODRIVER=wayland ./dhewm3
dhewm3 1.5.2.1305 linux-x86_64 Jun 17 2022 10:49:53 using SDL v2.0.20
SDL video driver: wayland
Logging console output to /home/biel/.local/share/dhewm3/dhewm3log.txt
terminal support enabled ( use +set in_tty 0 to disable )
pid: 14532
5856 MB System Memory
found interface lo - loopback
found interface wlo1 - 192.168.18.4/255.255.255.0
doom using MMX & SSE & SSE2 for SIMD processing
enabling Flush-To-Zero mode
enabling Denormals-Are-Zero mode
WARNING: base path '/usr/local/share/dhewm3' does not exist
WARNING: using path of executable: /home/biel/games/doom/doom3
----- Initializing File System -----
Loaded pk4 /home/biel/games/doom/doom3/base/resources.pk4 with checksum 0x3b402278
Loaded pk4 /home/biel/games/doom/doom3/base/resources_models.pk4 with checksum 0x2e375aa5
Loaded pk4 /home/biel/games/doom/doom3/base/resources_patched.pk4 with checksum 0xf59fd26d
Loaded pk4 /home/biel/games/doom/doom3/base/resources_sound.pk4 with checksum 0x79c69026
Loaded pk4 /home/biel/games/doom/doom3/base/resources_textures.pk4 with checksum 0x5a301c82
Loaded pk4 /home/biel/games/doom/doom3/base/resources_textures_propietary.pk4 with checksum 0x23fcbbbc
Current search path:
/home/biel/.config/dhewm3/base
/home/biel/.local/share/dhewm3/base
/home/biel/games/doom/doom3/base
/home/biel/games/doom/doom3/base/resources_textures_propietary.pk4 (8977 files)
/home/biel/games/doom/doom3/base/resources_textures.pk4 (5323 files)
/home/biel/games/doom/doom3/base/resources_sound.pk4 (4684 files)
/home/biel/games/doom/doom3/base/resources_patched.pk4 (103 files)
/home/biel/games/doom/doom3/base/resources_models.pk4 (6120 files)
/home/biel/games/doom/doom3/base/resources.pk4 (2514 files)
Addon pk4s:
----- Initializing Decls -----
5206 strings read from strings/english.lang
Couldn't open journal files
execing editor.cfg
execing default.cfg
Unknown command '#'
execing dhewm.cfg
couldn't exec autoexec.cfg
5206 strings read from strings/english.lang
----- Initializing OpenAL -----
Setup OpenAL device and context
OpenAL: found device 'Fiio E10 Estèreo analògic'
OpenAL: found device 'Family 17h (Models 10h-1fh) HD Audio Controller Estèreo analògic'
OpenAL vendor: OpenAL Community
OpenAL renderer: OpenAL Soft
OpenAL version: 1.1 ALSOFT 1.19.1
OpenAL: found extensions for resetting disconnected devices
OpenAL: found EFX extension
OpenAL: found 256 hardware voices
----- Initializing OpenGL -----
Initializing OpenGL subsystem
Will create a fullscreen-window with resolution 1366x768 (r_mode = 10)
SDL detected 1 displays: 
 0: 1366x768 at (0, 0) to (1366, 768)
Will use display 0 because mouse cursor is at (0, 0).
Requested 8 color bits per chan, 8 alpha 24 depth, 8 stencil
Got 8 stencil bits, 24 depth bits, color bits: r8 g8 b8 a8
Detected keyboard layout as "english"
OpenGL vendor: AMD
OpenGL renderer: AMD Radeon Vega 10 Graphics (raven, LLVM 13.0.1, DRM 3.42, 5.15.0-39-generic)
OpenGL version: 4.6 (Compatibility Profile) Mesa 22.0.1
...using GL_ARB_multitexture
...using GL_ARB_texture_env_combine
...using GL_ARB_texture_cube_map
...using GL_ARB_texture_env_dot3
...using GL_ARB_texture_env_add
...using GL_ARB_texture_non_power_of_two
...using GL_ARB_texture_compression
...using GL_EXT_texture_compression_s3tc
...using GL_EXT_texture_filter_anisotropic
   maxTextureAnisotropy: 16.000000
...using GL_1.4_texture_lod_bias
X..GL_EXT_shared_texture_palette not found
...using GL_EXT_texture3D
...using GL_EXT_stencil_wrap
...using GL_EXT_stencil_two_side
... got GL2.0+ glStencilOpSeparate()
...using GL_ARB_vertex_buffer_object
...using GL_ARB_vertex_program
...using GL_ARB_fragment_program
...using EXT_depth_bounds_test
ARB2 renderer: Available.
----- R_ReloadARBPrograms -----
glprogs/test.vfp
glprogs/test.vfp
glprogs/interaction.vfp
glprogs/interaction.vfp
glprogs/bumpyEnvironment.vfp
glprogs/bumpyEnvironment.vfp
glprogs/ambientLight.vfp
glprogs/ambientLight.vfp
glprogs/shadow.vp
glprogs/environment.vfp
glprogs/environment.vfp
glprogs/arbVP_glasswarp.txt: File not found
glprogs/arbFP_glasswarp.txt: File not found
using ARB_vertex_buffer_object memory
using ARB2 renderSystem
Will apply r_gamma and r_brightness in shaders (r_gammaInShader 1)
loaded game library '/home/biel/games/doom/doom3/base.so'.
game using MMX & SSE & SSE2 for SIMD processing
Flush-To-Zero mode is already enabled
Denormals-Are-Zero mode is already enabled
----- Initializing Game -----
gamename: baseDOOM-1
gamedate: Jun 17 2022
Initializing event system
...473 event definitions
Initializing class hierarchy
...142 classes, 764368 bytes for event callbacks
Initializing scripts
Compiled 'script/doom_main.script': 444 ms
----- Compile stats -----
Memory usage:
     Strings: 79, 10288 bytes
  Statements: 67875, 2172000 bytes
   Functions: 2109, 318020 bytes
   Variables: 170888 bytes
    Mem used: 3937768 bytes
 Static data: 3558984 bytes
   Allocated: 5109956 bytes
 Thread size: 14056 bytes
...6 aas types
----- Initializing Session -----
----- Warnings -----
during dhewm 3 initialization...
WARNING: base path '/usr/local/share/dhewm3' does not exist
WARNING: using path of executable: /home/biel/games/doom/doom3
2 warnings
in_grabKeyboard: Will *not* grab the keyboard if mouse is grabbed, so global keyboard-shortcuts (like Alt-Tab) will still work
----- Game Map Shutdown -----
Shutting down sound hardware
idRenderSystem::Shutdown()
Shutting down OpenGL subsystem
----- Game Shutdown -----
----- Game Map Shutdown -----
Shutdown event system
shutdown terminal support

BielBdeLuna avatar Jun 18 '22 09:06 BielBdeLuna

You could try changing r_fullscreenDesktop

It might also be worth trying SDL 2.0.22 or even their latest git code.

DanielGibson avatar Jun 18 '22 16:06 DanielGibson

the problem with both SDL_VIDEODRIVER=wayland ./dhewm3 and r_fullscreenDesktop is that the whole rendered screen is moved aside the Ubuntu menus and bars, and since the resolution to display within engine isn't diminished, so most of the buttons in the lower rows in the main menu keep getting obstructed outside the screen.

BielBdeLuna avatar Jun 18 '22 18:06 BielBdeLuna

So this happens with both r_fullscreenDesktop 0 and 1? Have you tried newer SDL versions?

DanielGibson avatar Jun 18 '22 19:06 DanielGibson

r_fullScreenDesktop end up always looking like the picture I posted: I set r_mode 3 so the resolution is set different than the one in my monitor (that is r_mode 10) then I set r_fullscreen 1 and then I set r_fullscreenDesktop 1 so the resolution goes back to desktop resolution independent of the selected mode then vid_restart and it ends up looking like the picture I posted

one thing that I've seen: When I start the engine with SDL_VIDEODRIVER=wayland ./dhewm3 the first thing than appears (the initializing image, with the Planet and the Id logo) appears correctly fullscreen, then when the Roq intro starts the fullscreen gets displaced to underneath and beside the Ubuntu bars like the picture I posted, but the first initializing screen works correctly!

BielBdeLuna avatar Jun 19 '22 09:06 BielBdeLuna

somewhat solved:

compiled SDL2 form their last git, and somewhat solved the whole issue:

Entering directly with $ ./dhewm3: if I have r_mode 10 ( my desktop resolution ):

  • i get the old error and I get out of fullscreen and back to r_mode 3 it's only when I have r_fullscreenDesktop 1 and r_fullscreen 1 that the game plays completely and not displaced like the picture I posted above

when I enter: $ ./dhewm3 +set r_mode 10 +set r_fullscreen 1 +set r_fullscreendesktop 1

Click here to expand/collapse the full console log.

$ ./dhewm3 +set r_mode 10 +set r_fullscreen 1 +set r_fullscreendesktop 1
dhewm3 1.5.2.1305 linux-x86_64 Jun 19 2022 11:44:21 using SDL v2.0.20
SDL video driver: x11
Logging console output to /home/biel/.local/share/dhewm3/dhewm3log.txt
terminal support enabled ( use +set in_tty 0 to disable )
pid: 77737
5856 MB System Memory
found interface lo - loopback
found interface wlo1 - 192.168.18.4/255.255.255.0
doom using MMX & SSE & SSE2 for SIMD processing
enabling Flush-To-Zero mode
enabling Denormals-Are-Zero mode
WARNING: base path '/usr/local/share/dhewm3' does not exist
WARNING: using path of executable: /home/biel/games/doom/doom3
----- Initializing File System -----
Loaded pk4 /home/biel/games/doom/doom3/base/resources.pk4 with checksum 0x3b402278
Loaded pk4 /home/biel/games/doom/doom3/base/resources_models.pk4 with checksum 0x2e375aa5
Loaded pk4 /home/biel/games/doom/doom3/base/resources_patched.pk4 with checksum 0xf59fd26d
Loaded pk4 /home/biel/games/doom/doom3/base/resources_sound.pk4 with checksum 0x79c69026
Loaded pk4 /home/biel/games/doom/doom3/base/resources_textures.pk4 with checksum 0x5a301c82
Loaded pk4 /home/biel/games/doom/doom3/base/resources_textures_propietary.pk4 with checksum 0x23fcbbbc
Current search path:
/home/biel/.config/dhewm3/base
/home/biel/.local/share/dhewm3/base
/home/biel/games/doom/doom3/base
/home/biel/games/doom/doom3/base/resources_textures_propietary.pk4 (8977 files)
/home/biel/games/doom/doom3/base/resources_textures.pk4 (5323 files)
/home/biel/games/doom/doom3/base/resources_sound.pk4 (4684 files)
/home/biel/games/doom/doom3/base/resources_patched.pk4 (103 files)
/home/biel/games/doom/doom3/base/resources_models.pk4 (6120 files)
/home/biel/games/doom/doom3/base/resources.pk4 (2514 files)
Addon pk4s:
----- Initializing Decls -----
5206 strings read from strings/english.lang
Couldn't open journal files
execing editor.cfg
execing default.cfg
Unknown command '#'
execing dhewm.cfg
couldn't exec autoexec.cfg
5206 strings read from strings/english.lang
----- Initializing OpenAL -----
Setup OpenAL device and context
OpenAL: found device 'Fiio E10 Estèreo analògic'
OpenAL: found device 'Family 17h (Models 10h-1fh) HD Audio Controller Estèreo analògic'
OpenAL vendor: OpenAL Community
OpenAL renderer: OpenAL Soft
OpenAL version: 1.1 ALSOFT 1.19.1
OpenAL: found extensions for resetting disconnected devices
OpenAL: found EFX extension
OpenAL: found 256 hardware voices
----- Initializing OpenGL -----
Initializing OpenGL subsystem
Will create a desktop-fullscreen-window with resolution 1366x768 (r_mode = 10)
SDL detected 1 displays: 
 0: 1360x768 at (0, 0) to (1360, 768)
Will use display 0 because mouse cursor is at (377, 417).
Requested 8 color bits per chan, 8 alpha 24 depth, 8 stencil
Got 8 stencil bits, 24 depth bits, color bits: r8 g8 b8 a8
Detected keyboard layout as "spanish"
OpenGL vendor: AMD
OpenGL renderer: AMD Radeon Vega 10 Graphics (raven, LLVM 13.0.1, DRM 3.42, 5.15.0-39-generic)
OpenGL version: 4.6 (Compatibility Profile) Mesa 22.0.1
...using GL_ARB_multitexture
...using GL_ARB_texture_env_combine
...using GL_ARB_texture_cube_map
...using GL_ARB_texture_env_dot3
...using GL_ARB_texture_env_add
...using GL_ARB_texture_non_power_of_two
...using GL_ARB_texture_compression
...using GL_EXT_texture_compression_s3tc
...using GL_EXT_texture_filter_anisotropic
   maxTextureAnisotropy: 16.000000
...using GL_1.4_texture_lod_bias
X..GL_EXT_shared_texture_palette not found
...using GL_EXT_texture3D
...using GL_EXT_stencil_wrap
...using GL_EXT_stencil_two_side
... got GL2.0+ glStencilOpSeparate()
...using GL_ARB_vertex_buffer_object
...using GL_ARB_vertex_program
...using GL_ARB_fragment_program
...using EXT_depth_bounds_test
ARB2 renderer: Available.
----- R_ReloadARBPrograms -----
glprogs/test.vfp
glprogs/test.vfp
glprogs/interaction.vfp
glprogs/interaction.vfp
glprogs/bumpyEnvironment.vfp
glprogs/bumpyEnvironment.vfp
glprogs/ambientLight.vfp
glprogs/ambientLight.vfp
glprogs/shadow.vp
glprogs/environment.vfp
glprogs/environment.vfp
glprogs/arbVP_glasswarp.txt: File not found
glprogs/arbFP_glasswarp.txt: File not found
using ARB_vertex_buffer_object memory
using ARB2 renderSystem
Will apply r_gamma and r_brightness in shaders (r_gammaInShader 1)
loaded game library '/home/biel/games/doom/doom3/base.so'.
game using MMX & SSE & SSE2 for SIMD processing
Flush-To-Zero mode is already enabled
Denormals-Are-Zero mode is already enabled
----- Initializing Game -----
gamename: baseDOOM-1
gamedate: Jun 19 2022
Initializing event system
...473 event definitions
Initializing class hierarchy
...142 classes, 764368 bytes for event callbacks
Initializing scripts
Compiled 'script/doom_main.script': 697 ms
----- Compile stats -----
Memory usage:
     Strings: 79, 10288 bytes
  Statements: 67875, 2172000 bytes
   Functions: 2109, 318020 bytes
   Variables: 170888 bytes
    Mem used: 3937768 bytes
 Static data: 3558984 bytes
   Allocated: 5109956 bytes
 Thread size: 14056 bytes
...6 aas types
----- Initializing Session -----
----- Warnings -----
during dhewm 3 initialization...
WARNING: base path '/usr/local/share/dhewm3' does not exist
WARNING: using path of executable: /home/biel/games/doom/doom3
2 warnings
in_grabKeyboard: Will *not* grab the keyboard if mouse is grabbed, so global keyboard-shortcuts (like Alt-Tab) will still work

If I enter with SDL_VIDEODRIVER=wayland ./dhewm3 then I get back all the displacement of the screen of the game, like the picture above

BielBdeLuna avatar Jun 19 '22 10:06 BielBdeLuna

there is currently a new release of SDL2, specifically it has fixes that address "fullscreen issues". It seems from the above that you are still using 2.0.20

paulwratt avatar Jun 25 '22 07:06 paulwratt