#include <gpuhelper.h>
Public Types | |
enum | ProjectionMode2D { PM_Normalized = 1, PM_Viewport = 2 } |
Public Member Functions | |
void | draw (GLenum mode, const std::vector< uint > *pIndexes) |
draw an indexed subset More... | |
void | draw (GLenum mode, uint nofElement) |
draw the nofElement first elements More... | |
void | draw (GLenum mode, uint start, uint end) |
draw a range of elements More... | |
void | drawUnitCube (void) |
void | drawUnitSphere (int level=0) |
void | drawVector (const Vector3f &position, const Vector3f &vec, const Color &color, float aspect=50.) |
void | drawVectorBox (const Vector3f &position, const Vector3f &vec, const Color &color, float aspect=50.) |
void | forceMatrixTarget (GLenum matrixTarget) |
GpuHelper () | |
template<typename Scalar , typename Derived > | |
void | loadMatrix (const Eigen::CwiseNullaryOp< Eigen::internal::scalar_identity_op< Scalar >, Derived > &, GLenum matrixTarget) |
template<typename Scalar , int _Flags> | |
void | loadMatrix (const Eigen::Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget) |
template<typename Scalar , int _Flags> | |
void | multMatrix (const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget) |
void | popMatrix (GLenum matrixTarget) |
void | popProjectionMode2D () |
template<typename Scalar , typename Derived > | |
void | pushMatrix (const Eigen::CwiseNullaryOp< Eigen::internal::scalar_identity_op< Scalar >, Derived > &, GLenum matrixTarget) |
template<typename Scalar , int _Flags> | |
void | pushMatrix (const Matrix< Scalar, 4, 4, _Flags, 4, 4 > &mat, GLenum matrixTarget) |
void | pushMatrix (GLenum matrixTarget) |
void | pushProjectionMode2D (ProjectionMode2D pm) |
void | setMatrixTarget (GLenum matrixTarget) |
~GpuHelper () | |
Protected Member Functions | |
void | update (void) |
Protected Attributes | |
GLuint | mColorBufferId |
GLenum | mCurrentMatrixTarget |
bool | mInitialized |
int | mVpHeight |
int | mVpWidth |
Definition at line 21 of file gpuhelper.h.
Enumerator | |
---|---|
PM_Normalized | |
PM_Viewport |
Definition at line 29 of file gpuhelper.h.
GpuHelper::GpuHelper | ( | ) |
Definition at line 20 of file gpuhelper.cpp.
GpuHelper::~GpuHelper | ( | ) |
Definition at line 27 of file gpuhelper.cpp.
|
inline |
draw an indexed subset
Definition at line 197 of file gpuhelper.h.
|
inline |
draw the nofElement first elements
Definition at line 191 of file gpuhelper.h.
|
inline |
draw a range of elements
Definition at line 202 of file gpuhelper.h.
void GpuHelper::drawUnitCube | ( | void | ) |
Definition at line 98 of file gpuhelper.cpp.
void GpuHelper::drawUnitSphere | ( | int | level = 0 | ) |
Definition at line 120 of file gpuhelper.cpp.
void GpuHelper::drawVector | ( | const Vector3f & | position, |
const Vector3f & | vec, | ||
const Color & | color, | ||
float | aspect = 50. |
||
) |
Definition at line 56 of file gpuhelper.cpp.
void GpuHelper::drawVectorBox | ( | const Vector3f & | position, |
const Vector3f & | vec, | ||
const Color & | color, | ||
float | aspect = 50. |
||
) |
Definition at line 77 of file gpuhelper.cpp.
|
inline |
Make the matrix matrixTarget the current OpenGL matrix target. Call this function before loadMatrix() or multMatrix() if you cannot guarantee that glMatrixMode() has never been called after the last loadMatrix() or multMatrix() calls.
Definition at line 63 of file gpuhelper.h.
void GpuHelper::loadMatrix | ( | const Eigen::CwiseNullaryOp< Eigen::internal::scalar_identity_op< Scalar >, Derived > & | , |
GLenum | matrixTarget | ||
) |
Definition at line 148 of file gpuhelper.h.
void GpuHelper::loadMatrix | ( | const Eigen::Matrix< Scalar, 4, 4, _Flags, 4, 4 > & | mat, |
GLenum | matrixTarget | ||
) |
Load the matrix mat to the OpenGL matrix matrixTarget. Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required and does a proper call to the right glLoadMatrix*() or glLoadIdentity() function according to the scalar type and storage order.
Definition at line 157 of file gpuhelper.h.
void GpuHelper::multMatrix | ( | const Matrix< Scalar, 4, 4, _Flags, 4, 4 > & | mat, |
GLenum | matrixTarget | ||
) |
Multiply the OpenGL matrix matrixTarget by the matrix mat. Essentially, this helper function automatically calls glMatrixMode(matrixTarget) if required and does a proper call to the right glMultMatrix*() function according to the scalar type and storage order.
Definition at line 141 of file gpuhelper.h.
|
inline |
Pop the OpenGL matrix matrixTarget
Definition at line 185 of file gpuhelper.h.
void GpuHelper::popProjectionMode2D | ( | ) |
Definition at line 50 of file gpuhelper.cpp.
void GpuHelper::pushMatrix | ( | const Eigen::CwiseNullaryOp< Eigen::internal::scalar_identity_op< Scalar >, Derived > & | , |
GLenum | matrixTarget | ||
) |
Definition at line 177 of file gpuhelper.h.
|
inline |
Push the OpenGL matrix matrixTarget and load mat.
Definition at line 170 of file gpuhelper.h.
|
inline |
Push and clone the OpenGL matrix matrixTarget
Definition at line 163 of file gpuhelper.h.
void GpuHelper::pushProjectionMode2D | ( | ProjectionMode2D | pm | ) |
Definition at line 31 of file gpuhelper.cpp.
|
inline |
Definition at line 134 of file gpuhelper.h.
|
protected |
|
protected |
Definition at line 103 of file gpuhelper.h.
|
protected |
Definition at line 105 of file gpuhelper.h.
|
protected |
Definition at line 106 of file gpuhelper.h.
|
protected |
Definition at line 104 of file gpuhelper.h.
|
protected |
Definition at line 104 of file gpuhelper.h.