[Libreoffice-commits] core.git: 52 commits - avmedia/source canvas/opengl canvas/source chart2/opengl chart2/source include/vcl slideshow/Library_OGLTrans.mk slideshow/source vcl/inc vcl/Library_vclopengl.mk vcl/osx vcl/source
Markus Mohrhard
markus.mohrhard at googlemail.com
Mon Sep 1 16:33:30 PDT 2014
avmedia/source/viewer/mediawindow_impl.cxx | 2
canvas/opengl/linearMultiColorGradientFragmentShader.glsl | 13
canvas/opengl/radialMultiColorGradientFragmentShader.glsl | 13
canvas/opengl/rectangularMultiColorGradientFragmentShader.glsl | 15
canvas/opengl/rectangularTwoColorGradientFragmentShader.glsl | 4
canvas/source/factory/cf_service.cxx | 7
canvas/source/opengl/ogl_canvashelper.cxx | 5
canvas/source/opengl/ogl_spritedevicehelper.cxx | 13
canvas/source/tools/canvastools.cxx | 1
chart2/opengl/README.deprecated | 23
chart2/opengl/backgroundFragmentShader.glsl | 4
chart2/opengl/backgroundVertexShader.glsl | 8
chart2/opengl/commonFragmentShader.glsl | 7
chart2/opengl/commonVertexShader.glsl | 6
chart2/opengl/debugFragmentShader.glsl | 4
chart2/opengl/debugVertexShader.glsl | 6
chart2/opengl/pickingFragmentShader.glsl | 10
chart2/opengl/pickingVertexShader.glsl | 8
chart2/opengl/renderTextureFragmentShader.glsl | 7
chart2/opengl/renderTextureVertexShader.glsl | 8
chart2/opengl/screenTextFragmentShader.glsl | 10
chart2/opengl/screenTextVertexShader.glsl | 8
chart2/opengl/shape3DFragmentShader.glsl | 1
chart2/opengl/shape3DFragmentShaderBatch.glsl | 1
chart2/opengl/shape3DFragmentShaderBatchScroll.glsl | 1
chart2/opengl/shape3DFragmentShaderV300.glsl | 7
chart2/opengl/shape3DVertexShader.glsl | 2
chart2/opengl/shape3DVertexShaderBatch.glsl | 2
chart2/opengl/shape3DVertexShaderBatchScroll.glsl | 2
chart2/opengl/shape3DVertexShaderV300.glsl | 11
chart2/opengl/symbolFragmentShader.glsl | 4
chart2/opengl/symbolVertexShader.glsl | 6
chart2/opengl/textFragmentShader.glsl | 11
chart2/opengl/textFragmentShaderBatch.glsl | 3
chart2/opengl/textVertexShader.glsl | 8
chart2/opengl/textVertexShaderBatch.glsl | 1
chart2/source/view/charttypes/GL3DBarChart.cxx | 3
chart2/source/view/main/GL3DRenderer.cxx | 115
chart2/source/view/main/OpenGLRender.cxx | 25
include/vcl/opengl/OpenGLContext.hxx | 14
include/vcl/opengl/OpenGLHelper.hxx | 4
include/vcl/sysdata.hxx | 6
slideshow/Library_OGLTrans.mk | 13
slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx | 593 ++--
slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx | 75
slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx | 46
slideshow/source/engine/OGLTrans/mac/OGLTrans_Shaders.h | 96
slideshow/source/engine/OGLTrans/mac/OGLTrans_Shaders.m | 233 -
slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionImpl.hxx | 501 ---
slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionImpl.mm | 1316 ----------
slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm | 1074 --------
slideshow/source/engine/OGLTrans/mac/aquaOpenGLView.h | 48
slideshow/source/engine/OGLTrans/mac/aquaOpenGLView.m | 195 -
slideshow/source/engine/shapes/viewmediashape.cxx | 2
vcl/Library_vclopengl.mk | 23
vcl/inc/OpenGLWrapper.hxx | 28
vcl/inc/osx/salobj.h | 2
vcl/osx/OpenGLWrapper.cxx | 27
vcl/osx/salinst.cxx | 5
vcl/osx/salobj.cxx | 46
vcl/source/opengl/OpenGLContext.cxx | 70
vcl/source/opengl/OpenGLHelper.cxx | 22
vcl/source/window/openglwin.cxx | 6
63 files changed, 891 insertions(+), 3939 deletions(-)
New commits:
commit 9dc883623f85f2ceec22c3e5c1750ff7acd3cac5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Sep 2 01:11:24 2014 +0200
prevent potential crash if no SystemWindowData is passed
Change-Id: I92a084bba88a4c34e93aac9b547a986ea6381790
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 8cccd1b..7932f8a 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -47,7 +47,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat
[mpFrame->getNSView() addSubview: mpClipView];
[mpClipView setHidden: YES];
}
- if (pWindowData->bOpenGL)
+ if (pWindowData && pWindowData->bOpenGL)
{
NSOpenGLPixelFormat* pixFormat = NULL;
commit 603d9c1a01a37358f04cee4852838b7ccaecb648
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Sep 2 01:10:58 2014 +0200
fix indentation
Change-Id: I558b6c0c1be917fbf6df722d4f0268c271bb888c
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 816eaf1..8cccd1b 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -87,7 +87,8 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat
{
maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame];
}
- if( maSysData.mpNSView )
+
+ if( maSysData.mpNSView )
{
if( mpClipView )
[mpClipView setDocumentView: maSysData.mpNSView];
commit be7d3df141bff7560545b4a54a7d8d99d730b17e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Sep 2 01:05:33 2014 +0200
remove SAL_DEBUGs introduced earlier
Change-Id: I901188b5b0a3e64e2407d039dd80f89cce8cf6de
diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx
index 07ee8b7..6d413fd 100644
--- a/canvas/source/factory/cf_service.cxx
+++ b/canvas/source/factory/cf_service.cxx
@@ -169,11 +169,6 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) :
xNameAccess, UNO_QUERY_THROW);
Sequence<OUString> serviceNames = xNameAccess->getElementNames();
- for (sal_Int32 i = 0; i < serviceNames.getLength(); ++i)
- {
- SAL_DEBUG(serviceNames[i]);
- }
-
const OUString* pCurr = serviceNames.getConstArray();
const OUString* const pEnd = pCurr + serviceNames.getLength();
while( pCurr != pEnd )
@@ -188,25 +183,13 @@ CanvasFactory::CanvasFactory( Reference<XComponentContext> const & xContext ) :
if( (xEntryNameAccess->getByName("PreferredImplementations") >>= implementationList) )
{
m_aAvailableImplementations.push_back( std::make_pair(*pCurr,implementationList) );
- for (sal_Int32 i = 0; i < implementationList.getLength(); ++i)
- {
- SAL_DEBUG("available :" << implementationList[i]);
- }
}
if( (xEntryNameAccess->getByName("AcceleratedImplementations") >>= implementationList) )
{
- for (sal_Int32 i = 0; i < implementationList.getLength(); ++i)
- {
- SAL_DEBUG("accelerated: " <<implementationList[i]);
- }
m_aAcceleratedImplementations.push_back( std::make_pair(*pCurr,implementationList) );
}
if( (xEntryNameAccess->getByName("AntialiasingImplementations") >>= implementationList) )
{
- for (sal_Int32 i = 0; i < implementationList.getLength(); ++i)
- {
- SAL_DEBUG("aa implemented: " << implementationList[i]);
- }
m_aAAImplementations.push_back( std::make_pair(*pCurr,implementationList) );
}
@@ -294,7 +277,6 @@ Reference<XInterface> CanvasFactory::use(
Reference<XComponentContext> const & xContext ) const
{
try {
- SAL_DEBUG("use: " << serviceName);
return m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
serviceName, args, xContext);
}
@@ -337,7 +319,6 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
Reference<XComponentContext> const & xContext ) const
{
::osl::MutexGuard guard(m_mutex);
- SAL_DEBUG(serviceName);
// forcing last entry from impl list, if config flag set
bool bForceLastEntry(false);
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx
index 2e4b592..58a59ea 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.cxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx
@@ -389,7 +389,6 @@ namespace oglcanvas
uno::Reference<rendering::XColorSpace> SpriteDeviceHelper::getColorSpace() const
{
- SAL_DEBUG("called SpriteDeviceHelper::getColorSpace()");
// always the same
return uno::Reference<rendering::XColorSpace>(
::canvas::tools::getStdColorSpace(),
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 999b9df..cde4356 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -218,9 +218,7 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders()
m_3DModelID = glGetUniformLocation(m_3DProID, "M");
m_3DNormalMatrixID = glGetUniformLocation(m_3DProID, "normalMatrix");
m_3DVertexID = glGetAttribLocation(m_3DProID, "vertexPositionModelspace");
- SAL_DEBUG("first " << m_3DVertexID);
m_3DNormalID = glGetAttribLocation(m_3DProID, "vertexNormalModelspace");
- SAL_DEBUG("second " << m_3DNormalID);
CHECK_GL_ERROR();
if (m_bScrollFlag)
{
@@ -289,30 +287,22 @@ void OpenGL3DRenderer::ShaderResources::LoadShaders()
m_TextProID = OpenGLHelper::LoadShaders("textVertexShader", "textFragmentShader");
m_TextMatrixID = glGetUniformLocation(m_TextProID, "MVP");
m_TextVertexID = glGetAttribLocation(m_TextProID, "vPosition");
- SAL_DEBUG(m_TextVertexID);
m_TextTexCoordID = glGetAttribLocation(m_TextProID, "texCoord");
- SAL_DEBUG(m_TextTexCoordID);
m_TextTexID = glGetUniformLocation(m_TextProID, "TextTex");
}
CHECK_GL_ERROR();
m_ScreenTextProID = OpenGLHelper::LoadShaders("screenTextVertexShader", "screenTextFragmentShader");
m_ScreenTextVertexID = glGetAttribLocation(m_ScreenTextProID, "vPosition");
- SAL_DEBUG(m_ScreenTextVertexID);
m_ScreenTextTexCoordID = glGetAttribLocation(m_ScreenTextProID, "texCoord");
- SAL_DEBUG(m_ScreenTextTexCoordID);
m_ScreenTextTexID = glGetUniformLocation(m_ScreenTextProID, "TextTex");
m_ScreenTextColorID = glGetUniformLocation(m_ScreenTextProID, "textColor");
CHECK_GL_ERROR();
m_CommonProID = OpenGLHelper::LoadShaders("commonVertexShader", "commonFragmentShader");
- SAL_DEBUG(m_CommonProID);
m_MatrixID = glGetUniformLocation(m_CommonProID, "MVP");
- SAL_DEBUG(m_MatrixID);
m_2DColorID = glGetUniformLocation(m_CommonProID, "vColor");
- SAL_DEBUG(m_2DColorID);
m_2DVertexID = glGetAttribLocation(m_CommonProID, "vPosition");
- SAL_DEBUG(m_2DVertexID);
CHECK_GL_ERROR();
}
@@ -878,7 +868,6 @@ void OpenGL3DRenderer::RenderLine3D(const Polygon3DInfo& polygon)
// 1rst attribute buffer : vertices
glEnableVertexAttribArray(maResources.m_2DVertexID);
- SAL_DEBUG(maResources.m_2DVertexID);
CHECK_GL_ERROR();
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
CHECK_GL_ERROR();
commit 200dd78946a70a4c08a4d479e845b3b724bbecc4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Sep 2 01:01:37 2014 +0200
fix crash when creating chart
Change-Id: Ie6e38a0461a10cc33ff3d85cbf3b35ffab0efd59
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx
index cfe6e6a..1151a4d 100644
--- a/vcl/source/window/openglwin.cxx
+++ b/vcl/source/window/openglwin.cxx
@@ -10,6 +10,7 @@
#include <vcl/openglwin.hxx>
#include <vcl/opengl/OpenGLContext.hxx>
#include <vcl/event.hxx>
+#include <vcl/sysdata.hxx>
class OpenGLWindowImpl
{
@@ -21,9 +22,10 @@ private:
boost::scoped_ptr<SystemChildWindow> mpChildWindow;
};
-OpenGLWindowImpl::OpenGLWindowImpl(Window* pWindow):
- mpChildWindow(new SystemChildWindow(pWindow))
+OpenGLWindowImpl::OpenGLWindowImpl(Window* pWindow)
{
+ SystemWindowData aData = OpenGLContext::generateWinData(pWindow, false);
+ mpChildWindow.reset(new SystemChildWindow(pWindow, 0, &aData));
mpChildWindow->Show();
maContext.init(mpChildWindow.get());
pWindow->SetMouseTransparent(false);
commit 1ba10b7b307ffdb098049c303719da4aa6752502
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Sep 2 00:20:37 2014 +0200
fix build
Change-Id: I13c67763ec3cb940292199f3e9e0f3942446959f
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx
index b608b85..f4c8856 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -515,7 +515,7 @@ void MediaWindowImpl::onURLChanged()
#if HAVE_FEATURE_GLTF
else if ( m_sMimeType == AVMEDIA_MIMETYPE_JSON )
{
- SystemWindowData aWinData = OpenGLContext::generateWinData(this);
+ SystemWindowData aWinData = OpenGLContext::generateWinData(this, false);
mpChildWindow.reset(new MediaChildWindow(this,&aWinData));
mbEventTransparent = false;
}
diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
index 9ebc014..fd3c507 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -477,7 +477,7 @@ namespace slideshow
Size( aAWTRect.Width, aAWTRect.Height ) );
mpEventHandlerParent->EnablePaint(false);
mpEventHandlerParent->Show();
- SystemWindowData aWinData = OpenGLContext::generateWinData(mpEventHandlerParent.get());
+ SystemWindowData aWinData = OpenGLContext::generateWinData(mpEventHandlerParent.get(), false);
mpMediaWindow.reset(new SystemChildWindow(mpEventHandlerParent.get(), 0, &aWinData));
mpMediaWindow->SetPosSizePixel( Point( 0, 0 ),
Size( aAWTRect.Width, aAWTRect.Height ) );
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 8cccd1b..816eaf1 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -87,8 +87,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat
{
maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame];
}
-
- if( maSysData.mpNSView )
+ if( maSysData.mpNSView )
{
if( mpClipView )
[mpClipView setDocumentView: maSysData.mpNSView];
commit dee6c7ca318b310996ecc997cd64be026c0f76d2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Tue Sep 2 00:00:11 2014 +0200
fix indentation
Change-Id: I4f299e510fecb57f763818743d357ae6bf2333af
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 816eaf1..8cccd1b 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -87,7 +87,8 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat
{
maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame];
}
- if( maSysData.mpNSView )
+
+ if( maSysData.mpNSView )
{
if( mpClipView )
[mpClipView setDocumentView: maSysData.mpNSView];
commit 8b384c946cb6725d691123152f5e7c6ac0692185
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 23:59:24 2014 +0200
support legacy and core context on OSX
Change-Id: Ib8cadb3f182ce49c0ca8b6ccaa95960eb8e5f9ae
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 7ce6763..79f97fc 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -181,7 +181,7 @@ public:
bool supportMultiSampling() const;
- static SystemWindowData generateWinData(Window* pParent);
+ static SystemWindowData generateWinData(Window* pParent, bool bRequestLegacyContext);
private:
SAL_DLLPRIVATE bool initWindow();
diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx
index 8ac816a..4cfc737 100644
--- a/include/vcl/sysdata.hxx
+++ b/include/vcl/sysdata.hxx
@@ -178,6 +178,7 @@ struct SystemWindowData
#if defined( WNT ) // meaningless on Windows
#elif defined( MACOSX )
bool bOpenGL; // create a OpenGL providing NSView
+ bool bLegacy; // create a 2.1 legacy context, only valid if bOpenGL == true
// Nothing
#elif defined( ANDROID )
// Nothing
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 7c7ad5d..816eaf1 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -49,17 +49,39 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat
}
if (pWindowData->bOpenGL)
{
- NSOpenGLPixelFormatAttribute aAttributes[] =
+ NSOpenGLPixelFormat* pixFormat = NULL;
+
+ if (pWindowData->bLegacy)
+ {
+ NSOpenGLPixelFormatAttribute aAttributes[] =
+ {
+ NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFAAlphaSize, 8,
+ NSOpenGLPFAColorSize, 24,
+ NSOpenGLPFAMultisample,
+ NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1,
+ NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)4,
+ 0
+ };
+ pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
+ }
+ else
{
- NSOpenGLPFADoubleBuffer,
- NSOpenGLPFAAlphaSize, 8,
- NSOpenGLPFAColorSize, 24,
- 0
- };
+ NSOpenGLPixelFormatAttribute aAttributes[] =
+ {
+ NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
+ NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFAAlphaSize, 8,
+ NSOpenGLPFAColorSize, 24,
+ NSOpenGLPFAMultisample,
+ NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute)1,
+ NSOpenGLPFASamples, (NSOpenGLPixelFormatAttribute)4,
+ 0
+ };
+ pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
+ }
- NSOpenGLPixelFormat* pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
maSysData.mpNSView = [[NSOpenGLView alloc] initWithFrame: aInitFrame pixelFormat:pixFormat];
-
}
else
{
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index d7ea0ee..18e0a02 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -615,7 +615,7 @@ bool OpenGLContext::initWindow()
{
if( !m_pChildWindow )
{
- SystemWindowData winData = generateWinData(mpWindow);
+ SystemWindowData winData = generateWinData(mpWindow, false);
m_pChildWindow = new SystemChildWindow(mpWindow, 0, &winData, false);
m_pChildWindowGC.reset(m_pChildWindow);
}
@@ -642,7 +642,7 @@ bool OpenGLContext::initWindow()
{
if( !m_pChildWindow )
{
- SystemWindowData winData = generateWinData(mpWindow);
+ SystemWindowData winData = generateWinData(mpWindow, mbRequestLegacyContext);
m_pChildWindow = new SystemChildWindow(mpWindow, 0, &winData, false);
m_pChildWindowGC.reset(m_pChildWindow);
}
@@ -673,7 +673,7 @@ bool OpenGLContext::initWindow()
bool OpenGLContext::initWindow()
{
const SystemEnvData* pChildSysData = 0;
- SystemWindowData winData = generateWinData(mpWindow);
+ SystemWindowData winData = generateWinData(mpWindow, false);
if( winData.pVisual )
{
if( !m_pChildWindow )
@@ -725,11 +725,13 @@ bool OpenGLContext::initWindow()
#if defined( WNT ) || defined( MACOSX ) || defined( IOS ) || defined( ANDROID )
-SystemWindowData OpenGLContext::generateWinData(Window* /*pParent*/)
+SystemWindowData OpenGLContext::generateWinData(Window* /*pParent*/, bool bRequestLegacyContext)
{
+ (void) bRequestLegacyContext;
SystemWindowData aWinData;
#if defined(MACOSX)
aWinData.bOpenGL = true;
+ aWinData.bLegacy = bRequestLegacyContext;
#endif
aWinData.nSize = sizeof(aWinData);
return aWinData;
@@ -750,7 +752,7 @@ void initOpenGLFunctionPointers()
}
-SystemWindowData OpenGLContext::generateWinData(Window* pParent)
+SystemWindowData OpenGLContext::generateWinData(Window* pParent, bool)
{
SystemWindowData aWinData;
aWinData.nSize = sizeof(aWinData);
commit 6626d135299f91c20b338a858af8f42f4e3d07d0
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 23:10:54 2014 +0200
fix non OSX build again
Change-Id: I3faccc9f70b1afb7cbefd5ba9b26612eb7cda1fd
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index b908f05..d7ea0ee 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -17,9 +17,11 @@
#include <vcl/bmpacc.hxx>
#include <vcl/graph.hxx>
+#if defined(MACOSX)
#include <premac.h>
#include "OpenGLWrapper.hxx"
#include <postmac.h>
+#endif
using namespace com::sun::star;
commit e111caa906f683f3e31a015e3a40414320271541
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 22:14:59 2014 +0200
remove unused method
Change-Id: I17d3e3fa4671d0004e2d7918ea3bcad1a7bcd2b5
diff --git a/vcl/inc/OpenGLWrapper.hxx b/vcl/inc/OpenGLWrapper.hxx
index 6911c33..0b90b41 100644
--- a/vcl/inc/OpenGLWrapper.hxx
+++ b/vcl/inc/OpenGLWrapper.hxx
@@ -23,8 +23,6 @@ public:
static void swapBuffers(NSOpenGLView* pView);
static void makeCurrent(NSOpenGLView* pView);
static void resetCurrent();
-
- static void init(NSOpenGLView* pView);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/OpenGLWrapper.cxx b/vcl/osx/OpenGLWrapper.cxx
index dc9ad7a..fc008f4 100644
--- a/vcl/osx/OpenGLWrapper.cxx
+++ b/vcl/osx/OpenGLWrapper.cxx
@@ -24,8 +24,4 @@ void OpenGLWrapper::resetCurrent()
[NSOpenGLContext clearCurrentContext];
}
-void OpenGLWrapper::init(NSOpenGLView* pView)
-{
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6ee477283d185f990892598593616d8951ce0e92
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 22:14:07 2014 +0200
fix non Mac build
Change-Id: I88df76fc1757b8372cd319ae1ecd7976b01554a1
diff --git a/vcl/Library_vclopengl.mk b/vcl/Library_vclopengl.mk
index e5fbbfe..e61dd8a 100644
--- a/vcl/Library_vclopengl.mk
+++ b/vcl/Library_vclopengl.mk
@@ -38,6 +38,12 @@ $(eval $(call gb_Library_use_libraries,vclopengl,\
$(gb_UWINAPI) \
))
+$(eval $(call gb_Library_add_exception_objects,vclopengl,\
+ vcl/source/opengl/OpenGLContext \
+ vcl/source/opengl/OpenGLHelper \
+ vcl/source/window/openglwin \
+))
+
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_cxxflags,vclopengl,\
@@ -53,9 +59,6 @@ $(eval $(call gb_Library_add_libs,vcl,\
$(eval $(call gb_Library_add_exception_objects,vclopengl,\
vcl/osx/OpenGLWrapper \
- vcl/source/opengl/OpenGLContext \
- vcl/source/opengl/OpenGLHelper \
- vcl/source/window/openglwin \
))
endif
commit 0e60b3375cacff4a7440d8f781f8b1a789b6b122
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 07:31:15 2014 +0200
fix OSX build
don't require Obj-C features in header files
Change-Id: Ibeea090b6b2bda191b8e8ffd08f15907653fd830
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index 59ac433..7ce6763 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -31,7 +31,11 @@
#include <GL/wglext.h>
#elif defined( MACOSX )
#include <OpenGL/OpenGL.h>
+#ifdef __OBJC__
@class NSOpenGLView;
+#else
+class NSOpenGLView;
+#endif
#elif defined( IOS )
#elif defined( ANDROID )
#elif defined( UNX )
commit 4f321bd267d31f7f67e009d66c40072ba11c3f59
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 01:59:57 2014 +0200
working OSX OpenGLContext
In contrast to the CGL solution this renders not only to a FBO but to a
rendering context.
Change-Id: I083795cab5ea6372efac312a1f5e0053066121ea
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx
index dc223d5..59ac433 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -31,6 +31,7 @@
#include <GL/wglext.h>
#elif defined( MACOSX )
#include <OpenGL/OpenGL.h>
+ at class NSOpenGLView;
#elif defined( IOS )
#elif defined( ANDROID )
#elif defined( UNX )
@@ -182,6 +183,10 @@ private:
SAL_DLLPRIVATE bool initWindow();
SAL_DLLPRIVATE bool ImplInit();
+#if defined(MACOSX)
+ NSOpenGLView* getOpenGLView();
+#endif
+
GLWindow m_aGLWin;
boost::scoped_ptr<Window> m_pWindow;
Window* mpWindow; //points to m_pWindow or the parent window, don't delete it
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 75185ad..b908f05 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -488,6 +488,8 @@ bool OpenGLContext::ImplInit()
#elif defined( MACOSX )
+ NSOpenGLView* pView = getOpenGLView();
+ OpenGLWrapper::makeCurrent(pView);
#elif defined( IOS )
@@ -837,6 +839,8 @@ void OpenGLContext::makeCurrent()
SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent(): wglMakeCurrent failed: " << GetLastError());
}
#elif defined( MACOSX )
+ NSOpenGLView* pView = getOpenGLView();
+ OpenGLWrapper::makeCurrent(pView);
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -849,6 +853,7 @@ void OpenGLContext::resetCurrent()
#if defined( WNT )
wglMakeCurrent( m_aGLWin.hDC, 0 );
#elif defined( MACOSX )
+ OpenGLWrapper::resetCurrent();
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -861,6 +866,8 @@ void OpenGLContext::swapBuffers()
#if defined( WNT )
SwapBuffers(m_aGLWin.hDC);
#elif defined( MACOSX )
+ NSOpenGLView* pView = getOpenGLView();
+ OpenGLWrapper::swapBuffers(pView);
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -903,5 +910,11 @@ bool OpenGLContext::supportMultiSampling() const
return m_aGLWin.bMultiSampleSupported;
}
+#if defined(MACOSX)
+NSOpenGLView* OpenGLContext::getOpenGLView()
+{
+ return reinterpret_cast<NSOpenGLView*>(m_pChildWindow->GetSystemData()->mpNSView);
+}
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e65acd2ebbb85d557068692674f317ff3a038e9b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 01:18:09 2014 +0200
use SystemWindowData to request a NSOpenGLWindow
Change-Id: Ief50a2fc533846cd61be66b1ea166a992942083b
diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx
index 59aaaa0..8ac816a 100644
--- a/include/vcl/sysdata.hxx
+++ b/include/vcl/sysdata.hxx
@@ -51,6 +51,7 @@ struct SystemEnvData
HWND hWnd; // the window hwnd
#elif defined( MACOSX )
NSView* mpNSView; // the cocoa (NSView *) implementing this object
+ bool mbOpenGL; // use a OpenGL providing NSView
#elif defined( ANDROID )
// Nothing
#elif defined( IOS )
@@ -75,6 +76,7 @@ struct SystemEnvData
, hWnd(0)
#elif defined( MACOSX )
, mpNSView(NULL)
+ , mbOpenGL(false)
#elif defined( ANDROID )
#elif defined( IOS )
#elif defined( UNX )
@@ -174,7 +176,8 @@ struct SystemWindowData
{
unsigned long nSize; // size in bytes of this structure
#if defined( WNT ) // meaningless on Windows
-#elif defined( MACOSX ) // meaningless on Mac OS X
+#elif defined( MACOSX )
+ bool bOpenGL; // create a OpenGL providing NSView
// Nothing
#elif defined( ANDROID )
// Nothing
diff --git a/vcl/inc/osx/salobj.h b/vcl/inc/osx/salobj.h
index 8e18a7d..5db9d3e 100644
--- a/vcl/inc/osx/salobj.h
+++ b/vcl/inc/osx/salobj.h
@@ -52,7 +52,7 @@ public:
void setClippedPosSize();
- AquaSalObject( AquaSalFrame* pFrame );
+ AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWinData );
virtual ~AquaSalObject();
virtual void ResetClipRegion() SAL_OVERRIDE;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 532fc38..93d1e1a 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -757,13 +757,12 @@ void AquaSalInstance::DestroyFrame( SalFrame* pFrame )
delete pFrame;
}
-SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* /* pWindowData */, bool /* bShow */ )
+SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool /* bShow */ )
{
- // SystemWindowData is meaningless on Mac OS X
AquaSalObject *pObject = NULL;
if ( pParent )
- pObject = new AquaSalObject( static_cast<AquaSalFrame*>(pParent) );
+ pObject = new AquaSalObject( static_cast<AquaSalFrame*>(pParent), pWindowData );
return pObject;
}
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 7f9df92..7c7ad5d 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -22,8 +22,9 @@
#include "osx/saldata.hxx"
#include "osx/salobj.h"
#include "osx/salframe.h"
+#include <AppKit/NSOpenGLView.h>
-AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
+AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowData ) :
mpFrame( pFrame ),
mnClipX( -1 ),
mnClipY( -1 ),
@@ -37,6 +38,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
{
maSysData.nSize = sizeof( maSysData );
maSysData.mpNSView = NULL;
+ maSysData.mbOpenGL = pWindowData->bOpenGL;
NSRect aInitFrame = { NSZeroPoint, { 20, 20 } };
mpClipView = [[NSClipView alloc] initWithFrame: aInitFrame ];
@@ -45,8 +47,25 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame ) :
[mpFrame->getNSView() addSubview: mpClipView];
[mpClipView setHidden: YES];
}
- maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame];
- if( maSysData.mpNSView )
+ if (pWindowData->bOpenGL)
+ {
+ NSOpenGLPixelFormatAttribute aAttributes[] =
+ {
+ NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFAAlphaSize, 8,
+ NSOpenGLPFAColorSize, 24,
+ 0
+ };
+
+ NSOpenGLPixelFormat* pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
+ maSysData.mpNSView = [[NSOpenGLView alloc] initWithFrame: aInitFrame pixelFormat:pixFormat];
+
+ }
+ else
+ {
+ maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame];
+ }
+ if( maSysData.mpNSView )
{
if( mpClipView )
[mpClipView setDocumentView: maSysData.mpNSView];
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index b4e7e0d..75185ad 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -724,6 +724,9 @@ bool OpenGLContext::initWindow()
SystemWindowData OpenGLContext::generateWinData(Window* /*pParent*/)
{
SystemWindowData aWinData;
+#if defined(MACOSX)
+ aWinData.bOpenGL = true;
+#endif
aWinData.nSize = sizeof(aWinData);
return aWinData;
}
commit ff3321cf775871f34985cd3e1d2c9fa25738037a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 00:39:19 2014 +0200
replace check with GLEW variable
Change-Id: I818d099c70f2f886908584e67a73934dee5dbef8
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index 24c85f2..bb0e979 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -376,9 +376,7 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
mpContext->setWinPosAndSize(Point(aCanvasArea.X, aCanvasArea.Y), Size(aCanvasArea.Width, aCanvasArea.Height));
SAL_INFO("slideshow.opengl", "canvas area: " << aCanvasArea.X << "," << aCanvasArea.Y << " - " << aCanvasArea.Width << "x" << aCanvasArea.Height);
- GLWindow& rGLWindow(mpContext->getOpenGLWindow());
-
- mbGenerateMipmap = rGLWindow.HasGLExtension( "GL_SGIS_generate_mipmap" );
+ mbGenerateMipmap = GLEW_SGIS_generate_mipmap;
CHECK_GL_ERROR();
glEnable(GL_CULL_FACE);
commit a5346d7f3d8a7d4ecf4917a374c9ce930205ff6e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Mon Sep 1 00:36:15 2014 +0200
switch to a NSOpenGLView implementation
Change-Id: Ifed59a9e899abc900ddf27378eec6b641be061d3
diff --git a/vcl/Library_vclopengl.mk b/vcl/Library_vclopengl.mk
index 11b46e5..e5fbbfe 100644
--- a/vcl/Library_vclopengl.mk
+++ b/vcl/Library_vclopengl.mk
@@ -10,6 +10,7 @@
$(eval $(call gb_Library_Library,vclopengl))
$(eval $(call gb_Library_set_include,vclopengl,\
+ -I$(SRCDIR)/vcl/inc/ \
$$(INCLUDE) \
))
@@ -37,12 +38,28 @@ $(eval $(call gb_Library_use_libraries,vclopengl,\
$(gb_UWINAPI) \
))
+ifeq ($(OS),MACOSX)
+
+$(eval $(call gb_Library_add_cxxflags,vclopengl,\
+ $(gb_OBJCXXFLAGS) \
+))
+
+$(eval $(call gb_Library_add_libs,vcl,\
+ -framework IOKit \
+ -F/System/Library/PrivateFrameworks \
+ -framework CoreUI \
+ -lobjc \
+))
+
$(eval $(call gb_Library_add_exception_objects,vclopengl,\
+ vcl/osx/OpenGLWrapper \
vcl/source/opengl/OpenGLContext \
vcl/source/opengl/OpenGLHelper \
vcl/source/window/openglwin \
))
+endif
+
ifeq ($(strip $(OS)),WNT)
$(eval $(call gb_Library_use_system_win32_libs,vclopengl,\
opengl32 \
@@ -52,6 +69,9 @@ $(eval $(call gb_Library_use_system_win32_libs,vclopengl,\
else ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_use_system_darwin_frameworks,vclopengl,\
OpenGL \
+ Cocoa \
+ Carbon \
+ CoreFoundation \
))
else ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclopengl,\
diff --git a/vcl/inc/OpenGLWrapper.hxx b/vcl/inc/OpenGLWrapper.hxx
new file mode 100644
index 0000000..6911c33
--- /dev/null
+++ b/vcl/inc/OpenGLWrapper.hxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "AppKit/NSOpenGLView.h"
+#include "AppKit/NSOpenGL.h"
+
+class OpenGLWrapper
+{
+private:
+
+ OpenGLWrapper();
+ OpenGLWrapper(const OpenGLWrapper&);
+ OpenGLWrapper& operator=(const OpenGLWrapper&);
+
+public:
+
+ static void swapBuffers(NSOpenGLView* pView);
+ static void makeCurrent(NSOpenGLView* pView);
+ static void resetCurrent();
+
+ static void init(NSOpenGLView* pView);
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/OpenGLWrapper.cxx b/vcl/osx/OpenGLWrapper.cxx
new file mode 100644
index 0000000..dc9ad7a
--- /dev/null
+++ b/vcl/osx/OpenGLWrapper.cxx
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "OpenGLWrapper.hxx"
+
+void OpenGLWrapper::swapBuffers(NSOpenGLView* pView)
+{
+ [[pView openGLContext] flushBuffer];
+}
+
+void OpenGLWrapper::makeCurrent(NSOpenGLView* pView)
+{
+ [[pView openGLContext] makeCurrentContext];
+}
+
+void OpenGLWrapper::resetCurrent()
+{
+ [NSOpenGLContext clearCurrentContext];
+}
+
+void OpenGLWrapper::init(NSOpenGLView* pView)
+{
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index e8ab18e..b4e7e0d 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -17,6 +17,10 @@
#include <vcl/bmpacc.hxx>
#include <vcl/graph.hxx>
+#include <premac.h>
+#include "OpenGLWrapper.hxx"
+#include <postmac.h>
+
using namespace com::sun::star;
GLWindow::~GLWindow()
@@ -44,8 +48,7 @@ OpenGLContext::~OpenGLContext()
ReleaseDC( m_aGLWin.hWnd, m_aGLWin.hDC );
}
#elif defined( MACOSX )
- CGLSetCurrentContext(NULL);
- CGLDestroyContext(m_aGLWin.context);
+ OpenGLWrapper::resetCurrent();
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -485,29 +488,6 @@ bool OpenGLContext::ImplInit()
#elif defined( MACOSX )
- CGLPixelFormatAttribute pixelFormatAttributes[] = {
-#if MACOSX_SDK_VERSION > 1060
- kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core,
-#endif
- kCGLPFAColorSize, (CGLPixelFormatAttribute) 24,
- kCGLPFAAlphaSize, (CGLPixelFormatAttribute) 8,
- kCGLPFADoubleBuffer,
- kCGLPFASampleBuffers, (CGLPixelFormatAttribute) 1,
- kCGLPFASampleBuffers, (CGLPixelFormatAttribute) 4,
- (CGLPixelFormatAttribute) 0
- };
-
- if (mbRequestLegacyContext)
- pixelFormatAttributes[1] = (CGLPixelFormatAttribute) kCGLOGLPVersion_Legacy;
-
- CGLPixelFormatObj pixelFormat;
- GLint numberOfPixels;
- CGLChoosePixelFormat(pixelFormatAttributes, &pixelFormat, &numberOfPixels);
-
- CGLCreateContext(pixelFormat, 0, &m_aGLWin.context);
- CGLDestroyPixelFormat(pixelFormat);
-
- CGLSetCurrentContext(m_aGLWin.context);
#elif defined( IOS )
@@ -854,8 +834,6 @@ void OpenGLContext::makeCurrent()
SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent(): wglMakeCurrent failed: " << GetLastError());
}
#elif defined( MACOSX )
- CGLError nError = CGLSetCurrentContext(m_aGLWin.context);
- SAL_WARN_IF(nError != kCGLNoError, "vcl.opengl", "error in makeCurrent");
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -868,8 +846,6 @@ void OpenGLContext::resetCurrent()
#if defined( WNT )
wglMakeCurrent( m_aGLWin.hDC, 0 );
#elif defined( MACOSX )
- CGLError nError = CGLSetCurrentContext(NULL);
- SAL_WARN_IF(nError != kCGLNoError, "vcl.opengl", "error in makeCurrent");
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
@@ -882,7 +858,6 @@ void OpenGLContext::swapBuffers()
#if defined( WNT )
SwapBuffers(m_aGLWin.hDC);
#elif defined( MACOSX )
- CGLFlushDrawable(m_aGLWin.context);
#elif defined( IOS ) || defined( ANDROID )
// nothing
#elif defined( UNX )
commit 45f9f5f4d92323ebb78dff5437d49ed4b50804ee
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Aug 28 01:37:10 2014 +0200
use size_t instead of unsigned int for container indices
Change-Id: Iff2f797915f1558ea23336e273bd26e0c0edc63e
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
index 53524f8..2ccc375 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
@@ -80,7 +80,7 @@ void OGLTransitionImpl::setScene(TransitionScene const& rScene)
void OGLTransitionImpl::prepare( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex )
{
const SceneObjects_t& rSceneObjects(maScene.getSceneObjects());
- for(unsigned int i(0); i != rSceneObjects.size(); ++i) {
+ for(size_t i(0); i != rSceneObjects.size(); ++i) {
rSceneObjects[i]->prepare();
}
@@ -90,7 +90,7 @@ void OGLTransitionImpl::prepare( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEn
void OGLTransitionImpl::finish()
{
const SceneObjects_t& rSceneObjects(maScene.getSceneObjects());
- for(unsigned int i(0); i != rSceneObjects.size(); ++i) {
+ for(size_t i(0); i != rSceneObjects.size(); ++i) {
rSceneObjects[i]->finish();
}
@@ -189,7 +189,7 @@ void OGLTransitionImpl::display( double nTime, ::sal_Int32 glLeavingSlideTex, ::
void OGLTransitionImpl::applyOverallOperations( double nTime, double SlideWidthScale, double SlideHeightScale )
{
const Operations_t& rOverallOperations(maScene.getOperations());
- for(unsigned int i(0); i != rOverallOperations.size(); ++i)
+ for(size_t i(0); i != rOverallOperations.size(); ++i)
rOverallOperations[i]->interpolate(nTime,SlideWidthScale,SlideHeightScale);
}
@@ -217,7 +217,7 @@ OGLTransitionImpl::displaySlide(
glTranslated( 0, 2 - surfaceLevel, 0 );
glCullFace(GL_FRONT);
- for(unsigned int i(0); i < primitives.size(); ++i)
+ for(size_t i(0); i < primitives.size(); ++i)
primitives[i].display(nTime, SlideWidthScale, SlideHeightScale);
glCullFace(GL_BACK);
@@ -226,7 +226,7 @@ OGLTransitionImpl::displaySlide(
glPopMatrix();
}
- for(unsigned int i(0); i < primitives.size(); ++i)
+ for(size_t i(0); i < primitives.size(); ++i)
primitives[i].display(nTime, SlideWidthScale, SlideHeightScale);
CHECK_GL_ERROR();
}
@@ -236,7 +236,7 @@ void OGLTransitionImpl::displayScene( double nTime, double SlideWidth, double Sl
CHECK_GL_ERROR();
const SceneObjects_t& rSceneObjects(maScene.getSceneObjects());
glEnable(GL_TEXTURE_2D);
- for(unsigned int i(0); i != rSceneObjects.size(); ++i)
+ for(size_t i(0); i != rSceneObjects.size(); ++i)
rSceneObjects[i]->display(nTime, SlideWidth, SlideHeight, DispWidth, DispHeight);
CHECK_GL_ERROR();
}
@@ -276,7 +276,7 @@ void Primitive::display(double nTime, double WidthScale, double HeightScale) con
void Primitive::applyOperations(double nTime, double WidthScale, double HeightScale) const
{
CHECK_GL_ERROR();
- for(unsigned int i(0); i < Operations.size(); ++i)
+ for(size_t i(0); i < Operations.size(); ++i)
Operations[i]->interpolate( nTime ,WidthScale,HeightScale);
glScaled(WidthScale,HeightScale,1);
CHECK_GL_ERROR();
@@ -285,7 +285,7 @@ void Primitive::applyOperations(double nTime, double WidthScale, double HeightSc
void SceneObject::display(double nTime, double /* SlideWidth */, double /* SlideHeight */, double DispWidth, double DispHeight ) const
{
CHECK_GL_ERROR();
- for(unsigned int i(0); i < maPrimitives.size(); ++i) {
+ for(size_t i(0); i < maPrimitives.size(); ++i) {
// fixme: allow various model spaces, now we make it so that
// it is regular -1,-1 to 1,1, where the whole display fits in
CHECK_GL_ERROR();
commit 27fce9349bb1e1a2842ce4e59183d3be1100a552
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Aug 28 00:25:30 2014 +0200
the values are float now
actually OpenGL does not like double that much
Change-Id: I3267f46072194bb6b2d4705733408e3db44c8c08
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
index 7e37e0e..53524f8 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
@@ -255,7 +255,7 @@ void Primitive::display(double nTime, double WidthScale, double HeightScale) con
if(!Normals.empty())
{
CHECK_GL_ERROR();
- glNormalPointer( GL_DOUBLE , 0 , &Normals[0] );
+ glNormalPointer( GL_FLOAT , 0 , &Normals[0] );
CHECK_GL_ERROR();
glEnableClientState( GL_NORMAL_ARRAY );
CHECK_GL_ERROR();
@@ -263,9 +263,9 @@ void Primitive::display(double nTime, double WidthScale, double HeightScale) con
CHECK_GL_ERROR();
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
CHECK_GL_ERROR();
- glTexCoordPointer( 2, GL_DOUBLE, 0, &TexCoords[0] );
+ glTexCoordPointer( 2, GL_FLOAT, 0, &TexCoords[0] );
CHECK_GL_ERROR();
- glVertexPointer( 3, GL_DOUBLE, 0, &Vertices[0] );
+ glVertexPointer( 3, GL_FLOAT, 0, &Vertices[0] );
CHECK_GL_ERROR();
glDrawArrays( GL_TRIANGLES, 0, Vertices.size() );
CHECK_GL_ERROR();
commit ca82d9e720ea4a07e14dc6becb1d4e4edf3013b5
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Aug 27 19:28:22 2014 +0200
remove that ugly underscore at the end of the method names
Change-Id: I3c81c9d8b89ddf18bdc5ae700b721ca71f2700bb
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
index f2c94ef..7e37e0e 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
@@ -84,7 +84,7 @@ void OGLTransitionImpl::prepare( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEn
rSceneObjects[i]->prepare();
}
- prepareTransition_( glLeavingSlideTex, glEnteringSlideTex );
+ prepareTransition( glLeavingSlideTex, glEnteringSlideTex );
}
void OGLTransitionImpl::finish()
@@ -94,7 +94,7 @@ void OGLTransitionImpl::finish()
rSceneObjects[i]->finish();
}
- finishTransition_();
+ finishTransition();
}
static void blendSlide( double depth )
@@ -144,15 +144,15 @@ static void slideShadow( double nTime, const Primitive& primitive, double sw, do
CHECK_GL_ERROR();
}
-void OGLTransitionImpl::prepare_( double, double, double, double, double )
+void OGLTransitionImpl::prepare( double, double, double, double, double )
{
}
-void OGLTransitionImpl::prepareTransition_( ::sal_Int32, ::sal_Int32 )
+void OGLTransitionImpl::prepareTransition( ::sal_Int32, ::sal_Int32 )
{
}
-void OGLTransitionImpl::finishTransition_()
+void OGLTransitionImpl::finishTransition()
{
}
@@ -173,7 +173,7 @@ void OGLTransitionImpl::display( double nTime, ::sal_Int32 glLeavingSlideTex, ::
const double SlideHeightScale = SlideHeight/DispHeight;
CHECK_GL_ERROR();
- prepare_( nTime, SlideWidth, SlideHeight, DispWidth, DispHeight );
+ prepare( nTime, SlideWidth, SlideHeight, DispWidth, DispHeight );
CHECK_GL_ERROR();
glPushMatrix();
@@ -1132,11 +1132,11 @@ public:
{}
private:
- virtual void prepare_( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight ) SAL_OVERRIDE;
+ virtual void prepare( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight ) SAL_OVERRIDE;
// mmPrepare = &OGLTransitionImpl::prepareDiamond;
};
-void DiamondTransition::prepare_( double nTime, double /* SlideWidth */, double /* SlideHeight */, double /* DispWidth */, double /* DispHeight */ )
+void DiamondTransition::prepare( double nTime, double /* SlideWidth */, double /* SlideHeight */, double /* DispWidth */, double /* DispHeight */ )
{
Primitive Slide1, Slide2;
@@ -1390,9 +1390,9 @@ protected:
private:
virtual void displaySlides_( double nTime, ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale ) SAL_OVERRIDE;
- virtual void prepareTransition_( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex ) SAL_OVERRIDE;
- virtual void finishTransition_() SAL_OVERRIDE;
- virtual GLuint makeShader_() = 0;
+ virtual void prepareTransition( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex ) SAL_OVERRIDE;
+ virtual void finishTransition() SAL_OVERRIDE;
+ virtual GLuint makeShader() = 0;
void impl_preparePermShader();
@@ -1426,14 +1426,14 @@ void ShaderTransition::displaySlides_( double nTime, ::sal_Int32 glLeavingSlideT
CHECK_GL_ERROR();
}
-void ShaderTransition::prepareTransition_( ::sal_Int32 /* glLeavingSlideTex */, ::sal_Int32 /* glEnteringSlideTex */ )
+void ShaderTransition::prepareTransition( ::sal_Int32 /* glLeavingSlideTex */, ::sal_Int32 /* glEnteringSlideTex */ )
{
- m_nProgramObject = makeShader_();
+ m_nProgramObject = makeShader();
impl_preparePermShader();
}
-void ShaderTransition::finishTransition_()
+void ShaderTransition::finishTransition()
{
CHECK_GL_ERROR();
if( m_nProgramObject ) {
@@ -1549,10 +1549,10 @@ public:
{}
private:
- virtual GLuint makeShader_() SAL_OVERRIDE;
+ virtual GLuint makeShader() SAL_OVERRIDE;
};
-GLuint StaticNoiseTransition::makeShader_()
+GLuint StaticNoiseTransition::makeShader()
{
return OpenGLHelper::LoadShaders( "basicVertexShader", "staticFragmentShader" );
}
@@ -1600,10 +1600,10 @@ public:
{}
private:
- virtual GLuint makeShader_() SAL_OVERRIDE;
+ virtual GLuint makeShader() SAL_OVERRIDE;
};
-GLuint DissolveTransition::makeShader_()
+GLuint DissolveTransition::makeShader()
{
return OpenGLHelper::LoadShaders( "basicVertexShader", "dissolveFragmentShader" );
}
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
index 460b3bf..f49f2d6 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.hxx
@@ -187,19 +187,19 @@ private:
*
* Default implementation does nothing.
*/
- virtual void prepare_( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight );
+ virtual void prepare( double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight );
/** This function is called after glx context is ready to let the transition prepare GL related things, like GLSL program.
*
* Default implementation does nothing.
*/
- virtual void prepareTransition_( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
+ virtual void prepareTransition( ::sal_Int32 glLeavingSlideTex, ::sal_Int32 glEnteringSlideTex );
/** This function is called when the transition needs to clear after itself, like delete own textures etc.
*
* Default implementation does nothing.
*/
- virtual void finishTransition_();
+ virtual void finishTransition();
/** This function is called in display method to display the slides.
*
commit 63f49714a1f02dae5651b518ca3f8a5897a783d1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Aug 27 17:44:59 2014 +0200
basegfx -> glm in OGLTrans
Change-Id: I3f3002d975f3ee2732c5e132b3b67531356aad5c
diff --git a/slideshow/Library_OGLTrans.mk b/slideshow/Library_OGLTrans.mk
index 20596b5..6a9d2ac 100644
--- a/slideshow/Library_OGLTrans.mk
+++ b/slideshow/Library_OGLTrans.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_Library_use_externals,OGLTrans,\
boost_headers \
glew \
mesa_headers \
+ glm_headers \
))
$(eval $(call gb_Library_set_componentfile,OGLTrans,slideshow/source/engine/OGLTrans/ogltrans))
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
index 17bdff5..f2c94ef 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionImpl.cxx
@@ -424,19 +424,19 @@ boost::shared_ptr<OGLTransitionImpl> makeOutsideCubeFaceToLeft()
{
Primitive Slide;
- Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
- Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
+ Slide.pushTriangle(glm::vec2(0,0),glm::vec2(1,0),glm::vec2(0,1));
+ Slide.pushTriangle(glm::vec2(1,0),glm::vec2(0,1),glm::vec2(1,1));
Primitives_t aLeavingPrimitives;
aLeavingPrimitives.push_back(Slide);
- Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0,1,0),basegfx::B3DVector(0,0,-1),90,false,0.0,1.0));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0,1,0),glm::vec3(0,0,-1),90,false,0.0,1.0));
Primitives_t aEnteringPrimitives;
aEnteringPrimitives.push_back(Slide);
Operations_t aOperations;
- aOperations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0,1,0),basegfx::B3DVector(0,0,-1),-90,true,0.0,1.0));
+ aOperations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0,1,0),glm::vec3(0,0,-1),-90,true,0.0,1.0));
return makeSimpleTransition(aLeavingPrimitives, aEnteringPrimitives, aOperations);
}
@@ -445,19 +445,19 @@ boost::shared_ptr<OGLTransitionImpl> makeInsideCubeFaceToLeft()
{
Primitive Slide;
- Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
- Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
+ Slide.pushTriangle(glm::vec2(0,0),glm::vec2(1,0),glm::vec2(0,1));
+ Slide.pushTriangle(glm::vec2(1,0),glm::vec2(0,1),glm::vec2(1,1));
Primitives_t aLeavingPrimitives;
aLeavingPrimitives.push_back(Slide);
- Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0,1,0),basegfx::B3DVector(0,0,1),-90,false,0.0,1.0));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0,1,0),glm::vec3(0,0,1),-90,false,0.0,1.0));
Primitives_t aEnteringPrimitives;
aEnteringPrimitives.push_back(Slide);
Operations_t aOperations;
- aOperations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0,1,0),basegfx::B3DVector(0,0,1),90,true,0.0,1.0));
+ aOperations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0,1,0),glm::vec3(0,0,1),90,true,0.0,1.0));
return makeSimpleTransition(aLeavingPrimitives, aEnteringPrimitives, aOperations);
}
@@ -466,13 +466,13 @@ boost::shared_ptr<OGLTransitionImpl> makeFallLeaving()
{
Primitive Slide;
- Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
- Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
+ Slide.pushTriangle(glm::vec2(0,0),glm::vec2(1,0),glm::vec2(0,1));
+ Slide.pushTriangle(glm::vec2(1,0),glm::vec2(0,1),glm::vec2(1,1));
Primitives_t aEnteringPrimitives;
aEnteringPrimitives.push_back(Slide);
- Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(1,0,0),basegfx::B3DVector(0,-1,0), 90,true,0.0,1.0));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(1,0,0),glm::vec3(0,-1,0), 90,true,0.0,1.0));
Primitives_t aLeavingPrimitives;
aLeavingPrimitives.push_back(Slide);
@@ -489,19 +489,19 @@ boost::shared_ptr<OGLTransitionImpl> makeTurnAround()
TransitionSettings aSettings;
aSettings.mbReflectSlides = true;
- Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
- Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
+ Slide.pushTriangle(glm::vec2(0,0),glm::vec2(1,0),glm::vec2(0,1));
+ Slide.pushTriangle(glm::vec2(1,0),glm::vec2(0,1),glm::vec2(1,1));
Primitives_t aLeavingPrimitives;
aLeavingPrimitives.push_back(Slide);
- Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0,1,0),basegfx::B3DVector(0,0,0),-180,false,0.0,1.0));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0,1,0),glm::vec3(0,0,0),-180,false,0.0,1.0));
Primitives_t aEnteringPrimitives;
aEnteringPrimitives.push_back(Slide);
Operations_t aOperations;
- aOperations.push_back(makeSTranslate(basegfx::B3DVector(0, 0, -1.5),true, 0, 0.5));
- aOperations.push_back(makeSTranslate(basegfx::B3DVector(0, 0, 1.5), true, 0.5, 1));
- aOperations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0, 1, 0),basegfx::B3DVector(0, 0, 0), -180, true, 0.0, 1.0));
+ aOperations.push_back(makeSTranslate(glm::vec3(0, 0, -1.5),true, 0, 0.5));
+ aOperations.push_back(makeSTranslate(glm::vec3(0, 0, 1.5), true, 0.5, 1));
+ aOperations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0, 1, 0),glm::vec3(0, 0, 0), -180, true, 0.0, 1.0));
return makeSimpleTransition(aLeavingPrimitives, aEnteringPrimitives, aOperations, aSettings);
}
@@ -510,14 +510,14 @@ boost::shared_ptr<OGLTransitionImpl> makeTurnDown()
{
Primitive Slide;
- Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
- Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
+ Slide.pushTriangle(glm::vec2(0,0),glm::vec2(1,0),glm::vec2(0,1));
+ Slide.pushTriangle(glm::vec2(1,0),glm::vec2(0,1),glm::vec2(1,1));
Primitives_t aLeavingPrimitives;
aLeavingPrimitives.push_back(Slide);
- Slide.Operations.push_back(makeSTranslate(basegfx::B3DVector(0, 0, 0.0001), false, -1.0, 0.0));
- Slide.Operations.push_back(makeSRotate (basegfx::B3DVector(0, 0, 1), basegfx::B3DVector(-1, 1, 0), -90, true, 0.0, 1.0));
- Slide.Operations.push_back(makeSRotate (basegfx::B3DVector(0, 0, 1), basegfx::B3DVector(-1, 1, 0), 90, false, -1.0, 0.0));
+ Slide.Operations.push_back(makeSTranslate(glm::vec3(0, 0, 0.0001), false, -1.0, 0.0));
+ Slide.Operations.push_back(makeSRotate (glm::vec3(0, 0, 1), glm::vec3(-1, 1, 0), -90, true, 0.0, 1.0));
+ Slide.Operations.push_back(makeSRotate (glm::vec3(0, 0, 1), glm::vec3(-1, 1, 0), 90, false, -1.0, 0.0));
Primitives_t aEnteringPrimitives;
aEnteringPrimitives.push_back(Slide);
@@ -531,13 +531,13 @@ boost::shared_ptr<OGLTransitionImpl> makeIris()
{
Primitive Slide;
- Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
- Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+ Slide.pushTriangle (glm::vec2 (0,0), glm::vec2 (1,0), glm::vec2 (0,1));
+ Slide.pushTriangle (glm::vec2 (1,0), glm::vec2 (0,1), glm::vec2 (1,1));
Primitives_t aEnteringPrimitives;
aEnteringPrimitives.push_back (Slide);
- Slide.Operations.push_back (makeSTranslate (basegfx::B3DVector (0, 0, 0.000001), false, -1, 0));
- Slide.Operations.push_back (makeSTranslate (basegfx::B3DVector (0, 0, -0.000002), false, 0.5, 1));
+ Slide.Operations.push_back (makeSTranslate (glm::vec3 (0, 0, 0.000001), false, -1, 0));
+ Slide.Operations.push_back (makeSTranslate (glm::vec3 (0, 0, -0.000002), false, 0.5, 1));
Primitives_t aLeavingPrimitives;
aLeavingPrimitives.push_back (Slide);
@@ -557,12 +557,12 @@ boost::shared_ptr<OGLTransitionImpl> makeIris()
cyo = (of*y + 1)/2;
lcxo = (of*lx + 1)/2;
lcyo = (of*ly + 1)/2;
- irisPart.pushTriangle (basegfx::B2DVector (lcx, lcy),
- basegfx::B2DVector (lcxo, lcyo),
- basegfx::B2DVector (cx, cy));
- irisPart.pushTriangle (basegfx::B2DVector (cx, cy),
- basegfx::B2DVector (lcxo, lcyo),
- basegfx::B2DVector (cxo, cyo));
+ irisPart.pushTriangle (glm::vec2 (lcx, lcy),
+ glm::vec2 (lcxo, lcyo),
+ glm::vec2 (cx, cy));
+ irisPart.pushTriangle (glm::vec2 (cx, cy),
+ glm::vec2 (lcxo, lcyo),
+ glm::vec2 (cxo, cyo));
lx = x;
ly = y;
t += 1.0/nSteps;
@@ -577,15 +577,15 @@ boost::shared_ptr<OGLTransitionImpl> makeIris()
rx = cos ((2*M_PI*i)/nParts);
ry = sin ((2*M_PI*i)/nParts);
- irisPart.Operations.push_back (makeSRotate (basegfx::B3DVector(0, 0, 1), basegfx::B3DVector(rx, ry, 0), angle, true, 0.0, 0.5));
- irisPart.Operations.push_back (makeSRotate (basegfx::B3DVector(0, 0, 1), basegfx::B3DVector(rx, ry, 0), -angle, true, 0.5, 1));
+ irisPart.Operations.push_back (makeSRotate (glm::vec3(0, 0, 1), glm::vec3(rx, ry, 0), angle, true, 0.0, 0.5));
+ irisPart.Operations.push_back (makeSRotate (glm::vec3(0, 0, 1), glm::vec3(rx, ry, 0), -angle, true, 0.5, 1));
if (i > 0) {
- irisPart.Operations.push_back (makeSTranslate (basegfx::B3DVector(rx, ry, 0), false, -1, 0));
- irisPart.Operations.push_back (makeSRotate (basegfx::B3DVector(0, 0, 1), basegfx::B3DVector(0, 0, 0), i*360.0/nParts, false, -1, 0));
- irisPart.Operations.push_back (makeSTranslate (basegfx::B3DVector(-1, 0, 0), false, -1, 0));
+ irisPart.Operations.push_back (makeSTranslate (glm::vec3(rx, ry, 0), false, -1, 0));
+ irisPart.Operations.push_back (makeSRotate (glm::vec3(0, 0, 1), glm::vec3(0, 0, 0), i*360.0/nParts, false, -1, 0));
+ irisPart.Operations.push_back (makeSTranslate (glm::vec3(-1, 0, 0), false, -1, 0));
}
- irisPart.Operations.push_back(makeSTranslate(basegfx::B3DVector(0, 0, 1), false, -2, 0.0));
- irisPart.Operations.push_back (makeSRotate (basegfx::B3DVector(1, .5, 0), basegfx::B3DVector(1, 0, 0), -30, false, -1, 0));
+ irisPart.Operations.push_back(makeSTranslate(glm::vec3(0, 0, 1), false, -2, 0.0));
+ irisPart.Operations.push_back (makeSRotate (glm::vec3(1, .5, 0), glm::vec3(1, 0, 0), -30, false, -1, 0));
pIris->pushPrimitive (irisPart);
}
@@ -653,42 +653,41 @@ boost::shared_ptr<OGLTransitionImpl> makeRochade()
w = 2.2;
h = 10;
- Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
- Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
+ Slide.pushTriangle(glm::vec2(0,0),glm::vec2(1,0),glm::vec2(0,1));
+ Slide.pushTriangle(glm::vec2(1,0),glm::vec2(0,1),glm::vec2(1,1));
Slide.Operations.push_back(makeSEllipseTranslate(w, h, 0.25, -0.25, true, 0, 1));
- Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0,1,0),basegfx::B3DVector(0,0,0), -45, true, 0, 1));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0,1,0),glm::vec3(0,0,0), -45, true, 0, 1));
Primitives_t aLeavingSlide;
aLeavingSlide.push_back(Slide);
Slide.Operations.clear();
Slide.Operations.push_back(makeSEllipseTranslate(w, h, 0.75, 0.25, true, 0, 1));
- Slide.Operations.push_back(makeSTranslate(basegfx::B3DVector(0, 0, -h), false, -1, 0));
- Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0,1,0),basegfx::B3DVector(0,0,0), -45, true, 0, 1));
- Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0,1,0),basegfx::B3DVector(0,0,0), 45, false, -1, 0));
+ Slide.Operations.push_back(makeSTranslate(glm::vec3(0, 0, -h), false, -1, 0));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0,1,0),glm::vec3(0,0,0), -45, true, 0, 1));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0,1,0),glm::vec3(0,0,0), 45, false, -1, 0));
Primitives_t aEnteringSlide;
aEnteringSlide.push_back(Slide);
return makeRochadeTransition(aLeavingSlide, aEnteringSlide, aSettings);
}
-// TODO(Q3): extract to basegfx
-inline basegfx::B2DVector clamp(const basegfx::B2DVector& v)
-{
- return basegfx::B2DVector(min(max(v.getX(),-1.0),1.0),
- min(max(v.getY(),-1.0),1.0));
-}
-
inline double randFromNeg1to1()
{
return ( ( static_cast<double>( rand() ) / static_cast<double>( RAND_MAX ) ) * 2.0 ) - 1.0;
}
// TODO(Q3): extract to basegfx
-inline basegfx::B3DVector randNormVectorInXYPlane()
+inline glm::vec3 randNormVectorInXYPlane()
+{
+ glm::vec3 toReturn(randFromNeg1to1(),randFromNeg1to1(),0.0);
+ return glm::normalize(toReturn);
+}
+
+template<typename T>
+T clamp(const T& rIn)
{
- basegfx::B3DVector toReturn(randFromNeg1to1(),randFromNeg1to1(),0.0);
- return toReturn/toReturn.getLength();
+ return glm::clamp(rIn, -1.0, 1.0);
}
boost::shared_ptr<OGLTransitionImpl> makeRevolvingCircles( ::sal_uInt16 nCircles , ::sal_uInt16 nPointsOnCircles )
@@ -699,21 +698,21 @@ boost::shared_ptr<OGLTransitionImpl> makeRevolvingCircles( ::sal_uInt16 nCircles
makeNByMTileFlip(1,1);
return makeSimpleTransition();
}
- double Radius(1.0/static_cast<double>( nCircles ));
- double dRadius(Radius);
- double LastRadius(0.0);
- double NextRadius(2*Radius);
+ float Radius(1.0/static_cast<double>( nCircles ));
+ float dRadius(Radius);
+ float LastRadius(0.0);
+ float NextRadius(2*Radius);
/// now we know there is at least two circles
/// the first will always be a full circle
/// the last will always be the outer shell of the slide with a circle hole
//add the full circle
- vector<basegfx::B2DVector> unScaledTexCoords;
- double TempAngle(0.0);
+ vector<glm::vec2> unScaledTexCoords;
+ float TempAngle(0.0);
for(unsigned int Point(0); Point < nPointsOnCircles; ++Point)
{
- unScaledTexCoords.push_back( basegfx::B2DVector( cos(TempAngle - 3.1415926/2.0) , sin(TempAngle- 3.1415926/2.0) ) );
+ unScaledTexCoords.push_back( glm::vec2( cos(TempAngle - 3.1415926/2.0) , sin(TempAngle- 3.1415926/2.0) ) );
TempAngle += dAngle;
}
@@ -725,16 +724,16 @@ boost::shared_ptr<OGLTransitionImpl> makeRevolvingCircles( ::sal_uInt16 nCircles
Primitive LeavingSlide;
for(int Point(0); Point + 1 < nPointsOnCircles; ++Point)
{
- EnteringSlide.pushTriangle( basegfx::B2DVector( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ Point + 1 ] / 2.0 + basegfx::B2DVector( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ Point ] / 2.0 + basegfx::B2DVector( 0.5 , 0.5 ) );
- LeavingSlide.pushTriangle( basegfx::B2DVector( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ Point + 1 ] / 2.0 + basegfx::B2DVector( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ Point ] / 2.0 + basegfx::B2DVector( 0.5, 0.5) );
+ EnteringSlide.pushTriangle( glm::vec2( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ Point + 1 ] / 2.0f + glm::vec2( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ Point ] / 2.0f + glm::vec2( 0.5 , 0.5 ) );
+ LeavingSlide.pushTriangle( glm::vec2( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ Point + 1 ] / 2.0f + glm::vec2( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ Point ] / 2.0f + glm::vec2( 0.5, 0.5) );
}
- EnteringSlide.pushTriangle( basegfx::B2DVector(0.5,0.5) , Radius * unScaledTexCoords[ 0 ] / 2.0 + basegfx::B2DVector( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ nPointsOnCircles - 1 ] / 2.0 + basegfx::B2DVector( 0.5 , 0.5 ) );
- LeavingSlide.pushTriangle( basegfx::B2DVector(0.5,0.5) , Radius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) , Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) );
+ EnteringSlide.pushTriangle( glm::vec2(0.5,0.5) , Radius * unScaledTexCoords[ 0 ] / 2.0f + glm::vec2( 0.5 , 0.5 ) , Radius * unScaledTexCoords[ nPointsOnCircles - 1 ] / 2.0f + glm::vec2( 0.5 , 0.5 ) );
+ LeavingSlide.pushTriangle( glm::vec2(0.5,0.5) , Radius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) , Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) );
- basegfx::B3DVector axis(randNormVectorInXYPlane());
- EnteringSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , 180, true, Radius/2.0 , (NextRadius + 1)/2.0 ) );
- LeavingSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , 180, true, Radius/2.0 , (NextRadius + 1)/2.0 ) );
- EnteringSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , -180, false,0.0,1.0) );
+ glm::vec3 axis(randNormVectorInXYPlane());
+ EnteringSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , 180, true, Radius/2.0 , (NextRadius + 1)/2.0 ) );
+ LeavingSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , 180, true, Radius/2.0 , (NextRadius + 1)/2.0 ) );
+ EnteringSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , -180, false,0.0,1.0) );
aEnteringSlide.push_back(EnteringSlide);
aLeavingSlide.push_back(LeavingSlide);
@@ -749,23 +748,23 @@ boost::shared_ptr<OGLTransitionImpl> makeRevolvingCircles( ::sal_uInt16 nCircles
Primitive EnteringSlide;
for(int Side(0); Side < nPointsOnCircles - 1; ++Side)
{
- EnteringSlide.pushTriangle(Radius*unScaledTexCoords[Side]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) );
- EnteringSlide.pushTriangle(Radius*unScaledTexCoords[Side]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) , Radius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) );
+ EnteringSlide.pushTriangle(Radius*unScaledTexCoords[Side]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) );
+ EnteringSlide.pushTriangle(Radius*unScaledTexCoords[Side]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) , Radius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) );
- LeavingSlide.pushTriangle(Radius*unScaledTexCoords[Side]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) );
- LeavingSlide.pushTriangle(Radius*unScaledTexCoords[Side]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) , Radius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) );
+ LeavingSlide.pushTriangle(Radius*unScaledTexCoords[Side]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) );
+ LeavingSlide.pushTriangle(Radius*unScaledTexCoords[Side]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) , Radius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) );
}
- EnteringSlide.pushTriangle(Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) );
- EnteringSlide.pushTriangle(Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) , Radius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) );
+ EnteringSlide.pushTriangle(Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) );
+ EnteringSlide.pushTriangle(Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) , Radius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) );
- LeavingSlide.pushTriangle(Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) );
- LeavingSlide.pushTriangle(Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) , Radius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) );
+ LeavingSlide.pushTriangle(Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) );
+ LeavingSlide.pushTriangle(Radius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) , Radius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) );
- basegfx::B3DVector axis(randNormVectorInXYPlane());
- EnteringSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , 180, true, Radius/2.0 , (NextRadius + 1)/2.0 ) );
- LeavingSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , 180, true, Radius/2.0 , (NextRadius + 1)/2.0 ) );
- EnteringSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , -180, false,0.0,1.0) );
+ glm::vec3 axis(randNormVectorInXYPlane());
+ EnteringSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , 180, true, Radius/2.0 , (NextRadius + 1)/2.0 ) );
+ LeavingSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , 180, true, Radius/2.0 , (NextRadius + 1)/2.0 ) );
+ EnteringSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , -180, false,0.0,1.0) );
aEnteringSlide.push_back(EnteringSlide);
aLeavingSlide.push_back(LeavingSlide);
@@ -781,23 +780,23 @@ boost::shared_ptr<OGLTransitionImpl> makeRevolvingCircles( ::sal_uInt16 nCircles
for(int Side(0); Side < nPointsOnCircles - 1; ++Side)
{
- EnteringSlide.pushTriangle(clamp(Radius*unScaledTexCoords[Side])/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) );
- EnteringSlide.pushTriangle(clamp(Radius*unScaledTexCoords[Side])/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) , clamp(Radius*unScaledTexCoords[Side + 1])/2.0 + basegfx::B2DVector(0.5,0.5) );
+ EnteringSlide.pushTriangle(clamp(Radius*unScaledTexCoords[Side])/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) );
+ EnteringSlide.pushTriangle(clamp(Radius*unScaledTexCoords[Side])/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) , clamp(Radius*unScaledTexCoords[Side + 1])/2.0f + glm::vec2(0.5,0.5) );
- LeavingSlide.pushTriangle(clamp(Radius*unScaledTexCoords[Side])/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) );
- LeavingSlide.pushTriangle(clamp(Radius*unScaledTexCoords[Side])/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0 + basegfx::B2DVector(0.5,0.5) , clamp(Radius*unScaledTexCoords[Side + 1])/2.0 + basegfx::B2DVector(0.5,0.5) );
+ LeavingSlide.pushTriangle(clamp(Radius*unScaledTexCoords[Side])/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) );
+ LeavingSlide.pushTriangle(clamp(Radius*unScaledTexCoords[Side])/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[Side + 1]/2.0f + glm::vec2(0.5,0.5) , clamp(Radius*unScaledTexCoords[Side + 1])/2.0f + glm::vec2(0.5,0.5) );
}
- EnteringSlide.pushTriangle(clamp(Radius*unScaledTexCoords[nPointsOnCircles - 1])/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) );
- EnteringSlide.pushTriangle(clamp(Radius*unScaledTexCoords[nPointsOnCircles - 1])/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) , clamp(Radius*unScaledTexCoords[0])/2.0 + basegfx::B2DVector(0.5,0.5) );
+ EnteringSlide.pushTriangle(clamp(Radius*unScaledTexCoords[nPointsOnCircles - 1])/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) );
+ EnteringSlide.pushTriangle(clamp(Radius*unScaledTexCoords[nPointsOnCircles - 1])/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) , clamp(Radius*unScaledTexCoords[0])/2.0f + glm::vec2(0.5,0.5) );
- LeavingSlide.pushTriangle(clamp(Radius*unScaledTexCoords[nPointsOnCircles - 1])/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[nPointsOnCircles - 1]/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) );
- LeavingSlide.pushTriangle(clamp(Radius*unScaledTexCoords[nPointsOnCircles - 1])/2.0 + basegfx::B2DVector(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0 + basegfx::B2DVector(0.5,0.5) , clamp(Radius*unScaledTexCoords[0])/2.0 + basegfx::B2DVector(0.5,0.5) );
+ LeavingSlide.pushTriangle(clamp(Radius*unScaledTexCoords[nPointsOnCircles - 1])/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[nPointsOnCircles - 1]/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) );
+ LeavingSlide.pushTriangle(clamp(Radius*unScaledTexCoords[nPointsOnCircles - 1])/2.0f + glm::vec2(0.5,0.5) , LastRadius*unScaledTexCoords[0]/2.0f + glm::vec2(0.5,0.5) , clamp(Radius*unScaledTexCoords[0])/2.0f + glm::vec2(0.5,0.5) );
- basegfx::B3DVector axis(randNormVectorInXYPlane());
- EnteringSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , 180, true, (LastRadius + dRadius)/2.0 , 1.0 ) );
- LeavingSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , 180, true, (LastRadius + dRadius)/2.0 , 1.0 ) );
- EnteringSlide.Operations.push_back( makeSRotate( axis , basegfx::B3DVector(0,0,0) , -180, false,0.0,1.0) );
+ glm::vec3 axis(randNormVectorInXYPlane());
+ EnteringSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , 180, true, (LastRadius + dRadius)/2.0 , 1.0 ) );
+ LeavingSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , 180, true, (LastRadius + dRadius)/2.0 , 1.0 ) );
+ EnteringSlide.Operations.push_back( makeSRotate( axis , glm::vec3(0,0,0) , -180, false,0.0,1.0) );
aEnteringSlide.push_back(EnteringSlide);
aLeavingSlide.push_back(LeavingSlide);
@@ -817,17 +816,17 @@ boost::shared_ptr<OGLTransitionImpl> makeHelix( ::sal_uInt16 nRows )
{
Primitive Tile;
- Tile.pushTriangle(basegfx::B2DVector( 1.0 , iDn ) , basegfx::B2DVector( 0.0 , iDn ) , basegfx::B2DVector( 0.0 , iPDn ));
+ Tile.pushTriangle(glm::vec2( 1.0 , iDn ) , glm::vec2( 0.0 , iDn ) , glm::vec2( 0.0 , iPDn ));
- Tile.pushTriangle(basegfx::B2DVector( 1.0 , iPDn ) , basegfx::B2DVector( 1.0 , iDn ) , basegfx::B2DVector( 0.0 , iPDn ));
+ Tile.pushTriangle(glm::vec2( 1.0 , iPDn ) , glm::vec2( 1.0 , iDn ) , glm::vec2( 0.0 , iPDn ));
- Tile.Operations.push_back( makeSRotate( basegfx::B3DVector( 0 , 1 , 0 ) , ( Tile.getVertices()[1] + Tile.getVertices()[3] )/2.0 , 180 ,
+ Tile.Operations.push_back( makeSRotate( glm::vec3( 0 , 1 , 0 ) , ( Tile.getVertices()[1] + Tile.getVertices()[3] )/2.0f , 180 ,
true,min(max(static_cast<double>(i - nRows/2.0)*invN/2.0,0.0),1.0),
min(max(static_cast<double>(i + nRows/2.0)*invN/2.0,0.0),1.0) ) );
aLeavingSlide.push_back(Tile);
- Tile.Operations.push_back( makeSRotate( basegfx::B3DVector( 0 , 1 , 0 ) , ( Tile.getVertices()[1] + Tile.getVertices()[3] )/2.0 , -180 , false,0.0,1.0) );
+ Tile.Operations.push_back( makeSRotate( glm::vec3( 0 , 1 , 0 ) , ( Tile.getVertices()[1] + Tile.getVertices()[3] )/2.0f , -180 , false,0.0,1.0) );
aEnteringSlide.push_back(Tile);
@@ -854,13 +853,13 @@ boost::shared_ptr<OGLTransitionImpl> makeNByMTileFlip( ::sal_uInt16 n, ::sal_uIn
{
Primitive Tile;
- Tile.pushTriangle(basegfx::B2DVector( iPDn , jDm ) , basegfx::B2DVector( iDn , jDm ) , basegfx::B2DVector( iDn , jPDm ));
+ Tile.pushTriangle(glm::vec2( iPDn , jDm ) , glm::vec2( iDn , jDm ) , glm::vec2( iDn , jPDm ));
- Tile.pushTriangle(basegfx::B2DVector( iPDn , jPDm ) , basegfx::B2DVector( iPDn , jDm ) , basegfx::B2DVector( iDn , jPDm ));//bottom left corner of tile
+ Tile.pushTriangle(glm::vec2( iPDn , jPDm ) , glm::vec2( iPDn , jDm ) , glm::vec2( iDn , jPDm ));//bottom left corner of tile
- Tile.Operations.push_back( makeSRotate( basegfx::B3DVector( 1 , 1 , 0 ) , ( Tile.getVertices()[1] + Tile.getVertices()[3] )/2.0 , 180 , true, iDn*jDm/2.0 , ((iPDn*jPDm)+1.0)/2.0 ) );
+ Tile.Operations.push_back( makeSRotate( glm::vec3( 1 , 1 , 0 ) , ( Tile.getVertices()[1] + Tile.getVertices()[3] )/2.0f , 180 , true, iDn*jDm/2.0 , ((iPDn*jPDm)+1.0)/2.0 ) );
aLeavingSlide.push_back(Tile);
- Tile.Operations.push_back( makeSRotate( basegfx::B3DVector( 1 , 1 , 0 ) , ( Tile.getVertices()[1] + Tile.getVertices()[3] )/2.0 , -180, false, iDn*jDm/2.0 , ((iPDn*jPDm)+1.0)/2.0 ) );
+ Tile.Operations.push_back( makeSRotate( glm::vec3( 1 , 1 , 0 ) , ( Tile.getVertices()[1] + Tile.getVertices()[3] )/2.0f , -180, false, iDn*jDm/2.0 , ((iPDn*jPDm)+1.0)/2.0 ) );
aEnteringSlide.push_back(Tile);
@@ -874,7 +873,7 @@ boost::shared_ptr<OGLTransitionImpl> makeNByMTileFlip( ::sal_uInt16 n, ::sal_uIn
return makeSimpleTransition(aLeavingSlide, aEnteringSlide);
}
-SRotate::SRotate(const basegfx::B3DVector& Axis, const basegfx::B3DVector& Origin,
+SRotate::SRotate(const glm::vec3& Axis, const glm::vec3& Origin,
double Angle, bool bInter, double T0, double T1):
Operation(bInter, T0, T1),
axis(Axis),
@@ -883,7 +882,7 @@ SRotate::SRotate(const basegfx::B3DVector& Axis, const basegfx::B3DVector& Origi
{
}
-SScale::SScale(const basegfx::B3DVector& Scale, const basegfx::B3DVector& Origin,
+SScale::SScale(const glm::vec3& Scale, const glm::vec3& Origin,
bool bInter, double T0, double T1):
Operation(bInter, T0, T1),
scale(Scale),
@@ -891,8 +890,8 @@ SScale::SScale(const basegfx::B3DVector& Scale, const basegfx::B3DVector& Origin
{
}
-RotateAndScaleDepthByWidth::RotateAndScaleDepthByWidth(const basegfx::B3DVector& Axis,
- const basegfx::B3DVector& Origin, double Angle, bool bInter, double T0, double T1):
+RotateAndScaleDepthByWidth::RotateAndScaleDepthByWidth(const glm::vec3& Axis,
+ const glm::vec3& Origin, double Angle, bool bInter, double T0, double T1):
Operation(bInter, T0, T1),
axis(Axis),
origin(Origin),
@@ -900,8 +899,8 @@ RotateAndScaleDepthByWidth::RotateAndScaleDepthByWidth(const basegfx::B3DVector&
{
}
-RotateAndScaleDepthByHeight::RotateAndScaleDepthByHeight(const basegfx::B3DVector& Axis,
- const basegfx::B3DVector& Origin, double Angle, bool bInter, double T0, double T1):
+RotateAndScaleDepthByHeight::RotateAndScaleDepthByHeight(const glm::vec3& Axis,
+ const glm::vec3& Origin, double Angle, bool bInter, double T0, double T1):
Operation(bInter, T0, T1),
axis(Axis),
origin(Origin),
@@ -910,26 +909,26 @@ RotateAndScaleDepthByHeight::RotateAndScaleDepthByHeight(const basegfx::B3DVecto
}
-STranslate::STranslate(const basegfx::B3DVector& Vector, bool bInter, double T0, double T1):
+STranslate::STranslate(const glm::vec3& Vector, bool bInter, double T0, double T1):
Operation(bInter, T0, T1),
vector(Vector)
{
}
boost::shared_ptr<SRotate>
-makeSRotate(const basegfx::B3DVector& Axis,const basegfx::B3DVector& Origin,double Angle,bool bInter, double T0, double T1)
+makeSRotate(const glm::vec3& Axis,const glm::vec3& Origin,double Angle,bool bInter, double T0, double T1)
{
return make_shared<SRotate>(Axis, Origin, Angle, bInter, T0, T1);
}
boost::shared_ptr<SScale>
-makeSScale(const basegfx::B3DVector& Scale, const basegfx::B3DVector& Origin,bool bInter, double T0, double T1)
+makeSScale(const glm::vec3& Scale, const glm::vec3& Origin,bool bInter, double T0, double T1)
{
return make_shared<SScale>(Scale, Origin, bInter, T0, T1);
}
boost::shared_ptr<STranslate>
-makeSTranslate(const basegfx::B3DVector& Vector,bool bInter, double T0, double T1)
+makeSTranslate(const glm::vec3& Vector,bool bInter, double T0, double T1)
{
return make_shared<STranslate>(Vector, bInter, T0, T1);
}
@@ -941,13 +940,13 @@ makeSEllipseTranslate(double dWidth, double dHeight, double dStartPosition, doub
}
boost::shared_ptr<RotateAndScaleDepthByWidth>
-makeRotateAndScaleDepthByWidth(const basegfx::B3DVector& Axis,const basegfx::B3DVector& Origin,double Angle,bool bInter, double T0, double T1)
+makeRotateAndScaleDepthByWidth(const glm::vec3& Axis,const glm::vec3& Origin,double Angle,bool bInter, double T0, double T1)
{
return make_shared<RotateAndScaleDepthByWidth>(Axis, Origin, Angle, bInter, T0, T1);
}
boost::shared_ptr<RotateAndScaleDepthByHeight>
-makeRotateAndScaleDepthByHeight(const basegfx::B3DVector& Axis,const basegfx::B3DVector& Origin,double Angle,bool bInter, double T0, double T1)
+makeRotateAndScaleDepthByHeight(const glm::vec3& Axis,const glm::vec3& Origin,double Angle,bool bInter, double T0, double T1)
{
return make_shared<RotateAndScaleDepthByHeight>(Axis, Origin, Angle, bInter, T0, T1);
}
@@ -965,7 +964,7 @@ void STranslate::interpolate(double t,double SlideWidthScale,double SlideHeightS
if(!mbInterpolate || t > mnT1)
t = mnT1;
t = intervalInter(t,mnT0,mnT1);
- glTranslated(SlideWidthScale*t*vector.getX(),SlideHeightScale*t*vector.getY(),t*vector.getZ());
+ glTranslated(SlideWidthScale*t*vector.x,SlideHeightScale*t*vector.y,t*vector.z);
CHECK_GL_ERROR();
}
@@ -977,11 +976,11 @@ void SRotate::interpolate(double t,double SlideWidthScale,double SlideHeightScal
if(!mbInterpolate || t > mnT1)
t = mnT1;
t = intervalInter(t,mnT0,mnT1);
- glTranslated(SlideWidthScale*origin.getX(),SlideHeightScale*origin.getY(),origin.getZ());
+ glTranslated(SlideWidthScale*origin.x,SlideHeightScale*origin.y,origin.z);
glScaled(SlideWidthScale,SlideHeightScale,1);
- glRotated(t*angle,axis.getX(),axis.getY(),axis.getZ());
+ glRotated(t*angle,axis.x,axis.y,axis.z);
glScaled(1/SlideWidthScale,1/SlideHeightScale,1);
- glTranslated(-SlideWidthScale*origin.getX(),-SlideHeightScale*origin.getY(),-origin.getZ());
+ glTranslated(-SlideWidthScale*origin.x,-SlideHeightScale*origin.y,-origin.z);
CHECK_GL_ERROR();
}
@@ -993,9 +992,9 @@ void SScale::interpolate(double t,double SlideWidthScale,double SlideHeightScale
if(!mbInterpolate || t > mnT1)
t = mnT1;
t = intervalInter(t,mnT0,mnT1);
- glTranslated(SlideWidthScale*origin.getX(),SlideHeightScale*origin.getY(),origin.getZ());
- glScaled((1-t) + t*scale.getX(),(1-t) + t*scale.getY(),(1-t) + t*scale.getZ());
- glTranslated(-SlideWidthScale*origin.getX(),-SlideHeightScale*origin.getY(),-origin.getZ());
+ glTranslated(SlideWidthScale*origin.x,SlideHeightScale*origin.y,origin.z);
+ glScaled((1-t) + t*scale.x,(1-t) + t*scale.y,(1-t) + t*scale.z);
+ glTranslated(-SlideWidthScale*origin.x,-SlideHeightScale*origin.y,-origin.z);
CHECK_GL_ERROR();
}
@@ -1007,9 +1006,9 @@ void RotateAndScaleDepthByWidth::interpolate(double t,double SlideWidthScale,dou
if(!mbInterpolate || t > mnT1)
t = mnT1;
t = intervalInter(t,mnT0,mnT1);
- glTranslated(SlideWidthScale*origin.getX(),SlideHeightScale*origin.getY(),SlideWidthScale*origin.getZ());
- glRotated(t*angle,axis.getX(),axis.getY(),axis.getZ());
- glTranslated(-SlideWidthScale*origin.getX(),-SlideHeightScale*origin.getY(),-SlideWidthScale*origin.getZ());
+ glTranslated(SlideWidthScale*origin.x,SlideHeightScale*origin.y,SlideWidthScale*origin.z);
+ glRotated(t*angle,axis.x,axis.y,axis.z);
+ glTranslated(-SlideWidthScale*origin.x,-SlideHeightScale*origin.y,-SlideWidthScale*origin.z);
CHECK_GL_ERROR();
}
@@ -1021,9 +1020,9 @@ void RotateAndScaleDepthByHeight::interpolate(double t,double SlideWidthScale,do
if(!mbInterpolate || t > mnT1)
t = mnT1;
t = intervalInter(t,mnT0,mnT1);
- glTranslated(SlideWidthScale*origin.getX(),SlideHeightScale*origin.getY(),SlideHeightScale*origin.getZ());
- glRotated(t*angle,axis.getX(),axis.getY(),axis.getZ());
- glTranslated(-SlideWidthScale*origin.getX(),-SlideHeightScale*origin.getY(),-SlideHeightScale*origin.getZ());
+ glTranslated(SlideWidthScale*origin.x,SlideHeightScale*origin.y,SlideHeightScale*origin.z);
+ glRotated(t*angle,axis.x,axis.y,axis.z);
+ glTranslated(-SlideWidthScale*origin.x,-SlideHeightScale*origin.y,-SlideHeightScale*origin.z);
CHECK_GL_ERROR();
}
@@ -1079,20 +1078,20 @@ void Primitive::swap(Primitive& rOther)
swap(TexCoords, rOther.TexCoords);
}
-void Primitive::pushTriangle(const basegfx::B2DVector& SlideLocation0,const basegfx::B2DVector& SlideLocation1,const basegfx::B2DVector& SlideLocation2)
+void Primitive::pushTriangle(const glm::vec2& SlideLocation0,const glm::vec2& SlideLocation1,const glm::vec2& SlideLocation2)
{
- vector<basegfx::B3DVector> Verts;
- vector<basegfx::B2DVector> Texs;
+ vector<glm::vec3> Verts;
+ vector<glm::vec2> Texs;
Verts.reserve(3);
Texs.reserve(3);
- Verts.push_back(basegfx::B3DVector( 2*SlideLocation0.getX() - 1, -2*SlideLocation0.getY() + 1 , 0.0 ));
- Verts.push_back(basegfx::B3DVector( 2*SlideLocation1.getX() - 1, -2*SlideLocation1.getY() + 1 , 0.0 ));
- Verts.push_back(basegfx::B3DVector( 2*SlideLocation2.getX() - 1, -2*SlideLocation2.getY() + 1 , 0.0 ));
+ Verts.push_back(glm::vec3( 2*SlideLocation0.x - 1, -2*SlideLocation0.y + 1 , 0.0 ));
+ Verts.push_back(glm::vec3( 2*SlideLocation1.x - 1, -2*SlideLocation1.y + 1 , 0.0 ));
+ Verts.push_back(glm::vec3( 2*SlideLocation2.x - 1, -2*SlideLocation2.y + 1 , 0.0 ));
//figure out if they're facing the correct way, and make them face the correct way.
- basegfx::B3DVector Normal( basegfx::cross( Verts[0] - Verts[1] , Verts[1] - Verts[2] ) );
- if(Normal.getZ() >= 0.0)//if the normal is facing us
+ glm::vec3 Normal( glm::cross( Verts[0] - Verts[1] , Verts[1] - Verts[2] ) );
+ if(Normal.z >= 0.0)//if the normal is facing us
{
Texs.push_back(SlideLocation0);
Texs.push_back(SlideLocation1);
@@ -1104,9 +1103,9 @@ void Primitive::pushTriangle(const basegfx::B2DVector& SlideLocation0,const base
Texs.push_back(SlideLocation2);
Texs.push_back(SlideLocation1);
Verts.clear();
- Verts.push_back(basegfx::B3DVector( 2*SlideLocation0.getX() - 1, -2*SlideLocation0.getY() + 1 , 0.0 ));
- Verts.push_back(basegfx::B3DVector( 2*SlideLocation2.getX() - 1, -2*SlideLocation2.getY() + 1 , 0.0 ));
- Verts.push_back(basegfx::B3DVector( 2*SlideLocation1.getX() - 1, -2*SlideLocation1.getY() + 1 , 0.0 ));
+ Verts.push_back(glm::vec3( 2*SlideLocation0.x - 1, -2*SlideLocation0.y + 1 , 0.0 ));
+ Verts.push_back(glm::vec3( 2*SlideLocation2.x - 1, -2*SlideLocation2.y + 1 , 0.0 ));
+ Verts.push_back(glm::vec3( 2*SlideLocation1.x - 1, -2*SlideLocation1.y + 1 , 0.0 ));
}
Vertices.push_back(Verts[0]);
@@ -1117,9 +1116,9 @@ void Primitive::pushTriangle(const basegfx::B2DVector& SlideLocation0,const base
TexCoords.push_back(Texs[1]);
TexCoords.push_back(Texs[2]);
- Normals.push_back(basegfx::B3DVector(0,0,1));//all normals always face the screen when untransformed.
- Normals.push_back(basegfx::B3DVector(0,0,1));//all normals always face the screen when untransformed.
- Normals.push_back(basegfx::B3DVector(0,0,1));//all normals always face the screen when untransformed.
+ Normals.push_back(glm::vec3(0,0,1));//all normals always face the screen when untransformed.
+ Normals.push_back(glm::vec3(0,0,1));//all normals always face the screen when untransformed.
+ Normals.push_back(glm::vec3(0,0,1));//all normals always face the screen when untransformed.
}
namespace
@@ -1141,32 +1140,32 @@ void DiamondTransition::prepare_( double nTime, double /* SlideWidth */, double
{
Primitive Slide1, Slide2;
- Slide1.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
- Slide1.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+ Slide1.pushTriangle (glm::vec2 (0,0), glm::vec2 (1,0), glm::vec2 (0,1));
+ Slide1.pushTriangle (glm::vec2 (1,0), glm::vec2 (0,1), glm::vec2 (1,1));
Primitives_t aEnteringSlidePrimitives;
aEnteringSlidePrimitives.push_back (Slide1);
if( nTime >= 0.5 ) {
double m = 1 - nTime;
- Slide2.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (m,0), basegfx::B2DVector (0,m));
- Slide2.pushTriangle (basegfx::B2DVector (nTime,0), basegfx::B2DVector (1,0), basegfx::B2DVector (1,m));
- Slide2.pushTriangle (basegfx::B2DVector (1,nTime), basegfx::B2DVector (1,1), basegfx::B2DVector (nTime,1));
- Slide2.pushTriangle (basegfx::B2DVector (0,nTime), basegfx::B2DVector (m,1), basegfx::B2DVector (0,1));
+ Slide2.pushTriangle (glm::vec2 (0,0), glm::vec2 (m,0), glm::vec2 (0,m));
+ Slide2.pushTriangle (glm::vec2 (nTime,0), glm::vec2 (1,0), glm::vec2 (1,m));
+ Slide2.pushTriangle (glm::vec2 (1,nTime), glm::vec2 (1,1), glm::vec2 (nTime,1));
+ Slide2.pushTriangle (glm::vec2 (0,nTime), glm::vec2 (m,1), glm::vec2 (0,1));
} else {
double l = 0.5 - nTime;
double h = 0.5 + nTime;
- Slide2.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0.5,l));
- Slide2.pushTriangle (basegfx::B2DVector (0.5,l), basegfx::B2DVector (1,0), basegfx::B2DVector (h,0.5));
- Slide2.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (1,1), basegfx::B2DVector (h,0.5));
- Slide2.pushTriangle (basegfx::B2DVector (h,0.5), basegfx::B2DVector (1,1), basegfx::B2DVector (0.5,h));
- Slide2.pushTriangle (basegfx::B2DVector (0.5,h), basegfx::B2DVector (1,1), basegfx::B2DVector (0,1));
- Slide2.pushTriangle (basegfx::B2DVector (l,0.5), basegfx::B2DVector (0.5,h), basegfx::B2DVector (0,1));
- Slide2.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (l,0.5), basegfx::B2DVector (0,1));
- Slide2.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (0.5,l), basegfx::B2DVector (l,0.5));
+ Slide2.pushTriangle (glm::vec2 (0,0), glm::vec2 (1,0), glm::vec2 (0.5,l));
+ Slide2.pushTriangle (glm::vec2 (0.5,l), glm::vec2 (1,0), glm::vec2 (h,0.5));
+ Slide2.pushTriangle (glm::vec2 (1,0), glm::vec2 (1,1), glm::vec2 (h,0.5));
+ Slide2.pushTriangle (glm::vec2 (h,0.5), glm::vec2 (1,1), glm::vec2 (0.5,h));
+ Slide2.pushTriangle (glm::vec2 (0.5,h), glm::vec2 (1,1), glm::vec2 (0,1));
+ Slide2.pushTriangle (glm::vec2 (l,0.5), glm::vec2 (0.5,h), glm::vec2 (0,1));
+ Slide2.pushTriangle (glm::vec2 (0,0), glm::vec2 (l,0.5), glm::vec2 (0,1));
+ Slide2.pushTriangle (glm::vec2 (0,0), glm::vec2 (0.5,l), glm::vec2 (l,0.5));
}
- Slide2.Operations.push_back (makeSTranslate (basegfx::B3DVector (0, 0, 0.00000001), false, -1, 0));
+ Slide2.Operations.push_back (makeSTranslate (glm::vec3 (0, 0, 0.00000001), false, -1, 0));
Primitives_t aLeavingSlidePrimitives;
aLeavingSlidePrimitives.push_back (Slide2);
@@ -1201,22 +1200,22 @@ boost::shared_ptr<OGLTransitionImpl> makeVenetianBlinds( bool vertical, int part
Primitive Slide;
n = (i + 1)/(double)parts;
if( vertical ) {
- Slide.pushTriangle (basegfx::B2DVector (ln,0), basegfx::B2DVector (n,0), basegfx::B2DVector (ln,1));
- Slide.pushTriangle (basegfx::B2DVector (n,0), basegfx::B2DVector (ln,1), basegfx::B2DVector (n,1));
- Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(basegfx::B3DVector(0, 1, 0), basegfx::B3DVector(n + ln - 1, 0, -t30*p), -120, true, 0.0, 1.0));
+ Slide.pushTriangle (glm::vec2 (ln,0), glm::vec2 (n,0), glm::vec2 (ln,1));
+ Slide.pushTriangle (glm::vec2 (n,0), glm::vec2 (ln,1), glm::vec2 (n,1));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByWidth(glm::vec3(0, 1, 0), glm::vec3(n + ln - 1, 0, -t30*p), -120, true, 0.0, 1.0));
} else {
- Slide.pushTriangle (basegfx::B2DVector (0,ln), basegfx::B2DVector (1,ln), basegfx::B2DVector (0,n));
- Slide.pushTriangle (basegfx::B2DVector (1,ln), basegfx::B2DVector (0,n), basegfx::B2DVector (1,n));
- Slide.Operations.push_back(makeRotateAndScaleDepthByHeight(basegfx::B3DVector(1, 0, 0), basegfx::B3DVector(0, 1 - n - ln, -t30*p), -120, true, 0.0, 1.0));
+ Slide.pushTriangle (glm::vec2 (0,ln), glm::vec2 (1,ln), glm::vec2 (0,n));
+ Slide.pushTriangle (glm::vec2 (1,ln), glm::vec2 (0,n), glm::vec2 (1,n));
+ Slide.Operations.push_back(makeRotateAndScaleDepthByHeight(glm::vec3(1, 0, 0), glm::vec3(0, 1 - n - ln, -t30*p), -120, true, 0.0, 1.0));
}
aLeavingSlide.push_back (Slide);
if( vertical ) {
- Slide.Operations.push_back(makeSRotate(basegfx::B3DVector(0, 1, 0), basegfx::B3DVector(2*n - 1, 0, 0), -60, false, -1, 0));
- Slide.Operations.push_back(makeSRotate(basegfx::B3DVector(0, 1, 0), basegfx::B3DVector(n + ln - 1, 0, 0), 180, false, -1, 0));
+ Slide.Operations.push_back(makeSRotate(glm::vec3(0, 1, 0), glm::vec3(2*n - 1, 0, 0), -60, false, -1, 0));
+ Slide.Operations.push_back(makeSRotate(glm::vec3(0, 1, 0), glm::vec3(n + ln - 1, 0, 0), 180, false, -1, 0));
} else {
- Slide.Operations.push_back(makeSRotate(basegfx::B3DVector(1, 0, 0), basegfx::B3DVector(0, 1 - 2*n, 0), -60, false, -1, 0));
- Slide.Operations.push_back(makeSRotate(basegfx::B3DVector(1, 0, 0), basegfx::B3DVector(0, 1 - n - ln, 0), 180, false, -1, 0));
+ Slide.Operations.push_back(makeSRotate(glm::vec3(1, 0, 0), glm::vec3(0, 1 - 2*n, 0), -60, false, -1, 0));
+ Slide.Operations.push_back(makeSRotate(glm::vec3(1, 0, 0), glm::vec3(0, 1 - n - ln, 0), 180, false, -1, 0));
}
aEnteringSlide.push_back (Slide);
ln = n;
@@ -1293,8 +1292,8 @@ boost::shared_ptr<OGLTransitionImpl> makeFadeSmoothly()
{
Primitive Slide;
- Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
- Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+ Slide.pushTriangle (glm::vec2 (0,0), glm::vec2 (1,0), glm::vec2 (0,1));
+ Slide.pushTriangle (glm::vec2 (1,0), glm::vec2 (0,1), glm::vec2 (1,1));
Primitives_t aLeavingSlide;
aLeavingSlide.push_back (Slide);
Primitives_t aEnteringSlide;
@@ -1364,8 +1363,8 @@ boost::shared_ptr<OGLTransitionImpl> makeFadeThroughBlack()
{
Primitive Slide;
- Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
- Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+ Slide.pushTriangle (glm::vec2 (0,0), glm::vec2 (1,0), glm::vec2 (0,1));
+ Slide.pushTriangle (glm::vec2 (1,0), glm::vec2 (0,1), glm::vec2 (1,1));
Primitives_t aLeavingSlide;
aLeavingSlide.push_back (Slide);
Primitives_t aEnteringSlide;
@@ -1576,8 +1575,8 @@ boost::shared_ptr<OGLTransitionImpl> makeStatic()
{
Primitive Slide;
- Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
- Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+ Slide.pushTriangle (glm::vec2 (0,0), glm::vec2 (1,0), glm::vec2 (0,1));
+ Slide.pushTriangle (glm::vec2 (1,0), glm::vec2 (0,1), glm::vec2 (1,1));
Primitives_t aLeavingSlide;
aLeavingSlide.push_back (Slide);
Primitives_t aEnteringSlide;
@@ -1627,8 +1626,8 @@ boost::shared_ptr<OGLTransitionImpl> makeDissolve()
{
Primitive Slide;
- Slide.pushTriangle (basegfx::B2DVector (0,0), basegfx::B2DVector (1,0), basegfx::B2DVector (0,1));
- Slide.pushTriangle (basegfx::B2DVector (1,0), basegfx::B2DVector (0,1), basegfx::B2DVector (1,1));
+ Slide.pushTriangle (glm::vec2 (0,0), glm::vec2 (1,0), glm::vec2 (0,1));
+ Slide.pushTriangle (glm::vec2 (1,0), glm::vec2 (0,1), glm::vec2 (1,1));
Primitives_t aLeavingSlide;
aLeavingSlide.push_back (Slide);
Primitives_t aEnteringSlide;
@@ -1645,25 +1644,25 @@ boost::shared_ptr<OGLTransitionImpl> makeNewsflash()
{
Primitive Slide;
- Slide.pushTriangle(basegfx::B2DVector(0,0),basegfx::B2DVector(1,0),basegfx::B2DVector(0,1));
- Slide.pushTriangle(basegfx::B2DVector(1,0),basegfx::B2DVector(0,1),basegfx::B2DVector(1,1));
- Slide.Operations.push_back(makeSRotate(basegfx::B3DVector(0,0,1),basegfx::B3DVector(0,0,0),3000,true,0,0.5));
- Slide.Operations.push_back(makeSScale(basegfx::B3DVector(0.01,0.01,0.01),basegfx::B3DVector(0,0,0),true,0,0.5));
- Slide.Operations.push_back(makeSTranslate(basegfx::B3DVector(-10000, 0, 0),false, 0.5, 2));
+ Slide.pushTriangle(glm::vec2(0,0),glm::vec2(1,0),glm::vec2(0,1));
+ Slide.pushTriangle(glm::vec2(1,0),glm::vec2(0,1),glm::vec2(1,1));
+ Slide.Operations.push_back(makeSRotate(glm::vec3(0,0,1),glm::vec3(0,0,0),3000,true,0,0.5));
+ Slide.Operations.push_back(makeSScale(glm::vec3(0.01,0.01,0.01),glm::vec3(0,0,0),true,0,0.5));
+ Slide.Operations.push_back(makeSTranslate(glm::vec3(-10000, 0, 0),false, 0.5, 2));
Primitives_t aLeavingSlide;
aLeavingSlide.push_back(Slide);
Slide.Operations.clear();
- Slide.Operations.push_back(makeSRotate(basegfx::B3DVector(0,0,1),basegfx::B3DVector(0,0,0),-3000,true,0.5,1));
- Slide.Operations.push_back(makeSTranslate(basegfx::B3DVector(-100, 0, 0),false, -1, 1));
- Slide.Operations.push_back(makeSTranslate(basegfx::B3DVector(100, 0, 0),false, 0.5, 1));
- Slide.Operations.push_back(makeSScale(basegfx::B3DVector(0.01,0.01,0.01),basegfx::B3DVector(0,0,0),false,-1,1));
- Slide.Operations.push_back(makeSScale(basegfx::B3DVector(100,100,100),basegfx::B3DVector(0,0,0),true,0.5,1));
+ Slide.Operations.push_back(makeSRotate(glm::vec3(0,0,1),glm::vec3(0,0,0),-3000,true,0.5,1));
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list