source: opengl-game/opengl-game.hpp@ 83b5b4b

feature/imgui-sdl points-test
Last change on this file since 83b5b4b was 83b5b4b, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago

Handle window resize events in openglgame

  • Property mode set to 100644
File size: 875 bytes
Line 
1#ifndef _OPENGL_GAME_H
2#define _OPENGL_GAME_H
3
4#include <glm/glm.hpp>
5
6#include "IMGUI/imgui.h"
7#include "imgui_impl_glfw_gl3.h"
8
9#include "game-gui-glfw.hpp"
10#include "graphics-pipeline_opengl.hpp"
11
12class OpenGLGame {
13 public:
14 OpenGLGame();
15 ~OpenGLGame();
16
17 void run(int width, int height, unsigned char guiFlags);
18
19 private:
20 GameGui* gui;
21 Viewport viewport;
22
23 vector<GraphicsPipeline_OpenGL> graphicsPipelines;
24
25 GLFWwindow* window;
26
27 bool initWindow(int width, int height, unsigned char guiFlags);
28 void initOpenGL();
29 void mainLoop();
30 void renderScene();
31 void renderUI();
32 void cleanup();
33};
34
35void APIENTRY opengl_debug_callback(
36 GLenum source,
37 GLenum type,
38 GLuint id,
39 GLenum severity,
40 GLsizei length,
41 const GLchar* message,
42 const void* userParam
43);
44
45#endif // _OPENGL_GAME_H
Note: See TracBrowser for help on using the repository browser.