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 Texture from_texture_handle (GLuint type, GLuint handle)
 Creates a texture object from an OpenGL texture handle. 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 (Texture &texture)
 Returns the OpenGL texture handle. More...
 
static TextureFormat_GL get_textureformat (TextureFormat format)
 Returns the opengl texture format. More...
 
static void set_active (GraphicContext &gc)
 Sets the thread's OpenGL context to the one used by the graphic context. More...
 
static void set_active (const OpenGLGraphicContextProvider *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 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
GLFunctions
functions
 Function table for OpenGL 2.0. More...
 

Friends

class GL1GraphicContextProvider
 
class GL3GraphicContextProvider
 
class PBuffer_GL1_Impl
 

Detailed Description

OpenGL utility class.

Member Function Documentation

static void clan::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 Texture clan::OpenGL::from_texture_handle ( GLuint  type,
GLuint  handle 
)
static

Creates a texture object from an OpenGL texture handle.

The returned object takes ownership of the texture handle (it calls glDeleteTextures when destroyed)

static std::vector<MessageLog_GL> clan::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* clan::OpenGL::get_proc_address ( const std::string function_name)
static

Get OpenGL extension specific function address.

static GLuint clan::OpenGL::get_texture_handle ( Texture texture)
static

Returns the OpenGL texture handle.

static TextureFormat_GL clan::OpenGL::get_textureformat ( TextureFormat  format)
static

Returns the opengl texture format.

static void clan::OpenGL::set_active ( GraphicContext gc)
static

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

static void clan::OpenGL::set_active ( const OpenGLGraphicContextProvider *const  gc_provider)
static

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

static bool clan::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 GLenum clan::OpenGL::to_cube_target ( int  index)
static
static GLenum clan::OpenGL::to_enum ( DrawBuffer  buf)
static
static GLenum clan::OpenGL::to_enum ( CompareFunction  func)
static
static GLenum clan::OpenGL::to_enum ( StencilOp  op)
static
static GLenum clan::OpenGL::to_enum ( CullMode  mode)
static
static GLenum clan::OpenGL::to_enum ( FillMode  mode)
static
static GLenum clan::OpenGL::to_enum ( BlendFunc  func)
static
static GLenum clan::OpenGL::to_enum ( BlendEquation  eq)
static
static GLenum clan::OpenGL::to_enum ( VertexAttributeDataType  value)
static
static GLenum clan::OpenGL::to_enum ( PrimitivesType  value)
static
static GLenum clan::OpenGL::to_enum ( LogicOp  op)
static
static GLenum clan::OpenGL::to_enum ( TextureFilter  filter)
static
static GLenum clan::OpenGL::to_enum ( TextureWrapMode  mode)
static
static GLenum clan::OpenGL::to_enum ( TextureCompareMode  mode)
static
static GLenum clan::OpenGL::to_enum ( BufferUsage  usage)
static
static GLenum clan::OpenGL::to_enum ( BufferAccess  access)
static

Friends And Related Function Documentation

friend class GL1GraphicContextProvider
friend
friend class GL3GraphicContextProvider
friend
friend class PBuffer_GL1_Impl
friend

Member Data Documentation

cl_tls_variable GLFunctions* clan::OpenGL::functions
static

Function table for OpenGL 2.0.


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