Macros | Functions
openglsupport.cpp File Reference
#include <main.h>
#include <iostream>
#include <GL/glew.h>
#include <Eigen/OpenGLSupport>
#include <GL/glut.h>
Include dependency graph for openglsupport.cpp:

Go to the source code of this file.

Macros

#define VERIFY_MATRIX(CODE, REF)
 
#define VERIFY_UNIFORM(SUFFIX, NAME, TYPE)
 
#define VERIFY_UNIFORMi(NAME, TYPE)
 

Functions

GLint createShader (const char *vtx, const char *frg)
 
void printInfoLog (GLuint objectID)
 
void test_openglsupport ()
 

Macro Definition Documentation

#define VERIFY_MATRIX (   CODE,
  REF 
)
Value:
{ \
glLoadIdentity(); \
CODE; \
Matrix<float,4,4,ColMajor> m; m.setZero(); \
glGet(GL_MODELVIEW_MATRIX, m); \
if(!(REF).cast<float>().isApprox(m)) { \
std::cerr << "Expected:\n" << ((REF).cast<float>()) << "\n" << "got\n" << m << "\n\n"; \
} \
VERIFY_IS_APPROX((REF).cast<float>(), m); \
}
Matrix3f m
if((m *x).isApprox(y))
#define VERIFY_IS_APPROX(a, b)
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())

Definition at line 20 of file openglsupport.cpp.

#define VERIFY_UNIFORM (   SUFFIX,
  NAME,
  TYPE 
)
Value:
{ \
TYPE value; value.setRandom(); \
int loc = glGetUniformLocation(prg_id, #NAME); \
VERIFY((loc!=-1) && "uniform not found"); \
glUniform(loc,value); \
EIGEN_CAT(glGetUniform,SUFFIX)(prg_id,loc,data.data()); \
if(!value.isApprox(data)) { \
std::cerr << "Expected:\n" << value << "\n" << "got\n" << data << "\n\n"; \
} \
VERIFY_IS_APPROX(value, data); \
}
#define EIGEN_CAT(a, b)
Definition: Macros.h:479
return int(ret)+1
if((m *x).isApprox(y))
#define VERIFY_IS_APPROX(a, b)
#define TYPE
Definition: benchFFT.cpp:31
int data[]
#define VERIFY(a)
Definition: main.h:325

Definition at line 31 of file openglsupport.cpp.

#define VERIFY_UNIFORMi (   NAME,
  TYPE 
)
Value:
{ \
TYPE value = TYPE::Random().eval().cast<float>().cast<TYPE::Scalar>(); \
int loc = glGetUniformLocation(prg_id, #NAME); \
VERIFY((loc!=-1) && "uniform not found"); \
glUniform(loc,value); \
glGetUniformiv(prg_id,loc,(GLint*)data.data()); \
if(!value.isApprox(data)) { \
std::cerr << "Expected:\n" << value << "\n" << "got\n" << data << "\n\n"; \
} \
VERIFY_IS_APPROX(value, data); \
}
return int(ret)+1
if((m *x).isApprox(y))
#define VERIFY_IS_APPROX(a, b)
#define TYPE
Definition: benchFFT.cpp:31
int data[]
#define VERIFY(a)
Definition: main.h:325

Definition at line 44 of file openglsupport.cpp.

Function Documentation

GLint createShader ( const char *  vtx,
const char *  frg 
)

Definition at line 72 of file openglsupport.cpp.

void printInfoLog ( GLuint  objectID)

Definition at line 57 of file openglsupport.cpp.

void test_openglsupport ( )

Definition at line 109 of file openglsupport.cpp.



gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:32