print('#include <string.h>') print('#include <windows.h>') print() print('#include <sstream>') print() print('#include "trace_writer_local.hpp"') print('#include "os.hpp"') print() 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() print('static OS_THREAD_LOCAL uintptr_t _reentrant;') print() print('// Helper class to track reentries in function scope.') print('struct ReentryScope {') print('inline ReentryScope() { _reentrant = 1; }') print('inline ~ReentryScope() { _reentrant = 0; }') print('};') print() module = Module() module.mergeModule(glapi) module.mergeModule(wglapi) api = API() api.addModule(module) tracer = WglTracer() tracer.traceApi(api)
print '#include <string.h>' print print '#include <dlfcn.h>' print print '#include "trace_writer_local.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print '#define GLX_GLXEXT_PROTOTYPES' print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print module = Module() module.mergeModule(glxapi) module.mergeModule(glapi) api = API() api.addModule(module) tracer = GlxTracer() tracer.traceApi(api) print r''' /* * Invoke the true dlopen() function. */ static void *_dlopen(const char *filename, int flag) { typedef void * (*PFN_DLOPEN)(const char *, int);
self.emitFakeTexture2D() print(r''' } ''') if __name__ == '__main__': print() print('#include <stdlib.h>') print('#include <string.h>') print() print('#include <memory>') print() print('#include "trace_writer_local.hpp"') print() print('// To validate our prototypes') print('#define GL_GLEXT_PROTOTYPES') print('#define GLX_GLXEXT_PROTOTYPES') print() print('#include "glproc.hpp"') print('#include "glsize.hpp"') print() module = Module() module.mergeModule(glxapi) module.mergeModule(glapi) api = API() api.addModule(module) tracer = GlxTracer() tracer.traceApi(api)
print '#include <string.h>' print print '#include "trace_writer_local.hpp"' print print '// To validate our prototypes' print '#define GL_GLEXT_PROTOTYPES' print '#define EGL_EGLEXT_PROTOTYPES' print print '#include "dlopen.hpp"' print '#include "glproc.hpp"' print '#include "glsize.hpp"' print '#include "eglsize.hpp"' print module = Module() module.mergeModule(eglapi) module.mergeModule(glapi) api = API() api.addModule(module) tracer = EglTracer() tracer.traceApi(api) print r''' /* * Several applications, such as Quake3, use dlopen("libGL.so.1"), but * LD_PRELOAD does not intercept symbols obtained via dlopen/dlsym, therefore * we need to intercept the dlopen() call here, and redirect to our wrapper * shared object.
if __name__ == "__main__": print print "#include <stdlib.h>" print "#include <string.h>" print print '#include "trace_writer_local.hpp"' print print "// To validate our prototypes" print "#define GL_GLEXT_PROTOTYPES" print print '#include "glproc.hpp"' print '#include "glsize.hpp"' print module = Module() module.mergeModule(cglapi) module.mergeModule(glapi) api = API() api.addModule(module) tracer = CglTracer() tracer.traceApi(api) print r""" PUBLIC void * gll_noop = 0; """
print '#include <string.h>' print '#include <windows.h>' print print '#include <sstream>' print print '#include "trace_writer_local.hpp"' print '#include "os.hpp"' print 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 print 'static OS_THREAD_SPECIFIC(uintptr_t) _reentrant;' print print '// Helper class to track reentries in function scope.' print 'struct ReentryScope {' print 'inline ReentryScope() { _reentrant = 1; }' print 'inline ~ReentryScope() { _reentrant = 0; }' print '};' print module = Module() module.mergeModule(glapi) module.mergeModule(wglapi) api = API() api.addModule(module) tracer = WglTracer() tracer.traceApi(api)
#include <RegalSystem.h> // Workaround for GLX emulation no supported for apitrace, yet #if REGAL_SYS_OSX || REGAL_SYS_ANDROID # if REGAL_SYS_GLX # undef REGAL_SYS_GLX # define REGAL_SYS_GLX 0 # endif #endif ''' cglmodule = Module('cgl') cglmodule.mergeModule(cglapi) eglmodule = Module('egl') eglmodule.mergeModule(eglapi) glxmodule = Module('glx') glxmodule.mergeModule(glxapi) wglmodule = Module('wgl') wglmodule.mergeModule(wglapi) gfxmodule = Module('gfx') gfxmodule.mergeModule(glapi) gfxmodule.mergeModule(glesapi) api = API() api.addModule(gfxmodule) api.addModule(cglmodule) api.addModule(eglmodule) api.addModule(glxmodule)
// Cass Everitt - 2013 #include <stdlib.h> #include <string.h> #include "trace_writer_regal.hpp" #define localWriter regalWriter #include "glproc.hpp" #include "glsize.hpp" #include <RegalSystem.h> ''' cglmodule = Module('cgl') cglmodule.mergeModule(cglapi) eglmodule = Module('egl') eglmodule.mergeModule(eglapi) glxmodule = Module('glx') glxmodule.mergeModule(glxapi) wglmodule = Module('wgl') wglmodule.mergeModule(wglapi) gfxmodule = Module('gfx') gfxmodule.mergeModule(glapi) gfxmodule.mergeModule(glesapi) api = API() api.addModule(gfxmodule) api.addModule(cglmodule) api.addModule(eglmodule) api.addModule(glxmodule)
if __name__ == '__main__': print() print('#include <stdlib.h>') print('#include <string.h>') print() print('#include "trace_writer_local.hpp"') print() print('// To validate our prototypes') print('#define GL_GLEXT_PROTOTYPES') print() print('#include "glproc.hpp"') print('#include "glsize.hpp"') print() module = Module() module.mergeModule(cglapi) module.mergeModule(glapi) api = API() api.addModule(module) tracer = CglTracer() tracer.traceApi(api) print(r''' PUBLIC void * gll_noop = 0; __attribute__((constructor)) static void _init(void) {