diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-05-07 04:16:54 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-05-07 21:23:04 +0200 |
commit | 67c134d4e26fca9317157f634bed1fff6a3093e4 (patch) | |
tree | 66dbdcd98fbb37ba74fe70669deb95aa7e5dbd62 /vcl | |
parent | a8e66dd657dff28ef7ae9cfbe15ea43e4c08aefd (diff) |
avoid linking against the OpenGL libs when only using the window
This lets us avoid to link libsclo against all the OpenGL libraries and
only link against libvcl_opengl. Only code actually using the context
will need to link against the OpenGL libs.
Change-Id: Ia47f4c651702a7fb8517073cda6fb113e7e26e50
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/openglwin.cxx | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx index 29a21a2ada81..3065718464b2 100644 --- a/vcl/source/window/openglwin.cxx +++ b/vcl/source/window/openglwin.cxx @@ -8,15 +8,40 @@ */ #include <vcl/openglwin.hxx> +#include <vcl/opengl/OpenGLContext.hxx> + +class OpenGLWindowImpl +{ +public: + OpenGLWindowImpl(SystemChildWindow* pWindow); + OpenGLContext* getContext(); +private: + OpenGLContext maContext; +}; + +OpenGLWindowImpl::OpenGLWindowImpl(SystemChildWindow* pWindow) +{ + maContext.init(pWindow); +} + +OpenGLContext* OpenGLWindowImpl::getContext() +{ + return &maContext; +} OpenGLWindow::OpenGLWindow(Window* pParent): - SystemChildWindow(pParent, 0) + SystemChildWindow(pParent, 0), + mpImpl(new OpenGLWindowImpl(this)) +{ +} + +OpenGLWindow::~OpenGLWindow() { } -OpenGLContext& OpenGLWindow::getContext() +OpenGLContext* OpenGLWindow::getContext() { - return maContext; + return mpImpl->getContext(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |