Files Class List

Detailed Description

General OpenGL queries.

This class includes static functions for general OpenGL queries and types used by the other classes in this file.

#include <cyGL.h>

Public Types

enum  Type {
  TYPE_UBYTE = 0 , TYPE_USHORT , TYPE_HALF , TYPE_FLOAT ,
  TYPE_INT8 , TYPE_UINT8 , TYPE_INT16 , TYPE_UINT16 ,
  TYPE_INT32 , TYPE_UINT32
}
 OpenGL types.
 

Static Public Member Functions

static GLenum GetGLType (GLubyte const *)
 Returns the OpenGL type identifier that corresponds to unsigned byte.
 
static GLenum GetGLType (GLushort const *)
 Returns the OpenGL type identifier that corresponds to unsigned short.
 
static GLenum GetGLType (GLfloat const *)
 Returns the OpenGL type identifier that corresponds to float.
 
static GLenum GetGLType (GLbyte const *)
 Returns the OpenGL type identifier that corresponds to byte.
 
static GLenum GetGLType (GLshort const *)
 Returns the OpenGL type identifier that corresponds to short.
 
static GLenum GetGLType (GLint const *)
 Returns the OpenGL type identifier that corresponds to int.
 
static GLenum GetGLType (GLuint const *)
 Returns the OpenGL type identifier that corresponds to unsigned int.
 
static Type GetType (GLubyte const *)
 Returns the Type that corresponds to unsigned byte.
 
static Type GetType (GLushort const *)
 Returns the Type that corresponds to unsigned short.
 
static Type GetType (GLfloat const *)
 Returns the Type that corresponds to float.
 
static Type GetType (GLbyte const *)
 Returns the Type that corresponds to byte.
 
static Type GetType (GLshort const *)
 Returns the Type that corresponds to short.
 
static Type GetType (GLint const *)
 Returns the Type that corresponds to int.
 
static Type GetType (GLuint const *)
 Returns the Type that corresponds to unsigned int.
 
static GLenum TextureFormat (Type type, int numChannels)
 Returns the internal OpenGL texture type identifier for the given Type and the number of channels.
 
static GLenum TextureDataFormat (Type type, int numChannels)
 Returns the OpenGL texture data format identifier for the given Type and the number of channels.
 
static void PrintVersion (std::ostream *outStream=&std::cout)
 Prints the OpenGL version to the given stream.
 
static void CheckError (char const *sourcefile, int line, char const *call=nullptr, std::ostream *outStream=&std::cout)
 Checks all previously triggered OpenGL errors and prints them to the given output stream.
 
static bool CheckContext ()
 Checks if an OpenGL context exists. Returns false if a valid OpenGL context cannot be retrieved. This is mostly useful for safely deleting previously allocated OpenGL objects.