*
**************************************************************************/
+#include <iostream>
+
#include "glproc.hpp"
#include "glws.hpp"
void swapBuffers(void) {
SwapBuffers(hDC);
+
+ // Drain message queue to prevent window from being considered
+ // non-responsive
+ MSG msg;
+ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
}
};
/*
* OpenGL library must be loaded by the time we call GDI.
*/
- __libGlHandle = LoadLibraryA("OPENGL32");
+
+ const char * libgl_filename = getenv("TRACE_LIBGL");
+
+ if (!libgl_filename) {
+ libgl_filename = "OPENGL32";
+ }
+
+ __libGlHandle = LoadLibraryA(libgl_filename);
+ if (!__libGlHandle) {
+ std::cerr << "error: unable to open " << libgl_filename << "\n";
+ exit(1);
+ }
}
void
}
Visual *
-createVisual(bool doubleBuffer) {
+createVisual(bool doubleBuffer, Profile profile) {
+ if (profile != PROFILE_COMPAT) {
+ return NULL;
+ }
+
Visual *visual = new Visual();
visual->doubleBuffer = doubleBuffer;