OpenGL utility class. More...

#include <opengl.h>

Static Public Member Functions

static void check_error ()
 Throw an exception if an OpenGL error was detected ( Using glGetError() ) More...
 
static std::vector< MessageLog_GLget_message_log (GLuint numMsgs)
 Get the OpenGL message log. More...
 
static ProcAddressget_proc_address (const std::string &function_name)
 Get OpenGL extension specific function address. More...
 
static GLuint get_texture_handle (const TexturePtr &texture)
 Returns the OpenGL texture handle. More...
 
static void set_active (const GraphicContextPtr &gc)
 Sets the thread's OpenGL context to the one used by the graphic context. More...
 
static void set_active (const OpenGLContextProvider *const gc_provider)
 Sets the thread's OpenGL context to the one used by the graphic context. More...
 
static bool set_active ()
 Sets the thread's OpenGL context to the first valid allocated one. More...
 
static TextureFormat_GL textureformat (TextureFormat format)
 Returns the opengl texture format. More...
 
static GLenum to_cube_target (int index)
 
static GLenum to_enum (DrawBuffer buf)
 
static GLenum to_enum (CompareFunction func)
 
static GLenum to_enum (StencilOp op)
 
static GLenum to_enum (CullMode mode)
 
static GLenum to_enum (FillMode mode)
 
static GLenum to_enum (BlendFunc func)
 
static GLenum to_enum (BlendEquation eq)
 
static GLenum to_enum (VertexAttributeDataType value)
 
static GLenum to_enum (PrimitivesType value)
 
static GLenum to_enum (LogicOp op)
 
static GLenum to_enum (TextureFilter filter)
 
static GLenum to_enum (TextureWrapMode mode)
 
static GLenum to_enum (TextureCompareMode mode)
 
static GLenum to_enum (BufferUsage usage)
 
static GLenum to_enum (BufferAccess access)
 

Static Public Attributes

static cl_tls_variable GLFunctionsfunctions
 Function table for OpenGL 2.0. More...
 

Friends

class GL1GraphicContext
 
class GL3GraphicContext
 
class PBuffer_GL1_Impl
 

Detailed Description

OpenGL utility class.

Member Function Documentation

static void uicore::OpenGL::check_error ( )
static

Throw an exception if an OpenGL error was detected ( Using glGetError() )

Remember to call glGetError() to clear any previous errors

static std::vector<MessageLog_GL> uicore::OpenGL::get_message_log ( GLuint  numMsgs)
static

Get the OpenGL message log.

This is required for this function to operate OpenGLContextDescription gldesc; gldesc.set_debug(true); OpenGLTarget::set_description(gldesc);

static ProcAddress* uicore::OpenGL::get_proc_address ( const std::string function_name)
static

Get OpenGL extension specific function address.

static GLuint uicore::OpenGL::get_texture_handle ( const TexturePtr texture)
static

Returns the OpenGL texture handle.

static void uicore::OpenGL::set_active ( const GraphicContextPtr gc)
static

Sets the thread's OpenGL context to the one used by the graphic context.

static void uicore::OpenGL::set_active ( const OpenGLContextProvider *const  gc_provider)
static

Sets the thread's OpenGL context to the one used by the graphic context.

static bool uicore::OpenGL::set_active ( )
static

Sets the thread's OpenGL context to the first valid allocated one.

If a valid OpenGL context is not found, then "no render context" is set.

Returns
true = Success. false = No OpenGL contexts could be found
static TextureFormat_GL uicore::OpenGL::textureformat ( TextureFormat  format)
static

Returns the opengl texture format.

static GLenum uicore::OpenGL::to_cube_target ( int  index)
static
static GLenum uicore::OpenGL::to_enum ( DrawBuffer  buf)
static
static GLenum uicore::OpenGL::to_enum ( CompareFunction  func)
static
static GLenum uicore::OpenGL::to_enum ( StencilOp  op)
static
static GLenum uicore::OpenGL::to_enum ( CullMode  mode)
static
static GLenum uicore::OpenGL::to_enum ( FillMode  mode)
static
static GLenum uicore::OpenGL::to_enum ( BlendFunc  func)
static
static GLenum uicore::OpenGL::to_enum ( BlendEquation  eq)
static
static GLenum uicore::OpenGL::to_enum ( VertexAttributeDataType  value)
static
static GLenum uicore::OpenGL::to_enum ( PrimitivesType  value)
static
static GLenum uicore::OpenGL::to_enum ( LogicOp  op)
static
static GLenum uicore::OpenGL::to_enum ( TextureFilter  filter)
static
static GLenum uicore::OpenGL::to_enum ( TextureWrapMode  mode)
static
static GLenum uicore::OpenGL::to_enum ( TextureCompareMode  mode)
static
static GLenum uicore::OpenGL::to_enum ( BufferUsage  usage)
static
static GLenum uicore::OpenGL::to_enum ( BufferAccess  access)
static

Friends And Related Function Documentation

friend class GL1GraphicContext
friend
friend class GL3GraphicContext
friend
friend class PBuffer_GL1_Impl
friend

Member Data Documentation

cl_tls_variable GLFunctions* uicore::OpenGL::functions
static

Function table for OpenGL 2.0.


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