Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
RenderingAbstract.cpp
Go to the documentation of this file.
1 /**************************************************************************************/
2 /* */
3 /* Visualization Library */
4 /* http://visualizationlibrary.org */
5 /* */
6 /* Copyright (c) 2005-2020, Michele Bosi */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without modification, */
10 /* are permitted provided that the following conditions are met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, this */
13 /* list of conditions and the following disclaimer. */
14 /* */
15 /* - Redistributions in binary form must reproduce the above copyright notice, this */
16 /* list of conditions and the following disclaimer in the documentation and/or */
17 /* other materials provided with the distribution. */
18 /* */
19 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
20 /* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
21 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
22 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
23 /* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
24 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
25 /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
26 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
27 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
28 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29 /* */
30 /**************************************************************************************/
31 
34 #include <vlGraphics/Rendering.hpp>
35 
36 using namespace vl;
37 
38 //------------------------------------------------------------------------------
40 {
41  VL_DEBUG_SET_OBJECT_NAME()
42  mFrameClock = 0.0f;
43  mEnableMask = 0xFFFFFFFF;
46 }
47 //------------------------------------------------------------------------------
49 {
50  super::operator=(other);
51 
52  mFrameClock = other.mFrameClock;
53  mEnableMask = other.mEnableMask;
56  return *this;
57 }
58 //------------------------------------------------------------------------------
60 {
62  for(int i=0; i<cb.size(); ++i)
63  {
64  if ( cb[i]->isEnabled() && cb[i]->onRenderingStarted(this) && cb[i]->removeAfterCall() )
65  {
66  onStartedCallbacks()->eraseAt( i );
67  --i;
68  }
69  }
70 }
71 //------------------------------------------------------------------------------
73 {
75  for(int i=0; i<cb.size(); ++i)
76  {
77  if ( cb[i]->isEnabled() && cb[i]->onRenderingFinished(this) && cb[i]->removeAfterCall() )
78  {
79  onFinishedCallbacks()->eraseAt( i );
80  --i;
81  }
82  }
83 }
84 //------------------------------------------------------------------------------
Collection< RenderEventCallback > * onFinishedCallbacks()
Returns the list of RenderEventCallback objects registered to the onRenderingFinished() event notific...
ref< Collection< RenderEventCallback > > mOnFinishedCallbacks
The RenderingAbstract class is the base of all the rendering related sub-classes. ...
Collection< RenderEventCallback > * onStartedCallbacks()
Returns the list of RenderEventCallback objects registered to the onRenderingStarted() event notifica...
int size() const
Definition: Collection.hpp:82
void dispatchOnRenderingStarted()
Calls the RenderEventCallback::onRenderingStarted() method of all the active callback objects...
Visualization Library main namespace.
RenderingAbstract()
Constructor.
void dispatchOnRenderingFinished()
Calls the RenderEventCallback::onRenderingFinished() method of all the active callback objects...
It&#39;s basically an std::vector for Objects that is itself an Object so it can be reference counted and...
Definition: Collection.hpp:49
ref< Collection< RenderEventCallback > > mOnStartedCallbacks
RenderingAbstract & operator=(const RenderingAbstract &other)
bool isEnabled(unsigned int mask)