Developer Documentation
ACG::GLState Class Reference

#include <ACG/Scenegraph/GLState.hh>

Public Member Functions

 GLState (bool _updateGL=true, bool _compatibilityProfile=true)
 Default constructor. More...
 
 ~GLState ()
 destructor More...
 
void makeCurrent ()
 does nothing More...
 
void initialize ()
 initialize all state variables (called by constructor) More...
 
bool updateGL () const
 should GL matrices be updated after each matrix operation More...
 
void set_updateGL (bool _b)
 should GL matrices be updated after each matrix operation More...
 
unsigned int msSinceLastRedraw () const
 time passed since last redraw in milliseconds More...
 
void set_msSinceLastRedraw (unsigned int _ms)
 set time passed since last redraw in milliseconds More...
 
void setState ()
 set the whole stored gl state More...
 
void clearBuffers ()
 clear buffers viewport rectangle More...
 
const GLenum & depthFunc () const
 get glDepthFunc() that is supposed to be active More...
 
void set_depthFunc (const GLenum &_depth_func)
 Call glDepthFunc() to actually change the depth comparison function, and store the new value in this GLState. More...
 
Vec3d project (const Vec3d &_point) const
 project point in world coordinates to window coordinates More...
 
Vec3d unproject (const Vec3d &_winPoint) const
 unproject point in window coordinates _winPoint to world coordinates More...
 
void set_color (const Vec4f &_col)
 set color More...
 
const Vec4fcolor ()
 set color More...
 
void set_clear_color (const Vec4f &_col)
 set background color More...
 
const Vec4fclear_color () const
 get background color More...
 
void set_base_color (const Vec4f &_col)
 set base color (used when lighting is off) More...
 
const Vec4fbase_color () const
 get base color (used when lighting is off) More...
 
void set_ambient_color (const Vec4f &_col)
 set ambient color More...
 
const Vec4fambient_color () const
 get ambient color More...
 
void set_diffuse_color (const Vec4f &_col)
 set diffuse color More...
 
const Vec4fdiffuse_color () const
 get diffuse color More...
 
void set_specular_color (const Vec4f &_col)
 set specular color More...
 
const Vec4fspecular_color () const
 get specular color More...
 
void set_overlay_color (const Vec4f &_col)
 set overlay color More...
 
const Vec4foverlay_color () const
 Get overlay color. More...
 
void set_shininess (float _shininess)
 set specular shininess (must be in [0, 128]) More...
 
float shininess () const
 get specular shininess (must be in [0, 128]) More...
 
void set_point_size (float _f)
 set point size More...
 
float point_size () const
 get point size More...
 
void set_line_width (float _f)
 set line width More...
 
float line_width () const
 get line width More...
 
void set_blending (bool _b)
 set whether transparent or solid objects should be drawn More...
 
bool blending ()
 get whether transparenet or solid objects should be drawn More...
 
void set_twosided_lighting (bool _b)
 set whether transparent or solid objects should be drawn More...
 
bool twosided_lighting ()
 get whether transparenet or solid objects should be drawn More...
 
void set_multisampling (bool _b)
 Enable or disable multisampling. More...
 
bool multisampling ()
 Get current multisampling state. More...
 
void allow_multisampling (bool _b)
 Disable multisampling globally. More...
 
bool multisampling_allowed ()
 Check if Multisampling is globally disabled. More...
 
int max_texture_units () const
 Get max number of available texture units. More...
 
void allow_mipmapping (bool _b)
 Allow mipmapping globally. More...
 
bool mipmapping_allowed () const
 Get current global mipmapping state. More...
 
void pick_init (bool _color)
 initialize name/color picking stack (like glInitNames()) More...
 
bool pick_set_maximum (size_t _idx)
 Set the maximal number of primitives/components of your object. More...
 
void pick_set_name (size_t _idx)
 sets the current name/color (like glLoadName(_idx)) More...
 
Vec4uc pick_get_name_color (size_t _idx)
 
Vec4f pick_get_name_color_norm (unsigned int _idx)
 same as pick_get_name_color, but the resulting color channels are normalized in [0.0, 1.0] range More...
 
void pick_push_name (size_t _idx)
 creates a new name the stack (like glPushName()) More...
 
void pick_pop_name ()
 pops the current name from the stack (like glPopName()) More...
 
std::vector< size_t > pick_color_to_stack (Vec4uc _rgba) const
 
size_t pick_free_indicies () const
 returns the number of still available colors during color picking More...
 
bool pick_error () const
 
size_t pick_current_index () const
 Returns the current color picking index (can be used for caching) More...
 
bool color_picking () const
 Is color picking active? More...
 
set GL projection matrix
void reset_projection ()
 reset projection matrix (load identity) More...
 
void set_projection (const GLMatrixd &_m)
 set projection More...
 
void set_projection (const GLMatrixd &_m, const GLMatrixd &_inv_m)
 set projection and provide inverse projection matrix More...
 
void ortho (double _left, double _right, double _bottom, double _top, double _near_plane, double _far_plane)
 orthographic projection More...
 
void frustum (double _left, double _right, double _bottom, double _top, double _near_plane, double _far_plane)
 perspective projection More...
 
void perspective (double _fovY, double _aspect, double _near_plane, double _far_plane)
 perspective projection More...
 
void viewport (int _left, int _bottom, int _width, int _height, int _glwidth=0, int _glheight=0)
 set viewport (lower left corner, width, height, glcontext width, height) More...
 
set GL modelview matrix
void reset_modelview ()
 reset modelview matrix (load identity) More...
 
void set_modelview (const GLMatrixd &_m)
 set modelview More...
 
void set_modelview (const GLMatrixd &_m, const GLMatrixd &_inv_m)
 set modelview and provide inverse modelview matrix More...
 
void lookAt (const Vec3d &_eye, const Vec3d &_center, const Vec3d &_up)
 set camera by lookAt More...
 
void translate (double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
 translate by (_x, _y, _z) More...
 
void translate (Vec3d _vector, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
 translate by _vector More...
 
void rotate (double _angle, double _x, double _y, double _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
 rotate around axis (_x, _y, _z) by _angle More...
 
void scale (double _s)
 scale by (_s, _s, _s) More...
 
void scale (double _s, MultiplyFrom)
 scale by (_s, _s, _s) More...
 
void scale (double _sx, double _sy, double _sz, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
 scale by (_sx, _sy, _sz) More...
 
void mult_matrix (const GLMatrixd &_m, const GLMatrixd &_inv_m, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
 multiply by a given transformation matrix More...
 
void push_projection_matrix ()
 push projection matrix More...
 
void pop_projection_matrix ()
 pop projection matrix More...
 
void push_modelview_matrix ()
 push modelview matrix More...
 
void pop_modelview_matrix ()
 pop modelview matrix More...
 
get GL states, matrices and projection details
const GLMatrixdprojection () const
 get projection matrix More...
 
const GLMatrixdmodelview () const
 get modelview matrix More...
 
const GLMatrixdviewport () const
 get viewport matrix More...
 
GLMatrixd forward_projection () const
 get forward projection matrix More...
 
const GLMatrixdinverse_projection () const
 get inverse projection matrix More...
 
const GLMatrixdinverse_modelview () const
 get inverse modelview matrix More...
 
void get_viewport (int &_left, int &_bottom, int &_width, int &_height) const
 get viewport More...
 
int viewport_width () const
 get viewport width More...
 
int viewport_height () const
 get viewport height More...
 
int context_width () const
 get gl context width More...
 
int context_height () const
 get gl context height More...
 
double near_plane () const
 get near clipping distance More...
 
double far_plane () const
 get far clipping distance More...
 
double fovy () const
 get field of view in y direction More...
 
double aspect () const
 get aspect ratio More...
 
Vec3d eye () const
 get eye point More...
 
Vec3d viewing_direction () const
 get viewing ray More...
 
Vec3d viewing_direction (int _x, int _y) const
 get viewing ray through pixel (_x,_y) More...
 
Vec3d up () const
 get up-vector w.r.t. camera coordinates More...
 
Vec3d right () const
 get right-vector w.r.t. camera coordinates More...
 
void viewing_ray (int _x, int _y, Vec3d &_origin, Vec3d &_direction) const
 

Static Public Member Functions

static void syncFromGL ()
 synchronize this class with the OpenGL state machine More...
 
static void depthFunc (GLenum _depthFunc)
 replaces glDepthFunc, supports locking (called in set_depthFunc too) More...
 
static void lockDepthFunc ()
 
static void unlockDepthFunc ()
 
static bool isDepthFuncLocked ()
 
glEnable / glDisable functionality
static void enable (GLenum _cap, bool _warnRemoved=true)
 replaces glEnable, but supports locking More...
 
static void disable (GLenum _cap, bool _warnRemoved=true)
 replaces glDisable, but supports locking More...
 
static void lockState (GLenum _cap)
 locks a specific cap state, such that enable() or disable() has no effect More...
 
static void unlockState (GLenum _cap)
 unlocks a specific cap state More...
 
static bool isStateLocked (GLenum _cap)
 returns true, if a cap state is locked More...
 
static bool isStateEnabled (GLenum _cap)
 returns true, if a cpa state is enabled More...
 
static void enableClientState (GLenum _cap)
 replaces glEnableClientState, supports locking More...
 
static void disableClientState (GLenum _cap)
 replaces glDisableClientState, supports locking More...
 
static void lockClientState (GLenum _cap)
 locks a client state More...
 
static void unlockClientState (GLenum _cap)
 unlocks a client state More...
 
static bool isClientStateEnabled (GLenum _cap)
 returns true, if a client state is enabled More...
 
static bool isClientStateLocked (GLenum _cap)
 returns true, if a client state is locked More...
 
static void blendFunc (GLenum _sfactor, GLenum _dfactor)
 replaces glBlendFunc, supports locking More...
 
static void getBlendFunc (GLenum *_sfactor, GLenum *_dfactor)
 get blend function, null-ptr safe More...
 
static void lockBlendFunc ()
 lock blend func More...
 
static void unlockBlendFunc ()
 unlock blend func More...
 
static bool isBlendFuncLocked ()
 get blend func locking state More...
 
static void blendFuncSeparate (GLenum _srcRGB, GLenum _dstRGB, GLenum _srcAlpha, GLenum _dstAlpha)
 replaces glBlendFuncSeparate, supports locking More...
 
static void getBlendFuncSeparate (GLenum *_srcRGB, GLenum *_dstRGB, GLenum *_srcAlpha, GLenum *_dstAlpha)
 get blend function, null-ptr safe More...
 
static void lockBlendFuncSeparate (bool _rgb=true, bool _alpha=true)
 lock blend func More...
 
static void unlockBlendFuncSeparate ()
 unlock blend func More...
 
static bool isBlendFuncSeparateLocked ()
 get blend func locking state More...
 
static bool isBlendFuncSeparateColorLocked ()
 replaces glEnable, but supports locking More...
 
static bool isBlendFuncSeparateAlphaLocked ()
 replaces glEnable, but supports locking More...
 
static void blendEquation (GLenum _mode)
 replaces glBlendEquation, supports locking More...
 
static GLenum getBlendEquation ()
 get blend equation More...
 
static void lockBlendEquation ()
 lock blend equation More...
 
static void unlockBlendEquation ()
 unlock blend equation More...
 
static bool isBlendEquationLocked ()
 get blend equation locking state More...
 
static void blendColor (GLclampf _red, GLclampf _green, GLclampf _blue, GLclampf _alpha)
 replaces glBlendColor, supports locking More...
 
static void getBlendColor (GLclampf *_col)
 get blend color, not null-ptr safe, 4 element color output: RGBA More...
 
static void lockBlendColor ()
 lock blend color More...
 
static void unlockBlendColor ()
 unlock blend color More...
 
static bool isBlendColorLocked ()
 get blend color locking state More...
 
static void alphaFunc (GLenum _func, GLclampf _ref)
 replaces glAlphaFunc, supports locking More...
 
static void getAlphaFunc (GLenum *_func, GLclampf *_ref)
 get alpha function, null-ptr safe More...
 
static void lockAlphaFunc ()
 lock alpha func More...
 
static void unlockAlphaFunc ()
 unlock alpha func More...
 
static bool isAlphaFuncLocked ()
 get alpha func locking state More...
 
static void shadeModel (GLenum _mode)
 replaces glShadeModel, supports locking More...
 
static GLenum getShadeModel ()
 get current shade model More...
 
static void lockShadeModel ()
 lock shade model More...
 
static void unlockShadeModel ()
 unlock shade model More...
 
static bool isShadeModelLocked ()
 get shade model locking state More...
 
static void cullFace (GLenum _mode)
 replaces glCullFace, supports locking More...
 
static GLenum getCullFace ()
 get current cull face More...
 
static void lockCullFace ()
 lock cull face More...
 
static void unlockCullFace ()
 unlock cull face More...
 
static bool isCullFaceLocked ()
 get cull face locking state More...
 
static void depthRange (GLclampd _zNear, GLclampd _zFar)
 replaces glDepthRange, supports locking More...
 
static void getDepthRange (GLclampd *_zNearOut, GLclampd *_zFarOut)
 get current depth range More...
 
static void lockDepthRange ()
 lock depth range More...
 
static void unlockDepthRange ()
 unlock depth range More...
 
static bool isDepthRangeLocked ()
 get depth range locking state More...
 
GL vertex pointers
static void vertexPointer (GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
 replaces glVertexPointer, supports locking More...
 
static void getVertexPointer (GLint *_size, GLenum *_type, GLsizei *_stride, const GLvoid **_pointer)
 get vertex pointer, null-ptr safe More...
 
static void vertexPointer (const Vec2f *_p)
 Wrapper: glVertexPointer for Vec2f. More...
 
static void vertexPointer (const Vec2d *_p)
 Wrapper: glVertexPointer for Vec2d. More...
 
static void vertexPointer (const Vec3f *_p)
 Wrapper: glVertexPointer for Vec3f. More...
 
static void vertexPointer (const Vec3d *_p)
 Wrapper: glVertexPointer for Vec3d. More...
 
static void vertexPointer (const Vec4f *_p)
 Wrapper: glVertexPointer for Vec4f. More...
 
static void vertexPointer (const Vec4d *_p)
 Wrapper: glVertexPointer for Vec4d. More...
 
static void lockVertexPointer ()
 lock vertex pointer More...
 
static void unlockVertexPointer ()
 unlock vertex pointer More...
 
static bool isVertexPointerLocked ()
 get vertex pointer lock state More...
 
static void normalPointer (GLenum _type, GLsizei _stride, const GLvoid *_pointer)
 replaces glNormalPointer, supports locking More...
 
static void getNormalPointer (GLenum *_type, GLsizei *_stride, const GLvoid **_pointer)
 get normal pointer, null-ptr safe More...
 
static void normalPointer (const Vec3f *_p)
 Wrapper: glNormalPointer for Vec3f. More...
 
static void normalPointer (const Vec3d *_p)
 Wrapper: glNormalPointer for Vec3d. More...
 
static void lockNormalPointer ()
 lock normal pointer More...
 
static void unlockNormalPointer ()
 unlock normal pointer More...
 
static bool isNormalPointerLocked ()
 get normal pointer lock state More...
 
static void colorPointer (GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
 replaces glColorPointer, supports locking More...
 
static void getColorPointer (GLint *_size, GLenum *_type, GLsizei *_stride, const GLvoid **_pointer)
 get color pointer, null-ptr safe More...
 
static void colorPointer (const Vec3uc *_p)
 Wrapper: glColorPointer for Vec3uc. More...
 
static void colorPointer (const Vec3f *_p)
 Wrapper: glColorPointer for Vec3f. More...
 
static void colorPointer (const Vec4uc *_p)
 Wrapper: glColorPointer for Vec4uc. More...
 
static void colorPointer (const Vec4f *_p)
 Wrapper: glColorPointer for Vec4f. More...
 
static void lockColorPointer ()
 lock color pointer More...
 
static void unlockColorPointer ()
 unlock vertex pointer More...
 
static bool isColorPointerLocked ()
 get vertex pointer lock state More...
 
static void texcoordPointer (GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
 replaces glTexcoordPointer, supports locking More...
 
static void getTexcoordPointer (GLint *_size, GLenum *_type, GLsizei *_stride, const GLvoid **_pointer)
 get color pointer, null-ptr safe More...
 
static void texcoordPointer (const float *_p)
 Wrapper: glTexcoordPointer for float. More...
 
static void texcoordPointer (const double *_p)
 Wrapper: glTexcoordPointer for double. More...
 
static void texcoordPointer (const Vec2f *_p)
 Wrapper: glTexcoordPointer for Vec2f. More...
 
static void texcoordPointer (const Vec2d *_p)
 Wrapper: glTexcoordPointer for Vec2d. More...
 
static void texcoordPointer (const Vec3f *_p)
 Wrapper: glTexcoordPointer for Vec3f. More...
 
static void texcoordPointer (const Vec3d *_p)
 Wrapper: glTexcoordPointer for Vec3d. More...
 
static void texcoordPointer (const Vec4f *_p)
 Wrapper: glTexcoordPointer for Vec4f. More...
 
static void texcoordPointer (const Vec4d *_p)
 Wrapper: glTexcoordPointer for Vec4d. More...
 
static void setTexGenMode (GLenum _coord, GLenum _name, GLint _param)
 replaces glVertexPointer, supports locking More...
 
static void getTexGenMode (GLenum _coord, GLenum _name, GLint *_param)
 replaces glVertexPointer, supports locking More...
 
static void lockTexcoordPointer ()
 lock color pointer More...
 
static void unlockTexcoordPointer ()
 unlock vertex pointer More...
 
static bool isTexcoordPointerLocked ()
 get vertex pointer lock state More...
 
GL buffer binding
static void genBuffersARB (GLsizei n, GLuint *buffers)
 
static void genBuffers (GLsizei n, GLuint *buffers)
 
static void bufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage)
 
static void bufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
 
static GLvoid * mapBuffer (GLenum target, GLenum access)
 
static GLboolean unmapBuffer (GLenum target)
 
static size_t getBufferSize (GLenum _target)
 
static void deleteBuffers (GLsizei n, const GLuint *buffers)
 
static void bindBuffer (GLenum _target, GLuint _buffer)
 replaces glBindBuffer, supports locking More...
 
static void bindBufferARB (GLenum _target, GLuint _buffer)
 same function as bindBuffer More...
 
static void lockBufferTarget (GLenum _target)
 lock buffer target More...
 
static void unlockBufferTarget (GLenum _target)
 unlock buffer target More...
 
static bool isBufferTargetLocked (GLenum _target)
 get buffer target locking state More...
 
static GLuint getBoundBuf (GLenum _target)
 get currently bound buffer More...
 
static GLenum getShaderType (GLuint _shader)
 
static size_t getShaderSourceLength (GLuint _shader)
 
static size_t getShaderSource (GLuint _shader, char *_buffer, size_t _bufferSize)
 
static GLuint getAttachedShader (GLuint _program, GLenum _type)
 
static void drawBuffer (GLenum _mode)
 replaces glDrawBuffer, supports locking More...
 
static void drawBuffers (GLsizei _n, const GLenum *_bufs)
 replaces glDrawBuffers, supports locking More...
 
static void lockDrawBuffer ()
 lock draw buffer state, applies to drawBuffer and drawBuffers More...
 
static void unlockDrawBuffer ()
 unlock draw buffer state More...
 
static bool isDrawBufferLocked ()
 get draw buffer lock state More...
 
static void bindFramebuffer (GLenum _target, GLuint _framebuffer)
 replaces glBindFramebuffer, supports locking More...
 
static GLuint getFramebufferDraw ()
 get current draw framebuffer of a target More...
 
static GLuint getFramebufferRead ()
 get current read framebuffer of a target More...
 
static void lockFramebuffer (GLenum _target)
 lock a framebuffer target More...
 
static void unlockFramebuffer (GLenum _target)
 unlock a framebuffer target More...
 
static bool isFramebufferLocked (GLenum _target)
 get framebuffer target lock state More...
 
GL shader program binding
static void useProgram (GLuint _program)
 replaces glUseProgram, supports locking More...
 
static GLuint getProgram ()
 get bound program More...
 
static void lockProgram ()
 lock the program More...
 
static void unlockProgram ()
 unlock the program More...
 
static bool isProgramLocked ()
 get program locking state More...
 
GL texture binding
static void activeTexture (GLenum _texunit)
 replaces glActiveTexture, no locking support More...
 
static void activeTextureARB (GLenum _texunit)
 same functiona as activeTexture More...
 
static GLenum getActiveTexture ()
 get active GL texture More...
 
static int getActiveTextureIndex ()
 get active texture as zero based index More...
 
static void bindTexture (GLenum _target, GLuint _buffer)
 replaces glBindTexture, supports locking More...
 
static void lockTextureStage ()
 locks the current texture stage (set by setActiveTexture) More...
 
static void unlockTextureStage ()
 unlocks the current texture target More...
 
static bool isTextureTargetLocked ()
 get texture target locking state More...
 
static GLuint getBoundTextureBuffer ()
 get bound texture More...
 
static GLenum getBoundTextureTarget ()
 get bound texture target More...
 

Static Public Attributes

static const Vec4f default_clear_color
 default value for clear color More...
 
static const Vec4f default_base_color
 default value for base color More...
 
static const Vec4f default_ambient_color
 default value for ambient color More...
 
static const Vec4f default_diffuse_color
 default value for diffuse color More...
 
static const Vec4f default_specular_color
 default value for specular color More...
 
static const Vec4f default_overlay_color
 default value for overlay color More...
 
static const float default_shininess
 default value for shininess More...
 

Static Private Member Functions

static int getBufferTargetIndex (GLenum _target)
 bijective map from GLenum buffer_target to [0..3], -1 if unsupported More...
 

Private Attributes

std::stack< GLMatrixdstack_projection_
 
std::stack< GLMatrixdstack_modelview_
 
std::stack< GLMatrixdstack_inverse_projection_
 
std::stack< GLMatrixdstack_inverse_modelview_
 
GLMatrixd projection_
 
GLMatrixd inverse_projection_
 
GLMatrixd modelview_
 
GLMatrixd inverse_modelview_
 
GLMatrixd window2viewport_
 
GLMatrixd inverse_window2viewport_
 
int left_
 
int bottom_
 
int width_
 
int height_
 
int glwidth_
 
int glheight_
 
double near_plane_
 
double far_plane_
 
Vec4f clear_color_
 
Vec4f color_
 
Vec4f base_color_
 
Vec4f ambient_color_
 
Vec4f diffuse_color_
 
Vec4f specular_color_
 
Vec4f overlay_color_
 
float shininess_
 
float point_size_
 
float line_width_
 
bool twosided_lighting_
 
bool multisampling_
 
bool allow_multisampling_
 
bool mipmapping_
 
bool updateGL_
 
bool blending_
 
unsigned int msSinceLastRedraw_
 
ColorStack colorStack_
 
bool colorPicking_
 

Static Private Attributes

static int num_texture_units_ = 0
 
static bool depthFuncLock_ = false
 
static std::deque< GLStateContextstateStack_
 
static GLenum glStateCaps [95]
 
static std::bitset< 0xFFFF+1 > glStateLock_
 
static bool blendFuncSeparateLock_ [2] = { false }
 
static bool blendEquationLock_ = false
 
static bool blendColorLock_ = false
 
static bool alphaFuncLock_ = false
 
static bool depthRangeLock_ = false
 
static int glBufferTargetLock_ [4] = {0}
 
static int glTextureStageLock_ [16] = {0}
 
static bool shadeModelLock_ = false
 
static bool cullFaceLock_ = false
 
static bool vertexPointerLock_ = false
 
static bool normalPointerLock_ = false
 
static bool texcoordPointerLock_ = false
 
static bool colorPointerLock_ = false
 
static bool drawBufferLock_ = false
 
static bool framebufferLock_ [2] = {false}
 
static bool programLock_ = false
 
static int maxTextureCoords_ = 0
 
static int maxCombinedTextureImageUnits_ = 0
 
static int maxDrawBuffers_ = 0
 

Profile setter

bool compatibilityProfile_
 
void setCompatibilityProfile (bool _compatibility)
 
bool compatibilityProfile () const
 

Render pass controls

unsigned int render_pass_
 
unsigned int max_render_passes_
 
unsigned int render_pass () const
 get current render pass counter More...
 
void reset_render_pass ()
 reset render pass counter More...
 
void next_render_pass ()
 increment render pass counter More...
 
unsigned int max_render_passes () const
 get maximum number of render passes More...
 
void set_max_render_passes (const unsigned int _max)
 set maximum number of render passes More...
 

Scene Infos

ACG::Vec3d bb_min_
 
ACG::Vec3d bb_max_
 
void set_bounding_box (ACG::Vec3d _min, ACG::Vec3d _max)
 
void get_bounding_box (ACG::Vec3d &_min, ACG::Vec3d &_max)
 

Detailed Description

This class stores all relevant OpenGL states and can therefore provide some nice and efficient functions like projecting, unprojecting, eye point or viewing direction.

Note
This class needs an OpenGL context. This is currently given in a QGLContext.

The projection matrix

The GLState class stores its own projection matrix which is of type GLMatrixT. Creating a viewing frustum of a perspective projection will result in the following projection matrix:

Where n is the orthogonal distance from the viewing plane (near plane) to the eye position, f is the orthogonal distance from the back clipping plane (far plane) to the eye position, l, r, t, b are scalars indicating the left, right, top and bottom coordinates of the viewing plane (so in fact we have a rectangle between the points (b,l) and (t,r)) and phi is the opening angle (field of view), also see figure 1.

Figure 1. A schematic illustration of a viewing frustum

Some useful values that can directly be computed out of the projection matrix:

Computing the fovy out of the projection matrix
Computing the aspect out of the projection matrix

Definition at line 213 of file GLState.hh.

Constructor & Destructor Documentation

◆ GLState()

ACG::GLState::GLState ( bool  _updateGL = true,
bool  _compatibilityProfile = true 
)

Default constructor.

Definition at line 121 of file GLState.cc.

◆ ~GLState()

ACG::GLState::~GLState ( )
inline

destructor

Definition at line 221 of file GLState.hh.

Member Function Documentation

◆ activeTexture()

void ACG::GLState::activeTexture ( GLenum  _texunit)
static

replaces glActiveTexture, no locking support

Definition at line 1900 of file GLState.cc.

◆ activeTextureARB()

static void ACG::GLState::activeTextureARB ( GLenum  _texunit)
inlinestatic

same functiona as activeTexture

Definition at line 678 of file GLState.hh.

◆ allow_mipmapping()

void ACG::GLState::allow_mipmapping ( bool  _b)
inline

Allow mipmapping globally.

Note: This actually does not change the opengl state since mipmapping is turned on/off via texture parameters To change the behaviour see in TextureNode

Definition at line 1093 of file GLState.hh.

◆ allow_multisampling()

void ACG::GLState::allow_multisampling ( bool  _b)
inline

Disable multisampling globally.

Definition at line 1076 of file GLState.hh.

◆ alphaFunc()

void ACG::GLState::alphaFunc ( GLenum  _func,
GLclampf  _ref 
)
static

replaces glAlphaFunc, supports locking

Definition at line 1708 of file GLState.cc.

◆ ambient_color()

const Vec4f & ACG::GLState::ambient_color ( ) const
inline

get ambient color

Definition at line 956 of file GLState.hh.

◆ aspect()

double ACG::GLState::aspect ( ) const

get aspect ratio

Definition at line 877 of file GLState.cc.

◆ base_color()

const Vec4f & ACG::GLState::base_color ( ) const
inline

get base color (used when lighting is off)

Definition at line 951 of file GLState.hh.

◆ bindBuffer()

void ACG::GLState::bindBuffer ( GLenum  _target,
GLuint  _buffer 
)
static

replaces glBindBuffer, supports locking

Definition at line 1820 of file GLState.cc.

◆ bindBufferARB()

static void ACG::GLState::bindBufferARB ( GLenum  _target,
GLuint  _buffer 
)
inlinestatic

same function as bindBuffer

Definition at line 579 of file GLState.hh.

◆ bindFramebuffer()

void ACG::GLState::bindFramebuffer ( GLenum  _target,
GLuint  _framebuffer 
)
static

replaces glBindFramebuffer, supports locking

Definition at line 2132 of file GLState.cc.

◆ bindTexture()

void ACG::GLState::bindTexture ( GLenum  _target,
GLuint  _buffer 
)
static

replaces glBindTexture, supports locking

Definition at line 1911 of file GLState.cc.

◆ blendColor()

void ACG::GLState::blendColor ( GLclampf  _red,
GLclampf  _green,
GLclampf  _blue,
GLclampf  _alpha 
)
static

replaces glBlendColor, supports locking

Definition at line 1686 of file GLState.cc.

◆ blendEquation()

void ACG::GLState::blendEquation ( GLenum  _mode)
static

replaces glBlendEquation, supports locking

Definition at line 1672 of file GLState.cc.

◆ blendFunc()

static void ACG::GLState::blendFunc ( GLenum  _sfactor,
GLenum  _dfactor 
)
inlinestatic

replaces glBlendFunc, supports locking

Definition at line 307 of file GLState.hh.

◆ blendFuncSeparate()

void ACG::GLState::blendFuncSeparate ( GLenum  _srcRGB,
GLenum  _dstRGB,
GLenum  _srcAlpha,
GLenum  _dstAlpha 
)
static

replaces glBlendFuncSeparate, supports locking

Definition at line 1621 of file GLState.cc.

◆ blending()

bool ACG::GLState::blending ( )
inline

get whether transparenet or solid objects should be drawn

Definition at line 1060 of file GLState.hh.

◆ bufferData()

void ACG::GLState::bufferData ( GLenum  target,
GLsizeiptr  size,
const GLvoid *  data,
GLenum  usage 
)
static

Simple wrapper around glBufferData. Useful where glew cannot be included.

Definition at line 2227 of file GLState.cc.

◆ bufferDataARB()

void ACG::GLState::bufferDataARB ( GLenum  target,
GLsizeiptrARB  size,
const GLvoid *  data,
GLenum  usage 
)
static

Simple wrapper around glBufferData. Useful where glew cannot be included.

Definition at line 2222 of file GLState.cc.

◆ clear_color()

const Vec4f & ACG::GLState::clear_color ( ) const
inline

get background color

Definition at line 946 of file GLState.hh.

◆ clearBuffers()

void ACG::GLState::clearBuffers ( )

clear buffers viewport rectangle

Definition at line 266 of file GLState.cc.

◆ color()

const Vec4f & ACG::GLState::color ( )
inline

set color

Definition at line 941 of file GLState.hh.

◆ color_picking()

bool ACG::GLState::color_picking ( ) const

Is color picking active?

Definition at line 1141 of file GLState.cc.

◆ colorPointer() [1/5]

static void ACG::GLState::colorPointer ( const Vec3f _p)
inlinestatic

Wrapper: glColorPointer for Vec3f.

Definition at line 470 of file GLState.hh.

◆ colorPointer() [2/5]

static void ACG::GLState::colorPointer ( const Vec3uc _p)
inlinestatic

Wrapper: glColorPointer for Vec3uc.

Definition at line 468 of file GLState.hh.

◆ colorPointer() [3/5]

static void ACG::GLState::colorPointer ( const Vec4f _p)
inlinestatic

Wrapper: glColorPointer for Vec4f.

Definition at line 474 of file GLState.hh.

◆ colorPointer() [4/5]

static void ACG::GLState::colorPointer ( const Vec4uc _p)
inlinestatic

Wrapper: glColorPointer for Vec4uc.

Definition at line 472 of file GLState.hh.

◆ colorPointer() [5/5]

void ACG::GLState::colorPointer ( GLint  _size,
GLenum  _type,
GLsizei  _stride,
const GLvoid *  _pointer 
)
static

replaces glColorPointer, supports locking

Definition at line 2005 of file GLState.cc.

◆ compatibilityProfile()

bool ACG::GLState::compatibilityProfile ( ) const

Definition at line 328 of file GLState.cc.

◆ context_height()

int ACG::GLState::context_height ( ) const
inline

get gl context height

Definition at line 855 of file GLState.hh.

◆ context_width()

int ACG::GLState::context_width ( ) const
inline

get gl context width

Definition at line 852 of file GLState.hh.

◆ cullFace()

void ACG::GLState::cullFace ( GLenum  _mode)
static

replaces glCullFace, supports locking

Definition at line 1743 of file GLState.cc.

◆ deleteBuffers()

void ACG::GLState::deleteBuffers ( GLsizei  n,
const GLuint *  buffers 
)
static

Simple wrapper around glDeleteBuffers. Useful where glew cannot be included.

Definition at line 2232 of file GLState.cc.

◆ depthFunc() [1/2]

const GLenum & ACG::GLState::depthFunc ( ) const

get glDepthFunc() that is supposed to be active

Definition at line 941 of file GLState.cc.

◆ depthFunc() [2/2]

void ACG::GLState::depthFunc ( GLenum  _depthFunc)
static

replaces glDepthFunc, supports locking (called in set_depthFunc too)

Definition at line 955 of file GLState.cc.

◆ depthRange()

void ACG::GLState::depthRange ( GLclampd  _zNear,
GLclampd  _zFar 
)
static

replaces glDepthRange, supports locking

Definition at line 1757 of file GLState.cc.

◆ diffuse_color()

const Vec4f & ACG::GLState::diffuse_color ( ) const
inline

get diffuse color

Definition at line 961 of file GLState.hh.

◆ disable()

void ACG::GLState::disable ( GLenum  _cap,
bool  _warnRemoved = true 
)
static

replaces glDisable, but supports locking

Definition at line 1527 of file GLState.cc.

◆ disableClientState()

void ACG::GLState::disableClientState ( GLenum  _cap)
static

replaces glDisableClientState, supports locking

Definition at line 1584 of file GLState.cc.

◆ drawBuffer()

void ACG::GLState::drawBuffer ( GLenum  _mode)
static

replaces glDrawBuffer, supports locking

Definition at line 2076 of file GLState.cc.

◆ drawBuffers()

void ACG::GLState::drawBuffers ( GLsizei  _n,
const GLenum *  _bufs 
)
static

replaces glDrawBuffers, supports locking

Definition at line 2091 of file GLState.cc.

◆ enable()

void ACG::GLState::enable ( GLenum  _cap,
bool  _warnRemoved = true 
)
static

replaces glEnable, but supports locking

Definition at line 1507 of file GLState.cc.

◆ enableClientState()

void ACG::GLState::enableClientState ( GLenum  _cap)
static

replaces glEnableClientState, supports locking

Definition at line 1570 of file GLState.cc.

◆ eye()

Vec3d ACG::GLState::eye ( ) const

get eye point

Definition at line 886 of file GLState.cc.

◆ far_plane()

double ACG::GLState::far_plane ( ) const
inline

get far clipping distance

Definition at line 861 of file GLState.hh.

◆ forward_projection()

GLMatrixd ACG::GLState::forward_projection ( ) const
inline

get forward projection matrix

Definition at line 826 of file GLState.hh.

◆ fovy()

double ACG::GLState::fovy ( ) const

get field of view in y direction

Definition at line 868 of file GLState.cc.

◆ frustum()

void ACG::GLState::frustum ( double  _left,
double  _right,
double  _bottom,
double  _top,
double  _near_plane,
double  _far_plane 
)

perspective projection

Definition at line 425 of file GLState.cc.

◆ genBuffers()

void ACG::GLState::genBuffers ( GLsizei  n,
GLuint *  buffers 
)
static

Simple wrapper around glGenBuffers. Useful where glew cannot be included.

Definition at line 2218 of file GLState.cc.

◆ genBuffersARB()

void ACG::GLState::genBuffersARB ( GLsizei  n,
GLuint *  buffers 
)
static

Simple wrapper around glGenBuffers. Useful where glew cannot be included.

Definition at line 2214 of file GLState.cc.

◆ get_bounding_box()

void ACG::GLState::get_bounding_box ( ACG::Vec3d _min,
ACG::Vec3d _max 
)

Get the current bounding box of the scene. This has to be set before traversal happens in the viewer by using set_bounding_box

Definition at line 813 of file GLState.cc.

◆ get_viewport()

void ACG::GLState::get_viewport ( int &  _left,
int &  _bottom,
int &  _width,
int &  _height 
) const
inline

get viewport

Definition at line 841 of file GLState.hh.

◆ getActiveTexture()

static GLenum ACG::GLState::getActiveTexture ( )
inlinestatic

get active GL texture

Definition at line 682 of file GLState.hh.

◆ getActiveTextureIndex()

static int ACG::GLState::getActiveTextureIndex ( )
inlinestatic

get active texture as zero based index

Definition at line 684 of file GLState.hh.

◆ getAlphaFunc()

void ACG::GLState::getAlphaFunc ( GLenum *  _func,
GLclampf *  _ref 
)
static

get alpha function, null-ptr safe

Definition at line 1723 of file GLState.cc.

◆ getAttachedShader()

GLuint ACG::GLState::getAttachedShader ( GLuint  _program,
GLenum  _type 
)
static

get the attached shader of type of a program NOTE: this assumes that only one shader of any type is attached to the program! returns GL_NONE if the program doesn't have a shader of requested type attached or if the passed name doesn't identify a valid shader program

Definition at line 1865 of file GLState.cc.

◆ getBlendColor()

void ACG::GLState::getBlendColor ( GLclampf *  _col)
static

get blend color, not null-ptr safe, 4 element color output: RGBA

Definition at line 1702 of file GLState.cc.

◆ getBlendEquation()

static GLenum ACG::GLState::getBlendEquation ( )
inlinestatic

get blend equation

Definition at line 341 of file GLState.hh.

◆ getBlendFunc()

static void ACG::GLState::getBlendFunc ( GLenum *  _sfactor,
GLenum *  _dfactor 
)
inlinestatic

get blend function, null-ptr safe

Definition at line 310 of file GLState.hh.

◆ getBlendFuncSeparate()

void ACG::GLState::getBlendFuncSeparate ( GLenum *  _srcRGB,
GLenum *  _dstRGB,
GLenum *  _srcAlpha,
GLenum *  _dstAlpha 
)
static

get blend function, null-ptr safe

Definition at line 1664 of file GLState.cc.

◆ getBoundBuf()

GLuint ACG::GLState::getBoundBuf ( GLenum  _target)
static

get currently bound buffer

Definition at line 1850 of file GLState.cc.

◆ getBoundTextureBuffer()

GLuint ACG::GLState::getBoundTextureBuffer ( )
static

get bound texture

Definition at line 1948 of file GLState.cc.

◆ getBoundTextureTarget()

GLenum ACG::GLState::getBoundTextureTarget ( )
static

get bound texture target

Definition at line 1953 of file GLState.cc.

◆ getBufferSize()

size_t ACG::GLState::getBufferSize ( GLenum  _target)
static

Wraps glGetBufferParameteriv for GL_BUFFER_SIZE Useful where glew cannot be included

Definition at line 2245 of file GLState.cc.

◆ getBufferTargetIndex()

int ACG::GLState::getBufferTargetIndex ( GLenum  _target)
staticprivate

bijective map from GLenum buffer_target to [0..3], -1 if unsupported

Definition at line 1781 of file GLState.cc.

◆ getColorPointer()

void ACG::GLState::getColorPointer ( GLint *  _size,
GLenum *  _type,
GLsizei *  _stride,
const GLvoid **  _pointer 
)
static

get color pointer, null-ptr safe

Definition at line 2019 of file GLState.cc.

◆ getCullFace()

static GLenum ACG::GLState::getCullFace ( )
inlinestatic

get current cull face

Definition at line 393 of file GLState.hh.

◆ getDepthRange()

void ACG::GLState::getDepthRange ( GLclampd *  _zNearOut,
GLclampd *  _zFarOut 
)
static

get current depth range

Definition at line 1773 of file GLState.cc.

◆ getFramebufferDraw()

GLuint ACG::GLState::getFramebufferDraw ( )
static

get current draw framebuffer of a target

get current framebuffer of a target

Definition at line 2117 of file GLState.cc.

◆ getFramebufferRead()

GLuint ACG::GLState::getFramebufferRead ( )
static

get current read framebuffer of a target

get current framebuffer of a target

Definition at line 2125 of file GLState.cc.

◆ getNormalPointer()

void ACG::GLState::getNormalPointer ( GLenum *  _type,
GLsizei *  _stride,
const GLvoid **  _pointer 
)
static

get normal pointer, null-ptr safe

Definition at line 1997 of file GLState.cc.

◆ getProgram()

static GLuint ACG::GLState::getProgram ( )
inlinestatic

get bound program

Definition at line 651 of file GLState.hh.

◆ getShadeModel()

static GLenum ACG::GLState::getShadeModel ( )
inlinestatic

get current shade model

Definition at line 381 of file GLState.hh.

◆ getShaderSource()

size_t ACG::GLState::getShaderSource ( GLuint  _shader,
char *  _buffer,
size_t  _bufferSize 
)
static

get glsl source from a shader object expects a char array of sufficient size, size can be queried with getShaderSourceLength() before calling this returns the actual size of the source string, excluding null terminator

Definition at line 1890 of file GLState.cc.

◆ getShaderSourceLength()

size_t ACG::GLState::getShaderSourceLength ( GLuint  _shader)
static

get the length of a shaders source returns 0 on failure

Definition at line 1882 of file GLState.cc.

◆ getShaderType()

GLenum ACG::GLState::getShaderType ( GLuint  _shader)
static

get the type of a shader object returns GL_NONE if the passed name doesn't identify a valid shader object

Definition at line 1856 of file GLState.cc.

◆ getTexcoordPointer()

void ACG::GLState::getTexcoordPointer ( GLint *  _size,
GLenum *  _type,
GLsizei *  _stride,
const GLvoid **  _pointer 
)
static

get color pointer, null-ptr safe

Definition at line 2041 of file GLState.cc.

◆ getTexGenMode()

void ACG::GLState::getTexGenMode ( GLenum  _coord,
GLenum  _name,
GLint *  _param 
)
static

replaces glVertexPointer, supports locking

Definition at line 2061 of file GLState.cc.

◆ getVertexPointer()

void ACG::GLState::getVertexPointer ( GLint *  _size,
GLenum *  _type,
GLsizei *  _stride,
const GLvoid **  _pointer 
)
static

get vertex pointer, null-ptr safe

Definition at line 1975 of file GLState.cc.

◆ initialize()

void ACG::GLState::initialize ( )

initialize all state variables (called by constructor)

Definition at line 162 of file GLState.cc.

◆ inverse_modelview()

const GLMatrixd & ACG::GLState::inverse_modelview ( ) const
inline

get inverse modelview matrix

Definition at line 836 of file GLState.hh.

◆ inverse_projection()

const GLMatrixd & ACG::GLState::inverse_projection ( ) const
inline

get inverse projection matrix

Definition at line 831 of file GLState.hh.

◆ isAlphaFuncLocked()

static bool ACG::GLState::isAlphaFuncLocked ( )
inlinestatic

get alpha func locking state

Definition at line 375 of file GLState.hh.

◆ isBlendColorLocked()

static bool ACG::GLState::isBlendColorLocked ( )
inlinestatic

get blend color locking state

Definition at line 361 of file GLState.hh.

◆ isBlendEquationLocked()

static bool ACG::GLState::isBlendEquationLocked ( )
inlinestatic

get blend equation locking state

Definition at line 348 of file GLState.hh.

◆ isBlendFuncLocked()

static bool ACG::GLState::isBlendFuncLocked ( )
inlinestatic

get blend func locking state

Definition at line 317 of file GLState.hh.

◆ isBlendFuncSeparateAlphaLocked()

static bool ACG::GLState::isBlendFuncSeparateAlphaLocked ( )
inlinestatic

replaces glEnable, but supports locking

Definition at line 334 of file GLState.hh.

◆ isBlendFuncSeparateColorLocked()

static bool ACG::GLState::isBlendFuncSeparateColorLocked ( )
inlinestatic

replaces glEnable, but supports locking

Definition at line 333 of file GLState.hh.

◆ isBlendFuncSeparateLocked()

static bool ACG::GLState::isBlendFuncSeparateLocked ( )
inlinestatic

get blend func locking state

Definition at line 332 of file GLState.hh.

◆ isBufferTargetLocked()

bool ACG::GLState::isBufferTargetLocked ( GLenum  _target)
static

get buffer target locking state

Definition at line 1845 of file GLState.cc.

◆ isClientStateEnabled()

bool ACG::GLState::isClientStateEnabled ( GLenum  _cap)
static

returns true, if a client state is enabled

Definition at line 1613 of file GLState.cc.

◆ isClientStateLocked()

bool ACG::GLState::isClientStateLocked ( GLenum  _cap)
static

returns true, if a client state is locked

Definition at line 1608 of file GLState.cc.

◆ isColorPointerLocked()

static bool ACG::GLState::isColorPointerLocked ( )
inlinestatic

get vertex pointer lock state

Definition at line 481 of file GLState.hh.

◆ isCullFaceLocked()

static bool ACG::GLState::isCullFaceLocked ( )
inlinestatic

get cull face locking state

Definition at line 399 of file GLState.hh.

◆ isDepthFuncLocked()

static bool ACG::GLState::isDepthFuncLocked ( )
inlinestatic

Definition at line 905 of file GLState.hh.

◆ isDepthRangeLocked()

static bool ACG::GLState::isDepthRangeLocked ( )
inlinestatic

get depth range locking state

Definition at line 410 of file GLState.hh.

◆ isDrawBufferLocked()

static bool ACG::GLState::isDrawBufferLocked ( )
inlinestatic

get draw buffer lock state

Definition at line 623 of file GLState.hh.

◆ isFramebufferLocked()

bool ACG::GLState::isFramebufferLocked ( GLenum  _target)
static

get framebuffer target lock state

Definition at line 2187 of file GLState.cc.

◆ isNormalPointerLocked()

static bool ACG::GLState::isNormalPointerLocked ( )
inlinestatic

get normal pointer lock state

Definition at line 459 of file GLState.hh.

◆ isProgramLocked()

static bool ACG::GLState::isProgramLocked ( )
inlinestatic

get program locking state

Definition at line 658 of file GLState.hh.

◆ isShadeModelLocked()

static bool ACG::GLState::isShadeModelLocked ( )
inlinestatic

get shade model locking state

Definition at line 387 of file GLState.hh.

◆ isStateEnabled()

bool ACG::GLState::isStateEnabled ( GLenum  _cap)
static

returns true, if a cpa state is enabled

Definition at line 1562 of file GLState.cc.

◆ isStateLocked()

bool ACG::GLState::isStateLocked ( GLenum  _cap)
static

returns true, if a cap state is locked

Definition at line 1557 of file GLState.cc.

◆ isTexcoordPointerLocked()

static bool ACG::GLState::isTexcoordPointerLocked ( )
inlinestatic

get vertex pointer lock state

Definition at line 516 of file GLState.hh.

◆ isTextureTargetLocked()

bool ACG::GLState::isTextureTargetLocked ( )
static

get texture target locking state

Definition at line 1943 of file GLState.cc.

◆ isVertexPointerLocked()

static bool ACG::GLState::isVertexPointerLocked ( )
inlinestatic

get vertex pointer lock state

Definition at line 442 of file GLState.hh.

◆ line_width()

float ACG::GLState::line_width ( ) const
inline

get line width

Definition at line 1000 of file GLState.hh.

◆ lockAlphaFunc()

static void ACG::GLState::lockAlphaFunc ( )
inlinestatic

lock alpha func

Definition at line 371 of file GLState.hh.

◆ lockBlendColor()

static void ACG::GLState::lockBlendColor ( )
inlinestatic

lock blend color

Definition at line 357 of file GLState.hh.

◆ lockBlendEquation()

static void ACG::GLState::lockBlendEquation ( )
inlinestatic

lock blend equation

Definition at line 344 of file GLState.hh.

◆ lockBlendFunc()

static void ACG::GLState::lockBlendFunc ( )
inlinestatic

lock blend func

Definition at line 313 of file GLState.hh.

◆ lockBlendFuncSeparate()

static void ACG::GLState::lockBlendFuncSeparate ( bool  _rgb = true,
bool  _alpha = true 
)
inlinestatic

lock blend func

Definition at line 328 of file GLState.hh.

◆ lockBufferTarget()

void ACG::GLState::lockBufferTarget ( GLenum  _target)
static

lock buffer target

Definition at line 1835 of file GLState.cc.

◆ lockClientState()

void ACG::GLState::lockClientState ( GLenum  _cap)
static

locks a client state

Definition at line 1598 of file GLState.cc.

◆ lockColorPointer()

static void ACG::GLState::lockColorPointer ( )
inlinestatic

lock color pointer

Definition at line 477 of file GLState.hh.

◆ lockCullFace()

static void ACG::GLState::lockCullFace ( )
inlinestatic

lock cull face

Definition at line 395 of file GLState.hh.

◆ lockDepthFunc()

static void ACG::GLState::lockDepthFunc ( )
inlinestatic

Definition at line 903 of file GLState.hh.

◆ lockDepthRange()

static void ACG::GLState::lockDepthRange ( )
inlinestatic

lock depth range

Definition at line 406 of file GLState.hh.

◆ lockDrawBuffer()

static void ACG::GLState::lockDrawBuffer ( )
inlinestatic

lock draw buffer state, applies to drawBuffer and drawBuffers

Definition at line 619 of file GLState.hh.

◆ lockFramebuffer()

void ACG::GLState::lockFramebuffer ( GLenum  _target)
static

lock a framebuffer target

Definition at line 2163 of file GLState.cc.

◆ lockNormalPointer()

static void ACG::GLState::lockNormalPointer ( )
inlinestatic

lock normal pointer

Definition at line 455 of file GLState.hh.

◆ lockProgram()

static void ACG::GLState::lockProgram ( )
inlinestatic

lock the program

Definition at line 654 of file GLState.hh.

◆ lockShadeModel()

static void ACG::GLState::lockShadeModel ( )
inlinestatic

lock shade model

Definition at line 383 of file GLState.hh.

◆ lockState()

void ACG::GLState::lockState ( GLenum  _cap)
static

locks a specific cap state, such that enable() or disable() has no effect

Definition at line 1547 of file GLState.cc.

◆ lockTexcoordPointer()

static void ACG::GLState::lockTexcoordPointer ( )
inlinestatic

lock color pointer

Definition at line 512 of file GLState.hh.

◆ lockTextureStage()

void ACG::GLState::lockTextureStage ( )
static

locks the current texture stage (set by setActiveTexture)

Definition at line 1933 of file GLState.cc.

◆ lockVertexPointer()

static void ACG::GLState::lockVertexPointer ( )
inlinestatic

lock vertex pointer

Definition at line 438 of file GLState.hh.

◆ lookAt()

void ACG::GLState::lookAt ( const Vec3d _eye,
const Vec3d _center,
const Vec3d _up 
)

set camera by lookAt

Definition at line 515 of file GLState.cc.

◆ makeCurrent()

void ACG::GLState::makeCurrent ( )
inline

does nothing

Definition at line 224 of file GLState.hh.

◆ mapBuffer()

GLvoid * ACG::GLState::mapBuffer ( GLenum  target,
GLenum  access 
)
static

Simple wrapper around glMapBuffer. Useful where glew cannot be included.

Definition at line 2236 of file GLState.cc.

◆ max_render_passes()

unsigned int ACG::GLState::max_render_passes ( ) const
inline

get maximum number of render passes

Definition at line 1018 of file GLState.hh.

◆ max_texture_units()

int ACG::GLState::max_texture_units ( ) const
inline

Get max number of available texture units.

Definition at line 1082 of file GLState.hh.

◆ mipmapping_allowed()

bool ACG::GLState::mipmapping_allowed ( ) const
inline

Get current global mipmapping state.

Definition at line 1096 of file GLState.hh.

◆ modelview()

const GLMatrixd & ACG::GLState::modelview ( ) const
inline

get modelview matrix

Definition at line 816 of file GLState.hh.

◆ msSinceLastRedraw()

unsigned int ACG::GLState::msSinceLastRedraw ( ) const
inline

time passed since last redraw in milliseconds

Definition at line 238 of file GLState.hh.

◆ mult_matrix()

void ACG::GLState::mult_matrix ( const GLMatrixd _m,
const GLMatrixd _inv_m,
MultiplyFrom  _mult_from = MULT_FROM_RIGHT 
)

multiply by a given transformation matrix

Definition at line 614 of file GLState.cc.

◆ multisampling()

bool ACG::GLState::multisampling ( )
inline

Get current multisampling state.

Definition at line 1073 of file GLState.hh.

◆ multisampling_allowed()

bool ACG::GLState::multisampling_allowed ( )
inline

Check if Multisampling is globally disabled.

Definition at line 1079 of file GLState.hh.

◆ near_plane()

double ACG::GLState::near_plane ( ) const
inline

get near clipping distance

Definition at line 858 of file GLState.hh.

◆ next_render_pass()

void ACG::GLState::next_render_pass ( )
inline

increment render pass counter

Definition at line 1015 of file GLState.hh.

◆ normalPointer() [1/3]

static void ACG::GLState::normalPointer ( const Vec3d _p)
inlinestatic

Wrapper: glNormalPointer for Vec3d.

Definition at line 452 of file GLState.hh.

◆ normalPointer() [2/3]

static void ACG::GLState::normalPointer ( const Vec3f _p)
inlinestatic

Wrapper: glNormalPointer for Vec3f.

Definition at line 450 of file GLState.hh.

◆ normalPointer() [3/3]

void ACG::GLState::normalPointer ( GLenum  _type,
GLsizei  _stride,
const GLvoid *  _pointer 
)
static

replaces glNormalPointer, supports locking

Definition at line 1983 of file GLState.cc.

◆ ortho()

void ACG::GLState::ortho ( double  _left,
double  _right,
double  _bottom,
double  _top,
double  _near_plane,
double  _far_plane 
)

orthographic projection

Definition at line 402 of file GLState.cc.

◆ overlay_color()

const Vec4f & ACG::GLState::overlay_color ( ) const
inline

Get overlay color.

This color does not set an opengl state but can be used to store an additional color for a wireframe.

Definition at line 980 of file GLState.hh.

◆ perspective()

void ACG::GLState::perspective ( double  _fovY,
double  _aspect,
double  _near_plane,
double  _far_plane 
)

perspective projection

Definition at line 448 of file GLState.cc.

◆ pick_color_to_stack()

std::vector< size_t > ACG::GLState::pick_color_to_stack ( Vec4uc  _rgba) const

converts the given color to index values on the stack (only used in color picking) This can be compared to the results of the selection buffer results

Definition at line 1104 of file GLState.cc.

◆ pick_current_index()

size_t ACG::GLState::pick_current_index ( ) const

Returns the current color picking index (can be used for caching)

Is this value equal to a value used in a previous picking run, then the same colors will be used. In this case a previously calculated color array/display list can be reused.

This is basically the name of the whole object ( which would be the same as the name of the first component of the object), not the name of the primitives/components in the object!

Definition at line 1131 of file GLState.cc.

◆ pick_error()

bool ACG::GLState::pick_error ( ) const

Did an error occur during picking (only used in color picking) Mostly to small color depth or wrong handling of pick_set_maximum

Definition at line 1122 of file GLState.cc.

◆ pick_free_indicies()

size_t ACG::GLState::pick_free_indicies ( ) const

returns the number of still available colors during color picking

Definition at line 1113 of file GLState.cc.

◆ pick_get_name_color()

Vec4uc ACG::GLState::pick_get_name_color ( size_t  _idx)

returns the color that will be used for index _idx during color picking if this index will be set with pick_set_name. This can be used to generate color arrays instead of using direct gl calls for each primitive

Definition at line 1068 of file GLState.cc.

◆ pick_get_name_color_norm()

Vec4f ACG::GLState::pick_get_name_color_norm ( unsigned int  _idx)

same as pick_get_name_color, but the resulting color channels are normalized in [0.0, 1.0] range

Definition at line 1077 of file GLState.cc.

◆ pick_init()

void ACG::GLState::pick_init ( bool  _color)

initialize name/color picking stack (like glInitNames())

Follows the OpenGL selection buffer implementation (OpenGL Red Book Chapter 13) http://www.glprogramming.com/red/chapter13.html

Color picking is another method to realize picking. This functions replace the original OpenGL functions, to allow the handling of selection buffer picking and color based picking with the same code.

Definition at line 1043 of file GLState.cc.

◆ pick_pop_name()

void ACG::GLState::pick_pop_name ( )

pops the current name from the stack (like glPopName())

Definition at line 1097 of file GLState.cc.

◆ pick_push_name()

void ACG::GLState::pick_push_name ( size_t  _idx)

creates a new name the stack (like glPushName())

Definition at line 1090 of file GLState.cc.

◆ pick_set_maximum()

bool ACG::GLState::pick_set_maximum ( size_t  _idx)

Set the maximal number of primitives/components of your object.

Sets the maximum used name index at current stack position (only used in color picking) A restriction inside the color picking implementation forces to set the maximum used number for the following pick_set_name calls between the two pick_push_name/pick_pop_name calls.

If you create picking for your nodes, the values set with pick_set_name have to be between zero and this value.

Definition at line 1051 of file GLState.cc.

◆ pick_set_name()

void ACG::GLState::pick_set_name ( size_t  _idx)

sets the current name/color (like glLoadName(_idx))

This will be the index of the primitive/component in the object. If you create picking for your nodes, the values set here will be returned as the target index. So if your object has three parts, you call pick_set_name(0), than render the first component and then pick_set_name(1), ...

If you perform the picking and click on the second component, the returned index will be 1 as set in the node.

Definition at line 1061 of file GLState.cc.

◆ point_size()

float ACG::GLState::point_size ( ) const
inline

get point size

Definition at line 995 of file GLState.hh.

◆ pop_modelview_matrix()

void ACG::GLState::pop_modelview_matrix ( )

pop modelview matrix

Definition at line 1026 of file GLState.cc.

◆ pop_projection_matrix()

void ACG::GLState::pop_projection_matrix ( )

pop projection matrix

Definition at line 989 of file GLState.cc.

◆ project()

Vec3d ACG::GLState::project ( const Vec3d _point) const

project point in world coordinates to window coordinates

Definition at line 640 of file GLState.cc.

◆ projection()

const GLMatrixd & ACG::GLState::projection ( ) const
inline

get projection matrix

Definition at line 811 of file GLState.hh.

◆ push_modelview_matrix()

void ACG::GLState::push_modelview_matrix ( )

push modelview matrix

Definition at line 1010 of file GLState.cc.

◆ push_projection_matrix()

void ACG::GLState::push_projection_matrix ( )

push projection matrix

Definition at line 971 of file GLState.cc.

◆ render_pass()

unsigned int ACG::GLState::render_pass ( ) const
inline

get current render pass counter

Definition at line 1009 of file GLState.hh.

◆ reset_modelview()

void ACG::GLState::reset_modelview ( )

reset modelview matrix (load identity)

Definition at line 370 of file GLState.cc.

◆ reset_projection()

void ACG::GLState::reset_projection ( )

reset projection matrix (load identity)

Definition at line 334 of file GLState.cc.

◆ reset_render_pass()

void ACG::GLState::reset_render_pass ( )
inline

reset render pass counter

Definition at line 1012 of file GLState.hh.

◆ right()

Vec3d ACG::GLState::right ( ) const

get right-vector w.r.t. camera coordinates

Definition at line 918 of file GLState.cc.

◆ rotate()

void ACG::GLState::rotate ( double  _angle,
double  _x,
double  _y,
double  _z,
MultiplyFrom  _mult_from = MULT_FROM_RIGHT 
)

rotate around axis (_x, _y, _z) by _angle

Definition at line 564 of file GLState.cc.

◆ scale() [1/3]

void ACG::GLState::scale ( double  _s)
inline

scale by (_s, _s, _s)

Definition at line 775 of file GLState.hh.

◆ scale() [2/3]

void ACG::GLState::scale ( double  _s,
MultiplyFrom   
)
inline

scale by (_s, _s, _s)

Definition at line 779 of file GLState.hh.

◆ scale() [3/3]

void ACG::GLState::scale ( double  _sx,
double  _sy,
double  _sz,
MultiplyFrom  _mult_from = MULT_FROM_RIGHT 
)

scale by (_sx, _sy, _sz)

Definition at line 589 of file GLState.cc.

◆ set_ambient_color()

void ACG::GLState::set_ambient_color ( const Vec4f _col)

set ambient color

Definition at line 707 of file GLState.cc.

◆ set_base_color()

void ACG::GLState::set_base_color ( const Vec4f _col)

set base color (used when lighting is off)

Definition at line 677 of file GLState.cc.

◆ set_blending()

void ACG::GLState::set_blending ( bool  _b)
inline

set whether transparent or solid objects should be drawn

Definition at line 1058 of file GLState.hh.

◆ set_bounding_box()

void ACG::GLState::set_bounding_box ( ACG::Vec3d  _min,
ACG::Vec3d  _max 
)

Provide scene Information about the boundingbox via this function It is not computed by the state itself!!

Definition at line 806 of file GLState.cc.

◆ set_clear_color()

void ACG::GLState::set_clear_color ( const Vec4f _col)

set background color

Definition at line 662 of file GLState.cc.

◆ set_color()

void ACG::GLState::set_color ( const Vec4f _col)

set color

Definition at line 691 of file GLState.cc.

◆ set_depthFunc()

void ACG::GLState::set_depthFunc ( const GLenum &  _depth_func)

Call glDepthFunc() to actually change the depth comparison function, and store the new value in this GLState.

Definition at line 948 of file GLState.cc.

◆ set_diffuse_color()

void ACG::GLState::set_diffuse_color ( const Vec4f _col)

set diffuse color

Definition at line 722 of file GLState.cc.

◆ set_line_width()

void ACG::GLState::set_line_width ( float  _f)

set line width

Definition at line 791 of file GLState.cc.

◆ set_max_render_passes()

void ACG::GLState::set_max_render_passes ( const unsigned int  _max)
inline

set maximum number of render passes

Definition at line 1021 of file GLState.hh.

◆ set_modelview() [1/2]

void ACG::GLState::set_modelview ( const GLMatrixd _m)
inline

set modelview

Definition at line 753 of file GLState.hh.

◆ set_modelview() [2/2]

void ACG::GLState::set_modelview ( const GLMatrixd _m,
const GLMatrixd _inv_m 
)

set modelview and provide inverse modelview matrix

Definition at line 386 of file GLState.cc.

◆ set_msSinceLastRedraw()

void ACG::GLState::set_msSinceLastRedraw ( unsigned int  _ms)
inline

set time passed since last redraw in milliseconds

Definition at line 241 of file GLState.hh.

◆ set_multisampling()

void ACG::GLState::set_multisampling ( bool  _b)

Enable or disable multisampling.

Definition at line 839 of file GLState.cc.

◆ set_overlay_color()

void ACG::GLState::set_overlay_color ( const Vec4f _col)

set overlay color

This color does not set an opengl state but can be used to store an additional color for a wireframe

Definition at line 752 of file GLState.cc.

◆ set_point_size()

void ACG::GLState::set_point_size ( float  _f)

set point size

Definition at line 776 of file GLState.cc.

◆ set_projection() [1/2]

void ACG::GLState::set_projection ( const GLMatrixd _m)
inline

set projection

Definition at line 716 of file GLState.hh.

◆ set_projection() [2/2]

void ACG::GLState::set_projection ( const GLMatrixd _m,
const GLMatrixd _inv_m 
)

set projection and provide inverse projection matrix

Definition at line 352 of file GLState.cc.

◆ set_shininess()

void ACG::GLState::set_shininess ( float  _shininess)

set specular shininess (must be in [0, 128])

Definition at line 761 of file GLState.cc.

◆ set_specular_color()

void ACG::GLState::set_specular_color ( const Vec4f _col)

set specular color

Definition at line 737 of file GLState.cc.

◆ set_twosided_lighting()

void ACG::GLState::set_twosided_lighting ( bool  _b)

set whether transparent or solid objects should be drawn

Definition at line 822 of file GLState.cc.

◆ set_updateGL()

void ACG::GLState::set_updateGL ( bool  _b)
inline

should GL matrices be updated after each matrix operation

Definition at line 235 of file GLState.hh.

◆ setCompatibilityProfile()

void ACG::GLState::setCompatibilityProfile ( bool  _compatibility)

Definition at line 323 of file GLState.cc.

◆ setState()

void ACG::GLState::setState ( )

set the whole stored gl state

Definition at line 209 of file GLState.cc.

◆ setTexGenMode()

void ACG::GLState::setTexGenMode ( GLenum  _coord,
GLenum  _name,
GLint  _param 
)
static

replaces glVertexPointer, supports locking

Definition at line 2049 of file GLState.cc.

◆ shadeModel()

void ACG::GLState::shadeModel ( GLenum  _mode)
static

replaces glShadeModel, supports locking

Definition at line 1729 of file GLState.cc.

◆ shininess()

float ACG::GLState::shininess ( ) const
inline

get specular shininess (must be in [0, 128])

Definition at line 985 of file GLState.hh.

◆ specular_color()

const Vec4f & ACG::GLState::specular_color ( ) const
inline

get specular color

Definition at line 966 of file GLState.hh.

◆ syncFromGL()

void ACG::GLState::syncFromGL ( )
static

synchronize this class with the OpenGL state machine

Definition at line 1244 of file GLState.cc.

◆ texcoordPointer() [1/9]

static void ACG::GLState::texcoordPointer ( const double *  _p)
inlinestatic

Wrapper: glTexcoordPointer for double.

Definition at line 492 of file GLState.hh.

◆ texcoordPointer() [2/9]

static void ACG::GLState::texcoordPointer ( const float *  _p)
inlinestatic

Wrapper: glTexcoordPointer for float.

Definition at line 490 of file GLState.hh.

◆ texcoordPointer() [3/9]

static void ACG::GLState::texcoordPointer ( const Vec2d _p)
inlinestatic

Wrapper: glTexcoordPointer for Vec2d.

Definition at line 496 of file GLState.hh.

◆ texcoordPointer() [4/9]

static void ACG::GLState::texcoordPointer ( const Vec2f _p)
inlinestatic

Wrapper: glTexcoordPointer for Vec2f.

Definition at line 494 of file GLState.hh.

◆ texcoordPointer() [5/9]

static void ACG::GLState::texcoordPointer ( const Vec3d _p)
inlinestatic

Wrapper: glTexcoordPointer for Vec3d.

Definition at line 500 of file GLState.hh.

◆ texcoordPointer() [6/9]

static void ACG::GLState::texcoordPointer ( const Vec3f _p)
inlinestatic

Wrapper: glTexcoordPointer for Vec3f.

Definition at line 498 of file GLState.hh.

◆ texcoordPointer() [7/9]

static void ACG::GLState::texcoordPointer ( const Vec4d _p)
inlinestatic

Wrapper: glTexcoordPointer for Vec4d.

Definition at line 504 of file GLState.hh.

◆ texcoordPointer() [8/9]

static void ACG::GLState::texcoordPointer ( const Vec4f _p)
inlinestatic

Wrapper: glTexcoordPointer for Vec4f.

Definition at line 502 of file GLState.hh.

◆ texcoordPointer() [9/9]

void ACG::GLState::texcoordPointer ( GLint  _size,
GLenum  _type,
GLsizei  _stride,
const GLvoid *  _pointer 
)
static

replaces glTexcoordPointer, supports locking

Definition at line 2027 of file GLState.cc.

◆ translate() [1/2]

void ACG::GLState::translate ( double  _x,
double  _y,
double  _z,
MultiplyFrom  _mult_from = MULT_FROM_RIGHT 
)

translate by (_x, _y, _z)

Definition at line 533 of file GLState.cc.

◆ translate() [2/2]

void ACG::GLState::translate ( Vec3d  _vector,
MultiplyFrom  _mult_from = MULT_FROM_RIGHT 
)

translate by _vector

Definition at line 556 of file GLState.cc.

◆ twosided_lighting()

bool ACG::GLState::twosided_lighting ( )
inline

get whether transparenet or solid objects should be drawn

Definition at line 1065 of file GLState.hh.

◆ unlockAlphaFunc()

static void ACG::GLState::unlockAlphaFunc ( )
inlinestatic

unlock alpha func

Definition at line 373 of file GLState.hh.

◆ unlockBlendColor()

static void ACG::GLState::unlockBlendColor ( )
inlinestatic

unlock blend color

Definition at line 359 of file GLState.hh.

◆ unlockBlendEquation()

static void ACG::GLState::unlockBlendEquation ( )
inlinestatic

unlock blend equation

Definition at line 346 of file GLState.hh.

◆ unlockBlendFunc()

static void ACG::GLState::unlockBlendFunc ( )
inlinestatic

unlock blend func

Definition at line 315 of file GLState.hh.

◆ unlockBlendFuncSeparate()

static void ACG::GLState::unlockBlendFuncSeparate ( )
inlinestatic

unlock blend func

Definition at line 330 of file GLState.hh.

◆ unlockBufferTarget()

void ACG::GLState::unlockBufferTarget ( GLenum  _target)
static

unlock buffer target

Definition at line 1840 of file GLState.cc.

◆ unlockClientState()

void ACG::GLState::unlockClientState ( GLenum  _cap)
static

unlocks a client state

Definition at line 1603 of file GLState.cc.

◆ unlockColorPointer()

static void ACG::GLState::unlockColorPointer ( )
inlinestatic

unlock vertex pointer

Definition at line 479 of file GLState.hh.

◆ unlockCullFace()

static void ACG::GLState::unlockCullFace ( )
inlinestatic

unlock cull face

Definition at line 397 of file GLState.hh.

◆ unlockDepthFunc()

static void ACG::GLState::unlockDepthFunc ( )
inlinestatic

Definition at line 904 of file GLState.hh.

◆ unlockDepthRange()

static void ACG::GLState::unlockDepthRange ( )
inlinestatic

unlock depth range

Definition at line 408 of file GLState.hh.

◆ unlockDrawBuffer()

static void ACG::GLState::unlockDrawBuffer ( )
inlinestatic

unlock draw buffer state

Definition at line 621 of file GLState.hh.

◆ unlockFramebuffer()

void ACG::GLState::unlockFramebuffer ( GLenum  _target)
static

unlock a framebuffer target

Definition at line 2175 of file GLState.cc.

◆ unlockNormalPointer()

static void ACG::GLState::unlockNormalPointer ( )
inlinestatic

unlock normal pointer

Definition at line 457 of file GLState.hh.

◆ unlockProgram()

static void ACG::GLState::unlockProgram ( )
inlinestatic

unlock the program

Definition at line 656 of file GLState.hh.

◆ unlockShadeModel()

static void ACG::GLState::unlockShadeModel ( )
inlinestatic

unlock shade model

Definition at line 385 of file GLState.hh.

◆ unlockState()

void ACG::GLState::unlockState ( GLenum  _cap)
static

unlocks a specific cap state

Definition at line 1552 of file GLState.cc.

◆ unlockTexcoordPointer()

static void ACG::GLState::unlockTexcoordPointer ( )
inlinestatic

unlock vertex pointer

Definition at line 514 of file GLState.hh.

◆ unlockTextureStage()

void ACG::GLState::unlockTextureStage ( )
static

unlocks the current texture target

Definition at line 1938 of file GLState.cc.

◆ unlockVertexPointer()

static void ACG::GLState::unlockVertexPointer ( )
inlinestatic

unlock vertex pointer

Definition at line 440 of file GLState.hh.

◆ unmapBuffer()

GLboolean ACG::GLState::unmapBuffer ( GLenum  target)
static

Simple wrapper around glUnmapBuffer. Useful where glew cannot be included.

Definition at line 2241 of file GLState.cc.

◆ unproject()

Vec3d ACG::GLState::unproject ( const Vec3d _winPoint) const

unproject point in window coordinates _winPoint to world coordinates

Definition at line 651 of file GLState.cc.

◆ up()

Vec3d ACG::GLState::up ( ) const

get up-vector w.r.t. camera coordinates

Definition at line 906 of file GLState.cc.

◆ updateGL()

bool ACG::GLState::updateGL ( ) const
inline

should GL matrices be updated after each matrix operation

Definition at line 233 of file GLState.hh.

◆ useProgram()

void ACG::GLState::useProgram ( GLuint  _program)
static

replaces glUseProgram, supports locking

Definition at line 2200 of file GLState.cc.

◆ vertexPointer() [1/7]

static void ACG::GLState::vertexPointer ( const Vec2d _p)
inlinestatic

Wrapper: glVertexPointer for Vec2d.

Definition at line 427 of file GLState.hh.

◆ vertexPointer() [2/7]

static void ACG::GLState::vertexPointer ( const Vec2f _p)
inlinestatic

Wrapper: glVertexPointer for Vec2f.

Definition at line 425 of file GLState.hh.

◆ vertexPointer() [3/7]

static void ACG::GLState::vertexPointer ( const Vec3d _p)
inlinestatic

Wrapper: glVertexPointer for Vec3d.

Definition at line 431 of file GLState.hh.

◆ vertexPointer() [4/7]

static void ACG::GLState::vertexPointer ( const Vec3f _p)
inlinestatic

Wrapper: glVertexPointer for Vec3f.

Definition at line 429 of file GLState.hh.

◆ vertexPointer() [5/7]

static void ACG::GLState::vertexPointer ( const Vec4d _p)
inlinestatic

Wrapper: glVertexPointer for Vec4d.

Definition at line 435 of file GLState.hh.

◆ vertexPointer() [6/7]

static void ACG::GLState::vertexPointer ( const Vec4f _p)
inlinestatic

Wrapper: glVertexPointer for Vec4f.

Definition at line 433 of file GLState.hh.

◆ vertexPointer() [7/7]

void ACG::GLState::vertexPointer ( GLint  _size,
GLenum  _type,
GLsizei  _stride,
const GLvoid *  _pointer 
)
static

replaces glVertexPointer, supports locking

Definition at line 1961 of file GLState.cc.

◆ viewing_direction() [1/2]

Vec3d ACG::GLState::viewing_direction ( ) const
inline

get viewing ray

Definition at line 873 of file GLState.hh.

◆ viewing_direction() [2/2]

Vec3d ACG::GLState::viewing_direction ( int  _x,
int  _y 
) const

get viewing ray through pixel (_x,_y)

Definition at line 894 of file GLState.cc.

◆ viewing_ray()

void ACG::GLState::viewing_ray ( int  _x,
int  _y,
Vec3d _origin,
Vec3d _direction 
) const

get viewing ray (_orgin & _direction) through pixel (_x,_y). _direction will be nornalized.

Definition at line 930 of file GLState.cc.

◆ viewport() [1/2]

const GLMatrixd & ACG::GLState::viewport ( ) const
inline

get viewport matrix

Definition at line 821 of file GLState.hh.

◆ viewport() [2/2]

void ACG::GLState::viewport ( int  _left,
int  _bottom,
int  _width,
int  _height,
int  _glwidth = 0,
int  _glheight = 0 
)

set viewport (lower left corner, width, height, glcontext width, height)

Definition at line 470 of file GLState.cc.

◆ viewport_height()

int ACG::GLState::viewport_height ( ) const
inline

get viewport height

Definition at line 849 of file GLState.hh.

◆ viewport_width()

int ACG::GLState::viewport_width ( ) const
inline

get viewport width

Definition at line 847 of file GLState.hh.

Member Data Documentation

◆ allow_multisampling_

bool ACG::GLState::allow_multisampling_
private

Definition at line 1219 of file GLState.hh.

◆ alphaFuncLock_

bool ACG::GLState::alphaFuncLock_ = false
staticprivate

Definition at line 1262 of file GLState.hh.

◆ ambient_color_

Vec4f ACG::GLState::ambient_color_
private

Definition at line 1203 of file GLState.hh.

◆ base_color_

Vec4f ACG::GLState::base_color_
private

Definition at line 1202 of file GLState.hh.

◆ bb_max_

ACG::Vec3d ACG::GLState::bb_max_
private

Provide scene Information about the boundingbox via this function It is not computed by the state itself!!

Definition at line 1050 of file GLState.hh.

◆ bb_min_

ACG::Vec3d ACG::GLState::bb_min_
private

Provide scene Information about the boundingbox via this function It is not computed by the state itself!!

Definition at line 1050 of file GLState.hh.

◆ blendColorLock_

bool ACG::GLState::blendColorLock_ = false
staticprivate

Definition at line 1261 of file GLState.hh.

◆ blendEquationLock_

bool ACG::GLState::blendEquationLock_ = false
staticprivate

Definition at line 1260 of file GLState.hh.

◆ blendFuncSeparateLock_

bool ACG::GLState::blendFuncSeparateLock_ = { false }
staticprivate

Definition at line 1259 of file GLState.hh.

◆ blending_

bool ACG::GLState::blending_
private

Definition at line 1230 of file GLState.hh.

◆ bottom_

int ACG::GLState::bottom_
private

Definition at line 1191 of file GLState.hh.

◆ clear_color_

Vec4f ACG::GLState::clear_color_
private

Definition at line 1200 of file GLState.hh.

◆ color_

Vec4f ACG::GLState::color_
private

Definition at line 1201 of file GLState.hh.

◆ colorPicking_

bool ACG::GLState::colorPicking_
private

Definition at line 1239 of file GLState.hh.

◆ colorPointerLock_

bool ACG::GLState::colorPointerLock_ = false
staticprivate

Definition at line 1283 of file GLState.hh.

◆ colorStack_

ColorStack ACG::GLState::colorStack_
private

Definition at line 1236 of file GLState.hh.

◆ compatibilityProfile_

bool ACG::GLState::compatibilityProfile_
private

Definition at line 260 of file GLState.hh.

◆ cullFaceLock_

bool ACG::GLState::cullFaceLock_ = false
staticprivate

Definition at line 1278 of file GLState.hh.

◆ default_ambient_color

const Vec4f ACG::GLState::default_ambient_color
static

default value for ambient color

Definition at line 926 of file GLState.hh.

◆ default_base_color

const Vec4f ACG::GLState::default_base_color
static

default value for base color

Definition at line 924 of file GLState.hh.

◆ default_clear_color

const Vec4f ACG::GLState::default_clear_color
static

default value for clear color

Definition at line 922 of file GLState.hh.

◆ default_diffuse_color

const Vec4f ACG::GLState::default_diffuse_color
static

default value for diffuse color

Definition at line 928 of file GLState.hh.

◆ default_overlay_color

const Vec4f ACG::GLState::default_overlay_color
static

default value for overlay color

Definition at line 932 of file GLState.hh.

◆ default_shininess

const float ACG::GLState::default_shininess
static

default value for shininess

Definition at line 934 of file GLState.hh.

◆ default_specular_color

const Vec4f ACG::GLState::default_specular_color
static

default value for specular color

Definition at line 930 of file GLState.hh.

◆ depthFuncLock_

bool ACG::GLState::depthFuncLock_ = false
staticprivate

Definition at line 1243 of file GLState.hh.

◆ depthRangeLock_

bool ACG::GLState::depthRangeLock_ = false
staticprivate

Definition at line 1264 of file GLState.hh.

◆ diffuse_color_

Vec4f ACG::GLState::diffuse_color_
private

Definition at line 1204 of file GLState.hh.

◆ drawBufferLock_

bool ACG::GLState::drawBufferLock_ = false
staticprivate

Definition at line 1287 of file GLState.hh.

◆ far_plane_

double ACG::GLState::far_plane_
private

Definition at line 1197 of file GLState.hh.

◆ framebufferLock_

bool ACG::GLState::framebufferLock_ = {false}
staticprivate

Definition at line 1291 of file GLState.hh.

◆ glBufferTargetLock_

int ACG::GLState::glBufferTargetLock_ = {0}
staticprivate

Definition at line 1269 of file GLState.hh.

◆ glheight_

int ACG::GLState::glheight_
private

Definition at line 1194 of file GLState.hh.

◆ glStateCaps

GLenum ACG::GLState::glStateCaps
staticprivate

Definition at line 1253 of file GLState.hh.

◆ glStateLock_

std::bitset< 0xFFFF+1 > ACG::GLState::glStateLock_
staticprivate

Definition at line 1257 of file GLState.hh.

◆ glTextureStageLock_

int ACG::GLState::glTextureStageLock_ = {0}
staticprivate

Definition at line 1272 of file GLState.hh.

◆ glwidth_

int ACG::GLState::glwidth_
private

Definition at line 1194 of file GLState.hh.

◆ height_

int ACG::GLState::height_
private

Definition at line 1191 of file GLState.hh.

◆ inverse_modelview_

GLMatrixd ACG::GLState::inverse_modelview_
private

Definition at line 1186 of file GLState.hh.

◆ inverse_projection_

GLMatrixd ACG::GLState::inverse_projection_
private

Definition at line 1184 of file GLState.hh.

◆ inverse_window2viewport_

GLMatrixd ACG::GLState::inverse_window2viewport_
private

Definition at line 1188 of file GLState.hh.

◆ left_

int ACG::GLState::left_
private

Definition at line 1191 of file GLState.hh.

◆ line_width_

float ACG::GLState::line_width_
private

Definition at line 1212 of file GLState.hh.

◆ max_render_passes_

unsigned int ACG::GLState::max_render_passes_
private

holds the maximum render pass number this has to be set externally

Definition at line 1030 of file GLState.hh.

◆ maxCombinedTextureImageUnits_

int ACG::GLState::maxCombinedTextureImageUnits_ = 0
staticprivate

Definition at line 1299 of file GLState.hh.

◆ maxDrawBuffers_

int ACG::GLState::maxDrawBuffers_ = 0
staticprivate

Definition at line 1300 of file GLState.hh.

◆ maxTextureCoords_

int ACG::GLState::maxTextureCoords_ = 0
staticprivate

Definition at line 1298 of file GLState.hh.

◆ mipmapping_

bool ACG::GLState::mipmapping_
private

Definition at line 1224 of file GLState.hh.

◆ modelview_

GLMatrixd ACG::GLState::modelview_
private

Definition at line 1185 of file GLState.hh.

◆ msSinceLastRedraw_

unsigned int ACG::GLState::msSinceLastRedraw_
private

Definition at line 1233 of file GLState.hh.

◆ multisampling_

bool ACG::GLState::multisampling_
private

Definition at line 1218 of file GLState.hh.

◆ near_plane_

double ACG::GLState::near_plane_
private

Definition at line 1197 of file GLState.hh.

◆ normalPointerLock_

bool ACG::GLState::normalPointerLock_ = false
staticprivate

Definition at line 1281 of file GLState.hh.

◆ num_texture_units_

int ACG::GLState::num_texture_units_ = 0
staticprivate

Definition at line 1221 of file GLState.hh.

◆ overlay_color_

Vec4f ACG::GLState::overlay_color_
private

Definition at line 1206 of file GLState.hh.

◆ point_size_

float ACG::GLState::point_size_
private

Definition at line 1212 of file GLState.hh.

◆ programLock_

bool ACG::GLState::programLock_ = false
staticprivate

Definition at line 1294 of file GLState.hh.

◆ projection_

GLMatrixd ACG::GLState::projection_
private

Definition at line 1183 of file GLState.hh.

◆ render_pass_

unsigned int ACG::GLState::render_pass_
private

holds the current render pass number (1-indexed) this has to be set externally

Definition at line 1026 of file GLState.hh.

◆ shadeModelLock_

bool ACG::GLState::shadeModelLock_ = false
staticprivate

Definition at line 1275 of file GLState.hh.

◆ shininess_

float ACG::GLState::shininess_
private

Definition at line 1209 of file GLState.hh.

◆ specular_color_

Vec4f ACG::GLState::specular_color_
private

Definition at line 1205 of file GLState.hh.

◆ stack_inverse_modelview_

std::stack<GLMatrixd> ACG::GLState::stack_inverse_modelview_
private

Definition at line 1180 of file GLState.hh.

◆ stack_inverse_projection_

std::stack<GLMatrixd> ACG::GLState::stack_inverse_projection_
private

Definition at line 1179 of file GLState.hh.

◆ stack_modelview_

std::stack<GLMatrixd> ACG::GLState::stack_modelview_
private

Definition at line 1178 of file GLState.hh.

◆ stack_projection_

std::stack<GLMatrixd> ACG::GLState::stack_projection_
private

Definition at line 1177 of file GLState.hh.

◆ stateStack_

std::deque< GLStateContext > ACG::GLState::stateStack_
staticprivate

Definition at line 1250 of file GLState.hh.

◆ texcoordPointerLock_

bool ACG::GLState::texcoordPointerLock_ = false
staticprivate

Definition at line 1282 of file GLState.hh.

◆ twosided_lighting_

bool ACG::GLState::twosided_lighting_
private

Definition at line 1215 of file GLState.hh.

◆ updateGL_

bool ACG::GLState::updateGL_
private

Definition at line 1227 of file GLState.hh.

◆ vertexPointerLock_

bool ACG::GLState::vertexPointerLock_ = false
staticprivate

Definition at line 1280 of file GLState.hh.

◆ width_

int ACG::GLState::width_
private

Definition at line 1191 of file GLState.hh.

◆ window2viewport_

GLMatrixd ACG::GLState::window2viewport_
private

Definition at line 1187 of file GLState.hh.


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