diff --git a/doomsday/apps/client/src/gl/gl_defer.cpp b/doomsday/apps/client/src/gl/gl_defer.cpp index 9c8e5ec08c..c370a9d120 100644 --- a/doomsday/apps/client/src/gl/gl_defer.cpp +++ b/doomsday/apps/client/src/gl/gl_defer.cpp @@ -157,6 +157,8 @@ static deferredtask_t* nextTask(void) LIBDENG_GL_DEFER1(e, GLenum e) { + DENG2_ASSERT(ptr != nullptr); + apifunc_t* api = (apifunc_t *) M_Malloc(sizeof(apifunc_t)); api->func.ptr_e = ptr; api->param.e = e; @@ -166,6 +168,8 @@ LIBDENG_GL_DEFER1(e, GLenum e) LIBDENG_GL_DEFER2(i, GLenum e, GLint i) { + DENG2_ASSERT(ptr != nullptr); + apifunc_t* api = (apifunc_t *) M_Malloc(sizeof(apifunc_t)); api->func.ptr_ei = ptr; api->param.ei.e = e; @@ -175,6 +179,8 @@ LIBDENG_GL_DEFER2(i, GLenum e, GLint i) LIBDENG_GL_DEFER2(f, GLenum e, GLfloat f) { + DENG2_ASSERT(ptr != nullptr); + apifunc_t* api = (apifunc_t *) M_Malloc(sizeof(apifunc_t)); api->func.ptr_ef = ptr; api->param.ef.e = e; @@ -184,6 +190,8 @@ LIBDENG_GL_DEFER2(f, GLenum e, GLfloat f) LIBDENG_GL_DEFER2(fv4, GLenum e, const GLfloat* floatArrayWithFourValues) { + DENG2_ASSERT(ptr != nullptr); + apifunc_t* api = (apifunc_t *) M_Malloc(sizeof(apifunc_t)); api->func.ptr_efv4 = ptr; api->param.efv4.e = e; @@ -193,6 +201,8 @@ LIBDENG_GL_DEFER2(fv4, GLenum e, const GLfloat* floatArrayWithFourValues) LIBDENG_GL_DEFER2(uintArray, GLsizei s, const GLuint* v) { + DENG2_ASSERT(ptr != nullptr); + apifunc_t* api = (apifunc_t *) M_Malloc(sizeof(apifunc_t)); api->func.ptr_uintArray = ptr; api->param.uintArray.count = s; diff --git a/doomsday/apps/client/src/gl/gl_deferredapi.cpp b/doomsday/apps/client/src/gl/gl_deferredapi.cpp index 7edbff7f7b..300fa56588 100644 --- a/doomsday/apps/client/src/gl/gl_deferredapi.cpp +++ b/doomsday/apps/client/src/gl/gl_deferredapi.cpp @@ -37,6 +37,36 @@ static QOpenGLContext &context() return *ClientWindow::main().context(); } +static void deng_glEnable(GLenum e) +{ + LIBGUI_GL.glEnable(e); +} + +static void deng_glDisable(GLenum e) +{ + LIBGUI_GL.glDisable(e); +} + +static void deng_glDeleteTextures(GLsizei num, GLuint const *names) +{ + LIBGUI_GL.glDeleteTextures(num, names); +} + +static void deng_glFogi(GLenum p, GLint v) +{ + LIBGUI_GL.glFogi(p, v); +} + +static void deng_glFogf(GLenum p, GLfloat v) +{ + LIBGUI_GL.glFogf(p, v); +} + +static void deng_glFogfv(GLenum p, GLfloat const *v) +{ + LIBGUI_GL.glFogfv(p, v); +} + #define GL_CALL1(form, func, x) \ if(mustDefer()) GL_Defer_##form(func, x); else func(x); #define GL_CALL2(form, func, x, y) \ @@ -44,30 +74,30 @@ static QOpenGLContext &context() DENG_EXTERN_C void Deferred_glEnable(GLenum e) { - GL_CALL1(e, reinterpret_cast(context().getProcAddress("glEnable")), e); + GL_CALL1(e, deng_glEnable, e); } DENG_EXTERN_C void Deferred_glDisable(GLenum e) { - GL_CALL1(e, reinterpret_cast(context().getProcAddress("glDisable")), e); + GL_CALL1(e, deng_glDisable, e); } DENG_EXTERN_C void Deferred_glDeleteTextures(GLsizei num, GLuint const *names) { - GL_CALL2(uintArray, reinterpret_cast(context().getProcAddress("glDeleteTextures")), num, names); + GL_CALL2(uintArray, deng_glDeleteTextures, num, names); } DENG_EXTERN_C void Deferred_glFogi(GLenum p, GLint v) { - GL_CALL2(i, reinterpret_cast(context().getProcAddress("glFogi")), p, v); + GL_CALL2(i, deng_glFogi, p, v); } DENG_EXTERN_C void Deferred_glFogf(GLenum p, GLfloat v) { - GL_CALL2(f, reinterpret_cast(context().getProcAddress("glFogf")), p, v); + GL_CALL2(f, deng_glFogf, p, v); } DENG_EXTERN_C void Deferred_glFogfv(GLenum p, GLfloat const *v) { - GL_CALL2(fv4, reinterpret_cast(context().getProcAddress("glFogfv")), p, v); + GL_CALL2(fv4, deng_glFogfv, p, v); } diff --git a/doomsday/apps/client/src/render/rend_main.cpp b/doomsday/apps/client/src/render/rend_main.cpp index 247b49c09d..0eda1a035d 100644 --- a/doomsday/apps/client/src/render/rend_main.cpp +++ b/doomsday/apps/client/src/render/rend_main.cpp @@ -81,12 +81,12 @@ #include "ui/editors/modelasseteditor.h" #include "ui/ui_main.h" #include "ui/postprocessing.h" - #include "ui/editors/edit_bias.h" #include "sys_system.h" #include "dd_main.h" #include "clientapp.h" +#include "network/net_main.h" #include #include diff --git a/doomsday/apps/client/src/ui/clientwindow.cpp b/doomsday/apps/client/src/ui/clientwindow.cpp index 5f927caa16..42b58e2e9c 100644 --- a/doomsday/apps/client/src/ui/clientwindow.cpp +++ b/doomsday/apps/client/src/ui/clientwindow.cpp @@ -473,13 +473,13 @@ DENG2_PIMPL(ClientWindow) self.eventHandler().audienceForFocusChange() += this; -#ifdef WIN32 +/*#ifdef WIN32 if (self.isFullScreen()) { // It would seem we must manually give our canvas focus. Bug in Qt? self.canvas().setFocus(); } -#endif +#endif*/ DD_FinishInitializationAfterWindowReady(); diff --git a/doomsday/apps/client/src/ui/mouse_qt.cpp b/doomsday/apps/client/src/ui/mouse_qt.cpp index 5416b2230d..5374b04baa 100644 --- a/doomsday/apps/client/src/ui/mouse_qt.cpp +++ b/doomsday/apps/client/src/ui/mouse_qt.cpp @@ -120,9 +120,9 @@ static void Mouse_Qt_GetState(mousestate_t *state) static void Mouse_Qt_ShowCursor(bool yes) { -#ifndef MACOSX +/*#ifndef MACOSX de::Canvas &canvas = ClientWindowSystem::main().canvas(); -#endif +#endif*/ LOG_INPUT_VERBOSE("%s cursor (presently visible? %b)") << (yes? "showing" : "hiding") << !cursorHidden; @@ -133,7 +133,7 @@ static void Mouse_Qt_ShowCursor(bool yes) #ifdef MACOSX Cursor_Show(false); #else - canvas.setCursor(QCursor(Qt::BlankCursor)); + //canvas.setCursor(QCursor(Qt::BlankCursor)); qApp->setOverrideCursor(QCursor(Qt::BlankCursor)); #endif } @@ -144,7 +144,7 @@ static void Mouse_Qt_ShowCursor(bool yes) Cursor_Show(true); #else qApp->restoreOverrideCursor(); - canvas.setCursor(QCursor(Qt::ArrowCursor)); // Default cursor. + //canvas.setCursor(QCursor(Qt::ArrowCursor)); // Default cursor. #endif } } diff --git a/doomsday/sdk/libgui/src/displaymode_windows.cpp b/doomsday/sdk/libgui/src/displaymode_windows.cpp index 14c36c223d..0c9223d39e 100644 --- a/doomsday/sdk/libgui/src/displaymode_windows.cpp +++ b/doomsday/sdk/libgui/src/displaymode_windows.cpp @@ -29,7 +29,7 @@ #include #include "de/gui/displaymode_native.h" -#include "de/PersistentCanvasWindow" +#include "de/PersistentGLWindow" static std::vector devModes; static DEVMODE currentDevMode; @@ -115,9 +115,9 @@ int DisplayMode_Native_Change(const DisplayMode* mode, int shouldCapture) void DisplayMode_Native_SetColorTransfer(DisplayColorTransfer const *colors) { - if (!de::CanvasWindow::mainExists()) return; + if (!de::GLWindow::mainExists()) return; - HWND hWnd = (HWND) de::CanvasWindow::main().nativeHandle(); + HWND hWnd = (HWND) de::GLWindow::main().nativeHandle(); DENG2_ASSERT(hWnd != 0); HDC hDC = GetDC(hWnd); @@ -130,7 +130,7 @@ void DisplayMode_Native_SetColorTransfer(DisplayColorTransfer const *colors) void DisplayMode_Native_GetColorTransfer(DisplayColorTransfer *colors) { - HWND hWnd = (HWND) de::CanvasWindow::main().nativeHandle(); + HWND hWnd = (HWND) de::GLWindow::main().nativeHandle(); DENG2_ASSERT(hWnd != 0); HDC hDC = GetDC(hWnd); diff --git a/doomsday/sdk/libgui/src/glwindow.cpp b/doomsday/sdk/libgui/src/glwindow.cpp index f8a048bec3..ae6e9c60a7 100644 --- a/doomsday/sdk/libgui/src/glwindow.cpp +++ b/doomsday/sdk/libgui/src/glwindow.cpp @@ -323,14 +323,14 @@ void GLWindow::wheelEvent(QWheelEvent *ev) bool GLWindow::event(QEvent *ev) { -#ifdef WIN32 +/*#ifdef WIN32 if (ev->type() == QEvent::ActivationChange) { //LOG_DEBUG("GLWindow: Forwarding QEvent::KeyRelease, Qt::Key_Alt"); QKeyEvent keyEvent = QKeyEvent(QEvent::KeyRelease, Qt::Key_Alt, Qt::NoModifier); return QApplication::sendEvent(&canvas(), &keyEvent); } -#endif +#endif*/ return QOpenGLWindow::event(ev); }