Changeset 7fc5e27 in opengl-game for game-gui-sdl.cpp
- Timestamp:
- Sep 3, 2019, 7:07:39 PM (6 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- b6e60b4
- Parents:
- 1ce9afe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
game-gui-sdl.cpp
r1ce9afe r7fc5e27 5 5 string GameGui_SDL::s_errorMessage; 6 6 7 string& GameGui_SDL:: GetError() {7 string& GameGui_SDL::getError() { 8 8 GameGui_SDL::s_errorMessage = SDL_GetError(); 9 9 … … 11 11 } 12 12 13 bool GameGui_SDL:: Init() {13 bool GameGui_SDL::init() { 14 14 // may want to define SDL_INIT_NOPARACHUTE when I start handling crashes since it 15 15 // prevents SDL from setting up its own handlers for SIG_SEGV and stuff like that … … 33 33 } 34 34 35 void GameGui_SDL:: Shutdown() {35 void GameGui_SDL::shutdown() { 36 36 SDL_Quit(); 37 37 } 38 38 39 void* GameGui_SDL::CreateWindow(const string& title, unsigned int width, unsigned int height, bool fullscreen) { 40 cout << "About to go fullscreen in SDL..." << endl; 41 39 void* GameGui_SDL::createWindow(const string& title, int width, int height, bool fullscreen) { 42 40 // TODO: Make an OpenGL version of the SDL_CreateWindow call as well 43 41 44 42 // On Apple's OS X you must set the NSHighResolutionCapable Info.plist property to YES, 45 43 // otherwise you will not receive a High DPI OpenGL canvas. 44 45 uint32_t flags = SDL_WINDOW_VULKAN; 46 47 flags |= fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : SDL_WINDOW_RESIZABLE; 48 46 49 window = SDL_CreateWindow(title.c_str(), 47 50 SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 48 width, height, 49 SDL_WINDOW_VULKAN | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE); 51 width, height, flags); 50 52 51 53 return window; 52 54 } 53 55 54 void GameGui_SDL:: DestroyWindow() {56 void GameGui_SDL::destroyWindow() { 55 57 // TODO: This function can throw some errors. They should be handled 56 58 SDL_DestroyWindow(window); … … 59 61 #ifdef GAMEGUI_INCLUDE_VULKAN 60 62 61 bool GameGui_SDL:: CreateVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) {63 bool GameGui_SDL::createVulkanSurface(VkInstance instance, VkSurfaceKHR* surface) { 62 64 return SDL_Vulkan_CreateSurface(window, instance, surface) ? 63 65 RTWO_SUCCESS : RTWO_ERROR; … … 66 68 #endif 67 69 68 vector<const char*> GameGui_SDL:: GetRequiredExtensions() {70 vector<const char*> GameGui_SDL::getRequiredExtensions() { 69 71 uint32_t extensionCount = 0; 70 72 SDL_Vulkan_GetInstanceExtensions(window, &extensionCount, nullptr); … … 76 78 } 77 79 78 void GameGui_SDL:: GetWindowSize(int* width, int* height) {80 void GameGui_SDL::getWindowSize(int* width, int* height) { 79 81 SDL_GetWindowSize(window, width, height); 80 82 }
Note:
See TracChangeset
for help on using the changeset viewer.