+static inline bool
+copyWrapper(const os::String & wrapperPath,
+ const char *programPath,
+ bool verbose)
+{
+ os::String wrapperFilename(wrapperPath);
+ wrapperFilename.trimDirectory();
+
+ os::String tmpWrapper(programPath);
+ tmpWrapper.trimFilename();
+ tmpWrapper.join(wrapperFilename);
+
+ if (verbose) {
+ std::cerr << wrapperPath << " -> " << tmpWrapper << "\n";
+ }
+
+ if (tmpWrapper.exists()) {
+ std::cerr << "error: not overwriting " << tmpWrapper << "\n";
+ return false;
+ }
+
+ if (!os::copyFile(wrapperPath, tmpWrapper, false)) {
+ std::cerr << "error: failed to copy " << wrapperPath << " into " << tmpWrapper << "\n";
+ return false;
+ }
+
+ return true;
+}
+
+
+static const char *glWrappers[] = {
+ GL_TRACE_WRAPPER,
+ NULL
+};
+
+#ifdef EGL_TRACE_WRAPPER
+static const char *eglWrappers[] = {
+ EGL_TRACE_WRAPPER,
+ NULL
+};
+#endif
+
+#ifdef _WIN32
+static const char *d3d7Wrappers[] = {
+ "ddraw.dll",
+ NULL
+};
+
+static const char *d3d8Wrappers[] = {
+ "d3d8.dll",
+ NULL
+};
+
+static const char *d3d9Wrappers[] = {
+ "d3d9.dll",
+ NULL
+};
+
+static const char *dxgiWrappers[] = {
+ "dxgitrace.dll",
+ //"dxgi.dll",
+ "d3d10.dll",
+ "d3d10_1.dll",
+ "d3d11.dll",
+ NULL
+};
+#endif
+