X-Git-Url: https://git.ralfj.de/gltest.git/blobdiff_plain/ce1b46da645fdcac80fc9c71082bb5cb40166576..abe5b74c820514f9f5896309e0e192569db35651:/glutil_gl2.cpp diff --git a/glutil_gl2.cpp b/glutil_gl2.cpp index 666ede9..68a789b 100644 --- a/glutil_gl2.cpp +++ b/glutil_gl2.cpp @@ -16,13 +16,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "glutil.h" + #include #include #include #include -#include "glutil.h" - // extension functions we use typedef GLuint (*GLCREATESHADERPROC) (GLenum type); typedef void (*GLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); @@ -127,32 +127,6 @@ void resolveFunctionPointers(T_glGetProcAddress p_glGetProcAddress) p_glDeleteBuffers = (GLDELETEBUFFERSPROC)resolveFunctionPointer(p_glGetProcAddress, "glDeleteBuffers"); } -static const char *glErrorToString(GLenum e) -{ -#define CASE(name) case name: return #name - switch (e) { - CASE(GL_NO_ERROR); - CASE(GL_INVALID_ENUM); - CASE(GL_INVALID_VALUE); - CASE(GL_INVALID_OPERATION); -#ifndef CON_GLES2 - CASE(GL_STACK_OVERFLOW); - CASE(GL_STACK_UNDERFLOW); -#endif - CASE(GL_OUT_OF_MEMORY); - default: return ""; - } -#undef CASE -} - -static void checkGlError(const char *what) -{ - GLenum e = glGetError(); - if (e == GL_NO_ERROR) return; - fprintf(stderr, "GL error %d (%s): %s\n", e, glErrorToString(e), what); - exit(1); -} - // shaders static const char *vertex_shader_source = "#version 100 \n\