GPU Splatting  1.0
A deffered render that draws the surface of point cloud data.
GLFWApplication.h
1 #pragma once
2 
3 #include <GL/glew.h>
4 #include <glfw/glfw3.h>
5 
7 
12 {
13 public:
15 
21  GLFWApplication(int width, int height, int ctx_major, int ctx_minor);
22 
23  virtual void init() = 0;
24  virtual void update() = 0;
25  virtual void render() = 0;
26 
28 
32  virtual void resize(int width, int height) = 0;
33 
34  virtual void initUI() = 0;
35  virtual void renderUI() = 0;
36 
37  void run();
38 
39 protected:
40  GLFWwindow* getWindow(){ return window; }
41  int getWidth();
42  int getHeight();
43  float getFrameTime(){ return frameTime; }
44  float getAbsTime(){ return absTime; }
45  double getMouseX(){ return mousex; }
46  double getMouseY(){ return mousey; }
47  double getMouseDx(){ return dmousex; }
48  double getMouseDy(){ return dmousey; }
49 
50 
51 private:
52  float frameTime;
53  float absTime;
54  GLFWwindow* window;
55 
56  // glfw callbacks
57  double mousex = 0, mousey = 0;
58  double dmousex = 0, dmousey = 0;
59 };
double getMouseX()
Returns the X-position of the mouse in the window.
Definition: GLFWApplication.h:45
float getFrameTime()
Returns the duration of the last frame in seconds.
Definition: GLFWApplication.h:43
virtual void render()=0
This method is called once per frame to render 3d content.
A generic base class for GLFW-applications.
Definition: GLFWApplication.h:11
virtual void update()=0
This method is called once per frame to update logic.
virtual void initUI()=0
This method will be called once before the first rendering.
void run()
This method starts the update-render-loop and returns if the window has been closed.
Definition: GLFWApplication.cpp:62
virtual void resize(int width, int height)=0
This method will be called if the size of the window changes.
virtual void init()=0
This method will be called once before the first rendering.
virtual void renderUI()=0
This method is called once per frame after the render() method to render the user interface...
int getHeight()
Returns the height of the window.
Definition: GLFWApplication.cpp:105
double getMouseDy()
Returns the difference in Y-position of the mouse since last frame.
Definition: GLFWApplication.h:48
double getMouseY()
Returns the Y-position of the mouse in the window.
Definition: GLFWApplication.h:46
double getMouseDx()
Returns the difference in X-position of the mouse since last frame.
Definition: GLFWApplication.h:47
int getWidth()
Returns the width of the window.
Definition: GLFWApplication.cpp:98
GLFWwindow * getWindow()
Returns the GLFW-window-handle.
Definition: GLFWApplication.h:40
GLFWApplication(int width, int height, int ctx_major, int ctx_minor)
Creates a new instance with the given parameters.
Definition: GLFWApplication.cpp:13