Cutout Vis2012
TUWienVisualisierung2(SS2012)-AdaptiveCutaways
 All Classes Namespaces Functions Pages
Public Member Functions | List of all members
GLFWGameWindow Class Referenceabstract

#include <GLFWGameWindow.h>

Inheritance diagram for GLFWGameWindow:
Vis2Window

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
 

Detailed Description

Base class for a GLFW window with OpenGL core context 3.0+ and a generic render loop.

Constructor & Destructor Documentation

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.

Parameters
widthwindow width in pixels
heightwindow height in pixels
titlewindow title
fullscreenfalse for windowed mode, true for fullscreen mode
majormajor version of the GL context, 3.x or 4.x
minorminor version of the GL context

Member Function Documentation

virtual void GLFWGameWindow::destroy ( )
pure virtual

Purely virtual function, to deallocate resources before window destruction

Implemented in Vis2Window.

virtual void GLFWGameWindow::draw ( )
pure virtual

Purely virtual function, to render each frame

Implemented in Vis2Window.

virtual void GLFWGameWindow::init ( )
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.

virtual void GLFWGameWindow::update ( double  frameLength)
pure virtual

Purely virtual function, to perform the application logic each frame

Implemented in Vis2Window.


The documentation for this class was generated from the following files: