Geogram
Version 1.9.1-rc
A programming library of geometric algorithms
|
Internal implementation of GLUP context. More...
#include <geogram_gfx/basic/common.h>
#include <geogram_gfx/GLUP/GLUP.h>
#include <geogram_gfx/GLUP/GLUP_marching_cells.h>
#include <geogram_gfx/basic/GLSL.h>
#include <map>
Go to the source code of this file.
Classes | |
class | GLUP::MatrixStack |
A Matrix stack. More... | |
struct | GLUP::MatrixStack::Matrix |
class | GLUP::ImmediateBuffer |
A buffer used by GLUP in immediate mode. More... | |
class | GLUP::ImmediateState |
Stores all the buffers used to implement the immediate-mode interface. More... | |
class | GLUP::StateVariableBase |
Base class for representing GLUP state variables. More... | |
class | GLUP::StateVariable< T > |
A GLUP state variable of a given type. More... | |
class | GLUP::FloatsArrayStateVariable |
A GLUP state variable that contains an array of floating points. This concerns both vectors and matrices. More... | |
class | GLUP::VectorStateVariable |
A GLUP state variable that contains a vector. More... | |
struct | GLUP::UniformState |
The set of state variables that represent GLUP uniform state. More... | |
struct | GLUP::PrimitiveInfo |
Stores the programs and vertex array object used to display a primitive of a given type. More... | |
class | GLUP::Context |
GLUP context stores a Uniform Buffer Object with state variables similar to OpenGL's fixed functionality pipeline, and a set of Vertex Buffer Objects to emulate OpenGL's immediate mode. More... | |
Enumerations | |
enum | GLUP::GLUPattribute { GLUP_VERTEX_ATTRIBUTE = 0 , GLUP_COLOR_ATTRIBUTE = 1 , GLUP_TEX_COORD_ATTRIBUTE = 2 , GLUP_NORMAL_ATTRIBUTE = 3 , GLUP_VERTEX_ID_ATTRIBUTE = 4 } |
Index of an ImmediateBuffer in the ImmediateState. More... | |
Functions | |
GLboolean | GLUP::invert_matrix (GLfloat inv[16], const GLfloat m[16]) |
Computes the inverse of a 4x4 matrix. More... | |
GLboolean | GLUP::invert_matrix (GLdouble inv[16], const GLdouble m[16]) |
Computes the inverse of a 4x4 matrix. More... | |
void | GLUP::mult_matrices (GLfloat out[16], const GLfloat m1[16], const GLfloat m2[16]) |
Computes the product of two 4x4 matrices. More... | |
void | GLUP::mult_matrices (GLdouble out[16], const GLdouble m1[16], const GLdouble m2[16]) |
Computes the product of two 4x4 matrices. More... | |
void | GLUP::mult_matrix_vector (GLfloat out[4], const GLfloat m[16], const GLfloat v[4]) |
Computes the product of a 4x4 matrix and a vector. More... | |
void | GLUP::mult_transpose_matrix_vector (GLfloat out[4], const GLfloat m[16], const GLfloat v[4]) |
Computes the product of the transpose of a 4x4 matrix and a vector. More... | |
void | GLUP::mult_transpose_matrix_vector (GLdouble out[4], const GLdouble m[16], const GLdouble v[4]) |
Computes the product of the transpose of a 4x4 matrix and a vector. More... | |
void | GLUP::mult_matrix_vector (GLdouble out[4], const GLdouble m[16], const GLdouble v[4]) |
Computes the product of a 4x4 matrix and a vector. More... | |
void | GLUP::transpose_matrix (GLfloat m[16]) |
Transposes a matrix in-place. More... | |
void | GLUP::transpose_matrix (GLdouble m[16]) |
Transposes a matrix in-place. More... | |
void | GLUP::show_matrix (const GLfloat m[16]) |
For debugging, outputs a matrix to the standard error. More... | |
void | GLUP::show_matrix (const GLdouble m[16]) |
For debugging, outputs a matrix to the standard error. More... | |
void | GLUP::show_vector (const GLfloat v[4]) |
For debugging, outputs a vector to the standard error. More... | |
void | GLUP::show_vector (const GLdouble v[4]) |
For debugging, outputs a vector to the standard error. More... | |
void | GLUP::load_identity_matrix (GLfloat out[16]) |
Resets a matrix to the identity matrix. More... | |
void | GLUP::load_identity_matrix (GLdouble out[16]) |
Resets a matrix to the identity matrix. More... | |
void | GLUP::copy_vector (GLfloat *to, const GLfloat *from, index_t dim) |
Copies a vector of floats. More... | |
void | GLUP::copy_vector (GLdouble *to, const GLdouble *from, index_t dim) |
Copies a vector of doubles. More... | |
void | GLUP::copy_vector (GLfloat *to, const GLdouble *from, index_t dim) |
Copies a vector of doubles to a vector of floats. More... | |
void | GLUP::copy_vector (GLdouble *to, const GLfloat *from, index_t dim) |
Copies a vector of floats to a vector of doubles. More... | |
void | GLUP::normalize_vector (GLfloat v[3]) |
Normalizes a vector. More... | |
Internal implementation of GLUP context.
Definition in file GLUP_context.h.
enum GLUP::GLUPattribute |
Index of an ImmediateBuffer in the ImmediateState.
GLUP_VERTEX_ID_ATTRIBUTE is used internally
Definition at line 347 of file GLUP_context.h.
|
inline |
Copies a vector of doubles.
[out] | to | a pointer to the destination vector |
[in] | from | a const pointer to the source vector |
[in] | dim | the number of components to copy |
Definition at line 226 of file GLUP_context.h.
|
inline |
Copies a vector of floats to a vector of doubles.
[out] | to | a pointer to the destination vector |
[in] | from | a const pointer to the source vector |
[in] | dim | the number of components to copy |
Definition at line 248 of file GLUP_context.h.
|
inline |
Copies a vector of doubles to a vector of floats.
[out] | to | a pointer to the destination vector |
[in] | from | a const pointer to the source vector |
[in] | dim | the number of components to copy |
Definition at line 236 of file GLUP_context.h.
|
inline |
Copies a vector of floats.
[out] | to | a pointer to the destination vector |
[in] | from | a const pointer to the source vector |
[in] | dim | the number of components to copy |
Definition at line 216 of file GLUP_context.h.
GLboolean GLUP::invert_matrix | ( | GLdouble | inv[16], |
const GLdouble | m[16] | ||
) |
Computes the inverse of a 4x4 matrix.
[out] | inv | the computed inverse of m |
[in] | m | pointer to the input matrix |
GL_TRUE | if the matrix m is invertible |
GL_FALSE | if the matrix m is singular. Then inv receives the transpose of the comatrix of m |
GLboolean GLUP::invert_matrix | ( | GLfloat | inv[16], |
const GLfloat | m[16] | ||
) |
Computes the inverse of a 4x4 matrix.
[out] | inv | the computed inverse of m |
[in] | m | pointer to the input matrix |
GL_TRUE | if the matrix m is invertible |
GL_FALSE | if the matrix m is singular. Then inv receives the transpose of the comatrix of m |
void GLUP::load_identity_matrix | ( | GLdouble | out[16] | ) |
Resets a matrix to the identity matrix.
[out] | out | the matrix to be reset. |
void GLUP::load_identity_matrix | ( | GLfloat | out[16] | ) |
Resets a matrix to the identity matrix.
[out] | out | the matrix to be reset. |
void GLUP::mult_matrices | ( | GLdouble | out[16], |
const GLdouble | m1[16], | ||
const GLdouble | m2[16] | ||
) |
Computes the product of two 4x4 matrices.
[out] | out | the computed product m1 * m2 |
[in] | m1,m2 | pointers to the input matrices |
void GLUP::mult_matrices | ( | GLfloat | out[16], |
const GLfloat | m1[16], | ||
const GLfloat | m2[16] | ||
) |
Computes the product of two 4x4 matrices.
[out] | out | the computed product m1 * m2 |
[in] | m1,m2 | pointers to the input matrices |
void GLUP::mult_matrix_vector | ( | GLdouble | out[4], |
const GLdouble | m[16], | ||
const GLdouble | v[4] | ||
) |
Computes the product of a 4x4 matrix and a vector.
[out] | out | the computed product m * v |
[in] | m | pointer to the input matrix |
[in] | v | pointer to the input vector |
void GLUP::mult_matrix_vector | ( | GLfloat | out[4], |
const GLfloat | m[16], | ||
const GLfloat | v[4] | ||
) |
Computes the product of a 4x4 matrix and a vector.
[out] | out | the computed product m * v |
[in] | m | pointer to the input matrix |
[in] | v | pointer to the input vector \TODO: it seems that in GLSL, w = M*v uses the transpose form, maybe I should change the names !! |
void GLUP::mult_transpose_matrix_vector | ( | GLdouble | out[4], |
const GLdouble | m[16], | ||
const GLdouble | v[4] | ||
) |
Computes the product of the transpose of a 4x4 matrix and a vector.
[out] | out | the computed product m * v |
[in] | m | pointer to the input matrix |
[in] | v | pointer to the input vector \TODO: it seems that in GLSL, w = M*v uses this one, maybe I should change the names !! |
void GLUP::mult_transpose_matrix_vector | ( | GLfloat | out[4], |
const GLfloat | m[16], | ||
const GLfloat | v[4] | ||
) |
Computes the product of the transpose of a 4x4 matrix and a vector.
[out] | out | the computed product m * v |
[in] | m | pointer to the input matrix |
[in] | v | pointer to the input vector \TODO: it seems that in GLSL, w = M*v uses this one, maybe I should change the names !! |
|
inline |
Normalizes a vector.
[in,out] | v | a pointer to the 3 coordinates of the 3d vector to be normalized. |
Definition at line 259 of file GLUP_context.h.
void GLUP::show_matrix | ( | const GLdouble | m[16] | ) |
For debugging, outputs a matrix to the standard error.
[in] | m | the matrix to be displayed. |
void GLUP::show_matrix | ( | const GLfloat | m[16] | ) |
For debugging, outputs a matrix to the standard error.
[in] | m | the matrix to be displayed. |
void GLUP::show_vector | ( | const GLdouble | v[4] | ) |
For debugging, outputs a vector to the standard error.
[in] | v | the vector to be displayed |
void GLUP::show_vector | ( | const GLfloat | v[4] | ) |
For debugging, outputs a vector to the standard error.
[in] | v | the vector to be displayed |
void GLUP::transpose_matrix | ( | GLdouble | m[16] | ) |
Transposes a matrix in-place.
[in,out] | m | a pointer to the 16 double-precision floating point coefficients of the matrix to be transposed. |
void GLUP::transpose_matrix | ( | GLfloat | m[16] | ) |
Transposes a matrix in-place.
[in,out] | m | a pointer to the 16 single-precision floating point coefficients of the matrix to be transposed. |