#include <main.h>
#include <iostream>
#include <string>
#include <GL/glew.h>
#include <Eigen/OpenGLSupport>
#include <GL/freeglut.h>
Go to the source code of this file.
◆ VERIFY_MATRIX
#define VERIFY_MATRIX |
( |
|
CODE, |
|
|
|
REF |
|
) |
| |
Value: { \
glMatrixMode(GL_MODELVIEW); \
glLoadIdentity(); \
CODE; \
Matrix<float,4,4,ColMajor>
m;
m.setZero(); \
glGet(GL_MODELVIEW_MATRIX,
m); \
std::cerr <<
"Expected:\n" << ((
REF).cast<float>()) <<
"\n" <<
"got\n" <<
m <<
"\n\n"; \
} \
VERIFY_IS_APPROX((
REF).cast<float>(),
m); \
}
Definition at line 28 of file openglsupport.cpp.
◆ VERIFY_UNIFORM
#define VERIFY_UNIFORM |
( |
|
SUFFIX, |
|
|
|
NAME, |
|
|
|
TYPE |
|
) |
| |
Value: { \
int
loc = glGetUniformLocation(prg_id, #NAME); \
VERIFY((
loc!=-1) &&
"uniform not found"); \
EIGEN_CAT(glGetUniform,SUFFIX)(prg_id,
loc,
data.data()); \
std::cerr <<
"Expected:\n" <<
value <<
"\n" <<
"got\n" <<
data <<
"\n\n"; \
} \
}
Definition at line 40 of file openglsupport.cpp.
◆ VERIFY_UNIFORMi
#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"); \
glGetUniformiv(prg_id,
loc,(GLint*)
data.data()); \
std::cerr <<
"Expected:\n" <<
value <<
"\n" <<
"got\n" <<
data <<
"\n\n"; \
} \
}
Definition at line 53 of file openglsupport.cpp.
◆ createProgram() [1/2]
GLint createProgram |
( |
const char * |
vtx, |
|
|
const char * |
frg, |
|
|
bool |
print_errors = true |
|
) |
| |
◆ createProgram() [2/2]
GLint createProgram |
( |
const std::string & |
vtx, |
|
|
const std::string & |
frg, |
|
|
bool |
print_errors = true |
|
) |
| |
◆ EIGEN_DECLARE_TEST()
EIGEN_DECLARE_TEST |
( |
openglsupport |
| ) |
|
◆ find_and_replace()
void find_and_replace |
( |
std::string & |
str, |
|
|
const std::string & |
find, |
|
|
const std::string & |
replace |
|
) |
| |
◆ format()
std::string format |
( |
const std::string & |
str, |
|
|
const std::vector< std::string > & |
find, |
|
|
const std::vector< std::string > & |
replace |
|
) |
| |
◆ getGlslVersionString()
std::string getGlslVersionString |
( |
int |
gl_major_version, |
|
|
int |
gl_minor_version |
|
) |
| |
◆ openglsupport_test_loop()
void openglsupport_test_loop |
( |
| ) |
|
◆ printProgramInfoLog()
void printProgramInfoLog |
( |
GLuint |
objectID | ) |
|
◆ printShaderInfoLog()
void printShaderInfoLog |
( |
GLuint |
objectID | ) |
|