Archive 17/01/2023.

A question about change resolution in fullscreen mode

spwork

when i use Graphise::SetMode(x,y) change resolution in fullscreen mode ,and my window flashse and Minimized,i must click on the state bar to restore the window,how to solve this situation?

I am use Win7 ,visual studio ,the lib build with DIRECT3D11。

SirNate0

If you call Graphics::Raise() after Graphics::SetMode(x,y) does it solve the problem?

spwork

it didn’t work, the window still minimized.

spwork

using OPENGL is ok,but using d3d9 or d3d11 the window will minimized.

mrchrissross

having same problem here, was this problem solved?

Modanung

This might be related.

As might this:

mrchrissross

The GetSubsystem<Graphics>()->SetMode(screenRes.x_, screenRes.y_); seems to work when i used it directly before GetSubsystem<Graphics>()->ToggleFullscreen(); however to to toggle full screen off i use GetSubsystem<Graphics>()->SetMode(screenRes.x_ / 2, screenRes.y_ / 2); but this seems to minimize the screen.

here is the code in total:

if (input->GetKeyPress(KEY_P))
{ 
    if (GetSubsystem<Graphics>()->GetFullscreen() == true)
        GetSubsystem<Graphics>()->SetMode(screenRes.x_ / 2, screenRes.y_ / 2);
    else
        GetSubsystem<Graphics>()->SetMode(screenRes.x_, screenRes.y_);

    GetSubsystem<Graphics>()->ToggleFullscreen();
}
Modanung

The behavior seems to be related to the SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS environment variable.