#include <main.h>
#include <iostream>
#include <GL/glew.h>
#include <Eigen/OpenGLSupport>
#include <GL/glut.h>
Go to the source code of this file.
#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); \
}
Definition at line 20 of file openglsupport.cpp.
#define VERIFY_UNIFORM |
( |
|
SUFFIX, |
|
|
|
NAME, |
|
|
|
TYPE |
|
) |
| |
Value:{ \
TYPE value; value.setRandom(); \
TYPE data; \
int loc = glGetUniformLocation(prg_id, #NAME); \
VERIFY((loc!=-1) && "uniform not found"); \
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); \
}
Definition at line 31 of file openglsupport.cpp.
#define VERIFY_UNIFORMi |
( |
|
NAME, |
|
|
|
TYPE |
|
) |
| |
Value:{ \
TYPE value = TYPE::Random().eval().cast<float>().cast<TYPE::Scalar>(); \
TYPE data; \
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); \
}
Definition at line 44 of file openglsupport.cpp.
GLint createShader |
( |
const char * |
vtx, |
|
|
const char * |
frg |
|
) |
| |
void printInfoLog |
( |
GLuint |
objectID | ) |
|
void test_openglsupport |
( |
| ) |
|