Changeset 5edbd58 in opengl-game
- Timestamp:
- Sep 2, 2019, 5:23:40 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 301d0d4
- Parents:
- 2beb6c7
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main-opengl.cpp
r2beb6c7 r5edbd58 3 3 #include <iostream> 4 4 5 #include "consts.hpp" 5 6 #include "crash-logger.hpp" 6 7 … … 28 29 29 30 try { 30 game.run( );31 game.run(640, 480, GUI_FLAGS_WINDOW_FULLSCREEN); 31 32 } catch (const exception& e) { 32 33 cerr << e.what() << endl; -
main-vulkan.cpp
r2beb6c7 r5edbd58 3 3 #include <iostream> 4 4 5 #include "consts.hpp" 5 6 #include "crash-logger.hpp" 6 7 … … 28 29 29 30 try { 30 game.run( );31 game.run(800, 600, GUI_FLAGS_WINDOW_FULLSCREEN); 31 32 } catch (const exception& e) { 32 33 cerr << e.what() << endl; -
opengl-game.cpp
r2beb6c7 r5edbd58 2 2 3 3 #include <iostream> 4 5 #include "consts.hpp" 4 6 5 7 #include "game-gui-glfw.hpp" … … 15 17 } 16 18 17 void OpenGLGame::run( ) {18 if (initWindow( ) == RTWO_ERROR) {19 void OpenGLGame::run(unsigned int width, unsigned int height, unsigned char guiFlags) { 20 if (initWindow(width, height, guiFlags) == RTWO_ERROR) { 19 21 return; 20 22 } … … 24 26 } 25 27 26 bool OpenGLGame::initWindow( ) {28 bool OpenGLGame::initWindow(unsigned int width, unsigned int height, unsigned char guiFlags) { 27 29 gui = new GameGui_GLFW(); 28 30 … … 34 36 cout << "GUI init succeeded" << endl; 35 37 36 window = (GLFWwindow*) gui->CreateWindow("OpenGL Game", SCREEN_WIDTH, SCREEN_HEIGHT);38 window = (GLFWwindow*) gui->CreateWindow("OpenGL Game", width, height); 37 39 if (window == nullptr) { 38 40 cout << "Window could not be created!" << endl; -
opengl-game.hpp
r2beb6c7 r5edbd58 3 3 4 4 #include "game-gui-glfw.hpp" 5 6 const int SCREEN_WIDTH = 800;7 const int SCREEN_HEIGHT = 600;8 5 9 6 class OpenGLGame { … … 12 9 ~OpenGLGame(); 13 10 14 void run( );11 void run(unsigned int width, unsigned int height, unsigned char guiFlags); 15 12 16 13 private: … … 18 15 GLFWwindow* window; 19 16 20 bool initWindow( );17 bool initWindow(unsigned int width, unsigned int height, unsigned char guiFlags); 21 18 void initOpenGL(); 22 19 void mainLoop(); -
vulkan-game.cpp
r2beb6c7 r5edbd58 2 2 3 3 #include <iostream> 4 5 #include "consts.hpp" 4 6 5 7 #define GAMEGUI_INCLUDE_VULKAN … … 16 18 } 17 19 18 void VulkanGame::run( ) {19 if (initWindow( ) == RTWO_ERROR) {20 void VulkanGame::run(unsigned int width, unsigned int height, unsigned char guiFlags) { 21 if (initWindow(width, height, guiFlags) == RTWO_ERROR) { 20 22 return; 21 23 } … … 25 27 } 26 28 27 bool VulkanGame::initWindow( ) {29 bool VulkanGame::initWindow(unsigned int width, unsigned int height, unsigned char guiFlags) { 28 30 gui = new GameGui_SDL(); 29 31 … … 35 37 cout << "GUI init succeeded" << endl; 36 38 37 window = (SDL_Window*) gui->CreateWindow("Vulkan Game", SCREEN_WIDTH, SCREEN_HEIGHT);39 window = (SDL_Window*) gui->CreateWindow("Vulkan Game", width, height); 38 40 if (window == nullptr) { 39 41 cout << "Window could not be created!" << endl; -
vulkan-game.hpp
r2beb6c7 r5edbd58 3 3 4 4 #include "game-gui-sdl.hpp" 5 6 const int SCREEN_WIDTH = 800;7 const int SCREEN_HEIGHT = 600;8 5 9 6 class VulkanGame { … … 12 9 ~VulkanGame(); 13 10 14 void run( );11 void run(unsigned int width, unsigned int height, unsigned char guiFlags); 15 12 16 13 private: … … 18 15 SDL_Window* window; 19 16 20 bool initWindow( );17 bool initWindow(unsigned int width, unsigned int height, unsigned char guiFlags); 21 18 void initVulkan(); 22 19 void mainLoop();
Note:
See TracChangeset
for help on using the changeset viewer.