3 #include "breakpoint.h"
9 GLenum cur_error = GL_NO_ERROR;
11 static void check_error()
13 GLenum (*orig_glGetError)() = NULL;
17 orig_glGetError = glsym("glGetError");
19 code = orig_glGetError();
24 pkt = packet_begin(FUNC_GLDERROR);
25 packet_write_int(pkt, code);
26 packet_send(pkt, get_out_fd());
28 if(cur_error==GL_NO_ERROR)
33 GLenum APIENTRY glGetError()
35 GLenum ret = cur_error;
36 cur_error = GL_NO_ERROR;
39 pkt = packet_begin(FUNC_GLGETERROR);
40 packet_write_int(pkt, ret);
41 packet_send(pkt, get_out_fd());
46 void (*eglGetProcAddress(const char *procname))(void)
52 if(glsym((const char *)procname))
54 handle = dlopen(NULL, RTLD_LAZY);
55 ret = dlsym(handle, (const char *)procname);
58 pkt = packet_begin(FUNC_EGLGETPROCADDRESS);
59 packet_write_pointer(pkt, ret);
60 packet_write_string(pkt, (const char *)procname);
61 packet_send(pkt, get_out_fd());
66 #include "gensrc/glwrap.funcs"