Changeset 0e6ecf3 in opengl-game for vulkan-game.cpp
- Timestamp:
- Jul 19, 2019, 8:50:06 PM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 8667f76
- Parents:
- 75108ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r75108ef r0e6ecf3 1 #include <vulkan/vulkan.h> 2 3 #include <SDL2/SDL.h> 4 #include <SDL2/SDL_vulkan.h> 1 #include "game-gui-glfw.hpp" 2 3 #include "game-gui-sdl.hpp" 5 4 6 5 //#define _USE_MATH_DEFINES // Will be needed when/if I need to # include <cmath> … … 11 10 #include <glm/mat4x4.hpp> 12 11 12 #include <fstream> 13 13 #include <iostream> 14 #include <optional> 15 #include <set> 14 16 #include <vector> 15 #include <set>16 #include <stdexcept>17 #include <cstdlib>18 #include <optional>19 #include <algorithm>20 #include <fstream>21 22 #include "game-gui-sdl.hpp"23 17 24 18 using namespace std; … … 137 131 return RTWO_ERROR; 138 132 } else { 139 // On Apple's OS X you must set the NSHighResolutionCapable Info.plist property to YES, 140 // otherwise you will not receive a High DPI OpenGL canvas. 141 142 // TODO: Move this into some generic method in game-gui-sdl 143 window = SDL_CreateWindow("Vulkan Game", 144 SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 145 SCREEN_WIDTH, SCREEN_HEIGHT, 146 SDL_WINDOW_VULKAN | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE); 133 window = (SDL_Window*) gui->CreateWindow("Vulkan Game", SCREEN_WIDTH, SCREEN_HEIGHT); 147 134 148 135 if (window == nullptr) { … … 274 261 } 275 262 276 if ( !SDL_Vulkan_CreateSurface(window, instance, &surface)) {263 if (gui->CreateVulkanSurface(instance, &surface) == RTWO_ERROR) { 277 264 throw runtime_error("failed to create window surface!"); 278 265 } 279 280 /*281 if (glfwCreateWindowSurface(instance, window, nullptr, &surface) != VK_SUCCESS) {282 throw runtime_error("failed to create window surface!");283 }284 */285 266 } 286 267 … … 1014 995 vkDestroyInstance(instance, nullptr); 1015 996 1016 // TODO: Move this into some generic method in game-gui-sdl 1017 SDL_DestroyWindow(window); 1018 997 gui->DestroyWindow(); 1019 998 gui->Shutdown(); 1020 999 delete gui; … … 1029 1008 1030 1009 return VK_FALSE; 1031 }1010 } 1032 1011 1033 1012 static vector<char> readFile(const string& filename) {
Note:
See TracChangeset
for help on using the changeset viewer.