35 #ifndef __OpenGLUtilities_h 36 #define __OpenGLUtilities_h 70 #ifndef __gVirtualXRayConfig_h 88 #ifndef __OpenGL2VBO_h 92 #ifndef __OpenGL3VBO_h 139 const char* aFunctionName,
152 const char* aFunctionName,
625 #endif // __OpenGLUtilities_h Class to handle vertex buffer objects (VBOs) in OpenGL 3.x or 4.x.
void pushProjectionMatrix()
Add the current matrix to the projection matrix stack.
void checkFBOErrorStatus(const char *aFileName, const char *aFunctionName, int aLineNumber)
Check the current FBO's error status.
void popEnableDisableState()
void loadModelViewMatrixFromOpenGL()
Replace the modelling-viewing matrix by OpenGL's modelling-viewing matrix.
void initializeGLEW()
Initialize GLEW.
void pushModelViewMatrix()
Add the current matrix to the model/view matrix stack.
void applyModelViewMatrix()
bool useOpenGL32()
Check if OpenGL 3.2 is supported by the current OpenGL context.
MATRIX4 buildOrthoProjectionMatrix(double left, double right, double bottom, double top, double near, double far)
Create a orthographic projection matrix.
void checkOpenGLErrorStatus(const char *aFileName, const char *aFunctionName, int aLineNumber)
Check OpenGL's error status.
Class to handle vertex buffer objects (VBOs).
VBO * createVBO()
Create an OpenGL VBO suitable for the current OpenGL context.
void initialiseGLAD(const std::string &anAPI)
Initialise GLAD.
void loadPerspectiveProjectionMatrix(double fovy, double aspect, double zNear, double zFar)
Replace the projection matrix by a perspective projection matrix.
void pushShaderProgram()
Add the current shader program to the corresponding stack.
OpenGL2VBO * createOpenGL2VBO()
Create an OpenGL 2.x VBO.
bool useOpenGL45()
Check if OpenGL 4.5 is supported by the current OpenGL context.
std::vector< std::pair< int, bool > > g_enable_disable_state_stack
The stack of enable/disable states.
std::string getShaderPixelType(const std::type_info &aTypeID)
void pushEnableDisableState(int aParameter)
Add the enable/disable state to the corresponding stack.
Matrix4x4< RATIONAL_NUMBER > MATRIX4
Type of data used to store 4x4 matrices.
void loadProjectionMatrixFromOpenGL()
Replace the projection matrix by OpenGL's projection matrix.
void pushTexture3D()
Add the current 3D texture binding to the texture stack.
std::string getShaderRGBAPixelType(const std::type_info &aTypeID)
Template class to handle a 4x4 matrixs.
std::string getShaderImageType(const std::type_info &aTypeID)
void initializeGLAD(const std::string &anAPI)
Initialize GLAD.
void loadIdentityModelViewMatrix()
Replace the model/view matrix by the identity matrix.
void initialiseGLEW()
Initialise GLEW.
Vec3< RATIONAL_NUMBER > VEC3
Type of data used to store 3D vectors.
void pushTexture2D()
Add the current 2D texture binding to the texture stack.
gVirtualXRay::Matrix4x4< float > getCurrentOpenGLMatrix()
Load the current OpenGL matrix.
MATRIX4 g_current_projection_matrix
The projection matrix.
std::vector< int > g_shader_program_stack
The stack of shader programs.
MATRIX4 buildFrustumProjectionMatrix(double left, double right, double bottom, double top, double near, double far)
Create a perspective projection matrix.
void loadOrthoProjectionMatrix(double left, double right, double bottom, double top, double near, double far)
Replace the projection matrix by a orthographic projection matrix.
Some utility functions about OpenGL. Now supports GLSL450 and OpenGL 4.5.
void pushTexture1D()
Add the current 1D texture binding to the texture stack.
std::vector< int > g_frame_buffer_object_stack
The stack of FBO binding.
void popProjectionMatrix()
std::vector< MATRIX4 > g_p_projection_matrix_stack
The stack of projection matrix.
void loadIdentityProjectionMatrix()
Replace the projection matrix by the identity matrix.
std::vector< MATRIX4 > g_p_modelview_matrix_stack
The stack of model/view matrices.
std::string getShaderTypeID(const std::type_info &aTypeID)
MATRIX4 buildLookAtModelViewMatrix(const VEC3 &eye, const VEC3 ¢re, const VEC3 &up)
Create a modelling-viewing matrix.
void loadFrustumProjectionMatrix(double left, double right, double bottom, double top, double near, double far)
Replace the projection matrix by a perspective projection matrix.
MATRIX4 g_current_modelview_matrix
The model/view matrices.
MATRIX4 buildPerspectiveProjectionMatrix(double fovy, double aspect, double zNear, double zFar)
Create a perspective projection matrix.
Matrix4x4 is a template class to handle a 4 by 4 matrix.
void pushTextureRectangle()
Add the current rectangle texture binding to the texture stack.
Class to handle vertex buffer objects (VBOs) in OpenGL 2.x.
void popModelViewMatrix()
void pushFBO()
Add the current FBO binding to the FBO stack.
bool useOpenGLCompute()
Check if OpenGL Compute Shaders are supported by the current OpenGL context.
std::vector< std::pair< int, int > > g_texture_stack
The stack of texture binding.
void loadLookAtModelViewMatrix(const VEC3 &eye, const VEC3 ¢re, const VEC3 &up)
Replace the modelling-viewing matrix by a viewing transformation matrix.
OpenGL3VBO * createOpenGL3VBO()
Create an OpenGL 3.x or 4.x VBO.