2#include <QOpenGLShaderProgram>
117 QOpenGLShaderProgram* _shader;
Renders an OpenGL object (vertex-array) in a color and using a transformation/translation matrix.
Definition OpenGLRenderObject.h:17
Pure virtual class to implement rendering separated from the widget and makes the sf::OpenGLWidget th...
Definition OpenGLRenderer.h:13
virtual void setIndexValue(int index, QVariant value)=0
Sets an arbitrary value on the derived- or subclass.
const QMatrix4x4 & _lightPositionMatrix
Easy of access reference to the light position matrix from the sf::OpenGLWidget.
Definition OpenGLRenderer.h:103
const QMatrix4x4 & _projectionMatrix
Easy of access reference to the projection matrix from the widget.
Definition OpenGLRenderer.h:95
virtual void changedProperty()=0
Called by sf::OpenGLWidget when a property has changed.
virtual void paint()=0
Called by from the render() method.
QList< OpenGLRenderObject * > _renderObjects
Holds the list of objects to render.
Definition OpenGLRenderer.h:91
const QMatrix4x4 & _lightDirectionMatrix
Easy of access reference to the light direction matrix from the sf::OpenGLWidget.
Definition OpenGLRenderer.h:107
OpenGLWidget * getWidget() const
Gets the owning widget which is calling the shots.
virtual void addRenderObject(OpenGLRenderObject *ro, bool append=true)
Adds an object to be rendered. The order of addition determines the outcome when transparency is invo...
OpenGLRenderer(OpenGLWidget *widget, QOpenGLShaderProgram *sp)
Constructor passing the widget which has the OpenGL context. The owner is the shader program object.
virtual void draw()=0
Called by from the render() method.
~OpenGLRenderer() override=default
Virtual destructor.
const QMatrix4x4 & _modelMatrix
Easy of access reference to the model matrix from the sf::OpenGLWidget.
Definition OpenGLRenderer.h:111
QOpenGLShaderProgram * getShaderProgram()
Gets shader program given in the constructor.
void render()
Call overridden method render() after the shader program has been linked.
static void initialize(OpenGLWidget *widget)
Called by sf::OpenGLWidget::initializeGL to initialize the OpenGL context for derived classes.
const QMatrix4x4 & _cameraMatrix
Easy of access reference to the camera matrix from the sf::OpenGLWidget.
Definition OpenGLRenderer.h:99
virtual void generate()=0
Called by setup() and (re-)generates the vertices for the drawn 3D-objects.
bool setup()
Call overridden method generate() after the shader program has been linked.
Definition Application.h:10