- os::Path wrapper;
-
- wrapper = findFile("wrappers/" CLI_TRACE_WRAPPER, APITRACE_WRAPPER_INSTALL_DIR "/" CLI_TRACE_WRAPPER, verbose);
-
- if (!wrapper.length()) {
+ const char *wrapperFilename;
+ std::vector<const char *> args;
+ int status = 1;
+
+ /*
+ * TODO: simplify code
+ */
+
+ bool useInject = false;
+ 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:
+ case API_D3D10_1:
+ case API_D3D11:
+ wrapperFilename = "dxgitrace.dll";
+ useInject = true;
+ break;
+#endif
+ default:
+ std::cerr << "error: unsupported API\n";