LibreOffice Module slideshow (master) 1
|
OpenGL 3D Transition class. More...
#include <TransitionImpl.hxx>
Public Member Functions | |
virtual | ~OGLTransitionImpl () |
OGLTransitionImpl (const OGLTransitionImpl &)=delete | |
OGLTransitionImpl & | operator= (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< int > | m_nFirstIndices |
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.
|
virtual |
Definition at line 69 of file TransitionImpl.cxx.
|
delete |
|
inlineprotected |
Definition at line 154 of file TransitionImpl.hxx.
|
protected |
Definition at line 277 of file TransitionImpl.cxx.
References CHECK_GL_ERROR, TransitionScene::getOperations(), i, slideshow::internal::interpolate(), m_nOperationsTransformLocation, and maScene.
Referenced by displaySlides_().
|
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.
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().
|
protected |
Definition at line 339 of file TransitionImpl.cxx.
References CHECK_GL_ERROR, display(), TransitionScene::getSceneObjects(), i, m_nPrimitiveTransformLocation, m_nSceneTransformLocation, and maScene.
Referenced by display().
|
protected |
Definition at line 297 of file TransitionImpl.cxx.
References CHECK_GL_ERROR, displayPrimitives(), m_nFirstIndices, m_nPrimitiveTransformLocation, and m_nSceneTransformLocation.
Referenced by displaySlides_().
|
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().
|
protected |
Definition at line 314 of file TransitionImpl.cxx.
References CHECK_GL_ERROR, m_nPrimitiveTransformLocation, m_nSceneTransformLocation, m_nVertexArrayObject, and m_nVertexBufferObject.
void OGLTransitionImpl::finish | ( | ) |
Clean up after transition.
Definition at line 208 of file TransitionImpl.cxx.
References CHECK_GL_ERROR, finishTransition(), TransitionScene::getSceneObjects(), i, m_nProgramObject, m_nVertexArrayObject, m_nVertexBufferObject, and maScene.
|
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().
|
inlineprotected |
Definition at line 159 of file TransitionImpl.hxx.
References maScene.
Referenced by displaySlides_(), and prepare().
|
inline |
Definition at line 148 of file TransitionImpl.hxx.
References maSettings.
|
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().
|
delete |
|
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.
bool OGLTransitionImpl::prepare | ( | sal_Int32 | glLeavingSlideTex, |
sal_Int32 | glEnteringSlideTex, | ||
OpenGLContext * | pContext | ||
) |
Prepare transition.
Definition at line 136 of file TransitionImpl.cxx.
References CHECK_GL_ERROR, getScene(), TransitionScene::getSceneObjects(), i, m_nFirstIndices, m_nNormalLocation, m_nOperationsTransformLocation, m_nPositionLocation, m_nPrimitiveTransformLocation, m_nProgramObject, m_nSceneTransformLocation, m_nTexCoordLocation, m_nTimeLocation, m_nVertexArrayObject, m_nVertexBufferObject, makeShader(), maScene, normal, position(), prepareTransition(), uploadModelViewProjectionMatrices(), and uploadPrimitives().
Referenced by display().
|
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().
|
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().
|
private |
Definition at line 229 of file TransitionImpl.hxx.
Referenced by displaySlide(), and prepare().
|
private |
Definition at line 224 of file TransitionImpl.hxx.
Referenced by prepare().
|
private |
Definition at line 219 of file TransitionImpl.hxx.
Referenced by applyOverallOperations(), and prepare().
|
private |
Per-vertex attribute locations.
Definition at line 223 of file TransitionImpl.hxx.
Referenced by prepare().
|
private |
Uniform locations for transform matrices.
Definition at line 217 of file TransitionImpl.hxx.
Referenced by displayScene(), displaySlide(), displayUnbufferedSlide(), and prepare().
|
protected |
GLSL program object.
Definition at line 234 of file TransitionImpl.hxx.
Referenced by finish(), prepare(), and uploadModelViewProjectionMatrices().
|
private |
Definition at line 218 of file TransitionImpl.hxx.
Referenced by displayScene(), displaySlide(), displayUnbufferedSlide(), and prepare().
|
private |
Definition at line 225 of file TransitionImpl.hxx.
Referenced by prepare().
|
protected |
Location of the "time" uniform.
Definition at line 242 of file TransitionImpl.hxx.
Referenced by displaySlides_(), and prepare().
|
private |
Definition at line 227 of file TransitionImpl.hxx.
Referenced by display(), displayUnbufferedSlide(), finish(), and prepare().
|
protected |
VBO in which to put primitive data.
Definition at line 238 of file TransitionImpl.hxx.
Referenced by displayUnbufferedSlide(), finish(), and prepare().
|
private |
Definition at line 208 of file TransitionImpl.hxx.
Referenced by applyOverallOperations(), displayScene(), finish(), getScene(), and prepare().
|
private |
Definition at line 209 of file TransitionImpl.hxx.
Referenced by getSettings().