Kaydet (Commit) eccaf91e authored tarafından David Tardon's avatar David Tardon

use VCL's OpenGLContext for 3D transitions

Change-Id: I510518461eb8bc9669d0de2679c34c473f66b175
üst 92621df9
......@@ -150,7 +150,10 @@ public:
void makeCurrent();
void swapBuffers();
void sync();
void show();
void setWinPosAndSize(const Point &rPos, const Size& rSize);
void setWinSize(const Size& rSize);
GLWindow& getOpenGLWindow();
......
......@@ -31,11 +31,13 @@ $(eval $(call gb_Library_use_libraries,OGLTrans,\
cppuhelper \
sal \
vcl \
vclopengl \
$(gb_UWINAPI) \
))
$(eval $(call gb_Library_use_externals,OGLTrans,\
boost_headers \
glew \
mesa_headers \
))
......
......@@ -33,20 +33,18 @@
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/vector/b3dvector.hxx>
#include <vector>
#ifdef _WIN32
// <GL/gl.h> includes <windows.h>, so include that early through
// <prewin.h> to avoid name clashes from at least GDI's Rectangle().
#include <prewin.h>
#include <postwin.h>
#endif
#include <GL/gl.h>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/vector/b3dvector.hxx>
#include <vector>
class Primitive;
class Operation;
class SceneObject;
......
......@@ -551,6 +551,17 @@ bool OpenGLContext::ImplInit()
return true;
}
void OpenGLContext::setWinPosAndSize(const Point &rPos, const Size& rSize)
{
if(m_pWindow)
m_pWindow->SetPosSizePixel(rPos, rSize);
if( m_pChildWindow )
m_pChildWindow->SetPosSizePixel(rPos, rSize);
m_aGLWin.Width = rSize.Width();
m_aGLWin.Height = rSize.Height();
}
void OpenGLContext::setWinSize(const Size& rSize)
{
if(m_pWindow)
......@@ -795,4 +806,24 @@ void OpenGLContext::swapBuffers()
#endif
}
void OpenGLContext::sync()
{
#if defined( WNT )
// nothing
#elif defined( MACOSX ) || defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
glXWaitGL();
XSync(m_aGLWin.dpy, false);
#endif
}
void OpenGLContext::show()
{
if (m_pChildWindow)
m_pChildWindow->Show();
else if (m_pWindow)
m_pWindow->Show();
}
/* 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