Changeset 8667f76 in opengl-game for vulkan-game.cpp


Ignore:
Timestamp:
Jul 19, 2019, 9:49:52 PM (6 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
80edd70
Parents:
0e6ecf3
git-author:
Dmitry Portnoy <dmitry.portnoy@…> (07/19/19 21:45:27)
git-committer:
Dmitry Portnoy <dmitry.portnoy@…> (07/19/19 21:49:52)
Message:

Move getWindowSize and getRequiredExtensions to the game gui

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.cpp

    r0e6ecf3 r8667f76  
    1414#include <optional>
    1515#include <set>
    16 #include <vector>
    1716
    1817using namespace std;
     
    125124      bool framebufferResized = false;
    126125
    127       // both SDL and GLFW create window functions return NULL on failure
    128126      bool initWindow() {
    129127         if (gui->Init() == RTWO_ERROR) {
     
    160158      void recreateSwapChain() {
    161159         int width = 0, height = 0;
    162          SDL_GetWindowSize(window, &width, &height);
     160         gui->GetWindowSize(&width, &height);
    163161
    164162         while (width == 0 || height == 0 ||
    165163            (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED) != 0) {
    166164            SDL_WaitEvent(nullptr);
    167             SDL_GetWindowSize(window, &width, &height);
     165            gui->GetWindowSize(&width, &height);
    168166         }
    169167
     
    219217         createInfo.ppEnabledExtensionNames = extensions.data();
    220218
    221          cout << endl << "SDL extensions:" << endl;
     219         cout << endl << "Extensions:" << endl;
    222220         for (const char* extensionName : extensions) {
    223221            cout << extensionName << endl;
     
    488486         } else {
    489487            int width, height;
    490             SDL_GetWindowSize(window, &width, &height);
     488            gui->GetWindowSize(&width, &height);
    491489
    492490            VkExtent2D actualExtent = {
     
    511509
    512510      vector<const char*> getRequiredExtensions() {
    513          uint32_t extensionCount = 0;
    514          SDL_Vulkan_GetInstanceExtensions(window, &extensionCount, nullptr);
    515 
    516          vector<const char*> extensions(extensionCount);
    517          SDL_Vulkan_GetInstanceExtensions(window, &extensionCount, extensions.data());
     511         vector<const char*> extensions = gui->GetRequiredExtensions();
    518512
    519513         if (enableValidationLayers) {
Note: See TracChangeset for help on using the changeset viewer.