3 This file is part of gldbg
4 Copyright © 2010 Mikko Rasa, Mikkosoft Productions
5 Distributed under the GPL
10 #include "functions.h"
14 GLenum cur_error = GL_NO_ERROR;
16 static void check_error()
18 GLenum (*orig_glGetError)() = 0;
22 orig_glGetError = glsym("glGetError");
24 code = orig_glGetError();
27 begin_packet(FUNC_GLDERROR);
31 if(cur_error==GL_NO_ERROR)
36 GLenum APIENTRY glGetError()
38 GLenum ret = cur_error;
39 cur_error = GL_NO_ERROR;
41 begin_packet(FUNC_GLGETERROR);
48 void (*eglGetProcAddress(const char *procname))(void)
53 if(glsym((const char *)procname))
55 handle = dlopen(NULL, RTLD_LAZY);
56 ret = dlsym(handle, (const char *)procname);
59 begin_packet(FUNC_EGLGETPROCADDRESS);
61 write_string((const char *)procname);
67 #include "gensrc/glwrap.funcs"