Gem Illuminator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GemRenderer Class Reference

The GemRenderer class renders all of our gems. For performance reasons the GemRenderer packs all gems and fakes instanced drawing. More...

#include <gemrenderer.h>

Public Member Functions

 GemRenderer ()
 
 ~GemRenderer ()
 
void cleanup (QOpenGLFunctions &gl)
 Cleans up all gpu resources. More...
 
void initialize (QOpenGLFunctions &gl)
 Initializes all gpu resources. More...
 
void paint (QOpenGLFunctions &gl, QOpenGLShaderProgram &program)
 paint Paints all gems using faked instanced drawing. More...
 
void setSceneExtent (float extent)
 Sets the scene extent, which is required to encode gem positions into byte textures. More...
 
void updateGem (AbstractGem *gem)
 Save given gem in order to update it later. More...
 

Protected Member Functions

void updateData (QOpenGLFunctions &gl)
 Updates previous added gem using updateGem() More...
 

Protected Attributes

bool m_areFloatTexturesAvailable
 
QHash< GemType, GemRenderData * > * m_gemBuffersTex
 
QHash< AbstractGem
*, GemDataInfo * > * 
m_gemMap
 
bool m_isGemBufferUpdateRequired
 
bool m_isGemDataBufferInvalid
 
bool m_isInitialized
 
QList< GemDataInfo * > * m_newGems
 
float m_sceneExtent
 

Detailed Description

The GemRenderer class renders all of our gems. For performance reasons the GemRenderer packs all gems and fakes instanced drawing.

Constructor & Destructor Documentation

GemRenderer::GemRenderer ( )
GemRenderer::~GemRenderer ( )

Member Function Documentation

void GemRenderer::cleanup ( QOpenGLFunctions &  gl)

Cleans up all gpu resources.

Parameters
glQOpenGLFunctions used to do gl-calls
void GemRenderer::initialize ( QOpenGLFunctions &  gl)

Initializes all gpu resources.

Parameters
glQOpenGLFunctions used to do gl-calls
void GemRenderer::paint ( QOpenGLFunctions &  gl,
QOpenGLShaderProgram &  program 
)

paint Paints all gems using faked instanced drawing.

Parameters
glQOpenGLFunctions used to do gl-calls
programThe program that is used for drawing gems.
void GemRenderer::setSceneExtent ( float  extent)

Sets the scene extent, which is required to encode gem positions into byte textures.

Parameters
extent
void GemRenderer::updateData ( QOpenGLFunctions &  gl)
protected

Updates previous added gem using updateGem()

Parameters
glQOpenGLFunctions used to do gl-calls
void GemRenderer::updateGem ( AbstractGem gem)

Save given gem in order to update it later.

Parameters
gemThe gem that should be updated (or added).
See also
updateData()

Member Data Documentation

bool GemRenderer::m_areFloatTexturesAvailable
protected
QHash<GemType, GemRenderData *>* GemRenderer::m_gemBuffersTex
protected
QHash<AbstractGem *, GemDataInfo *>* GemRenderer::m_gemMap
protected
bool GemRenderer::m_isGemBufferUpdateRequired
protected
bool GemRenderer::m_isGemDataBufferInvalid
protected
bool GemRenderer::m_isInitialized
protected
QList<GemDataInfo *>* GemRenderer::m_newGems
protected
float GemRenderer::m_sceneExtent
protected

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