13 bool FileExists(
const string &filename) {
14 std::ifstream ifile(filename.c_str());
19 void SetOcclusionQuality(
int quality) {
20 occlusionQuality = quality;
22 int GetOcclusionQuality() {
23 return occlusionQuality;
28 void SetWindowHeight(
int h) {
32 int GetWindowHeight() {
36 void SetWindowWidth(
int w) {
40 int GetWindowWidth() {
45 string ReadFile(
const string &filename) {
46 std::ifstream ifile(filename.c_str());
47 return string(std::istreambuf_iterator<char>(ifile), std::istreambuf_iterator<char>());
51 void GetErrors(
void) {
52 GLenum error = glGetError();
54 if (error != GL_NO_ERROR) {
57 cerr <<
"GL: enum argument out of range." << endl;
59 case GL_INVALID_VALUE:
60 cerr <<
"GL: Numeric argument out of range." << endl;
62 case GL_INVALID_OPERATION:
63 cerr <<
"GL: Operation illegal in current state." << endl;
65 case GL_INVALID_FRAMEBUFFER_OPERATION:
66 cerr <<
"GL: Framebuffer object is not complete." << endl;
68 case GL_OUT_OF_MEMORY:
69 cerr <<
"GL: Not enough memory left to execute command." << endl;
72 cerr <<
"GL: Unknown error." << endl;