Developer Documentation
|
#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 Vec4f & | color () |
set color More... | |
void | set_clear_color (const Vec4f &_col) |
set background color More... | |
const Vec4f & | clear_color () const |
get background color More... | |
void | set_base_color (const Vec4f &_col) |
set base color (used when lighting is off) More... | |
const Vec4f & | base_color () const |
get base color (used when lighting is off) More... | |
void | set_ambient_color (const Vec4f &_col) |
set ambient color More... | |
const Vec4f & | ambient_color () const |
get ambient color More... | |
void | set_diffuse_color (const Vec4f &_col) |
set diffuse color More... | |
const Vec4f & | diffuse_color () const |
get diffuse color More... | |
void | set_specular_color (const Vec4f &_col) |
set specular color More... | |
const Vec4f & | specular_color () const |
get specular color More... | |
void | set_overlay_color (const Vec4f &_col) |
set overlay color More... | |
const Vec4f & | overlay_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 GLMatrixd & | projection () const |
get projection matrix More... | |
const GLMatrixd & | modelview () const |
get modelview matrix More... | |
const GLMatrixd & | viewport () const |
get viewport matrix More... | |
GLMatrixd | forward_projection () const |
get forward projection matrix More... | |
const GLMatrixd & | inverse_projection () const |
get inverse projection matrix More... | |
const GLMatrixd & | inverse_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< GLMatrixd > | stack_projection_ |
std::stack< GLMatrixd > | stack_modelview_ |
std::stack< GLMatrixd > | stack_inverse_projection_ |
std::stack< GLMatrixd > | stack_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< GLStateContext > | stateStack_ |
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) |
This class stores all relevant OpenGL states and can therefore provide some nice and efficient functions like projecting, unprojecting, eye point or viewing direction.
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.
Some useful values that can directly be computed out of the projection matrix:
Definition at line 213 of file GLState.hh.
ACG::GLState::GLState | ( | bool | _updateGL = true , |
bool | _compatibilityProfile = true |
||
) |
Default constructor.
Definition at line 121 of file GLState.cc.
|
inline |
destructor
Definition at line 221 of file GLState.hh.
|
static |
replaces glActiveTexture, no locking support
Definition at line 1900 of file GLState.cc.
|
inlinestatic |
same functiona as activeTexture
Definition at line 678 of file GLState.hh.
|
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.
|
inline |
Disable multisampling globally.
Definition at line 1076 of file GLState.hh.
|
static |
replaces glAlphaFunc, supports locking
Definition at line 1708 of file GLState.cc.
|
inline |
get ambient color
Definition at line 956 of file GLState.hh.
double ACG::GLState::aspect | ( | ) | const |
get aspect ratio
Definition at line 877 of file GLState.cc.
|
inline |
get base color (used when lighting is off)
Definition at line 951 of file GLState.hh.
|
static |
replaces glBindBuffer, supports locking
Definition at line 1820 of file GLState.cc.
|
inlinestatic |
same function as bindBuffer
Definition at line 579 of file GLState.hh.
|
static |
replaces glBindFramebuffer, supports locking
Definition at line 2132 of file GLState.cc.
|
static |
replaces glBindTexture, supports locking
Definition at line 1911 of file GLState.cc.
|
static |
replaces glBlendColor, supports locking
Definition at line 1686 of file GLState.cc.
|
static |
replaces glBlendEquation, supports locking
Definition at line 1672 of file GLState.cc.
|
inlinestatic |
replaces glBlendFunc, supports locking
Definition at line 307 of file GLState.hh.
|
static |
replaces glBlendFuncSeparate, supports locking
Definition at line 1621 of file GLState.cc.
|
inline |
get whether transparenet or solid objects should be drawn
Definition at line 1060 of file GLState.hh.
|
static |
Simple wrapper around glBufferData. Useful where glew cannot be included.
Definition at line 2227 of file GLState.cc.
|
static |
Simple wrapper around glBufferData. Useful where glew cannot be included.
Definition at line 2222 of file GLState.cc.
|
inline |
get background color
Definition at line 946 of file GLState.hh.
void ACG::GLState::clearBuffers | ( | ) |
clear buffers viewport rectangle
Definition at line 266 of file GLState.cc.
|
inline |
set color
Definition at line 941 of file GLState.hh.
bool ACG::GLState::color_picking | ( | ) | const |
Is color picking active?
Definition at line 1141 of file GLState.cc.
|
inlinestatic |
Wrapper: glColorPointer for Vec3f.
Definition at line 470 of file GLState.hh.
|
inlinestatic |
Wrapper: glColorPointer for Vec3uc.
Definition at line 468 of file GLState.hh.
|
inlinestatic |
Wrapper: glColorPointer for Vec4f.
Definition at line 474 of file GLState.hh.
|
inlinestatic |
Wrapper: glColorPointer for Vec4uc.
Definition at line 472 of file GLState.hh.
|
static |
replaces glColorPointer, supports locking
Definition at line 2005 of file GLState.cc.
bool ACG::GLState::compatibilityProfile | ( | ) | const |
Definition at line 328 of file GLState.cc.
|
inline |
get gl context height
Definition at line 855 of file GLState.hh.
|
inline |
get gl context width
Definition at line 852 of file GLState.hh.
|
static |
replaces glCullFace, supports locking
Definition at line 1743 of file GLState.cc.
|
static |
Simple wrapper around glDeleteBuffers. Useful where glew cannot be included.
Definition at line 2232 of file GLState.cc.
const GLenum & ACG::GLState::depthFunc | ( | ) | const |
get glDepthFunc() that is supposed to be active
Definition at line 941 of file GLState.cc.
|
static |
replaces glDepthFunc, supports locking (called in set_depthFunc too)
Definition at line 955 of file GLState.cc.
|
static |
replaces glDepthRange, supports locking
Definition at line 1757 of file GLState.cc.
|
inline |
get diffuse color
Definition at line 961 of file GLState.hh.
|
static |
replaces glDisable, but supports locking
Definition at line 1527 of file GLState.cc.
|
static |
replaces glDisableClientState, supports locking
Definition at line 1584 of file GLState.cc.
|
static |
replaces glDrawBuffer, supports locking
Definition at line 2076 of file GLState.cc.
|
static |
replaces glDrawBuffers, supports locking
Definition at line 2091 of file GLState.cc.
|
static |
replaces glEnable, but supports locking
Definition at line 1507 of file GLState.cc.
|
static |
replaces glEnableClientState, supports locking
Definition at line 1570 of file GLState.cc.
Vec3d ACG::GLState::eye | ( | ) | const |
get eye point
Definition at line 886 of file GLState.cc.
|
inline |
get far clipping distance
Definition at line 861 of file GLState.hh.
|
inline |
get forward projection matrix
Definition at line 826 of file GLState.hh.
double ACG::GLState::fovy | ( | ) | const |
get field of view in y direction
Definition at line 868 of file GLState.cc.
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.
|
static |
Simple wrapper around glGenBuffers. Useful where glew cannot be included.
Definition at line 2218 of file GLState.cc.
|
static |
Simple wrapper around glGenBuffers. Useful where glew cannot be included.
Definition at line 2214 of file GLState.cc.
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.
|
inline |
get viewport
Definition at line 841 of file GLState.hh.
|
inlinestatic |
get active GL texture
Definition at line 682 of file GLState.hh.
|
inlinestatic |
get active texture as zero based index
Definition at line 684 of file GLState.hh.
|
static |
get alpha function, null-ptr safe
Definition at line 1723 of file GLState.cc.
|
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.
|
static |
get blend color, not null-ptr safe, 4 element color output: RGBA
Definition at line 1702 of file GLState.cc.
|
inlinestatic |
get blend equation
Definition at line 341 of file GLState.hh.
|
inlinestatic |
get blend function, null-ptr safe
Definition at line 310 of file GLState.hh.
|
static |
get blend function, null-ptr safe
Definition at line 1664 of file GLState.cc.
|
static |
get currently bound buffer
Definition at line 1850 of file GLState.cc.
|
static |
get bound texture
Definition at line 1948 of file GLState.cc.
|
static |
get bound texture target
Definition at line 1953 of file GLState.cc.
|
static |
Wraps glGetBufferParameteriv for GL_BUFFER_SIZE Useful where glew cannot be included
Definition at line 2245 of file GLState.cc.
|
staticprivate |
bijective map from GLenum buffer_target to [0..3], -1 if unsupported
Definition at line 1781 of file GLState.cc.
|
static |
get color pointer, null-ptr safe
Definition at line 2019 of file GLState.cc.
|
inlinestatic |
get current cull face
Definition at line 393 of file GLState.hh.
|
static |
get current depth range
Definition at line 1773 of file GLState.cc.
|
static |
get current draw framebuffer of a target
get current framebuffer of a target
Definition at line 2117 of file GLState.cc.
|
static |
get current read framebuffer of a target
get current framebuffer of a target
Definition at line 2125 of file GLState.cc.
|
static |
get normal pointer, null-ptr safe
Definition at line 1997 of file GLState.cc.
|
inlinestatic |
get bound program
Definition at line 651 of file GLState.hh.
|
inlinestatic |
get current shade model
Definition at line 381 of file GLState.hh.
|
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.
|
static |
get the length of a shaders source returns 0 on failure
Definition at line 1882 of file GLState.cc.
|
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.
|
static |
get color pointer, null-ptr safe
Definition at line 2041 of file GLState.cc.
|
static |
replaces glVertexPointer, supports locking
Definition at line 2061 of file GLState.cc.
|
static |
get vertex pointer, null-ptr safe
Definition at line 1975 of file GLState.cc.
void ACG::GLState::initialize | ( | ) |
initialize all state variables (called by constructor)
Definition at line 162 of file GLState.cc.
|
inline |
get inverse modelview matrix
Definition at line 836 of file GLState.hh.
|
inline |
get inverse projection matrix
Definition at line 831 of file GLState.hh.
|
inlinestatic |
get alpha func locking state
Definition at line 375 of file GLState.hh.
|
inlinestatic |
get blend color locking state
Definition at line 361 of file GLState.hh.
|
inlinestatic |
get blend equation locking state
Definition at line 348 of file GLState.hh.
|
inlinestatic |
get blend func locking state
Definition at line 317 of file GLState.hh.
|
inlinestatic |
replaces glEnable, but supports locking
Definition at line 334 of file GLState.hh.
|
inlinestatic |
replaces glEnable, but supports locking
Definition at line 333 of file GLState.hh.
|
inlinestatic |
get blend func locking state
Definition at line 332 of file GLState.hh.
|
static |
get buffer target locking state
Definition at line 1845 of file GLState.cc.
|
static |
returns true, if a client state is enabled
Definition at line 1613 of file GLState.cc.
|
static |
returns true, if a client state is locked
Definition at line 1608 of file GLState.cc.
|
inlinestatic |
get vertex pointer lock state
Definition at line 481 of file GLState.hh.
|
inlinestatic |
get cull face locking state
Definition at line 399 of file GLState.hh.
|
inlinestatic |
Definition at line 905 of file GLState.hh.
|
inlinestatic |
get depth range locking state
Definition at line 410 of file GLState.hh.
|
inlinestatic |
get draw buffer lock state
Definition at line 623 of file GLState.hh.
|
static |
get framebuffer target lock state
Definition at line 2187 of file GLState.cc.
|
inlinestatic |
get normal pointer lock state
Definition at line 459 of file GLState.hh.
|
inlinestatic |
get program locking state
Definition at line 658 of file GLState.hh.
|
inlinestatic |
get shade model locking state
Definition at line 387 of file GLState.hh.
|
static |
returns true, if a cpa state is enabled
Definition at line 1562 of file GLState.cc.
|
static |
returns true, if a cap state is locked
Definition at line 1557 of file GLState.cc.
|
inlinestatic |
get vertex pointer lock state
Definition at line 516 of file GLState.hh.
|
static |
get texture target locking state
Definition at line 1943 of file GLState.cc.
|
inlinestatic |
get vertex pointer lock state
Definition at line 442 of file GLState.hh.
|
inline |
get line width
Definition at line 1000 of file GLState.hh.
|
inlinestatic |
lock alpha func
Definition at line 371 of file GLState.hh.
|
inlinestatic |
lock blend color
Definition at line 357 of file GLState.hh.
|
inlinestatic |
lock blend equation
Definition at line 344 of file GLState.hh.
|
inlinestatic |
lock blend func
Definition at line 313 of file GLState.hh.
|
inlinestatic |
lock blend func
Definition at line 328 of file GLState.hh.
|
static |
lock buffer target
Definition at line 1835 of file GLState.cc.
|
static |
locks a client state
Definition at line 1598 of file GLState.cc.
|
inlinestatic |
lock color pointer
Definition at line 477 of file GLState.hh.
|
inlinestatic |
lock cull face
Definition at line 395 of file GLState.hh.
|
inlinestatic |
Definition at line 903 of file GLState.hh.
|
inlinestatic |
lock depth range
Definition at line 406 of file GLState.hh.
|
inlinestatic |
lock draw buffer state, applies to drawBuffer and drawBuffers
Definition at line 619 of file GLState.hh.
|
static |
lock a framebuffer target
Definition at line 2163 of file GLState.cc.
|
inlinestatic |
lock normal pointer
Definition at line 455 of file GLState.hh.
|
inlinestatic |
lock the program
Definition at line 654 of file GLState.hh.
|
inlinestatic |
lock shade model
Definition at line 383 of file GLState.hh.
|
static |
locks a specific cap state, such that enable() or disable() has no effect
Definition at line 1547 of file GLState.cc.
|
inlinestatic |
lock color pointer
Definition at line 512 of file GLState.hh.
|
static |
locks the current texture stage (set by setActiveTexture)
Definition at line 1933 of file GLState.cc.
|
inlinestatic |
lock vertex pointer
Definition at line 438 of file GLState.hh.
set camera by lookAt
Definition at line 515 of file GLState.cc.
|
inline |
does nothing
Definition at line 224 of file GLState.hh.
|
static |
Simple wrapper around glMapBuffer. Useful where glew cannot be included.
Definition at line 2236 of file GLState.cc.
|
inline |
get maximum number of render passes
Definition at line 1018 of file GLState.hh.
|
inline |
Get max number of available texture units.
Definition at line 1082 of file GLState.hh.
|
inline |
Get current global mipmapping state.
Definition at line 1096 of file GLState.hh.
|
inline |
get modelview matrix
Definition at line 816 of file GLState.hh.
|
inline |
time passed since last redraw in milliseconds
Definition at line 238 of file GLState.hh.
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.
|
inline |
Get current multisampling state.
Definition at line 1073 of file GLState.hh.
|
inline |
Check if Multisampling is globally disabled.
Definition at line 1079 of file GLState.hh.
|
inline |
get near clipping distance
Definition at line 858 of file GLState.hh.
|
inline |
increment render pass counter
Definition at line 1015 of file GLState.hh.
|
inlinestatic |
Wrapper: glNormalPointer for Vec3d.
Definition at line 452 of file GLState.hh.
|
inlinestatic |
Wrapper: glNormalPointer for Vec3f.
Definition at line 450 of file GLState.hh.
|
static |
replaces glNormalPointer, supports locking
Definition at line 1983 of file GLState.cc.
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.
|
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.
void ACG::GLState::perspective | ( | double | _fovY, |
double | _aspect, | ||
double | _near_plane, | ||
double | _far_plane | ||
) |
perspective projection
Definition at line 448 of file GLState.cc.
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.
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.
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.
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.
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.
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.
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.
void ACG::GLState::pick_pop_name | ( | ) |
pops the current name from the stack (like glPopName())
Definition at line 1097 of file GLState.cc.
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.
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.
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.
|
inline |
get point size
Definition at line 995 of file GLState.hh.
void ACG::GLState::pop_modelview_matrix | ( | ) |
pop modelview matrix
Definition at line 1026 of file GLState.cc.
void ACG::GLState::pop_projection_matrix | ( | ) |
pop projection matrix
Definition at line 989 of file GLState.cc.
project point in world coordinates to window coordinates
Definition at line 640 of file GLState.cc.
|
inline |
get projection matrix
Definition at line 811 of file GLState.hh.
void ACG::GLState::push_modelview_matrix | ( | ) |
push modelview matrix
Definition at line 1010 of file GLState.cc.
void ACG::GLState::push_projection_matrix | ( | ) |
push projection matrix
Definition at line 971 of file GLState.cc.
|
inline |
get current render pass counter
Definition at line 1009 of file GLState.hh.
void ACG::GLState::reset_modelview | ( | ) |
reset modelview matrix (load identity)
Definition at line 370 of file GLState.cc.
void ACG::GLState::reset_projection | ( | ) |
reset projection matrix (load identity)
Definition at line 334 of file GLState.cc.
|
inline |
reset render pass counter
Definition at line 1012 of file GLState.hh.
Vec3d ACG::GLState::right | ( | ) | const |
get right-vector w.r.t. camera coordinates
Definition at line 918 of file GLState.cc.
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.
|
inline |
scale by (_s, _s, _s)
Definition at line 775 of file GLState.hh.
|
inline |
scale by (_s, _s, _s)
Definition at line 779 of file GLState.hh.
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.
void ACG::GLState::set_ambient_color | ( | const Vec4f & | _col | ) |
set ambient color
Definition at line 707 of file GLState.cc.
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.
|
inline |
set whether transparent or solid objects should be drawn
Definition at line 1058 of file GLState.hh.
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.
void ACG::GLState::set_clear_color | ( | const Vec4f & | _col | ) |
set background color
Definition at line 662 of file GLState.cc.
void ACG::GLState::set_color | ( | const Vec4f & | _col | ) |
set color
Definition at line 691 of file GLState.cc.
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.
void ACG::GLState::set_diffuse_color | ( | const Vec4f & | _col | ) |
set diffuse color
Definition at line 722 of file GLState.cc.
void ACG::GLState::set_line_width | ( | float | _f | ) |
set line width
Definition at line 791 of file GLState.cc.
|
inline |
set maximum number of render passes
Definition at line 1021 of file GLState.hh.
|
inline |
set modelview
Definition at line 753 of file GLState.hh.
set modelview and provide inverse modelview matrix
Definition at line 386 of file GLState.cc.
|
inline |
set time passed since last redraw in milliseconds
Definition at line 241 of file GLState.hh.
void ACG::GLState::set_multisampling | ( | bool | _b | ) |
Enable or disable multisampling.
Definition at line 839 of file GLState.cc.
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.
void ACG::GLState::set_point_size | ( | float | _f | ) |
set point size
Definition at line 776 of file GLState.cc.
|
inline |
set projection
Definition at line 716 of file GLState.hh.
set projection and provide inverse projection matrix
Definition at line 352 of file GLState.cc.
void ACG::GLState::set_shininess | ( | float | _shininess | ) |
set specular shininess (must be in [0, 128])
Definition at line 761 of file GLState.cc.
void ACG::GLState::set_specular_color | ( | const Vec4f & | _col | ) |
set specular color
Definition at line 737 of file GLState.cc.
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.
|
inline |
should GL matrices be updated after each matrix operation
Definition at line 235 of file GLState.hh.
void ACG::GLState::setCompatibilityProfile | ( | bool | _compatibility | ) |
Definition at line 323 of file GLState.cc.
void ACG::GLState::setState | ( | ) |
set the whole stored gl state
Definition at line 209 of file GLState.cc.
|
static |
replaces glVertexPointer, supports locking
Definition at line 2049 of file GLState.cc.
|
static |
replaces glShadeModel, supports locking
Definition at line 1729 of file GLState.cc.
|
inline |
get specular shininess (must be in [0, 128])
Definition at line 985 of file GLState.hh.
|
inline |
get specular color
Definition at line 966 of file GLState.hh.
|
static |
synchronize this class with the OpenGL state machine
Definition at line 1244 of file GLState.cc.
|
inlinestatic |
Wrapper: glTexcoordPointer for double.
Definition at line 492 of file GLState.hh.
|
inlinestatic |
Wrapper: glTexcoordPointer for float.
Definition at line 490 of file GLState.hh.
|
inlinestatic |
Wrapper: glTexcoordPointer for Vec2d.
Definition at line 496 of file GLState.hh.
|
inlinestatic |
Wrapper: glTexcoordPointer for Vec2f.
Definition at line 494 of file GLState.hh.
|
inlinestatic |
Wrapper: glTexcoordPointer for Vec3d.
Definition at line 500 of file GLState.hh.
|
inlinestatic |
Wrapper: glTexcoordPointer for Vec3f.
Definition at line 498 of file GLState.hh.
|
inlinestatic |
Wrapper: glTexcoordPointer for Vec4d.
Definition at line 504 of file GLState.hh.
|
inlinestatic |
Wrapper: glTexcoordPointer for Vec4f.
Definition at line 502 of file GLState.hh.
|
static |
replaces glTexcoordPointer, supports locking
Definition at line 2027 of file GLState.cc.
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.
void ACG::GLState::translate | ( | Vec3d | _vector, |
MultiplyFrom | _mult_from = MULT_FROM_RIGHT |
||
) |
translate by _vector
Definition at line 556 of file GLState.cc.
|
inline |
get whether transparenet or solid objects should be drawn
Definition at line 1065 of file GLState.hh.
|
inlinestatic |
unlock alpha func
Definition at line 373 of file GLState.hh.
|
inlinestatic |
unlock blend color
Definition at line 359 of file GLState.hh.
|
inlinestatic |
unlock blend equation
Definition at line 346 of file GLState.hh.
|
inlinestatic |
unlock blend func
Definition at line 315 of file GLState.hh.
|
inlinestatic |
unlock blend func
Definition at line 330 of file GLState.hh.
|
static |
unlock buffer target
Definition at line 1840 of file GLState.cc.
|
static |
unlocks a client state
Definition at line 1603 of file GLState.cc.
|
inlinestatic |
unlock vertex pointer
Definition at line 479 of file GLState.hh.
|
inlinestatic |
unlock cull face
Definition at line 397 of file GLState.hh.
|
inlinestatic |
Definition at line 904 of file GLState.hh.
|
inlinestatic |
unlock depth range
Definition at line 408 of file GLState.hh.
|
inlinestatic |
unlock draw buffer state
Definition at line 621 of file GLState.hh.
|
static |
unlock a framebuffer target
Definition at line 2175 of file GLState.cc.
|
inlinestatic |
unlock normal pointer
Definition at line 457 of file GLState.hh.
|
inlinestatic |
unlock the program
Definition at line 656 of file GLState.hh.
|
inlinestatic |
unlock shade model
Definition at line 385 of file GLState.hh.
|
static |
unlocks a specific cap state
Definition at line 1552 of file GLState.cc.
|
inlinestatic |
unlock vertex pointer
Definition at line 514 of file GLState.hh.
|
static |
unlocks the current texture target
Definition at line 1938 of file GLState.cc.
|
inlinestatic |
unlock vertex pointer
Definition at line 440 of file GLState.hh.
|
static |
Simple wrapper around glUnmapBuffer. Useful where glew cannot be included.
Definition at line 2241 of file GLState.cc.
unproject point in window coordinates _winPoint to world coordinates
Definition at line 651 of file GLState.cc.
Vec3d ACG::GLState::up | ( | ) | const |
get up-vector w.r.t. camera coordinates
Definition at line 906 of file GLState.cc.
|
inline |
should GL matrices be updated after each matrix operation
Definition at line 233 of file GLState.hh.
|
static |
replaces glUseProgram, supports locking
Definition at line 2200 of file GLState.cc.
|
inlinestatic |
Wrapper: glVertexPointer for Vec2d.
Definition at line 427 of file GLState.hh.
|
inlinestatic |
Wrapper: glVertexPointer for Vec2f.
Definition at line 425 of file GLState.hh.
|
inlinestatic |
Wrapper: glVertexPointer for Vec3d.
Definition at line 431 of file GLState.hh.
|
inlinestatic |
Wrapper: glVertexPointer for Vec3f.
Definition at line 429 of file GLState.hh.
|
inlinestatic |
Wrapper: glVertexPointer for Vec4d.
Definition at line 435 of file GLState.hh.
|
inlinestatic |
Wrapper: glVertexPointer for Vec4f.
Definition at line 433 of file GLState.hh.
|
static |
replaces glVertexPointer, supports locking
Definition at line 1961 of file GLState.cc.
|
inline |
get viewing ray
Definition at line 873 of file GLState.hh.
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.
get viewing ray (_orgin & _direction) through pixel (_x,_y). _direction will be nornalized.
Definition at line 930 of file GLState.cc.
|
inline |
get viewport matrix
Definition at line 821 of file GLState.hh.
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.
|
inline |
get viewport height
Definition at line 849 of file GLState.hh.
|
inline |
get viewport width
Definition at line 847 of file GLState.hh.
|
private |
Definition at line 1219 of file GLState.hh.
|
staticprivate |
Definition at line 1262 of file GLState.hh.
|
private |
Definition at line 1203 of file GLState.hh.
|
private |
Definition at line 1202 of file GLState.hh.
|
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.
|
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.
|
staticprivate |
Definition at line 1261 of file GLState.hh.
|
staticprivate |
Definition at line 1260 of file GLState.hh.
|
staticprivate |
Definition at line 1259 of file GLState.hh.
|
private |
Definition at line 1230 of file GLState.hh.
|
private |
Definition at line 1191 of file GLState.hh.
|
private |
Definition at line 1200 of file GLState.hh.
|
private |
Definition at line 1201 of file GLState.hh.
|
private |
Definition at line 1239 of file GLState.hh.
|
staticprivate |
Definition at line 1283 of file GLState.hh.
|
private |
Definition at line 1236 of file GLState.hh.
|
private |
Definition at line 260 of file GLState.hh.
|
staticprivate |
Definition at line 1278 of file GLState.hh.
|
static |
default value for ambient color
Definition at line 926 of file GLState.hh.
|
static |
default value for base color
Definition at line 924 of file GLState.hh.
|
static |
default value for clear color
Definition at line 922 of file GLState.hh.
|
static |
default value for diffuse color
Definition at line 928 of file GLState.hh.
|
static |
default value for overlay color
Definition at line 932 of file GLState.hh.
|
static |
default value for shininess
Definition at line 934 of file GLState.hh.
|
static |
default value for specular color
Definition at line 930 of file GLState.hh.
|
staticprivate |
Definition at line 1243 of file GLState.hh.
|
staticprivate |
Definition at line 1264 of file GLState.hh.
|
private |
Definition at line 1204 of file GLState.hh.
|
staticprivate |
Definition at line 1287 of file GLState.hh.
|
private |
Definition at line 1197 of file GLState.hh.
|
staticprivate |
Definition at line 1291 of file GLState.hh.
|
staticprivate |
Definition at line 1269 of file GLState.hh.
|
private |
Definition at line 1194 of file GLState.hh.
|
staticprivate |
Definition at line 1253 of file GLState.hh.
|
staticprivate |
Definition at line 1257 of file GLState.hh.
|
staticprivate |
Definition at line 1272 of file GLState.hh.
|
private |
Definition at line 1194 of file GLState.hh.
|
private |
Definition at line 1191 of file GLState.hh.
|
private |
Definition at line 1186 of file GLState.hh.
|
private |
Definition at line 1184 of file GLState.hh.
|
private |
Definition at line 1188 of file GLState.hh.
|
private |
Definition at line 1191 of file GLState.hh.
|
private |
Definition at line 1212 of file GLState.hh.
|
private |
holds the maximum render pass number this has to be set externally
Definition at line 1030 of file GLState.hh.
|
staticprivate |
Definition at line 1299 of file GLState.hh.
|
staticprivate |
Definition at line 1300 of file GLState.hh.
|
staticprivate |
Definition at line 1298 of file GLState.hh.
|
private |
Definition at line 1224 of file GLState.hh.
|
private |
Definition at line 1185 of file GLState.hh.
|
private |
Definition at line 1233 of file GLState.hh.
|
private |
Definition at line 1218 of file GLState.hh.
|
private |
Definition at line 1197 of file GLState.hh.
|
staticprivate |
Definition at line 1281 of file GLState.hh.
|
staticprivate |
Definition at line 1221 of file GLState.hh.
|
private |
Definition at line 1206 of file GLState.hh.
|
private |
Definition at line 1212 of file GLState.hh.
|
staticprivate |
Definition at line 1294 of file GLState.hh.
|
private |
Definition at line 1183 of file GLState.hh.
|
private |
holds the current render pass number (1-indexed) this has to be set externally
Definition at line 1026 of file GLState.hh.
|
staticprivate |
Definition at line 1275 of file GLState.hh.
|
private |
Definition at line 1209 of file GLState.hh.
|
private |
Definition at line 1205 of file GLState.hh.
|
private |
Definition at line 1180 of file GLState.hh.
|
private |
Definition at line 1179 of file GLState.hh.
|
private |
Definition at line 1178 of file GLState.hh.
|
private |
Definition at line 1177 of file GLState.hh.
|
staticprivate |
Definition at line 1250 of file GLState.hh.
|
staticprivate |
Definition at line 1282 of file GLState.hh.
|
private |
Definition at line 1215 of file GLState.hh.
|
private |
Definition at line 1227 of file GLState.hh.
|
staticprivate |
Definition at line 1280 of file GLState.hh.
|
private |
Definition at line 1191 of file GLState.hh.
|
private |
Definition at line 1187 of file GLState.hh.