Walls And Holes  1
AbstractRenderer Class Referenceabstract

Something that renders a 3D scene to the screen using OpenGL. More...

#include <abstractrenderer.h>

Inheritance diagram for AbstractRenderer:
Collaboration diagram for AbstractRenderer:

Public Slots

void requestUpdate ()
 Calling this slot makes the renderer update itself when possible. More...
 
virtual void cleanUp ()=0
 This slot should clean up all resources associated to the renderer. More...
 

Signals

void repaintNeeded ()
 Emitted when the renderer has updates to make to its image. More...
 
void makeContextCurrent ()
 
void doneContextCurrent ()
 

Public Member Functions

virtual ~AbstractRenderer ()
 
virtual void paint (QMatrix4x4 mvpMatrix, QVector3D camPos)=0
 Uses OpenGL commands to draw to the frame buffer. Nothing is assumed about the previous contents of the frame (i.e. glClear does not need to be called before this), and the OpenGL state should not change as a result of calling this function. More...
 
virtual void create ()
 This is (should be) called on an OpenGL thread before this object is used. Allows the renderer to initialize its OpenGL-dependent objects. More...
 
void initializeGL ()
 Initializes OpenGL-related details. More...
 

Protected Member Functions

bool checkGLErrors ()
 Helper method to loop glGetError() and print out all current errors. More...
 
virtual void initializeRenderer ()=0
 Used to initialize renderer parameters that require an OpenGL context to be bound. More...
 

Detailed Description

Something that renders a 3D scene to the screen using OpenGL.

Constructor & Destructor Documentation

◆ ~AbstractRenderer()

virtual AbstractRenderer::~AbstractRenderer ( )
inlinevirtual

Member Function Documentation

◆ checkGLErrors()

bool AbstractRenderer::checkGLErrors ( )
inlineprotected

Helper method to loop glGetError() and print out all current errors.

Prints nothing if there are no errors, but otherwise prints the names of the errors.

Returns
Returns true if an error was detected and false otherwise.
Here is the caller graph for this function:

◆ cleanUp

virtual void AbstractRenderer::cleanUp ( )
pure virtualslot

This slot should clean up all resources associated to the renderer.

◆ create()

virtual void AbstractRenderer::create ( )
inlinevirtual

This is (should be) called on an OpenGL thread before this object is used. Allows the renderer to initialize its OpenGL-dependent objects.

The difference between this and initializeGL() is that this should only include lightweight initialization.

Reimplemented in SimpleTexturedRenderer.

◆ doneContextCurrent

void AbstractRenderer::doneContextCurrent ( )
signal
Here is the caller graph for this function:

◆ initializeGL()

void AbstractRenderer::initializeGL ( )
inline

Initializes OpenGL-related details.

Here is the call graph for this function:

◆ initializeRenderer()

virtual void AbstractRenderer::initializeRenderer ( )
protectedpure virtual

Used to initialize renderer parameters that require an OpenGL context to be bound.

Implemented in SimpleTexturedRenderer.

Here is the caller graph for this function:

◆ makeContextCurrent

void AbstractRenderer::makeContextCurrent ( )
signal
Here is the caller graph for this function:

◆ paint()

virtual void AbstractRenderer::paint ( QMatrix4x4  mvpMatrix,
QVector3D  camPos 
)
pure virtual

Uses OpenGL commands to draw to the frame buffer. Nothing is assumed about the previous contents of the frame (i.e. glClear does not need to be called before this), and the OpenGL state should not change as a result of calling this function.

It is assumed that initializeGL() has been called for the current OpenGL context.

Parameters
vpMatrixThe model-view-projection matrix that should be used.
camPosThe world-space coordinates of the camera.

Implemented in SimpleTexturedRenderer.

◆ repaintNeeded

void AbstractRenderer::repaintNeeded ( )
signal

Emitted when the renderer has updates to make to its image.

Here is the caller graph for this function:

◆ requestUpdate

void AbstractRenderer::requestUpdate ( )
inlineslot

Calling this slot makes the renderer update itself when possible.

Here is the caller graph for this function:

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