A class to handle OpenGL extensions. More...
Static Public Member Functions | |
static bool | loadGLExtPointSprite () |
Loads the openGL point sprite extension. | |
static bool | loadGLExtPointParameter () |
Loads the openGL extended point parameter extension. | |
static void | setPixelPerUnit (float fovy, int screenHeight) |
Computes a conversion ratio between pixels and universe units. | |
static bool | loadGLExtTexture3D () |
Loads the OpenGL texture 3D extension. | |
static void | glTexImage3D (GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) |
Specifies a three-dimensional texture image. | |
static bool | loadGLExtShader () |
Loads the shader extension. | |
Protected Types | |
enum | GLExtension { UNCHECKED, SUPPORTED, UNSUPPORTED } |
Constants for openGL extension loading. More... | |
Static Protected Member Functions | |
static void * | glGetProcAddress (const char *name) |
Gets the address of an OpenGL function in a portable way. | |
static GLExtension | getPointSpriteGLExt () |
Gets the state of the point sprite extension. | |
static void | enablePointSpriteGLExt () |
Enables the use of point sprites. | |
static void | disablePointSpriteGLExt () |
Disables the use of point sprites. | |
static GLExtension | getPointParameterGLExt () |
Gets the state of the point parameters extension. | |
static void | enablePointParameterGLExt (float size, bool distance) |
Enables the use of point parameters. | |
static void | disablePointParameterGLExt () |
Disables the use of point parameters. | |
static GLExtension | getTexture3DGLExt () |
Gets the state of the texture 3D extension. | |
static GLExtension | getShaderGLExt () |
Gets the state of the shader support. |
A class to handle OpenGL extensions.
This class presents an interface to handle openGL extensions.
The interface is static an has a public and a protected side.
A class willing to make use of the openGL extensions must derive from this class to access the protected interface.
If an OpenGL extension is not handle by this class, the proper way to implement it within SPARK will be to derive this class to implement it. Then the Renderer which will use the extension has to extends the child class.
The opengl extensions implemented are :
Definition at line 64 of file SPK_GLExtHandler.h.
enum GLExtension [protected] |
Constants for openGL extension loading.
Definition at line 187 of file SPK_GLExtHandler.h.
static void disablePointParameterGLExt | ( | ) | [static, protected] |
Disables the use of point parameters.
Note that before calling this method, the user must ensure that the point parameters extension is loaded.
void disablePointSpriteGLExt | ( | ) | [static, protected] |
Disables the use of point sprites.
Note that before calling this method, the user must ensure that the point sprite extension is loaded.
Definition at line 375 of file SPK_GLExtHandler.h.
static void enablePointParameterGLExt | ( | float | size, | |
bool | distance | |||
) | [static, protected] |
Enables the use of point parameters.
This method will set the right point parameters to get the desired point size.
It can either be used to have points size function of the distance to the camera (is distance is true) or only to allow bigger range for point sizes (if distance is false).
Note that if distance is set to true setPixelPerUnit(float,int) must be call once before.
Note that before calling this method, the user must ensure that the point parameters extension is loaded.
size | : the size of the point | |
distance | : true to enable the modification of the size function of the distance, false not to. |
void enablePointSpriteGLExt | ( | ) | [static, protected] |
Enables the use of point sprites.
Note that before calling this method, the user must ensure that the point sprite extension is loaded.
Definition at line 369 of file SPK_GLExtHandler.h.
static GLExtension getPointParameterGLExt | ( | ) | [static, protected] |
Gets the state of the point parameters extension.
static GLExtension getPointSpriteGLExt | ( | ) | [static, protected] |
Gets the state of the point sprite extension.
static GLExtension getShaderGLExt | ( | ) | [static, protected] |
Gets the state of the shader support.
static GLExtension getTexture3DGLExt | ( | ) | [static, protected] |
Gets the state of the texture 3D extension.
void * glGetProcAddress | ( | const char * | name | ) | [static, protected] |
Gets the address of an OpenGL function in a portable way.
name | : the name of the OpenGL function |
Definition at line 356 of file SPK_GLExtHandler.h.
static void glTexImage3D | ( | GLenum | target, | |
GLint | level, | |||
GLenum | internalFormat, | |||
GLsizei | width, | |||
GLsizei | height, | |||
GLsizei | depth, | |||
GLint | border, | |||
GLenum | format, | |||
GLenum | type, | |||
const GLvoid * | pixels | |||
) | [static] |
Specifies a three-dimensional texture image.
This method is exactly like calling the glTexImage3D method of OpenGL excepts it is already defined.
If the OpenGL texture 3D extension is not supported, this method does nothing.
For more information, check the OpenGL documentation of glTexImage3D.
target | : check the OpenGL documentation of glTexImage3D | |
level | : check the OpenGL documentation of glTexImage3D | |
internalFormat | : check the OpenGL documentation of glTexImage3D | |
width | : check the OpenGL documentation of glTexImage3D | |
height | : check the OpenGL documentation of glTexImage3D | |
depth | : check the OpenGL documentation of glTexImage3D | |
border | : check the OpenGL documentation of glTexImage3D | |
format | : check the OpenGL documentation of glTexImage3D | |
type | : check the OpenGL documentation of glTexImage3D | |
pixels | : check the OpenGL documentation of glTexImage3D |
static bool loadGLExtPointParameter | ( | ) | [static] |
Loads the openGL extended point parameter extension.
Note that this methods is called internally when needed.
The extension is loaded or not only at the first call to this method, the further calls only tell whether the extension was loaded or not.
In that way, this method is only useful to the user, to check whether the extension is supported or not.
static bool loadGLExtPointSprite | ( | ) | [static] |
Loads the openGL point sprite extension.
Note that this methods is called internally when needed.
The extension is loaded or not only at the first call to this method, the following calls only tell whether the extension was loaded or not.
In that way, this method is only useful to the user, to check whether the extension is supported or not.
static bool loadGLExtShader | ( | ) | [static] |
Loads the shader extension.
Note that this methods is called internally when needed.
The extension is loaded or not only at the first call to this method, the further calls only tell whether the extension was loaded or not.
In that way, this method is only useful to the user, to check whether the extension is supported or not.
NOTE THAT FOR THE MOMENT, EVEN IF SHADER EXTENSIONS CAN BE LOADED, THEY ARE NOT USED WITHIN SPARK
static bool loadGLExtTexture3D | ( | ) | [static] |
Loads the OpenGL texture 3D extension.
Note that this methods is called internally when needed.
The extension is loaded or not only at the first call to this method, the further calls only tell whether the extension was loaded or not.
In that way, this method is only useful to the user, to check whether the extension is supported or not.
static void setPixelPerUnit | ( | float | fovy, | |
int | screenHeight | |||
) | [static] |
Computes a conversion ratio between pixels and universe units.
This method must be called when using GLPointRenderer with world size enabled.
It allows to well transpose world size to pixel size by setting the right openGL parameters.
Note that fovy can be replaced by fovx if screenHeight is replaced by screenWidth.
fovy | : the field of view in the y axis in radians | |
screenHeight | : the height of the viewport in pixels |