*
**************************************************************************/
-#include "glimports.hpp"
+#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);
+ }
}
};
void
init(void) {
+ /*
+ * OpenGL library must be loaded by the time we call GDI.
+ */
+ __libGlHandle = LoadLibraryA("OPENGL32");
}
void
}
Visual *
-createVisual(bool doubleBuffer) {
+createVisual(bool doubleBuffer, Profile profile) {
+ if (profile != PROFILE_COMPAT) {
+ return NULL;
+ }
+
Visual *visual = new Visual();
visual->doubleBuffer = doubleBuffer;
return NULL;
}
- return new WglContext(visual, profile, dynamic_cast<WglContext *>(shareContext));
+ return new WglContext(visual, profile, static_cast<WglContext *>(shareContext));
}
bool
if (!drawable || !context) {
return wglMakeCurrent(NULL, NULL);
} else {
- WglDrawable *wglDrawable = dynamic_cast<WglDrawable *>(drawable);
- WglContext *wglContext = dynamic_cast<WglContext *>(context);
+ WglDrawable *wglDrawable = static_cast<WglDrawable *>(drawable);
+ WglContext *wglContext = static_cast<WglContext *>(context);
if (!wglContext->hglrc) {
wglContext->hglrc = wglCreateContext(wglDrawable->hDC);