Changeset 321272c in opengl-game


Ignore:
Timestamp:
Jul 11, 2019, 8:40:14 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
bfd620e
Parents:
98f3232
Message:

Create an SDL surface and usse it to fill the window with a white background

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.cpp

    r98f3232 r321272c  
    9797      VkDebugUtilsMessengerEXT debugMessenger;
    9898      VkSurfaceKHR surface;
     99      SDL_Surface* sdlSurface = nullptr;
    99100
    100101      VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
     
    193194
    194195      void createSurface() {
    195          //SDL_Surface* screenSurface = nullptr;
     196         sdlSurface = SDL_GetWindowSurface(window);
     197
     198         if (sdlSurface == nullptr) {
     199             cout << "Could not get SDL Surface! =(" << endl;
     200         }
    196201
    197202         if (!SDL_Vulkan_CreateSurface(window, instance, &surface)) {
     
    375380         SDL_Event e;
    376381         bool quit = false;
    377 
    378          /*
    379          screenSurface = SDL_GetWindowSurface(window);
    380          cout << "Got here" << endl;
    381          cout << (screenSurface == nullptr ? "true" : "false") << endl;
    382 
    383          SDL_FillRect(screenSurface, nullptr, SDL_MapRGB(screenSurface->format, 0xFF, 0xFF, 0xFF));
    384          cout << "Filled" << endl;
    385 
    386          SDL_UpdateWindowSurface(window);
    387          cout << "Updated" << endl;
    388          */
    389382
    390383         while (!quit) {
     
    401394            }
    402395         }
     396
     397         SDL_FillRect(sdlSurface, nullptr, SDL_MapRGB(sdlSurface->format, 0xFF, 0xFF, 0xFF));
     398
     399         SDL_UpdateWindowSurface(window);
    403400      }
    404401
Note: See TracChangeset for help on using the changeset viewer.