Changeset 0e6ecf3 in opengl-game for game-gui-sdl.cpp
- Timestamp:
- Jul 19, 2019, 8:50:06 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 8667f76
- Parents:
- 75108ef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
game-gui-sdl.cpp
r75108ef r0e6ecf3 1 1 #include "game-gui-sdl.hpp" 2 3 #include <SDL2/SDL.h>4 5 #include <iostream>6 7 using namespace std;8 2 9 3 bool GameGui_SDL::Init() { … … 22 16 SDL_Quit(); 23 17 } 18 19 void* GameGui_SDL::CreateWindow(const string& title, unsigned int width, unsigned int height) { 20 // On Apple's OS X you must set the NSHighResolutionCapable Info.plist property to YES, 21 // otherwise you will not receive a High DPI OpenGL canvas. 22 window = SDL_CreateWindow(title.c_str(), 23 SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 24 width, height, 25 SDL_WINDOW_VULKAN | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE); 26 27 return window; 28 } 29 30 void GameGui_SDL::DestroyWindow() { 31 // TODO: This function can throw some errors. They should be handled 32 SDL_DestroyWindow(window); 33 } 34 35 bool GameGui_SDL::CreateVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) { 36 return SDL_Vulkan_CreateSurface(window, instance, surface) ? 37 RTWO_SUCCESS : RTWO_ERROR; 38 }
Note:
See TracChangeset
for help on using the changeset viewer.