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() )
 
static Texture from_texture_handle (GLuint type, GLuint handle)
 Creates a texture object from an OpenGL texture handle.
 
static std::vector< MessageLog_GLget_message_log (GLuint numMsgs)
 Get the OpenGL message log.
 
static ProcAddressget_proc_address (const std::string &function_name)
 Get OpenGL extension specific function address.
 
static GLuint get_texture_handle (Texture &texture)
 Returns the OpenGL texture handle.
 
static TextureFormat_GL get_textureformat (TextureFormat format)
 Returns the opengl texture format.
 
static bool set_active ()
 Sets the thread's OpenGL context to the first valid allocated one.
 
static void set_active (const OpenGLGraphicContextProvider *const gc_provider)
 Sets the thread's OpenGL context to the one used by the graphic context.
 
static void set_active (GraphicContext &gc)
 Sets the thread's OpenGL context to the one used by the graphic context.
 
static GLenum to_cube_target (int index)
 
static GLenum to_enum (BlendEquation eq)
 
static GLenum to_enum (BlendFunc func)
 
static GLenum to_enum (BufferAccess access)
 
static GLenum to_enum (BufferUsage usage)
 
static GLenum to_enum (CompareFunction func)
 
static GLenum to_enum (CullMode mode)
 
static GLenum to_enum (DrawBuffer buf)
 
static GLenum to_enum (FillMode mode)
 
static GLenum to_enum (LogicOp op)
 
static GLenum to_enum (PrimitivesType value)
 
static GLenum to_enum (StencilOp op)
 
static GLenum to_enum (TextureCompareMode mode)
 
static GLenum to_enum (TextureFilter filter)
 
static GLenum to_enum (TextureWrapMode mode)
 
static GLenum to_enum (VertexAttributeDataType value)
 

Static Public Attributes

static cl_tls_variable GLFunctionsfunctions
 Function table for OpenGL 2.0.
 

Friends

class GL1GraphicContextProvider
 
class GL3GraphicContextProvider
 
class PBuffer_GL1_Impl
 

Detailed Description

OpenGL utility class.

Member Function Documentation

◆ check_error()

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

◆ from_texture_handle()

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)

◆ get_message_log()

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);

◆ get_proc_address()

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

Get OpenGL extension specific function address.

◆ get_texture_handle()

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

Returns the OpenGL texture handle.

◆ get_textureformat()

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

Returns the opengl texture format.

◆ set_active() [1/3]

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

◆ set_active() [2/3]

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.

◆ set_active() [3/3]

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

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

◆ to_cube_target()

static GLenum clan::OpenGL::to_cube_target ( int index)
static

◆ to_enum() [1/15]

static GLenum clan::OpenGL::to_enum ( BlendEquation eq)
static

◆ to_enum() [2/15]

static GLenum clan::OpenGL::to_enum ( BlendFunc func)
static

◆ to_enum() [3/15]

static GLenum clan::OpenGL::to_enum ( BufferAccess access)
static

◆ to_enum() [4/15]

static GLenum clan::OpenGL::to_enum ( BufferUsage usage)
static

◆ to_enum() [5/15]

static GLenum clan::OpenGL::to_enum ( CompareFunction func)
static

◆ to_enum() [6/15]

static GLenum clan::OpenGL::to_enum ( CullMode mode)
static

◆ to_enum() [7/15]

static GLenum clan::OpenGL::to_enum ( DrawBuffer buf)
static

◆ to_enum() [8/15]

static GLenum clan::OpenGL::to_enum ( FillMode mode)
static

◆ to_enum() [9/15]

static GLenum clan::OpenGL::to_enum ( LogicOp op)
static

◆ to_enum() [10/15]

static GLenum clan::OpenGL::to_enum ( PrimitivesType value)
static

◆ to_enum() [11/15]

static GLenum clan::OpenGL::to_enum ( StencilOp op)
static

◆ to_enum() [12/15]

static GLenum clan::OpenGL::to_enum ( TextureCompareMode mode)
static

◆ to_enum() [13/15]

static GLenum clan::OpenGL::to_enum ( TextureFilter filter)
static

◆ to_enum() [14/15]

static GLenum clan::OpenGL::to_enum ( TextureWrapMode mode)
static

◆ to_enum() [15/15]

static GLenum clan::OpenGL::to_enum ( VertexAttributeDataType value)
static

Friends And Related Symbol Documentation

◆ GL1GraphicContextProvider

friend class GL1GraphicContextProvider
friend

◆ GL3GraphicContextProvider

friend class GL3GraphicContextProvider
friend

◆ PBuffer_GL1_Impl

friend class PBuffer_GL1_Impl
friend

Member Data Documentation

◆ functions

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: