Description

Rendering classes and functions

Library containing classes and functions for 2D and 3D rendering. This library serves as an abstraction layer for a low-level graphics library (OpenGL,OpenGL ES 2.0).

Namespaces

   
namespace Rendering::Comparison
namespace Rendering::MeshUtils
Operations on meshes.
namespace Rendering::Serialization
Serialization functions for objects (meshes, textures etc.)
namespace Rendering::ShaderUtils
namespace Rendering::TextureUtils
namespace Rendering::VertexAttributeIds

Classes

   
class Rendering::AlphaTestParameters
Parameters of alpha test.
class Rendering::BlendingParameters
class Rendering::BufferObject
class Rendering::ClipPlaneParameters
class Rendering::ColorAttributeAccessor
class Rendering::ColorBufferParameters
Parameters of color buffer.
class Rendering::CoreRenderingStatus
class Rendering::CullFaceParameters
Parameters of front- or back-face culling.
class Rendering::DepthBufferParameters
Parameters of depth buffer.
class Rendering::FBO
class Rendering::FloatAttributeAccessor
class Rendering::ImageBindParameters
Controls the binding of an image (part of a texture) for load and store operations in the shader.
class Rendering::LightingParameters
Parameters of lighting.
class Rendering::LightParameters
class Rendering::LineParameters
Parameters of rasterized lines.
class Rendering::MaterialParameters
class Rendering::Mesh
class Rendering::MeshDataStrategy
class Rendering::MeshIndexData
class Rendering::MeshVertexData
class Rendering::NormalAttributeAccessor
class Rendering::OcclusionQuery
class Rendering::PBO
struct Rendering::PixelFormatGL
class Rendering::PointParameters
Parameters of rastered points.
class Rendering::PolygonModeParameters
class Rendering::PolygonOffsetParameters
Parameters of the polygon offset settings.
class Rendering::PositionAttributeAccessor
class Rendering::PrimitiveRestartParameters
class Rendering::QueryObject
class Rendering::RenderingContext
class Rendering::RenderingStatus
class Rendering::ScissorParameters
class Rendering::Shader
class Rendering::ShaderObjectInfo
class Rendering::SimpleMeshDataStrategy
class Rendering::StatisticsQuery
class Rendering::StencilParameters
Access to and modifcation of the stencil buffer.
class Rendering::TexCoordAttributeAccessor
class Rendering::TextRenderer
Text rendering using bitmap fonts.
class Rendering::Texture
class Rendering::UIntAttributeAccessor
class Rendering::Uniform
class Rendering::UniformRegistry
class Rendering::VertexAccessor
class Rendering::VertexAttributeAccessor
class Rendering::VertexDescription

Enumerations

   
   
enum TexUnitUsageParameter {GENERAL_PURPOSE, TEXTURE_MAPPING, DISABLED}
Determines the intended usage of a texture bound to a texture unit.
   
enum TextureType {TEXTURE_1D, TEXTURE_1D_ARRAY, TEXTURE_2D, TEXTURE_2D_ARRAY, TEXTURE_3D, TEXTURE_CUBE_MAP, TEXTURE_CUBE_MAP_ARRAY, TEXTURE_BUFFER, TEXTURE_2D_MULTISAMPLE}

Typedefs

   
   
typedef Util::CountedObjectWrapper < BufferObject > CountedBufferObject
   
typedef Util::AttributeFormat VertexAttribute

Variables

   
   
const uint8_t MAX_CLIP_PLANES
   
const uint8_t MAX_BOUND_IMAGES
   
const uint8_t MAX_TEXTURES

Functions

   
   
void drawAbsBox( RenderingContext & rc, const Geometry::Box & box)
   
void drawAbsBox( RenderingContext & rc, const Geometry::Box & box, const Util::Color4f & color)
   
void drawAbsWireframeBox( RenderingContext & rc, const Geometry::Box & box)
   
void drawAbsWireframeBox( RenderingContext & rc, const Geometry::Box & box, const Util::Color4f & color)
   
void drawBox( RenderingContext & rc, const Geometry::Box & box)
   
void drawBox( RenderingContext & rc, const Geometry::Box & box, const Util::Color4f & color)
   
void drawWireframeBox( RenderingContext & rc, const Geometry::Box & box)
   
void drawWireframeBox( RenderingContext & rc, const Geometry::Box & box, const Util::Color4f & color)
   
void drawWireframeSphere( RenderingContext & rc, const Geometry::Sphere & sphere)
   
void drawWireframeSphere( RenderingContext & rc, const Geometry::Sphere & sphere, const Util::Color4f & color)
   
void drawFastAbsBox( RenderingContext & rc, const Geometry::Box & box)
   
void drawFullScreenRect( RenderingContext & rc)
   
void drawQuad( RenderingContext & rc, const Geometry::Vec3f & lowerLeft, const Geometry::Vec3f & lowerRight, const Geometry::Vec3f & upperRight, const Geometry::Vec3f & upperLeft)
   
void drawQuad( RenderingContext & rc, const Geometry::Vec3f & lowerLeft, const Geometry::Vec3f & lowerRight, const Geometry::Vec3f & upperRight, const Geometry::Vec3f & upperLeft, const Util::Color4f & color)
   
void drawWireframeRect( RenderingContext & rc, const Geometry::Rect & rect)
   
void drawWireframeRect( RenderingContext & rc, const Geometry::Rect & rect, const Util::Color4f & color)
   
void drawRect( RenderingContext & rc, const Geometry::Rect & rect)
   
void drawRect( RenderingContext & rc, const Geometry::Rect & rect, const Util::Color4f & color)
   
void drawWireframeCircle( RenderingContext & rc, const Geometry::Vec2f & center, float radius)
   
void drawWireframeCircle( RenderingContext & rc, const Geometry::Vec2f & center, float radius, const Util::Color4f & color)
   
void drawTriangle( RenderingContext & rc, const Geometry::Vec3f & vertexA, const Geometry::Vec3f & vertexB, const Geometry::Vec3f & vertexC)
   
void drawVector( RenderingContext & rc, const Geometry::Vec3f & from, const Geometry::Vec3f & to)
   
void drawVector( RenderingContext & rc, const Geometry::Vec3f & from, const Geometry::Vec3f & to, const Util::Color4f & color)
   
void drawVector( RenderingContext & rc, const Geometry::Vec3f & from, const Geometry::Vec3f & to, const Util::Color4f & color1, const Util::Color4f & color2)
   
void enable2DMode( RenderingContext & rc)
   
void enable2DMode( RenderingContext & rc, const Geometry::Rect_i & screenRect)
   
void disable2DMode( RenderingContext & rc)
Reset the projection and modelview matrices to the state before the last call to enable2DMode() .
   
void enableInstanceBuffer( RenderingContext & rc, BufferObject & instanceBuffer, int32_t location, uint32_t elements)
   
void disableInstanceBuffer( RenderingContext & rc, BufferObject & instanceBuffer, int32_t location, uint32_t elements)
   
void drawInstances( RenderingContext & rc, Mesh * m, uint32_t firstElement, uint32_t elementCount, uint32_t instanceCount)
   
void drawCamera( RenderingContext & rc, const Util::Color4f & color)
Draw a symbolized camera using the given rendering context, and color.
   
void drawCoordSys( RenderingContext & rc, float scale)
   
void drawFrustum( RenderingContext & rc, const Geometry::Frustum & frustum, const Util::Color4f & color, float lineWidth)
Draw the given frustum as lines using the given rendering context, color, and line width.
   
void drawGrid( RenderingContext & rc, float scale)
   
void enableGLErrorChecking()
   
void disableGLErrorChecking()
   
void checkGLError(const char * file, int line)
   
const char * getGLTypeString(uint32_t type)
   
uint32_t getGLTypeSize(uint32_t type)
   
uint32_t getGLType( Util::TypeConstant type)
   
Util::TypeConstant getAttributeType(uint32_t glType)
   
void outputGLInformation(std::ostream & output)
   
const char * getGraphicsLanguageVersion()
   
const char * getShadingLanguageVersion()
   
bool isExtensionSupported(const char * extension)
   
float readDepthValue(int32_t x, int32_t y)
   
void enableDebugOutput()
   
void disableDebugOutput()
   
void pushDebugGroup(const std::string & name)
   
void popDebugGroup()
   
void triggerCapture()
   
void startCapture()
   
void endCapture()

Documentation

enum
Rendering::TexUnitUsageParameter

public
 
 
enum TexUnitUsageParameter
Enumerator   Description
Enumerator   Description
GENERAL_PURPOSE   The texture is not used for texturing. When using legacy OpenGL, the corresponding state is disabled (see, e.g., the parameterGL_TEXTURE_2DofglDisable) for the corresponding unit (seeglActiveTexture). If a shader is used, the corresponding uniformsg_textureEnabled[unit] is set tofalse.
TEXTURE_MAPPING   The texture is used for texturing mapping using per vertex texture coordinates. When using legacy OpenGL, the corresponding state is enabled (see the parameterGL_TEXTURE_1D/2D/3DofglEnable) for the corresponding unit (seeglActiveTexture). If a shader is used, the corresponding uniformsg_textureEnabled[unit] is set totrue.
DISABLED   No Texture is bound to the texture unit.

Determines the intended usage of a texture bound to a texture unit.

Defined in Rendering/RenderingContext/RenderingParameters.h:1059


enum
Rendering::TextureType

public
 
 
enum TextureType
Enumerator   Description
Enumerator   Description
TEXTURE_1D = 0  
TEXTURE_1D_ARRAY = 1  
TEXTURE_2D = 2  
TEXTURE_2D_ARRAY = 3  
TEXTURE_3D = 4  
TEXTURE_CUBE_MAP = 5  
TEXTURE_CUBE_MAP_ARRAY = 6  
TEXTURE_BUFFER = 7  
TEXTURE_2D_MULTISAMPLE = 8  

A Texture ‘s type. (Corresponds to ‘glTextureType’, but the actual value is independent from OpenGL.

Note: Value assignment must never change! (they may be used for serialization)

Defined in Rendering/Texture/TextureType.h:20


typedef
Rendering::CountedBufferObject

public
 
 
typedef Util::CountedObjectWrapper < BufferObject > CountedBufferObject

Defined in Rendering/BufferObject.h:177


typedef
Rendering::VertexAttribute

public
 
 
typedef Util::AttributeFormat VertexAttribute

Defined in Rendering/Mesh/VertexAttribute.h:17


variable
Rendering::MAX_CLIP_PLANES

public static
 
 
const uint8_t MAX_CLIP_PLANES

Defined in Rendering/RenderingContext/RenderingParameters.h:314


variable
Rendering::MAX_BOUND_IMAGES

public static
 
 
const uint8_t MAX_BOUND_IMAGES

Defined in Rendering/RenderingContext/RenderingParameters.h:529


variable
Rendering::MAX_TEXTURES

public static
 
 
const uint8_t MAX_TEXTURES

Defined in Rendering/RenderingContext/RenderingParameters.h:1081


function
Rendering::drawAbsBox

public
     
     
void drawAbsBox( RenderingContext & rc,
  const Geometry::Box & box
)    

Defined in Rendering/Draw.h:62


function
Rendering::drawAbsBox

public
     
     
void drawAbsBox( RenderingContext & rc,
  const Geometry::Box & box,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:63


function
Rendering::drawAbsWireframeBox

public
     
     
void drawAbsWireframeBox( RenderingContext & rc,
  const Geometry::Box & box
)    

Defined in Rendering/Draw.h:64


function
Rendering::drawAbsWireframeBox

public
     
     
void drawAbsWireframeBox( RenderingContext & rc,
  const Geometry::Box & box,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:65


function
Rendering::drawBox

public
     
     
void drawBox( RenderingContext & rc,
  const Geometry::Box & box
)    

Defined in Rendering/Draw.h:66


function
Rendering::drawBox

public
     
     
void drawBox( RenderingContext & rc,
  const Geometry::Box & box,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:67


function
Rendering::drawWireframeBox

public
     
     
void drawWireframeBox( RenderingContext & rc,
  const Geometry::Box & box
)    

Defined in Rendering/Draw.h:68


function
Rendering::drawWireframeBox

public
     
     
void drawWireframeBox( RenderingContext & rc,
  const Geometry::Box & box,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:69


function
Rendering::drawWireframeSphere

public
     
     
void drawWireframeSphere( RenderingContext & rc,
  const Geometry::Sphere & sphere
)    

Defined in Rendering/Draw.h:70


function
Rendering::drawWireframeSphere

public
     
     
void drawWireframeSphere( RenderingContext & rc,
  const Geometry::Sphere & sphere,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:71


function
Rendering::drawFastAbsBox

public
     
     
void drawFastAbsBox( RenderingContext & rc,
  const Geometry::Box & box
)    

Note: Because OpenGL immediate mode is used inside this function, the caller has to make sure that RenderingContext::applyChanges() is called before.

Defined in Rendering/Draw.h:77


function
Rendering::drawFullScreenRect

public
     
     
void drawFullScreenRect( RenderingContext & rc )

Defined in Rendering/Draw.h:80


function
Rendering::drawQuad

public
     
     
void drawQuad( RenderingContext & rc,
  const Geometry::Vec3f & lowerLeft,
  const Geometry::Vec3f & lowerRight,
  const Geometry::Vec3f & upperRight,
  const Geometry::Vec3f & upperLeft
)    

Draw a quadrilateral in three-dimensional space. The quadrilateral is given by four points. Positions, normals and texture coordinates are generated for the vertices.

Defined in Rendering/Draw.h:86


function
Rendering::drawQuad

public
     
     
void drawQuad( RenderingContext & rc,
  const Geometry::Vec3f & lowerLeft,
  const Geometry::Vec3f & lowerRight,
  const Geometry::Vec3f & upperRight,
  const Geometry::Vec3f & upperLeft,
  const Util::Color4f & color
)    

Set the current color and draw a quadrilateral in three-dimensional space.

See also: drawQuad

Defined in Rendering/Draw.h:92


function
Rendering::drawWireframeRect

public
     
     
void drawWireframeRect( RenderingContext & rc,
  const Geometry::Rect & rect
)    

Defined in Rendering/Draw.h:94


function
Rendering::drawWireframeRect

public
     
     
void drawWireframeRect( RenderingContext & rc,
  const Geometry::Rect & rect,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:95


function
Rendering::drawRect

public
     
     
void drawRect( RenderingContext & rc,
  const Geometry::Rect & rect
)    

Defined in Rendering/Draw.h:97


function
Rendering::drawRect

public
     
     
void drawRect( RenderingContext & rc,
  const Geometry::Rect & rect,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:98


function
Rendering::drawWireframeCircle

public
     
     
void drawWireframeCircle( RenderingContext & rc,
  const Geometry::Vec2f & center,
  float radius
)    

Defined in Rendering/Draw.h:100


function
Rendering::drawWireframeCircle

public
     
     
void drawWireframeCircle( RenderingContext & rc,
  const Geometry::Vec2f & center,
  float radius,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:101


function
Rendering::drawTriangle

public
     
     
void drawTriangle( RenderingContext & rc,
  const Geometry::Vec3f & vertexA,
  const Geometry::Vec3f & vertexB,
  const Geometry::Vec3f & vertexC
)    

Draw a triangle in three-dimensional space. The triangle is given by three points. Positions are generated for the vertices only.

Defined in Rendering/Draw.h:108


function
Rendering::drawVector

public
     
     
void drawVector( RenderingContext & rc,
  const Geometry::Vec3f & from,
  const Geometry::Vec3f & to
)    

Defined in Rendering/Draw.h:110


function
Rendering::drawVector

public
     
     
void drawVector( RenderingContext & rc,
  const Geometry::Vec3f & from,
  const Geometry::Vec3f & to,
  const Util::Color4f & color
)    

Defined in Rendering/Draw.h:111


function
Rendering::drawVector

public
     
     
void drawVector( RenderingContext & rc,
  const Geometry::Vec3f & from,
  const Geometry::Vec3f & to,
  const Util::Color4f & color1,
  const Util::Color4f & color2
)    

Defined in Rendering/Draw.h:112


function
Rendering::enable2DMode

public
     
     
void enable2DMode( RenderingContext & rc )

Set the projection and modelview matrices to enable drawing in screen space.

Note: The state before the call is saved. Call disable2DMode() to restore it.

Defined in Rendering/Draw.h:119


function
Rendering::enable2DMode

public
     
     
void enable2DMode( RenderingContext & rc,
  const Geometry::Rect_i & screenRect
)    

Defined in Rendering/Draw.h:120


function
Rendering::disable2DMode

public
     
     
void disable2DMode( RenderingContext & rc )

Reset the projection and modelview matrices to the state before the last call to enable2DMode() .

Defined in Rendering/Draw.h:123


function
Rendering::enableInstanceBuffer

public
     
     
void enableInstanceBuffer( RenderingContext & rc,
  BufferObject & instanceBuffer,
  int32_t location,
  uint32_t elements
)    

Defined in Rendering/Draw.h:125


function
Rendering::disableInstanceBuffer

public
     
     
void disableInstanceBuffer( RenderingContext & rc,
  BufferObject & instanceBuffer,
  int32_t location,
  uint32_t elements
)    

Defined in Rendering/Draw.h:126


function
Rendering::drawInstances

public
     
     
void drawInstances( RenderingContext & rc,
  Mesh * m,
  uint32_t firstElement,
  uint32_t elementCount,
  uint32_t instanceCount
)    

Defined in Rendering/Draw.h:127


function
Rendering::drawCamera

public
     
     
void drawCamera( RenderingContext & rc,
  const Util::Color4f & color
)    

Draw a symbolized camera using the given rendering context, and color.

Defined in Rendering/DrawCompound.h:37


function
Rendering::drawCoordSys

public
     
     
void drawCoordSys( RenderingContext & rc,
  float scale
)    

Defined in Rendering/DrawCompound.h:39


function
Rendering::drawFrustum

public
     
     
void drawFrustum( RenderingContext & rc,
  const Geometry::Frustum & frustum,
  const Util::Color4f & color,
  float lineWidth
)    

Draw the given frustum as lines using the given rendering context, color, and line width.

Defined in Rendering/DrawCompound.h:42


function
Rendering::drawGrid

public
     
     
void drawGrid( RenderingContext & rc,
  float scale
)    

Defined in Rendering/DrawCompound.h:44


function
Rendering::enableGLErrorChecking

public
   
   
void enableGLErrorChecking( )

Defined in Rendering/Helper.h:27


function
Rendering::disableGLErrorChecking

public
   
   
void disableGLErrorChecking( )

Defined in Rendering/Helper.h:28


function
Rendering::checkGLError

public
     
     
void checkGLError( const char * file,
  int line
)    

Defined in Rendering/Helper.h:29


function
Rendering::getGLTypeString

public
     
     
const char * getGLTypeString( uint32_t type )

Return a human-readable description for the given OpenGL type.

Parameters

type
Valid values are GL_BOOL, GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, and GL_DOUBLE.

Returns

String description of the type, or an empty string if the type is invalid.

Defined in Rendering/Helper.h:37


function
Rendering::getGLTypeSize

public
     
     
uint32_t getGLTypeSize( uint32_t type )

Return the size of the given OpenGL type.

Parameters

type
Valid values are GL_BOOL, GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, and GL_DOUBLE.

Returns

Size in bytes, or zero if the type is invalid.

Defined in Rendering/Helper.h:45


function
Rendering::getGLType

public
     
     
uint32_t getGLType( Util::TypeConstant type )

Returns the OpenGL type for the given resource attribute type.

Parameters

type
the attribute type (e.g., TypeConstant).

Returns

The corresponding OpenGL type constant.

Defined in Rendering/Helper.h:53


function
Rendering::getAttributeType

public
     
     
Util::TypeConstant getAttributeType( uint32_t glType )

Returns the resource attribute type for the given OpenGL type.

Parameters

type
the OpenGL type.

Returns

The corresponding attribute type.

Defined in Rendering/Helper.h:61


function
Rendering::outputGLInformation

public
     
     
void outputGLInformation( std::ostream & output )

Write information about the current OpenGL context to the given stream.

Parameters

output
Output stream that the data is written to

See also: glGetString

Defined in Rendering/Helper.h:69


function
Rendering::getGraphicsLanguageVersion

public
   
   
const char * getGraphicsLanguageVersion( )

Return the supported graphics language version.

Returns

Null-terminated string containing the supported graphics language version

See also: constantGL_VERSIONof functionglGetString

See also: glewIsSupported

Defined in Rendering/Helper.h:78


function
Rendering::getShadingLanguageVersion

public
   
   
const char * getShadingLanguageVersion( )

Return the supported shading language version.

Returns

Null-terminated string containing the supported shading language version

See also: constantGL_SHADING_LANGUAGE_VERSIONof functionglGetString

Defined in Rendering/Helper.h:86


function
Rendering::isExtensionSupported

public
     
     
bool isExtensionSupported( const char * extension )

Check for support of a specific OpenGL extension.

Parameters

extension
Null-terminated string containing the name of the requested extension

Returns

trueif the requested extension is supported,falseotherwise.

See also: glewIsSupported

Defined in Rendering/Helper.h:95


function
Rendering::readDepthValue

public
     
     
float readDepthValue( int32_t x,
  int32_t y
)    

Read a single value from the depth buffer.

See also: glReadPixels

Defined in Rendering/Helper.h:102


function
Rendering::enableDebugOutput

public
   
   
void enableDebugOutput( )

Enable debug output that can be used to find errors or performance problems.

See also: OpenGL extensionGL_ARB_debug_output

Defined in Rendering/Helper.h:109


function
Rendering::disableDebugOutput

public
   
   
void disableDebugOutput( )

Disable the debug output again.

See also: enableDebugOutput()

Defined in Rendering/Helper.h:116


function
Rendering::pushDebugGroup

public
     
     
void pushDebugGroup( const std::string & name )

Push a named debug group into the command stream

Parameters

name
Name of the debug group

See also: glPushDebugGroup

Defined in Rendering/Helper.h:124


function
Rendering::popDebugGroup

public
   
   
void popDebugGroup( )

Pop the active debug group

See also: glPopDebugGroup

Defined in Rendering/Helper.h:130


function
Rendering::triggerCapture

public
   
   
void triggerCapture( )

Triggers a capture of the current GL state in RenderDoc.

Note: Requires RenderDoc

Defined in Rendering/Helper.h:136


function
Rendering::startCapture

public
   
   
void startCapture( )

Starts capturing of the GL state in RenderDoc.

Note: Requires RenderDoc

Defined in Rendering/Helper.h:142


function
Rendering::endCapture

public
   
   
void endCapture( )

Ends the active capture.

Note: Requires RenderDoc

Defined in Rendering/Helper.h:148