qCC_db  version 2.5.4 (Qt) - 19 Apr 2014
 All Classes Functions Variables Typedefs Enumerations Enumerator Pages
Static Public Member Functions | List of all members
ccGLUtils Class Reference

Static Public Member Functions

static void DisplayTexture2DPosition (GLuint tex, int x, int y, int w, int h, uchar alpha=255)
 
static void DisplayTexture2D (GLuint tex, int w, int h, uchar alpha=255)
 
static void DisplayTexture2DCorner (GLuint tex, int w, int h, uchar alpha=255)
 
static bool SaveTextureToFile (const char *filename, GLuint texID, unsigned w, unsigned h)
 Saves a given texture (texID) to an image file.
 
static void SaveTextureToArray (unsigned char *data, GLuint texID, unsigned w, unsigned h)
 Loads texture from GPU mem to an RGBA array (i.e. 32 bits per pixel)
 
static ccGLMatrix GenerateGLRotationMatrixFromVectors (const CCVector3 &sourceVec, const CCVector3 &destVec)
 Generates the rotation matrix that transforms a vector in another given one. More...
 
static ccGLMatrix GenerateGLRotationMatrixFromAxisAndAngle (const CCVector3 &axis, PointCoordinateType angle_deg)
 Generates the rotation matrix corresponding to an axis (vector) and an angle. More...
 
static ccGLMatrix GenerateViewMat (CC_VIEW_ORIENTATION orientation)
 Returns a 4x4 'OpenGL' matrix corresponding to a given vue orientation. More...
 
static void MakeLightsNeutral ()
 Makes all active GL light sources neutral (i.e. 'gray') More...
 
static bool CatchGLError (const char *context)
 Catches last GL error (if any) More...
 

Member Function Documentation

bool ccGLUtils::CatchGLError ( const char *  context)
static

Catches last GL error (if any)

Displays an error message. In debug mode, pauses execution and then exits.

Parameters
contextname of the method/object that try to catch the error
Returns
true if an error occurred, false otherwise
ccGLMatrix ccGLUtils::GenerateGLRotationMatrixFromAxisAndAngle ( const CCVector3 &  axis,
PointCoordinateType  angle_deg 
)
static

Generates the rotation matrix corresponding to an axis (vector) and an angle.

WARNING: an OpenGL context must be active!

Parameters
axisthe rotation axis (as a vector)
angle_degthe rotation angle (in degrees)
Returns
'OpenGL' style 4x4 matrix
ccGLMatrix ccGLUtils::GenerateGLRotationMatrixFromVectors ( const CCVector3 &  sourceVec,
const CCVector3 &  destVec 
)
static

Generates the rotation matrix that transforms a vector in another given one.

WARNING: an OpenGL context must be active!

Parameters
sourceVecthe original UNIT vector
destVecthe resulting UNIT vector
Returns
'OpenGL' style 4x4 matrix
ccGLMatrix ccGLUtils::GenerateViewMat ( CC_VIEW_ORIENTATION  orientation)
static

Returns a 4x4 'OpenGL' matrix corresponding to a given vue orientation.

Parameters
orientationview orientation
Returns
corresponding GL matrix
void ccGLUtils::MakeLightsNeutral ( )
static

Makes all active GL light sources neutral (i.e. 'gray')

WARNING: an OpenGL context must be active!


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