Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
|
#include <GLFWGameWindow.h>
Public Member Functions | |
GLFWGameWindow (int width, int height, const std::string &title, bool fullscreen, int major, int minor) | |
virtual void | init ()=0 |
virtual void | update (double frameLength)=0 |
virtual void | draw ()=0 |
virtual void | destroy ()=0 |
bool | run () |
void | stop () |
void | setGLVersion (int major, int minor) |
void | setPrintFPS (bool print) |
double | getAverageFPS () const |
int | getWidth () const |
int | getHeight () const |
Base class for a GLFW window with OpenGL core context 3.0+ and a generic render loop.
GLFWGameWindow::GLFWGameWindow | ( | int | width, |
int | height, | ||
const std::string & | title, | ||
bool | fullscreen, | ||
int | major, | ||
int | minor | ||
) |
Initializes fields of the objects. Call run()
to start the render loop.
width | window width in pixels |
height | window height in pixels |
title | window title |
fullscreen | false for windowed mode, true for fullscreen mode |
major | major version of the GL context, 3.x or 4.x |
minor | minor version of the GL context |
|
pure virtual |
Purely virtual function, to deallocate resources before window destruction
Implemented in Vis2Window.
|
pure virtual |
Purely virtual function, to render each frame
Implemented in Vis2Window.
|
pure virtual |
Purely virtual function, to initialize resources after OpenGL context has been creates
Implemented in Vis2Window.
bool GLFWGameWindow::run | ( | ) |
Creates an OpenGL context, calls init
and starts the render loop.
void GLFWGameWindow::setPrintFPS | ( | bool | print) |
if set to true, the current fps will be displayed to the standard output every few seconds
void GLFWGameWindow::stop | ( | ) |
Causes the render loop to terminate after its current iteration.
|
pure virtual |
Purely virtual function, to perform the application logic each frame
Implemented in Vis2Window.