Changeset 83b5b4b in opengl-game
- Timestamp:
- Oct 4, 2019, 8:19:15 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 0b1b52d
- Parents:
- 5b02676
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (10/04/19 20:16:22)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (10/04/19 20:19:15)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
game-gui-glfw.cpp
r5b02676 r83b5b4b 156 156 UIEvent e; 157 157 e.type = UI_EVENT_WINDOWRESIZE; 158 e.windowResize.width = width; 159 e.windowResize.height = height; 158 160 159 161 GameGui_GLFW::s_events.push(e); -
game-gui.hpp
r5b02676 r83b5b4b 41 41 }; 42 42 43 struct WindowResizeEvent { 44 EventType type; 45 int width; 46 int height; 47 }; 48 43 49 struct UnknownEvent { 44 50 EventType type; … … 51 57 KeyEvent key; 52 58 MouseEvent mouse; 59 WindowResizeEvent windowResize; 53 60 UnknownEvent unknown; 54 61 }; -
graphics-pipeline.hpp
r5b02676 r83b5b4b 6 6 using namespace std; 7 7 8 struct Viewport { 9 int x; 10 int y; 11 int width; 12 int height; 13 }; 14 8 15 class GraphicsPipeline { 9 16 public: … … 11 18 12 19 virtual void createPipeline(string vertShaderFile, string fragShaderFile) = 0; 20 21 protected: 22 Viewport viewport; // So far, not used for GraphicsPipeline_OpenGL 13 23 }; 14 24 -
opengl-game.cpp
r5b02676 r83b5b4b 5 5 #include "consts.hpp" 6 6 #include "logger.hpp" 7 8 #include "utils.hpp" 7 9 8 10 using namespace std; … … 66 68 } 67 69 70 viewport = { 0, 0, gui->getWindowWidth(), gui->getWindowHeight() }; 71 68 72 cout << "Target window size: (" << width << ", " << height << ")" << endl; 69 cout << "Actual window size: (" << gui->getWindowWidth() << ", " << gui->getWindowHeight()<< ")" << endl;73 cout << "Actual window size: (" << viewport.width << ", " << viewport.height << ")" << endl; 70 74 71 75 return RTWO_SUCCESS; … … 141 145 case UI_EVENT_WINDOWRESIZE: 142 146 cout << "Window resize event detected" << endl; 147 viewport.width = e.windowResize.width; 148 viewport.height = e.windowResize.height; 143 149 break; 144 150 default: -
opengl-game.hpp
r5b02676 r83b5b4b 1 1 #ifndef _OPENGL_GAME_H 2 2 #define _OPENGL_GAME_H 3 4 #include <glm/glm.hpp> 3 5 4 6 #include "IMGUI/imgui.h" … … 17 19 private: 18 20 GameGui* gui; 21 Viewport viewport; 19 22 20 23 vector<GraphicsPipeline_OpenGL> graphicsPipelines;
Note:
See TracChangeset
for help on using the changeset viewer.