Walls And Holes  1
SimpleTexturedRenderer Class Reference

The SimpleTexturedRenderer class renders a SimpleTexturedScene. More...

#include <simpletexturedrenderer.h>

Inheritance diagram for SimpleTexturedRenderer:
Collaboration diagram for SimpleTexturedRenderer:

Public Slots

void objectAdded (const SimpleTexturedObject &obj)
 This slot should be called whenever the underlying scene has a new object. More...
 
void objectRemoved (const SimpleTexturedObject &obj)
 This slot should be called whenever an object is removed from the underlying scene. Locks the mGLDataMutex. More...
 
void clearAll ()
 Clears all OpenGL data, not assuming that a context is current. Some data may not be cleared immediately. Locks the mGLDataMutex. More...
 
void cleanUp () override
 Cleans up all OpenGL data. This assumes that the correct context is current, and all data is cleaned immediately. Locks the mGLDataMutex. More...
 
- Public Slots inherited from AbstractRenderer
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...
 

Public Member Functions

 SimpleTexturedRenderer (SharedSimpleTexturedScene scene)
 
virtual ~SimpleTexturedRenderer ()
 
void paint (QMatrix4x4 mvpMatrix, QVector3D camPos) override
 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...
 
void create () override
 This is (should be) called on an OpenGL thread before this object is used. Allows the renderer to initialize its OpenGL-dependent objects. More...
 
- Public Member Functions inherited from AbstractRenderer
virtual ~AbstractRenderer ()
 
void initializeGL ()
 Initializes OpenGL-related details. More...
 

Protected Member Functions

void initializeRenderer () override
 Used to initialize renderer parameters that require an OpenGL context to be bound. More...
 
- Protected Member Functions inherited from AbstractRenderer
bool checkGLErrors ()
 Helper method to loop glGetError() and print out all current errors. More...
 

Additional Inherited Members

- Signals inherited from AbstractRenderer
void repaintNeeded ()
 Emitted when the renderer has updates to make to its image. More...
 
void makeContextCurrent ()
 
void doneContextCurrent ()
 

Detailed Description

Constructor & Destructor Documentation

◆ SimpleTexturedRenderer()

SimpleTexturedRenderer::SimpleTexturedRenderer ( SharedSimpleTexturedScene  scene)

◆ ~SimpleTexturedRenderer()

SimpleTexturedRenderer::~SimpleTexturedRenderer ( )
virtual

Member Function Documentation

◆ cleanUp

void SimpleTexturedRenderer::cleanUp ( )
overrideslot

Cleans up all OpenGL data. This assumes that the correct context is current, and all data is cleaned immediately. Locks the mGLDataMutex.

Here is the call graph for this function:

◆ clearAll

void SimpleTexturedRenderer::clearAll ( )
slot

Clears all OpenGL data, not assuming that a context is current. Some data may not be cleared immediately. Locks the mGLDataMutex.

Here is the caller graph for this function:

◆ create()

void SimpleTexturedRenderer::create ( )
overridevirtual

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 from AbstractRenderer.

Here is the call graph for this function:

◆ initializeRenderer()

void SimpleTexturedRenderer::initializeRenderer ( )
overrideprotectedvirtual

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

Implements AbstractRenderer.

Here is the call graph for this function:

◆ objectAdded

void SimpleTexturedRenderer::objectAdded ( const SimpleTexturedObject obj)
slot

This slot should be called whenever the underlying scene has a new object.

Parameters
objThe new object.
Here is the caller graph for this function:

◆ objectRemoved

void SimpleTexturedRenderer::objectRemoved ( const SimpleTexturedObject obj)
slot

This slot should be called whenever an object is removed from the underlying scene. Locks the mGLDataMutex.

Parameters
objThe object that is already removed or will be removed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ paint()

void SimpleTexturedRenderer::paint ( QMatrix4x4  mvpMatrix,
QVector3D  camPos 
)
overridevirtual

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.

Implements AbstractRenderer.

Here is the call graph for this function:

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