X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wgltrace.py;h=17d1acc7b6a054570767b0ff3c4a33c7aa955da0;hb=da7579b25c6bba1c6406d8b9382df126aca077f3;hp=480ebcb66fd73398d434719150c0b7e78e0851bc;hpb=8f6be5674e4288af0db0c8bda008acffc2650afa;p=apitrace diff --git a/wgltrace.py b/wgltrace.py index 480ebcb..17d1acc 100644 --- a/wgltrace.py +++ b/wgltrace.py @@ -37,10 +37,9 @@ from codegen import * class WglTracer(GlTracer): - def get_function_address(self, function): - return '__%s' % (function.name,) - def wrap_ret(self, function, instance): + GlTracer.wrap_ret(self, function, instance) + if function.name == "wglGetProcAddress": print ' if (%s) {' % instance @@ -54,7 +53,7 @@ class WglTracer(GlTracer): print ' %s = (%s)&%s;' % (instance, function.type, f.name); def handle_default(): - print ' OS::DebugMessage("apitrace: unknown function \\"%s\\"\\n", lpszProc);' + print ' OS::DebugMessage("apitrace: warning: unknown function \\"%s\\"\\n", lpszProc);' string_switch('lpszProc', func_dict.keys(), handle_case, handle_default) print ' }' @@ -67,13 +66,13 @@ if __name__ == '__main__': print '#include ' print '#include ' print - print '#include "trace_write.hpp"' + print '#include "trace_writer.hpp"' print '#include "os.hpp"' print print ''' static HINSTANCE g_hDll = NULL; -static PROC +PROC __getPublicProcAddress(LPCSTR lpProcName) { if (!g_hDll) { @@ -95,6 +94,10 @@ __getPublicProcAddress(LPCSTR lpProcName) } ''' + print '// To validate our prototypes' + print '#define GL_GLEXT_PROTOTYPES' + print '#define WGL_GLXEXT_PROTOTYPES' + print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print