Changeset b6e60b4 in opengl-game for opengl-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
-
opengl-game.cpp
r7fc5e27 rb6e60b4 17 17 } 18 18 19 void OpenGLGame::run( unsigned int width, unsignedint height, unsigned char guiFlags) {19 void OpenGLGame::run(int width, int height, unsigned char guiFlags) { 20 20 if (initWindow(width, height, guiFlags) == RTWO_ERROR) { 21 21 return; 22 22 } 23 23 24 initOpenGL(); 24 25 mainLoop(); … … 26 27 } 27 28 28 bool OpenGLGame::initWindow( unsigned int width, unsignedint height, unsigned char guiFlags) {29 bool OpenGLGame::initWindow(int width, int height, unsigned char guiFlags) { 29 30 gui = new GameGui_GLFW(); 30 31 31 if (gui-> Init() == RTWO_ERROR) {32 if (gui->init() == RTWO_ERROR) { 32 33 cout << "UI library could not be initialized!" << endl; 33 cout << gui-> GetError() << endl;34 cout << gui->getError() << endl; 34 35 return RTWO_ERROR; 35 36 } 36 37 cout << "GUI init succeeded" << endl; 37 38 38 window = (GLFWwindow*) gui-> CreateWindow("OpenGL Game", width, height, guiFlags |GUI_FLAGS_WINDOW_FULLSCREEN);39 window = (GLFWwindow*) gui->createWindow("OpenGL Game", width, height, guiFlags & GUI_FLAGS_WINDOW_FULLSCREEN); 39 40 if (window == nullptr) { 40 41 cout << "Window could not be created!" << endl; 41 42 return RTWO_ERROR; 42 43 } 44 45 int actualWidth=0, actualHeight=0; 46 gui->getWindowSize(&actualWidth, &actualHeight); 47 48 cout << "Target window size: (" << width << ", " << height << ")" << endl; 49 cout << "Actual window size: (" << actualWidth << ", " << actualHeight << ")" << endl; 43 50 44 51 return RTWO_SUCCESS; … … 61 68 62 69 void OpenGLGame::cleanup() { 63 gui-> DestroyWindow();64 gui-> Shutdown();70 gui->destroyWindow(); 71 gui->shutdown(); 65 72 delete gui; 66 73 }
Note:
See TracChangeset
for help on using the changeset viewer.