Main OpenGL Handle.
More...
#include <OglInclude.hpp>
|
static const unsigned int | numShaderTypes = GLIP_NUM_SHADER_TYPES |
| Number of different shader types.
|
|
static const GLenum | shaderTypes [GLIP_NUM_SHADER_TYPES] = {GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, GL_COMPUTE_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER} |
| List (tight) of various shader types.
|
|
|
(Note that these are not member functions.)
|
template< size_t N > bool | belongsToGLEnums (const GLenum &p, const GLenum(&l)[N]) |
| Test if a symbol belongs to a list of possible symbols. More...
|
|
std::string | getGLErrorDescription (const GLenum &e) |
| Get the description for a particular error code. More...
|
|
void | debugGL (void) |
| Print the current binding points state on std::cout (GL_TEXTURE_BINDING_1D, GL_TEXTURE_BINDING_2D, GL_TEXTURE_BINDING_3D, GL_ARRAY_BUFFER_BINDING, GL_ELEMENT_ARRAY_BUFFER_BINDING, GL_PIXEL_PACK_BUFFER_BINDING, GL_PIXEL_UNPACK_BUFFER_BINDING, GL_FRAMEBUFFER_BINDING, GL_TEXTURE_BUFFER_EXT, GL_CURRENT_PROGRAM).
|
|
std::string | getGLEnumName (const GLenum &p) |
| Get the parameter name as a string. More...
|
|
std::string | getGLEnumNameSafe (const GLenum &p) |
| Get the parameter name as a string. More...
|
|
GLenum | getGLEnum (const std::string &s) |
| Get the parameter from its name in a string. More...
|
|
bool | belongsToGLEnums (const GLenum &p, const GLenum *l, const size_t s) |
| Test if a symbol belongs to a list of possible symbols. More...
|
|
ID of the supported hardware vendors.
Enumerator |
---|
vd_NVIDIA |
For NVIDIA.
|
vd_AMDATI |
For AMD/ATI.
|
vd_INTEL |
For INTEL.
|
vd_UNKNOWN |
When unknown.
|
HandleOpenGL::HandleOpenGL |
( |
void |
| ) |
|
Initialize Glew and other tools for the OpenGL state machine.
You have to create one object of this type before functions using OpenGL.
void HandleOpenGL::deinit |
( |
void |
| ) |
|
|
static |
Deinitialize Glew and other tools for the OpenGL state machine.
You have to call this function when the context has been created with HandleOpenGL::init.
std::vector< std::string > HandleOpenGL::getAvailableGLSLVersions |
( |
void |
| ) |
|
|
static |
Get the list of available GLSL version.
- Returns
- A vector of string containing the available GLSL versions.
std::string HandleOpenGL::getGLSLVersion |
( |
void |
| ) |
|
|
static |
- Returns
- A std::string object containing the GLSL version or an empty string if the OpenGL version is less than 2.0.
std::string HandleOpenGL::getRendererName |
( |
void |
| ) |
|
|
static |
- Returns
- A std::string object containing the renderer name.
unsigned int HandleOpenGL::getShaderTypeIndex |
( |
GLenum |
shaderType | ) |
|
|
static |
Get the index of a shader type.
- Parameters
-
shaderType | The shader type : GL_VERTEX_SHADER, GL_FRAGMENT_SHADER, GL_COMPUTE_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER. |
- Returns
- The index associated with the type.
std::string HandleOpenGL::getVendorName |
( |
void |
| ) |
|
|
static |
- Returns
- A std::string object containing the vendor name.
std::string HandleOpenGL::getVersion |
( |
void |
| ) |
|
|
static |
- Returns
- A std::string object containing the OpenGL version.
void HandleOpenGL::getVersion |
( |
int & |
major, |
|
|
int & |
minor |
|
) |
| |
|
static |
void HandleOpenGL::init |
( |
void |
| ) |
|
|
static |
Initialize Glew and other tools for the OpenGL state machine.
When using this function, you MUST make an explicit call to HandleOpenGL::deinit when exiting program.
bool HandleOpenGL::isInitialized |
( |
void |
| ) |
|
|
static |
Test if the context was already initialized.
- Returns
- True if the context was initialized (and not terminated).
template< size_t N > bool belongsToGLEnums |
( |
const GLenum & |
p, |
|
|
const GLenum(&) |
l[N] |
|
) |
| |
|
related |
Test if a symbol belongs to a list of possible symbols.
- Parameters
-
p | Symbol to be tested. |
l | List of symbols. |
- Returns
- True if the symbol belongs to the list.
Sample usage :
const GLenum list[] = {GL_RED, GL_LUMINANCE, GL_RGB, GL_RGBA};
bool belongsToGLEnums |
( |
const GLenum & |
p, |
|
|
const GLenum * |
l, |
|
|
const size_t |
s |
|
) |
| |
|
related |
Test if a symbol belongs to a list of possible symbols.
- Parameters
-
p | Symbol to be tested. |
l | List of symbols. |
s | Size of the list, in bytes (from sizeof, for instance). |
- Returns
- True if the symbol belongs to the list.
Sample usage :
const GLenum[] list = {GL_RED, GL_LUMINANCE, GL_RGB, GL_RGBA};
GLenum getGLEnum |
( |
const std::string & |
s | ) |
|
|
related |
Get the parameter from its name in a string.
- Parameters
-
s | The GLenum parameter name. |
- Returns
- The corresponding enum or throw an exception if no enum was found.
std::string getGLEnumName |
( |
const GLenum & |
p | ) |
|
|
related |
Get the parameter name as a string.
- Parameters
-
- Returns
- A standard string.
std::string getGLEnumNameSafe |
( |
const GLenum & |
p | ) |
|
|
related |
Get the parameter name as a string.
- Parameters
-
- Returns
- A standard string or <Unknown:ID> where ID is the decimal representation of the enum.
std::string getGLErrorDescription |
( |
const GLenum & |
e | ) |
|
|
related |
Get the description for a particular error code.
- Parameters
-
- Returns
- A std::string containing a description of the error or a string with the error code if it is unknown.
The documentation for this class was generated from the following files: