From 6d4da2ff2d46c41bd455c029f0dac8d4e4b15be5 Mon Sep 17 00:00:00 2001 From: skyjake Date: Tue, 4 Jun 2013 21:57:22 +0300 Subject: [PATCH] Windows: Fixed various issues (exports, GL context) --- doomsday/libdeng2/include/de/core/memorylogsink.h | 2 +- doomsday/libgui/include/de/gui/canvas.h | 2 ++ doomsday/libgui/include/de/gui/font.h | 6 +++--- doomsday/libgui/include/de/gui/glentrypoints.h | 8 ++++++++ doomsday/libgui/include/de/gui/glshaderbank.h | 2 +- doomsday/libgui/src/canvas.cpp | 7 ++++++- doomsday/libgui/src/canvaswindow.cpp | 2 +- 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/doomsday/libdeng2/include/de/core/memorylogsink.h b/doomsday/libdeng2/include/de/core/memorylogsink.h index 6d824a1066..f4e1a1ba52 100644 --- a/doomsday/libdeng2/include/de/core/memorylogsink.h +++ b/doomsday/libdeng2/include/de/core/memorylogsink.h @@ -29,7 +29,7 @@ namespace de { /** * Log sink that stores log entries in memory. */ -class MemoryLogSink : public LogSink, public Lockable +class DENG2_PUBLIC MemoryLogSink : public LogSink, public Lockable { public: MemoryLogSink(LogEntry::Level minimumLevel = LogEntry::DEBUG); diff --git a/doomsday/libgui/include/de/gui/canvas.h b/doomsday/libgui/include/de/gui/canvas.h index 78486b6816..7d0087c3bf 100644 --- a/doomsday/libgui/include/de/gui/canvas.h +++ b/doomsday/libgui/include/de/gui/canvas.h @@ -130,6 +130,8 @@ class LIBGUI_PUBLIC Canvas : public QGLWidget, public KeyEventSource, public Mou */ bool isMouseTrapped() const; + bool isGLReady() const; + /** * Replaces the current audiences of this canvas with another canvas's * audiences. diff --git a/doomsday/libgui/include/de/gui/font.h b/doomsday/libgui/include/de/gui/font.h index 8f4629b2d5..39e6344128 100644 --- a/doomsday/libgui/include/de/gui/font.h +++ b/doomsday/libgui/include/de/gui/font.h @@ -57,7 +57,7 @@ class LIBGUI_PUBLIC Font * of text that contains style information (as escape sequences that start * with the Esc ASCII code 0x1b). */ - class RichFormat + class LIBGUI_PUBLIC RichFormat { public: enum ContentStyle { @@ -93,7 +93,7 @@ class LIBGUI_PUBLIC Font * Interface for an object providing style information: fonts and * colors. */ - class IStyle + class LIBGUI_PUBLIC IStyle { public: typedef Vector4ub Color; @@ -158,7 +158,7 @@ class LIBGUI_PUBLIC Font * @note Iterator::next() must be called before at least once after * constructing the instance to move the iterator onto the first range. */ - struct Iterator + struct LIBGUI_PUBLIC Iterator { RichFormat const &format; int index; diff --git a/doomsday/libgui/include/de/gui/glentrypoints.h b/doomsday/libgui/include/de/gui/glentrypoints.h index 49993f1d9c..d126d2f57f 100644 --- a/doomsday/libgui/include/de/gui/glentrypoints.h +++ b/doomsday/libgui/include/de/gui/glentrypoints.h @@ -26,6 +26,14 @@ #define WIN32_LEAN_AND_MEAN #include +#ifdef min +# undef min +#endif + +#ifdef max +# undef max +#endif + #include #include #include diff --git a/doomsday/libgui/include/de/gui/glshaderbank.h b/doomsday/libgui/include/de/gui/glshaderbank.h index f1310b4b6f..9cfa7fefc0 100644 --- a/doomsday/libgui/include/de/gui/glshaderbank.h +++ b/doomsday/libgui/include/de/gui/glshaderbank.h @@ -35,7 +35,7 @@ class GLProgram; * * Shaders and programs cannot be accessed until OpenGL is ready. */ -class GLShaderBank : public InfoBank +class LIBGUI_PUBLIC GLShaderBank : public InfoBank { public: GLShaderBank(); diff --git a/doomsday/libgui/src/canvas.cpp b/doomsday/libgui/src/canvas.cpp index 044eedaa80..eab5927a2f 100644 --- a/doomsday/libgui/src/canvas.cpp +++ b/doomsday/libgui/src/canvas.cpp @@ -229,6 +229,11 @@ bool Canvas::isMouseTrapped() const return d->mouseGrabbed; } +bool Canvas::isGLReady() const +{ + return d->readyNotified; +} + void Canvas::copyAudiencesFrom(Canvas const &other) { audienceForGLReady = other.audienceForGLReady; @@ -289,7 +294,7 @@ void Canvas::showEvent(QShowEvent* ev) #ifdef WIN32 makeCurrent(); getAllOpenGLEntryPoints(); - doneCurrent(); + //doneCurrent(); #endif QTimer::singleShot(1, this, SLOT(notifyReady())); } diff --git a/doomsday/libgui/src/canvaswindow.cpp b/doomsday/libgui/src/canvaswindow.cpp index e70f5efd09..4db1372069 100644 --- a/doomsday/libgui/src/canvaswindow.cpp +++ b/doomsday/libgui/src/canvaswindow.cpp @@ -105,7 +105,7 @@ DENG2_PIMPL(CanvasWindow) i->canvasGLInit(*canvas); } - canvas->doneCurrent(); + //canvas->doneCurrent(); canvas->updateGL(); // Reacquire the focus.