+ const char *wrapperFilename;
+
+ /*
+ * TODO: simplify code
+ */
+
+ switch (api) {
+ case API_GL:
+ wrapperFilename = GL_TRACE_WRAPPER;
+ break;
+#ifdef EGL_TRACE_WRAPPER
+ case API_EGL:
+ wrapperFilename = EGL_TRACE_WRAPPER;
+ break;
+#endif
+#ifdef _WIN32
+ case API_D3D7:
+ wrapperFilename = "ddraw.dll";
+ break;
+ case API_D3D8:
+ wrapperFilename = "d3d8.dll";
+ break;
+ case API_D3D9:
+ wrapperFilename = "d3d9.dll";
+ break;
+ case API_D3D10:
+ wrapperFilename = "d3d10.dll";
+ break;
+ case API_D3D10_1:
+ wrapperFilename = "d3d10_1.dll";
+ break;
+ case API_D3D11:
+ wrapperFilename = "d3d11.dll";
+ break;
+#endif
+ default:
+ std::cerr << "error: unsupported API\n";
+ return 1;
+ }