![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
Pure useful functions for OpenGL. More...
Pure useful functions for OpenGL.
Definition at line 22 of file PureGLsnippets.h.
#include <PureGLsnippets.h>
Static Public Member Functions | |
static void | Init () |
Initialize static class instance. | |
static const char * | getGLErrorTextFromEnum (GLenum err) |
Gets the string representation of the given GL error. | |
static TPureBool | isGLErrorPresent () |
Gets whether there is an error in OpenGL or not. | |
static GLenum | getLastSavedGLError () |
Gets the last saved GL error. | |
static void | ClearGLError () |
Clears GL error state. | |
static TPureUInt | getSizeofIndexType (GLenum iType) |
Returns the size in Bytes of the given OpenGL index type. | |
static TPureUInt | getVertexIndex (const void *arr, TPureUInt index, GLenum iType) |
Returns arr[index] element from the given array of iType type elements. | |
static TPureBool | setVertexIndex (void *arr, TPureUInt index, TPureUInt value, GLenum iType) |
Sets arr[index] element of the given array of iType type elements to value. | |
static void | SetGLBoundingBoxRendering (TPureBool state) |
Sets GL states up for bounding box rendering or resets them. | |
static void | glPrepareBeforeDrawBoundingBox () |
static void | SetZPassRendering (TPureBool state) |
static TPURE_BLENDFACTOR | getPureBlendFromGLBlend (GLenum glb) |
Gets the appropriate Pure blend factor for the given GL enum. | |
static GLenum | getGLBlendFromPureBlend (TPURE_BLENDFACTOR bf) |
Gets the appropriate GL enum for the given Pure blend factor. | |
static void | glLoadTextureIntoTMU (const PureTexture *tex, TPureUInt iTMU, TPureBool bSticked) |
Loads the given texture into the texture mapping unit. | |
static void | glLoadTexturesAndSetBlendState (const PureMaterial *mat, TPureBool bObjLevel1Sticked, TPureBool bObjLevel1Blended) |
Loads all textures into texture mapping units and sets blending if needed for single-pass multitexturing. | |
Static Private Attributes | |
static const char *const | GL_ERR_STR_NO_ERROR = "No Error" |
static const char *const | GL_ERR_STR_INVALID_ENUM = "Invalid Enum" |
static const char *const | GL_ERR_STR_INVALID_VALUE = "Invalid Value" |
static const char *const | GL_ERR_STR_INVALID_OPERATION = "Invalid Operation" |
static const char *const | GL_ERR_STR_STACK_OVERFLOW = "Stack Overflow" |
static const char *const | GL_ERR_STR_STACK_UNDERFLOW = "Stack Underflow" |
static const char *const | GL_ERR_STR_OUT_OF_MEMORY = "Out of Memory" |
static GLenum | errLast = GL_NO_ERROR |
static std::vector< GLuint > | iLastTex |
Last loaded texture in TMU, where vector elem 0 is for TMU0, elem 1 is for TMU1 and so on ... | |
|
static |
Clears GL error state.
Clears OpenGL error state.
Error code is not saved, so this function has no impact on return code of getLastSavedGLError().
Definition at line 90 of file PureGLsnippets.cpp.
|
static |
Gets the appropriate GL enum for the given Pure blend factor.
Definition at line 256 of file PureGLsnippets.cpp.
|
static |
Gets the string representation of the given GL error.
err | OpenGL error code. These are defined in GL.h. |
Definition at line 44 of file PureGLsnippets.cpp.
|
static |
Gets the last saved GL error.
Gets the last saved OpenGL error.
The last saved OpenGL error code is GL_NO_ERROR by default so it is recommended to call isGLErrorPresent() first.
Definition at line 80 of file PureGLsnippets.cpp.
|
static |
Gets the appropriate Pure blend factor for the given GL enum.
Definition at line 230 of file PureGLsnippets.cpp.
|
static |
Returns the size in Bytes of the given OpenGL index type.
Useful when allocating index/element buffer/array for a specific index type.
Definition at line 102 of file PureGLsnippets.cpp.
Returns arr[index] element from the given array of iType type elements.
Useful when the size of an index/element buffer/array is not known at compilation time, but we want to minimize its total size at runtime, thus we allocate its size based on the required element type selected at runtime.
Definition at line 120 of file PureGLsnippets.cpp.
|
static |
Loads the given texture into the texture mapping unit.
tex | Texture to be loaded. If NULL, texturing will be disabled on the specified texture mapping unit. |
iTMU | Into which texture mapping unit we want to load the texture. Currently it must be either 0 or 1. |
bSticked | True if object is sticked to screen, false otherwise. |
Definition at line 283 of file PureGLsnippets.cpp.
|
static |
Loads all textures into texture mapping units and sets blending if needed for single-pass multitexturing.
This function is called per subobject. So if this is buggy, then it can cause problems around blending: even though level-1 object set blending state properly, this one may accidentally change it if it messes up some checks around multitexturing and such, this is also a reason why it must be aware of the blending state of the subobject's level-1 parent object!
mat | Material from where textures should be loaded. If it is PGENULL, texturing will be disabled. |
bObjLevel1Sticked | True if the manager Object3D is sticked to screen, false otherwise. |
bObjLevel1Blended | True if the manager Object3D's material is blended, false otherwise. |
Definition at line 344 of file PureGLsnippets.cpp.
|
static |
Definition at line 192 of file PureGLsnippets.cpp.
|
static |
Initialize static class instance.
Definition at line 28 of file PureGLsnippets.cpp.
|
static |
Gets whether there is an error in OpenGL or not.
The error gets saved by this function and can be further evaluated later by calling getLastSavedGLError(). OpenGL error state is also cleared.
Definition at line 67 of file PureGLsnippets.cpp.
|
static |
Sets GL states up for bounding box rendering or resets them.
state | If true, GL states are set for bounding box rendering. If false, some states are reset for normal rendering (rest of states are controlled by Object3D in such case). |
Definition at line 169 of file PureGLsnippets.cpp.
|
static |
Sets arr[index] element of the given array of iType type elements to value.
If the given value doesn't fit into given iType element type, an error message will be logged to console and no change to array will be done.
Definition at line 137 of file PureGLsnippets.cpp.
|
static |
Definition at line 204 of file PureGLsnippets.cpp.
|
staticprivate |
Definition at line 59 of file PureGLsnippets.h.
|
staticprivate |
Definition at line 52 of file PureGLsnippets.h.
|
staticprivate |
Definition at line 54 of file PureGLsnippets.h.
|
staticprivate |
Definition at line 53 of file PureGLsnippets.h.
|
staticprivate |
Definition at line 51 of file PureGLsnippets.h.
|
staticprivate |
Definition at line 57 of file PureGLsnippets.h.
|
staticprivate |
Definition at line 55 of file PureGLsnippets.h.
|
staticprivate |
Definition at line 56 of file PureGLsnippets.h.
|
staticprivate |
Last loaded texture in TMU, where vector elem 0 is for TMU0, elem 1 is for TMU1 and so on ...
Definition at line 61 of file PureGLsnippets.h.