LibreOffice Module slideshow (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
OGLTransitionImpl Class Referenceabstract

OpenGL 3D Transition class. More...

#include <TransitionImpl.hxx>

Collaboration diagram for OGLTransitionImpl:
[legend]

Public Member Functions

virtual ~OGLTransitionImpl ()
 
 OGLTransitionImpl (const OGLTransitionImpl &)=delete
 
OGLTransitionImploperator= (const OGLTransitionImpl &)=delete
 
bool prepare (sal_Int32 glLeavingSlideTex, sal_Int32 glEnteringSlideTex, OpenGLContext *pContext)
 Prepare transition. More...
 
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. More...
 
void finish ()
 Clean up after transition. More...
 
TransitionSettings const & getSettings () const
 

Protected Member Functions

 OGLTransitionImpl (const TransitionScene &rScene, const TransitionSettings &rSettings)
 
TransitionScene const & getScene () const
 
void displaySlide (double nTime, sal_Int32 glSlideTex, const Primitives_t &primitives, double SlideWidthScale, double SlideHeightScale)
 
void displayUnbufferedSlide (double nTime, sal_Int32 glSlideTex, const Primitives_t &primitives, double SlideWidthScale, double SlideHeightScale)
 
void displayScene (double nTime, double SlideWidth, double SlideHeight, double DispWidth, double DispHeight)
 
void applyOverallOperations (double nTime, double SlideWidthScale, double SlideHeightScale)
 

Protected Attributes

GLuint m_nProgramObject = 0u
 GLSL program object. More...
 
GLuint m_nVertexBufferObject = 0u
 VBO in which to put primitive data. More...
 
GLint m_nTimeLocation = -1
 Location of the "time" uniform. More...
 

Private Member Functions

virtual void prepare (double SlideWidth, double SlideHeight)
 This function is called in display method to prepare the slides, scene, etc. More...
 
virtual void cleanup ()
 This function is called in display method to prepare the slides, scene, etc. More...
 
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, like GLSL program. More...
 
virtual void finishTransition ()
 This function is called when the transition needs to clear after itself, like delete own textures etc. More...
 
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. More...
 
virtual GLuint makeShader () const =0
 This function is called in prepare method to create the GL program. More...
 
void uploadModelViewProjectionMatrices ()
 Calculates the projection and model/view matrices, and upload them. More...
 

Private Attributes

const TransitionScene maScene
 
const TransitionSettings maSettings
 
GLint m_nPrimitiveTransformLocation = -1
 Uniform locations for transform matrices. More...
 
GLint m_nSceneTransformLocation = -1
 
GLint m_nOperationsTransformLocation = -1
 
GLint m_nPositionLocation = -1
 Per-vertex attribute locations. More...
 
GLint m_nNormalLocation = -1
 
GLint m_nTexCoordLocation = -1
 
GLuint m_nVertexArrayObject = 0u
 
std::vector< intm_nFirstIndices
 

Detailed Description

OpenGL 3D Transition class.

It implicitly is constructed from XOGLTransition

It holds Primitives and Operations on those primitives.

Definition at line 130 of file TransitionImpl.hxx.

Constructor & Destructor Documentation

◆ ~OGLTransitionImpl()

OGLTransitionImpl::~OGLTransitionImpl ( )
virtual

Definition at line 69 of file TransitionImpl.cxx.

◆ OGLTransitionImpl() [1/2]

OGLTransitionImpl::OGLTransitionImpl ( const OGLTransitionImpl )
delete

◆ OGLTransitionImpl() [2/2]

OGLTransitionImpl::OGLTransitionImpl ( const TransitionScene rScene,
const TransitionSettings rSettings 
)
inlineprotected

Definition at line 154 of file TransitionImpl.hxx.

Member Function Documentation

◆ applyOverallOperations()

void OGLTransitionImpl::applyOverallOperations ( double  nTime,
double  SlideWidthScale,
double  SlideHeightScale 
)
protected

◆ cleanup()

void OGLTransitionImpl::cleanup ( )
privatevirtual

This function is called in display method to prepare the slides, scene, etc.

Default implementation does nothing.

Definition at line 233 of file TransitionImpl.cxx.

◆ display()

void OGLTransitionImpl::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.

Definition at line 260 of file TransitionImpl.cxx.

References CHECK_GL_ERROR, displayScene(), displaySlides_(), m_nVertexArrayObject, and prepare().

Referenced by displayScene().

◆ displayScene()

void OGLTransitionImpl::displayScene ( double  nTime,
double  SlideWidth,
double  SlideHeight,
double  DispWidth,
double  DispHeight 
)
protected

◆ displaySlide()

void OGLTransitionImpl::displaySlide ( double  nTime,
sal_Int32  glSlideTex,
const Primitives_t primitives,
double  SlideWidthScale,
double  SlideHeightScale 
)
protected

◆ displaySlides_()

void OGLTransitionImpl::displaySlides_ ( double  nTime,
sal_Int32  glLeavingSlideTex,
sal_Int32  glEnteringSlideTex,
double  SlideWidthScale,
double  SlideHeightScale,
OpenGLContext pContext 
)
privatevirtual

This function is called in display method to display the slides.

Default implementation applies overall operations and then displays both slides.

Definition at line 245 of file TransitionImpl.cxx.

References applyOverallOperations(), CHECK_GL_ERROR, displaySlide(), getScene(), and m_nTimeLocation.

Referenced by display().

◆ displayUnbufferedSlide()

void OGLTransitionImpl::displayUnbufferedSlide ( double  nTime,
sal_Int32  glSlideTex,
const Primitives_t primitives,
double  SlideWidthScale,
double  SlideHeightScale 
)
protected

◆ finish()

void OGLTransitionImpl::finish ( )

◆ finishTransition()

void OGLTransitionImpl::finishTransition ( )
privatevirtual

This function is called when the transition needs to clear after itself, like delete own textures etc.

Default implementation does nothing.

Definition at line 241 of file TransitionImpl.cxx.

Referenced by finish().

◆ getScene()

TransitionScene const & OGLTransitionImpl::getScene ( ) const
inlineprotected

Definition at line 159 of file TransitionImpl.hxx.

References maScene.

Referenced by displaySlides_(), and prepare().

◆ getSettings()

TransitionSettings const & OGLTransitionImpl::getSettings ( ) const
inline

Definition at line 148 of file TransitionImpl.hxx.

References maSettings.

◆ makeShader()

virtual GLuint OGLTransitionImpl::makeShader ( ) const
privatepure virtual

This function is called in prepare method to create the GL program.

It is a pure virtual to make sure no class will use a default one.

Referenced by prepare().

◆ operator=()

OGLTransitionImpl & OGLTransitionImpl::operator= ( const OGLTransitionImpl )
delete

◆ prepare() [1/2]

void OGLTransitionImpl::prepare ( double  SlideWidth,
double  SlideHeight 
)
privatevirtual

This function is called in display method to prepare the slides, scene, etc.

Default implementation does nothing.

Definition at line 229 of file TransitionImpl.cxx.

◆ prepare() [2/2]

bool OGLTransitionImpl::prepare ( sal_Int32  glLeavingSlideTex,
sal_Int32  glEnteringSlideTex,
OpenGLContext pContext 
)

◆ prepareTransition()

void OGLTransitionImpl::prepareTransition ( sal_Int32  glLeavingSlideTex,
sal_Int32  glEnteringSlideTex,
OpenGLContext pContext 
)
privatevirtual

This function is called after glx context is ready to let the transition prepare GL related things, like GLSL program.

Default implementation does nothing.

Definition at line 237 of file TransitionImpl.cxx.

Referenced by prepare().

◆ uploadModelViewProjectionMatrices()

void OGLTransitionImpl::uploadModelViewProjectionMatrices ( )
private

Calculates the projection and model/view matrices, and upload them.

Definition at line 73 of file TransitionImpl.cxx.

References CHECK_GL_ERROR, m_nProgramObject, and scale.

Referenced by prepare().

Member Data Documentation

◆ m_nFirstIndices

std::vector<int> OGLTransitionImpl::m_nFirstIndices
private

Definition at line 229 of file TransitionImpl.hxx.

Referenced by displaySlide(), and prepare().

◆ m_nNormalLocation

GLint OGLTransitionImpl::m_nNormalLocation = -1
private

Definition at line 224 of file TransitionImpl.hxx.

Referenced by prepare().

◆ m_nOperationsTransformLocation

GLint OGLTransitionImpl::m_nOperationsTransformLocation = -1
private

Definition at line 219 of file TransitionImpl.hxx.

Referenced by applyOverallOperations(), and prepare().

◆ m_nPositionLocation

GLint OGLTransitionImpl::m_nPositionLocation = -1
private

Per-vertex attribute locations.

Definition at line 223 of file TransitionImpl.hxx.

Referenced by prepare().

◆ m_nPrimitiveTransformLocation

GLint OGLTransitionImpl::m_nPrimitiveTransformLocation = -1
private

Uniform locations for transform matrices.

Definition at line 217 of file TransitionImpl.hxx.

Referenced by displayScene(), displaySlide(), displayUnbufferedSlide(), and prepare().

◆ m_nProgramObject

GLuint OGLTransitionImpl::m_nProgramObject = 0u
protected

GLSL program object.

Definition at line 234 of file TransitionImpl.hxx.

Referenced by finish(), prepare(), and uploadModelViewProjectionMatrices().

◆ m_nSceneTransformLocation

GLint OGLTransitionImpl::m_nSceneTransformLocation = -1
private

Definition at line 218 of file TransitionImpl.hxx.

Referenced by displayScene(), displaySlide(), displayUnbufferedSlide(), and prepare().

◆ m_nTexCoordLocation

GLint OGLTransitionImpl::m_nTexCoordLocation = -1
private

Definition at line 225 of file TransitionImpl.hxx.

Referenced by prepare().

◆ m_nTimeLocation

GLint OGLTransitionImpl::m_nTimeLocation = -1
protected

Location of the "time" uniform.

Definition at line 242 of file TransitionImpl.hxx.

Referenced by displaySlides_(), and prepare().

◆ m_nVertexArrayObject

GLuint OGLTransitionImpl::m_nVertexArrayObject = 0u
private

Definition at line 227 of file TransitionImpl.hxx.

Referenced by display(), displayUnbufferedSlide(), finish(), and prepare().

◆ m_nVertexBufferObject

GLuint OGLTransitionImpl::m_nVertexBufferObject = 0u
protected

VBO in which to put primitive data.

Definition at line 238 of file TransitionImpl.hxx.

Referenced by displayUnbufferedSlide(), finish(), and prepare().

◆ maScene

const TransitionScene OGLTransitionImpl::maScene
private

Definition at line 208 of file TransitionImpl.hxx.

Referenced by applyOverallOperations(), displayScene(), finish(), getScene(), and prepare().

◆ maSettings

const TransitionSettings OGLTransitionImpl::maSettings
private

Definition at line 209 of file TransitionImpl.hxx.

Referenced by getSettings().


The documentation for this class was generated from the following files: