Kaydet (Commit) 7a8146e0 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

non-desktop: Attempt to get rid of glew.

Change-Id: I883ff114ebd98234fcc9f41d69de96aadedadf4b
üst c553a2fd
......@@ -26,10 +26,11 @@ class IOpenGLRenderer;
class SVX_DLLPUBLIC SdrOpenGLObj : public SdrObject, public IOpenGLInfoProvider
{
public:
SdrOpenGLObj();
virtual ~SdrOpenGLObj();
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE;
OpenGLContext& getOpenGLContext();
OpenGLContext* getOpenGLContext();
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
......@@ -40,7 +41,7 @@ public:
private:
OpenGLContext maContext;
OpenGLContext* mpContext;
boost::scoped_ptr<IOpenGLRenderer> mpRenderer;
};
......
......@@ -21,8 +21,9 @@ ViewObjectContactOfOpenGLObj::ViewObjectContactOfOpenGLObj(
ObjectContact& rObjectContact, ViewContact& rViewContact )
: ViewObjectContactOfSdrObj( rObjectContact, rViewContact )
{
OpenGLContext& rContext = static_cast<SdrOpenGLObj&>(static_cast<ViewContactOfSdrObj&>(rViewContact).GetSdrObject()).getOpenGLContext();
rContext.init(getWindow());
OpenGLContext* pContext = static_cast<SdrOpenGLObj&>(static_cast<ViewContactOfSdrObj&>(rViewContact).GetSdrObject()).getOpenGLContext();
if (pContext)
pContext->init(getWindow());
}
ViewObjectContactOfOpenGLObj::~ViewObjectContactOfOpenGLObj()
......
......@@ -7,13 +7,26 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <config_features.h>
#include <svx/svdoopengl.hxx>
#include <svx/sdr/contact/viewcontactofopenglobj.hxx>
#include <vcl/opengl/IOpenGLRenderer.hxx>
SdrOpenGLObj::SdrOpenGLObj()
: SdrObject(),
IOpenGLInfoProvider(),
mpContext(NULL)
{
#if HAVE_FEATURE_DESKTOP
mpContext = new OpenGLContext;
#endif
}
SdrOpenGLObj::~SdrOpenGLObj()
{
delete mpContext;
}
sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact()
......@@ -21,17 +34,19 @@ sdr::contact::ViewContact* SdrOpenGLObj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfOpenGLObj(*this);
}
OpenGLContext& SdrOpenGLObj::getOpenGLContext()
OpenGLContext* SdrOpenGLObj::getOpenGLContext()
{
return maContext;
return mpContext;
}
void SdrOpenGLObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
{
SdrObject::NbcResize(rRef, xFact, yFact);
//now pass the information to the OpenGL context
maContext.setWinSize(aOutRect.GetSize());
// now pass the information to the OpenGL context
if (mpContext)
mpContext->setWinSize(aOutRect.GetSize());
SAL_WARN("svx.opengl", "resized opengl drawinglayer object");
}
......@@ -48,7 +63,7 @@ IOpenGLRenderer* SdrOpenGLObj::getRenderer()
bool SdrOpenGLObj::isOpenGLInitialized()
{
return maContext.isInitialized();
return mpContext && mpContext->isInitialized();
}
/* 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