// // basic.cpp // J // // Created by Joshua Moerman on 8/28/11. // Copyright 2011 Vadovas. All rights reserved. // #include "basic.h" namespace J { void check_error(){ #if defined(DEBUG) GLenum status = glGetError(); switch (status) { case GL_NO_ERROR: return; #define c(x) case x: throw std::runtime_error("GL Error: "#x); c(GL_INVALID_ENUM) c(GL_INVALID_VALUE) c(GL_INVALID_OPERATION) c(GL_INVALID_FRAMEBUFFER_OPERATION) c(GL_OUT_OF_MEMORY) #undef c default: throw std::runtime_error("GL Error: UNKNOWN"); } #endif } }