Changeset 301c90a in opengl-game for game-gui-sdl.cpp


Ignore:
Timestamp:
Mar 13, 2021, 10:37:06 PM (3 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
d255d52
Parents:
187b0f5
Message:

Implement the start of a generic UI system built on top of IMGUI, which can reposition elements when the screen is resized, and use it in VulkanGame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • game-gui-sdl.cpp

    r187b0f5 r301c90a  
    154154}
    155155
     156// TODO: Check that this is only used where the drawable size is needed
     157// Maybe create a separate refreshWindowSize funcion as well.
    156158void GameGui_SDL::refreshWindowSize() {
    157    // TODO: Make sure this works on a mac (the analogous glfw function had issues on Mac retina displays)
    158    SDL_GetWindowSize(window, &windowWidth, &windowHeight);
     159   // TODO: Make sure this works on a Mac (the analogous glfw function had issues on Mac retina displays)
     160
     161#ifdef GAMEGUI_INCLUDE_VULKAN
     162   SDL_Vulkan_GetDrawableSize(window, &windowWidth, &windowHeight);
     163#else
     164   SDL_GL_GetDrawableSize(window, &windowWidth, &windowHeight);
     165#endif
    159166
    160167   if (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED) {
Note: See TracChangeset for help on using the changeset viewer.