4 #include <glfw/glfw3.h>
23 virtual void init() = 0;
32 virtual void resize(
int width,
int height) = 0;
44 float getAbsTime(){
return absTime; }
57 double mousex = 0, mousey = 0;
58 double dmousex = 0, dmousey = 0;
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