Changeset d2f607c in opengl-game for game-gui-sdl.cpp


Ignore:
Timestamp:
Sep 12, 2019, 5:28:02 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
203ab1b
Parents:
7bf5433
Message:

Fix the logic for creating a fullscreen SDL window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game-gui-sdl.cpp

    r7bf5433 rd2f607c  
    5959   // otherwise you will not receive a High DPI OpenGL canvas.
    6060
    61    uint32_t flags = SDL_WINDOW_VULKAN;
     61   SDL_DisplayMode dm;
     62   SDL_GetCurrentDisplayMode(0, &dm);
    6263
    63    flags |= fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_RESIZABLE;
     64   if (fullscreen) {
     65      width = dm.w;
     66      height = dm.h;
     67   }
     68
     69   uint32_t flags = SDL_WINDOW_VULKAN | (fullscreen ? SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE);
    6470
    6571   window = SDL_CreateWindow(title.c_str(),
Note: See TracChangeset for help on using the changeset viewer.