Changeset b6e60b4 in opengl-game for vulkan-game.cpp
- Timestamp:
- Sep 3, 2019, 7:11:36 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- ed7c953
- Parents:
- 7fc5e27
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r7fc5e27 rb6e60b4 18 18 } 19 19 20 void VulkanGame::run( unsigned int width, unsignedint height, unsigned char guiFlags) {20 void VulkanGame::run(int width, int height, unsigned char guiFlags) { 21 21 if (initWindow(width, height, guiFlags) == RTWO_ERROR) { 22 22 return; 23 23 } 24 24 25 initVulkan(); 25 26 mainLoop(); … … 27 28 } 28 29 29 bool VulkanGame::initWindow( unsigned int width, unsignedint height, unsigned char guiFlags) {30 bool VulkanGame::initWindow(int width, int height, unsigned char guiFlags) { 30 31 gui = new GameGui_SDL(); 31 32 32 if (gui-> Init() == RTWO_ERROR) {33 if (gui->init() == RTWO_ERROR) { 33 34 cout << "UI library could not be initialized!" << endl; 34 cout << gui-> GetError() << endl;35 cout << gui->getError() << endl; 35 36 return RTWO_ERROR; 36 37 } 37 cout << "GUI init succeeded" << endl;38 38 39 window = (SDL_Window*) gui-> CreateWindow("Vulkan Game", width, height, guiFlags |GUI_FLAGS_WINDOW_FULLSCREEN);39 window = (SDL_Window*) gui->createWindow("Vulkan Game", width, height, guiFlags & GUI_FLAGS_WINDOW_FULLSCREEN); 40 40 if (window == nullptr) { 41 41 cout << "Window could not be created!" << endl; 42 42 return RTWO_ERROR; 43 43 } 44 45 int actualWidth, actualHeight; 46 gui->getWindowSize(&actualWidth, &actualHeight); 47 48 cout << "Target window size: (" << width << ", " << height << ")" << endl; 49 cout << "Actual window size: (" << actualWidth << ", " << actualHeight << ")" << endl; 44 50 45 51 return RTWO_SUCCESS; … … 69 75 70 76 void VulkanGame::cleanup() { 71 gui-> DestroyWindow();72 gui-> Shutdown();77 gui->destroyWindow(); 78 gui->shutdown(); 73 79 delete gui; 74 80 }
Note:
See TracChangeset
for help on using the changeset viewer.