Changeset d2f607c in opengl-game


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

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r7bf5433 rd2f607c  
    1 newgame
     1openglref
    22vulkanref
    33openglgame
  • 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(),
  • makefile

    r7bf5433 rd2f607c  
    2222# as this well prevent regenerating .o files for unchanged .cpp files
    2323
    24 newgame: new-game.cpp logger.cpp utils.cpp crash-logger.cpp imgui_impl_glfw_gl3.cpp $(IMGUI_FILES)
     24openglref: new-game.cpp logger.cpp utils.cpp crash-logger.cpp imgui_impl_glfw_gl3.cpp $(IMGUI_FILES)
    2525        $(CC) $^ $(DEP) $(CFLAGS) -o $@
    2626
     
    6767
    6868clean:
    69         rm -f newgame
     69        rm -f openglref
    7070        rm -f vulkanref
    7171        rm -f openglgame
Note: See TracChangeset for help on using the changeset viewer.