Something that renders a 3D scene to the screen using OpenGL.
More...
#include <abstractrenderer.h>
|
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...
|
|
|
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...
|
|
|
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...
|
|
Something that renders a 3D scene to the screen using OpenGL.
◆ ~AbstractRenderer()
virtual AbstractRenderer::~AbstractRenderer |
( |
| ) |
|
|
inlinevirtual |
◆ 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.
◆ 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 |
◆ initializeGL()
void AbstractRenderer::initializeGL |
( |
| ) |
|
|
inline |
Initializes OpenGL-related details.
◆ initializeRenderer()
virtual void AbstractRenderer::initializeRenderer |
( |
| ) |
|
|
protectedpure virtual |
Used to initialize renderer parameters that require an OpenGL context to be bound.
Implemented in SimpleTexturedRenderer.
◆ makeContextCurrent
void AbstractRenderer::makeContextCurrent |
( |
| ) |
|
|
signal |
◆ 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
-
vpMatrix | The model-view-projection matrix that should be used. |
camPos | The 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.
◆ requestUpdate
void AbstractRenderer::requestUpdate |
( |
| ) |
|
|
inlineslot |
Calling this slot makes the renderer update itself when possible.
The documentation for this class was generated from the following file: