28#ifndef INCLUDED_OGLTRANS_TRANSITIONIMPL_HXX_
29#define INCLUDED_OGLTRANS_TRANSITIONIMPL_HXX_
31#include <config_lgpl.h>
33#include <glm/gtc/type_ptr.hpp>
140 bool prepare( sal_Int32 glLeavingSlideTex, sal_Int32 glEnteringSlideTex,
OpenGLContext *pContext );
143 void display(
double nTime, sal_Int32 glLeavingSlideTex, sal_Int32 glEnteringSlideTex,
double SlideWidth,
double SlideHeight,
double DispWidth,
double DispHeight,
OpenGLContext *pContext );
164 void displaySlide(
double nTime, sal_Int32 glSlideTex,
const Primitives_t& primitives,
double SlideWidthScale,
double SlideHeightScale );
166 void displayScene(
double nTime,
double SlideWidth,
double SlideHeight,
double DispWidth,
double DispHeight);
174 virtual void prepare(
double SlideWidth,
double SlideHeight );
199 virtual void displaySlides_(
double nTime, sal_Int32 glLeavingSlideTex, sal_Int32 glEnteringSlideTex,
double SlideWidthScale,
double SlideHeightScale,
OpenGLContext *pContext );
249std::shared_ptr<OGLTransitionImpl>
makeNByMTileFlip( sal_uInt16 n, sal_uInt16 m );
250std::shared_ptr<OGLTransitionImpl>
makeRevolvingCircles( sal_uInt16 nCircles , sal_uInt16 nPointsOnCircles );
251std::shared_ptr<OGLTransitionImpl>
makeHelix( sal_uInt16 nRows );
255std::shared_ptr<OGLTransitionImpl>
makeIris();
258std::shared_ptr<OGLTransitionImpl>
makeStatic();
260std::shared_ptr<OGLTransitionImpl>
makeVortex();
261std::shared_ptr<OGLTransitionImpl>
makeRipple();
282 virtual void display(GLint sceneTransformLocation, GLint primitiveTransformLocation,
double nTime,
double SlideWidth,
double SlideHeight,
double DispWidth,
double DispHeight )
const;
300static_assert(
sizeof(
Vertex) == (3 + 3 + 2) * 4,
"Vertex struct has wrong size/alignment");
314 void applyOperations(glm::mat4& matrix,
double nTime,
double SlideWidthScale,
double SlideHeightScale)
const;
315 void display(GLint primitiveTransformLocation,
double nTime,
double WidthScale,
double HeightScale)
const;
316 void display(GLint primitiveTransformLocation,
double nTime,
double WidthScale,
double HeightScale,
int first)
const;
330 void pushTriangle(
const glm::vec2& SlideLocation0,
const glm::vec2& SlideLocation1,
const glm::vec2& SlideLocation2);
382 : maLeavingSlidePrimitives(
std::move(rLeavingSlidePrimitives))
383 , maEnteringSlidePrimitives(
std::move(rEnteringSlidePrimitives))
384 , maOverallOperations(
std::move(rOverallOperations))
385 , maSceneObjects(
std::move(rSceneObjects))
std::shared_ptr< OGLTransitionImpl > makeFadeThroughColor(bool white=false)
std::shared_ptr< OGLTransitionImpl > makeTurnAround()
std::shared_ptr< OGLTransitionImpl > makeHoneycomb()
std::shared_ptr< OGLTransitionImpl > makeRipple()
std::shared_ptr< OGLTransitionImpl > makeVenetianBlinds(bool vertical, int parts)
std::vector< Primitive > Primitives_t
std::shared_ptr< OGLTransitionImpl > makeGlitter()
std::shared_ptr< OGLTransitionImpl > makeDiamond()
2D replacements
std::shared_ptr< OGLTransitionImpl > makeDissolve()
std::shared_ptr< OGLTransitionImpl > makeRochade()
std::shared_ptr< OGLTransitionImpl > makeRevolvingCircles(sal_uInt16 nCircles, sal_uInt16 nPointsOnCircles)
std::shared_ptr< OGLTransitionImpl > makeNByMTileFlip(sal_uInt16 n, sal_uInt16 m)
std::shared_ptr< OGLTransitionImpl > makeFallLeaving()
std::shared_ptr< OGLTransitionImpl > makeFadeSmoothly()
std::shared_ptr< OGLTransitionImpl > makeIris()
std::vector< std::shared_ptr< Operation > > Operations_t
std::shared_ptr< OGLTransitionImpl > makeNewsflash()
std::shared_ptr< OGLTransitionImpl > makeStatic()
std::shared_ptr< OGLTransitionImpl > makeOutsideCubeFaceToLeft()
std::shared_ptr< OGLTransitionImpl > makeTurnDown()
std::vector< std::shared_ptr< SceneObject > > SceneObjects_t
std::shared_ptr< OGLTransitionImpl > makeVortex()
std::shared_ptr< OGLTransitionImpl > makeHelix(sal_uInt16 nRows)
std::shared_ptr< OGLTransitionImpl > makeInsideCubeFaceToLeft()
OpenGL 3D Transition class.
std::vector< int > m_nFirstIndices
void displaySlide(double nTime, sal_Int32 glSlideTex, const Primitives_t &primitives, double SlideWidthScale, double SlideHeightScale)
void uploadModelViewProjectionMatrices()
Calculates the projection and model/view matrices, and upload them.
TransitionSettings const & getSettings() const
GLint m_nSceneTransformLocation
GLint m_nOperationsTransformLocation
GLint m_nTimeLocation
Location of the "time" uniform.
OGLTransitionImpl & operator=(const OGLTransitionImpl &)=delete
void finish()
Clean up after transition.
const TransitionScene maScene
virtual void displaySlides_(double nTime, sal_Int32 glLeavingSlideTex, sal_Int32 glEnteringSlideTex, double SlideWidthScale, double SlideHeightScale, OpenGLContext *pContext)
This function is called in display method to display the slides.
void display(double nTime, sal_Int32 glLeavingSlideTex, sal_Int32 glEnteringSlideTex, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight, OpenGLContext *pContext)
Display a step of the transition.
GLuint m_nVertexBufferObject
VBO in which to put primitive data.
GLuint m_nProgramObject
GLSL program object.
virtual void prepareTransition(sal_Int32 glLeavingSlideTex, sal_Int32 glEnteringSlideTex, OpenGLContext *pContext)
This function is called after glx context is ready to let the transition prepare GL related things,...
virtual void finishTransition()
This function is called when the transition needs to clear after itself, like delete own textures etc...
void displayScene(double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight)
OGLTransitionImpl(const OGLTransitionImpl &)=delete
virtual void cleanup()
This function is called in display method to prepare the slides, scene, etc.
GLint m_nPrimitiveTransformLocation
Uniform locations for transform matrices.
void displayUnbufferedSlide(double nTime, sal_Int32 glSlideTex, const Primitives_t &primitives, double SlideWidthScale, double SlideHeightScale)
bool prepare(sal_Int32 glLeavingSlideTex, sal_Int32 glEnteringSlideTex, OpenGLContext *pContext)
Prepare transition.
virtual ~OGLTransitionImpl()
TransitionScene const & getScene() const
GLuint m_nVertexArrayObject
GLint m_nPositionLocation
Per-vertex attribute locations.
void applyOverallOperations(double nTime, double SlideWidthScale, double SlideHeightScale)
virtual GLuint makeShader() const =0
This function is called in prepare method to create the GL program.
OGLTransitionImpl(const TransitionScene &rScene, const TransitionSettings &rSettings)
const TransitionSettings maSettings
GLint m_nTexCoordLocation
This class is to be derived to make any operation (transform) you may need in order to construct your...
This class is a list of Triangles that will share Operations, and could possibly share.
void applyOperations(glm::mat4 &matrix, double nTime, double SlideWidthScale, double SlideHeightScale) const
int writeVertices(Vertex *location) const
copies all vertices to the C array passed
Operations_t Operations
list of Operations to be performed on this primitive.These operations will be called in the order the...
void swap(Primitive &rOther)
std::vector< Vertex > Vertices
list of vertices
const glm::vec3 & getVertex(int n) const
guards against directly changing the vertices
void display(GLint primitiveTransformLocation, double nTime, double WidthScale, double HeightScale) const
int getVerticesByteSize() const
accessor for the size of the vertices data
void pushTriangle(const glm::vec2 &SlideLocation0, const glm::vec2 &SlideLocation1, const glm::vec2 &SlideLocation2)
PushBack a vertex,normal, and tex coord.
Primitive & operator=(const Primitive &rvalue)
int getVerticesCount() const
void pushPrimitive(const Primitive &p)
Primitives_t maPrimitives
All the surrounding scene primitives.
virtual void prepare(GLuint)
std::vector< int > maFirstIndices
SceneObject & operator=(const SceneObject &)=delete
SceneObject(const SceneObject &)=delete
virtual void display(GLint sceneTransformLocation, GLint primitiveTransformLocation, double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight) const
const SceneObjects_t & getSceneObjects() const
void swap(TransitionScene &rOther)
Primitives_t maLeavingSlidePrimitives
All the primitives that use the leaving slide texture.
TransitionScene(Primitives_t &&rLeavingSlidePrimitives, Primitives_t &&rEnteringSlidePrimitives, Operations_t &&rOverallOperations=Operations_t(), SceneObjects_t &&rSceneObjects=SceneObjects_t())
SceneObjects_t maSceneObjects
All the surrounding scene objects.
const Operations_t & getOperations() const
const Primitives_t & getEnteringSlide() const
const Primitives_t & getLeavingSlide() const
Operations_t maOverallOperations
All the operations that should be applied to both leaving and entering slide primitives.
Primitives_t maEnteringSlidePrimitives
All the primitives that use the leaving slide texture.
TransitionScene & operator=(const TransitionScene &rOther)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
const wchar_t *typedef int(__stdcall *DllNativeUnregProc)(int
bool mbUseMipMapLeaving
Whether to use mipmapping for slides textures.
float mnRequiredGLVersion
which GL version does the transition require