Allolib  1.0
C++ Components For Interactive Multimedia
al::Graphics Class Reference

Interface for loading fonts and rendering text. More...

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/graphics/al_Graphics.hpp>

Inheritance diagram for al::Graphics:
al::RenderManager

Public Types

enum class  ColoringMode : unsigned int {
  UNIFORM , MESH , TEXTURE , MATERIAL ,
  CUSTOM
}
 

Public Member Functions

void bufferToDraw (unsigned int buffer)
 
void blending (bool doBlend)
 Turn blending on/off.
 
void blendMode (unsigned int src, unsigned int dst, unsigned int eq)
 
void blendAdd ()
 Set blend mode to additive (symmetric additive lighten)
 
void blendSub ()
 Set blend mode to subtractive (symmetric additive darken)
 
void blendScreen ()
 Set blend mode to screen (symmetric multiplicative lighten)
 
void blendMult ()
 Set blend mode to multiplicative (symmetric multiplicative darken)
 
void blendTrans ()
 Set blend mode to transparent (asymmetric)
 
void depthTesting (bool testDepth)
 Turn depth testing on/off.
 
void depthMask (bool maskDepth)
 Turn the depth mask on/off.
 
void scissorTest (bool testScissor)
 Turn scissor testing on/off.
 
void scissorArea (int left, int bottom, int width, int height)
 
void culling (bool doCulling)
 Turn face culling on/off.
 
void cullFace (unsigned int face)
 face=[GL_FRONT, GL_BACK, GL_FRONT_AND_BACK], initial: GL_BACK
 
void cullFaceBack ()
 
void cullFaceFront ()
 
void cullFaceBoth ()
 
void polygonMode (unsigned int mode)
 
void polygonPoint ()
 Draw only points of vertices.
 
void polygonLine ()
 Draw only edges of polygons with lines.
 
void polygonFill ()
 Draw filled polygons.
 
void colorMask (bool r, bool g, bool b, bool a)
 Turn color mask RGBA components on/off.
 
void colorMask (bool b)
 Turn color mask on/off (all RGBA components)
 
void pointSize (float size)
 
void lineWidth (float size)
 
void clearColor (float r, float g, float b, float a=1.f)
 
void clearColor (Color const &c)
 
void clearDepth (float d=1.f)
 
void clearBuffer (int buffer, float r, float g, float b, float a=1.f)
 
void clear (float r, float g, float b, float a=1.f)
 
void clear (float grayscale=0.f, float a=1.f)
 
void clear (Color const &c)
 
void init ()
 
void tint (Color const &c)
 
void tint (float r, float g, float b, float a=1.f)
 
void tint (float grayscale, float a=1.f)
 
void color ()
 
void color (float r, float g, float b, float a=1.f)
 
void color (Color const &c)
 
void color (float grayscale, float a=1.f)
 
void meshColor ()
 
void texture ()
 
void material ()
 
void material (Material const &m)
 
void lighting (bool b)
 
void numLight (int n)
 
void enableLight (int idx)
 
void disableLight (int idx)
 
void toggleLight (int idx)
 
void light (Light const &l, int idx=0)
 
void quad (Texture &tex, float x, float y, float w, float h)
 
void quadViewport (Texture &tex, float x=-1, float y=-1, float w=2, float h=2)
 
void shader (ShaderProgram &s)
 
ShaderProgramshader ()
 
ShaderProgramshaderPtr ()
 
void camera (Viewpoint const &v) override
 
void send_lighting_uniforms (ShaderProgram &s, lighting_shader_uniforms const &u)
 
void update () override
 
void eye (float e)
 
float eye ()
 
Lens const & lens () const
 
Lenslens ()
 
void lens (Lens const &l)
 
void omni (bool b)
 
bool omni ()
 
virtual void camera (Viewpoint const &v)
 
virtual void camera (Viewpoint::SpecialType v)
 
void multModelMatrix (const Matrix4f &m)
 Multiply current matrix.
 
void multViewMatrix (const Matrix4f &m)
 
void multProjMatrix (const Matrix4f &m)
 
Matrix4f modelMatrix () const
 
void modelMatrix (const Matrix4f &m)
 
Matrix4f viewMatrix () const
 
void viewMatrix (const Matrix4f &m)
 
Matrix4f projMatrix () const
 
void projMatrix (const Matrix4f &m)
 
void pushModelMatrix ()
 
void pushModelMatrix (const Matrix4f &m)
 
void pushViewMatrix ()
 
void pushViewMatrix (const Matrix4f &m)
 
void pushProjMatrix ()
 
void pushProjMatrix (const Matrix4f &m)
 
void popModelMatrix ()
 
void popViewMatrix ()
 
void popProjMatrix ()
 
void resetModelMatrixStack ()
 
void resetViewMatrixStack ()
 
void resetProjMatrixStack ()
 
void resetMatrixStack ()
 
void pushMatrix ()
 Push current matrix stack.
 
void pushMatrix (const Matrix4f &m)
 
void popMatrix ()
 Pop current matrix stack.
 
void loadIdentity ()
 Set current matrix to identity.
 
void translate (float x, float y, float z=0.)
 Translate current matrix.
 
template<class T >
void translate (const Vec< 3, T > &v)
 Translate current matrix.
 
template<class T >
void translate (const Vec< 2, T > &v)
 Translate current matrix.
 
void rotate (float angle, float x=0., float y=0., float z=1.)
 
void rotate (const Quatf &q)
 Rotate current matrix.
 
void rotate (const Quatd &q)
 Rotate current matrix.
 
template<class T >
void rotate (float angle, const Vec< 3, T > &axis)
 
void scale (float x, float y, float z=1.)
 Scale current matrix along each dimension.
 
void scale (float s)
 Scale current matrix uniformly.
 
template<class T >
void scale (const Vec< 3, T > &v)
 Scale current matrix along each dimension.
 
template<class T >
void scale (const Vec< 2, T > &v)
 Scale current matrix along each dimension.
 
void viewport (int left, int bottom, int width, int height)
 Set viewport.
 
void viewport (const Viewport &v)
 
Viewport viewport ()
 
void pushViewport ()
 
void pushViewport (int l, int b, int w, int h)
 
void pushViewport (const Viewport &v)
 
void pushViewport (int w, int h)
 
void popViewport ()
 
void framebuffer (EasyFBO &easyFBO)
 
void framebuffer (FBO &fbo)
 
void framebuffer (unsigned int id)
 
unsigned int framebuffer ()
 
void pushFramebuffer ()
 
void pushFramebuffer (EasyFBO &f)
 
void pushFramebuffer (FBO &f)
 
void pushFramebuffer (unsigned int f)
 
void popFramebuffer ()
 
virtual void camera (Viewpoint::SpecialType v)
 
void pushCamera ()
 
void pushCamera (Viewpoint const &v)
 
void pushCamera (Viewpoint::SpecialType v)
 
void popCamera ()
 
void draw (VAOMesh &mesh)
 
void draw (EasyVAO &vao)
 
void draw (const Mesh &mesh)
 
void draw (Mesh &&mesh)
 

Static Public Attributes

static const float LEFT_EYE
 
static const float RIGHT_EYE
 
static const float MONO_EYE
 

Protected Attributes

ShaderProgrammShaderPtr = nullptr
 
std::unordered_map< unsigned int, int > modelviewLocs
 
std::unordered_map< unsigned int, int > projLocs
 
bool mShaderChanged = false
 
MatrixStack mViewStack
 
MatrixStack mProjStack
 
MatrixStack mModelStack
 
bool mMatChanged = false
 
ViewportStack mViewportStack
 
EasyVAO mInternalVAO
 
FBOStack mFBOStack
 

Detailed Description

Interface for loading fonts and rendering text.

Definition at line 63 of file al_Graphics.hpp.

Member Function Documentation

◆ blendMode()

void al::Graphics::blendMode ( unsigned int  src,
unsigned int  dst,
unsigned int  eq 
)
inline

Set blend mode src,dst=[GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA] eq=[GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MIN, GL_MAX]

Definition at line 90 of file al_Graphics.hpp.

◆ bufferToDraw()

void al::Graphics::bufferToDraw ( unsigned int  buffer)
inline

buffer=[GL_NONE, GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT, GL_FRONT_AND_BACK]

Definition at line 78 of file al_Graphics.hpp.

◆ polygonMode()

void al::Graphics::polygonMode ( unsigned int  mode)
inline

Set polygon drawing mode mode=[GL_POINT, GL_LINE, GL_FILL] GL_FRONT and GL_BACK is deprecated in 3.2 core profile

Definition at line 132 of file al_Graphics.hpp.

◆ rotate() [1/2]

template<class T >
void al::RenderManager::rotate ( float  angle,
const Vec< 3, T > &  axis 
)
inlineinherited

Rotate current matrix

Parameters
[in]angleangle, in degrees
[in]axisrotation axis

Definition at line 213 of file al_RenderManager.hpp.

◆ rotate() [2/2]

void al::RenderManager::rotate ( float  angle,
float  x = 0.,
float  y = 0.,
float  z = 1. 
)
inherited

Rotate current matrix

Parameters
[in]angleangle, in degrees
[in]xx component of rotation axis
[in]yy component of rotation axis
[in]zz component of rotation axis

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