Kaydet (Commit) 67c134d4 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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
üst a8e66dd6
......@@ -11,16 +11,23 @@
#define INCLUDED_VCL_OPENGLWIN_HXX
#include <vcl/syschild.hxx>
#include <vcl/opengl/OpenGLContext.hxx>
#include <vcl/vclopengl_dllapi.hxx>
class OpenGLWindow : public SystemChildWindow
#include <boost/scoped_ptr.hpp>
class OpenGLContext;
class OpenGLWindowImpl;
// pImpl Pattern to avoid linking against OpenGL libs when using the class without the context
class VCLOPENGL_DLLPUBLIC OpenGLWindow : public SystemChildWindow
{
public:
OpenGLWindow(Window* pParent);
OpenGLContext& getContext();
~OpenGLWindow();
OpenGLContext* getContext();
private:
OpenGLContext maContext;
boost::scoped_ptr<OpenGLWindowImpl> mpImpl;
};
#endif
......
......@@ -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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment