You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Everything works, no problems, on any display. Now if I want to change the resolution of such an exclusive full screen mode, I define a new target display mode and set it, like this:
And here is the problem. Although the new target display mode is applied, for some modes the screen remains black. The resolution is consistent with the mode, the window size as well (I checked by getting the client window size — no inconsistencies), but the screen remains black and the system cursor is not visible. In order for the window to actually appear on the screen, I have to deactivate it (Alt+Tab or by clicking on another screen), then it will minimize, and then restore it from the taskbar.
Interestingly, this issue only occurs for certain modes (almost half of those supported by my monitor), but I haven't found any data to tell me if there's any consistency to this — it just seems a bit random at the moment. The only temporary hack I've found that fixes this issue is to disable and re-enable fullscreen just before applying the new target display mode:
The screen flashes a little longer, but at least it finally shows a window on it.
Edit: such a black screen only occurs with some drivers — if I don't specify any (I give null as the driver name) or I use the gpu driver name, the black screen occurs. In case of opengl, direct3d11 and direct3d12 everything works perfectly fine.
The text was updated successfully, but these errors were encountered:
Why does this sound like you're applying how you'd set up an SDL2 video driver on SDL3?
SDL_GetRenderDriverInfo() has been removed, since most of the information it reported were estimates and could not be accurate before creating a renderer. Often times this function was used to figure out the index of a driver, so one would call it in a for-loop, looking for the driver named "opengl" or whatnot. SDL_GetRenderDriver() has been added for this functionality, which returns only the name of the driver.
SDL_CreateRenderer()'s second argument is no longer an integer index, but a const char * representing a renderer's name; if you were just using a for-loop to find which index is the "opengl" or whatnot driver, you can just pass that string directly here, now. Passing NULL is the same as passing -1 here in SDL2, to signify you want SDL to decide for you.
Because I'm using the basic SDL3 renderer, which is nothing wrong and nothing special. I don't do anything that isn't officially supported by SDL3. I got the names of all drivers supported by my machine using the SDL_GetRenderDriver function (based on the SDL_GetNumRenderDrivers result to know how many there are) and I have the following at my disposal:
I checked how fullscreen support looks like and encountered problems with changing the resolution when the renderer is created without specifying the name of a driver (i.e. when SDL is to select it automatically) or if I specify the driver name as gpu.
Edit: if I do not specify the driver name myself, SDL automatically selects the gpu driver for me.
Windows 10 (64-bit)
SDL 3.1.6 (64-bit)
To display a window in exclusive full screen, I get the target mode data and start full screen mode like this:
Everything works, no problems, on any display. Now if I want to change the resolution of such an exclusive full screen mode, I define a new target display mode and set it, like this:
And here is the problem. Although the new target display mode is applied, for some modes the screen remains black. The resolution is consistent with the mode, the window size as well (I checked by getting the client window size — no inconsistencies), but the screen remains black and the system cursor is not visible. In order for the window to actually appear on the screen, I have to deactivate it (
Alt+Tab
or by clicking on another screen), then it will minimize, and then restore it from the taskbar.Interestingly, this issue only occurs for certain modes (almost half of those supported by my monitor), but I haven't found any data to tell me if there's any consistency to this — it just seems a bit random at the moment. The only temporary hack I've found that fixes this issue is to disable and re-enable fullscreen just before applying the new target display mode:
The screen flashes a little longer, but at least it finally shows a window on it.
Edit: such a black screen only occurs with some drivers — if I don't specify any (I give
null
as the driver name) or I use thegpu
driver name, the black screen occurs. In case ofopengl
,direct3d11
anddirect3d12
everything works perfectly fine.The text was updated successfully, but these errors were encountered: