2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/event/common/stage-impl.h>
24 #include <cstring> // for strcmp
27 #include <dali/integration-api/system-overlay.h>
28 #include <dali/internal/event/actors/layer-impl.h>
29 #include <dali/internal/event/actors/layer-list.h>
30 #include <dali/internal/event/actors/camera-actor-impl.h>
31 #include <dali/internal/event/common/system-overlay-impl.h>
32 #include <dali/internal/event/common/thread-local-storage.h>
33 #include <dali/internal/event/common/property-notification-manager.h>
34 #include <dali/internal/event/render-tasks/render-task-list-impl.h>
35 #include <dali/internal/update/nodes/node.h>
36 #include <dali/internal/event/common/object-registry-impl.h>
37 #include <dali/integration-api/platform-abstraction.h>
38 #include <dali/public-api/common/constants.h>
39 #include <dali/public-api/events/touch-data.h>
40 #include <dali/public-api/object/type-registry.h>
41 #include <dali/public-api/render-tasks/render-task-list.h>
42 #include <dali/public-api/rendering/frame-buffer.h>
44 using Dali::Internal::SceneGraph::Node;
48 #if defined(DEBUG_ENABLED)
49 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_DEPTH_TIMER" );
62 const float DEFAULT_STEREO_BASE( 65.0f );
66 const char* const SIGNAL_KEY_EVENT = "keyEvent";
67 const char* const SIGNAL_KEY_EVENT_GENERATED = "keyEventGenerated";
68 const char* const SIGNAL_EVENT_PROCESSING_FINISHED = "eventProcessingFinished";
69 const char* const SIGNAL_TOUCHED = "touched";
70 const char* const SIGNAL_TOUCH = "touch";
71 const char* const SIGNAL_WHEEL_EVENT = "wheelEvent";
72 const char* const SIGNAL_CONTEXT_LOST = "contextLost";
73 const char* const SIGNAL_CONTEXT_REGAINED = "contextRegained";
74 const char* const SIGNAL_SCENE_CREATED = "sceneCreated";
76 TypeRegistration mType( typeid(Dali::Stage), typeid(Dali::BaseHandle), NULL );
78 SignalConnectorType signalConnector1( mType, SIGNAL_KEY_EVENT, &Stage::DoConnectSignal );
79 SignalConnectorType signalConnector2( mType, SIGNAL_EVENT_PROCESSING_FINISHED, &Stage::DoConnectSignal );
80 SignalConnectorType signalConnector3( mType, SIGNAL_TOUCHED, &Stage::DoConnectSignal );
81 SignalConnectorType signalConnector4( mType, SIGNAL_WHEEL_EVENT, &Stage::DoConnectSignal );
82 SignalConnectorType signalConnector5( mType, SIGNAL_CONTEXT_LOST, &Stage::DoConnectSignal );
83 SignalConnectorType signalConnector6( mType, SIGNAL_CONTEXT_REGAINED, &Stage::DoConnectSignal );
84 SignalConnectorType signalConnector7( mType, SIGNAL_SCENE_CREATED, &Stage::DoConnectSignal );
85 SignalConnectorType signalConnector8( mType, SIGNAL_KEY_EVENT_GENERATED, &Stage::DoConnectSignal );
86 SignalConnectorType signalConnector9( mType, SIGNAL_TOUCH, &Stage::DoConnectSignal );
88 } // unnamed namespace
90 StagePtr Stage::New( AnimationPlaylist& playlist,
91 PropertyNotificationManager& propertyNotificationManager,
92 SceneGraph::UpdateManager& updateManager,
93 NotificationManager& notificationManager,
94 Integration::RenderController& renderController )
96 return StagePtr( new Stage( playlist, propertyNotificationManager, updateManager, notificationManager, renderController ) );
99 void Stage::Initialize( bool renderToFbo )
101 mRenderToFbo = renderToFbo;
102 mObjectRegistry = ObjectRegistry::New();
104 // Create the ordered list of layers
105 mLayerList = LayerList::New( mUpdateManager, false/*not system-level*/ );
107 // The stage owns the default layer
108 mRootLayer = Layer::NewRoot( *mLayerList, mUpdateManager, false/*not system-level*/ );
109 mRootLayer->SetName("RootLayer");
110 // The root layer needs to have a fixed resize policy (as opposed to the default USE_NATURAL_SIZE).
111 // This stops actors parented to the stage having their relayout requests propagating
112 // up to the root layer, and down through other children unnecessarily.
113 mRootLayer->SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
115 // Create the default camera actor first; this is needed by the RenderTaskList
116 CreateDefaultCameraActor();
118 // Create the list of render-tasks
119 mRenderTaskList = RenderTaskList::New( *this, *this, false/*not system-level*/ );
121 // Create the default render-task
122 Dali::RenderTask defaultRenderTask = mRenderTaskList->CreateTask();
125 void Stage::Uninitialize()
127 // Remove actors added to SystemOverlay
128 delete mSystemOverlay;
129 mSystemOverlay = NULL;
133 // its enough to release the handle so the object is released
134 // don't need to remove it from root actor as root actor will delete the object
135 mDefaultCamera.Reset();
140 // we are closing down so just delete the root, no point emit disconnect
141 // signals or send messages to update
146 StagePtr Stage::GetCurrent()
148 StagePtr stage( NULL );
149 // no checking in this version
150 ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
153 stage = tls->GetCurrentStage();
158 bool Stage::IsInstalled()
160 return ThreadLocalStorage::Created();
163 ObjectRegistry& Stage::GetObjectRegistry()
165 return *mObjectRegistry;
168 void Stage::RegisterObject( Dali::BaseObject* object )
170 mObjectRegistry->RegisterObject( object );
173 void Stage::UnregisterObject( Dali::BaseObject* object )
175 mObjectRegistry->UnregisterObject( object );
178 Layer& Stage::GetRootActor()
183 AnimationPlaylist& Stage::GetAnimationPlaylist()
185 return mAnimationPlaylist;
188 PropertyNotificationManager& Stage::GetPropertyNotificationManager()
190 return mPropertyNotificationManager;
193 void Stage::Add( Actor& actor )
195 mRootLayer->Add( actor );
198 void Stage::Remove( Actor& actor )
200 mRootLayer->Remove( actor );
203 void Stage::SurfaceResized( float width, float height )
205 if( ( fabs( width - mSurfaceSize.width ) > Math::MACHINE_EPSILON_1000 ) || ( fabs( height - mSurfaceSize.height ) > Math::MACHINE_EPSILON_1000 ) )
207 mSurfaceSize.width = width;
208 mSurfaceSize.height = height;
210 // Internally we want to report the actual size of the stage.
212 mSize.height = height - mTopMargin;
214 // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
215 mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
217 // Adjust the camera height to allow for top-margin
218 SetDefaultCameraPosition();
220 mRootLayer->SetSize( mSize.width, mSize.height );
222 // Repeat for SystemOverlay actors
225 // Note that the SystemOverlay has a separate camera, configured for the full surface-size.
226 // This will remain unaffected by changes in SetDefaultCameraPosition()
227 mSystemOverlay->GetImpl()->SetSize( width, height );
230 SetDefaultSurfaceRectMessage( mUpdateManager, Rect<int>( 0, 0, width, height ) );
232 // if single render task to screen then set its viewport parameters
233 if( 1 == mRenderTaskList->GetTaskCount() )
235 Dali::RenderTask defaultRenderTask = mRenderTaskList->GetTask( 0u );
237 if(!defaultRenderTask.GetTargetFrameBuffer())
239 defaultRenderTask.SetViewport( Viewport(0, 0, width, height) );
245 Dali::FrameBuffer frameBuffer = Dali::FrameBuffer::New( width, height, Dali::FrameBuffer::Attachment::NONE );
246 Dali::Texture texture = Dali::Texture::New( Dali::TextureType::TEXTURE_2D, Dali::Pixel::RGB888, width, height );
247 frameBuffer.AttachColorTexture( texture );
249 Dali::RenderTask defaultRenderTask = mRenderTaskList->GetTask( 0u );
250 defaultRenderTask.SetFrameBuffer( frameBuffer );
255 Vector2 Stage::GetSize() const
260 void Stage::SetTopMargin( unsigned int margin )
262 if (mTopMargin == margin)
268 mSize.width = mSurfaceSize.width;
269 mSize.height = mSurfaceSize.height - mTopMargin;
271 // Adjust the camera height to allow for top-margin
272 SetDefaultCameraPosition();
274 mRootLayer->SetSize( mSize.width, mSize.height );
277 RenderTaskList& Stage::GetRenderTaskList() const
279 return *mRenderTaskList;
282 void Stage::CreateDefaultCameraActor()
284 // The default camera attributes and position is such that
285 // children of the default layer, can be positioned at (0,0) and
286 // be at the top-left of the viewport.
287 mDefaultCamera = CameraActor::New( Size::ZERO );
288 mDefaultCamera->SetParentOrigin(ParentOrigin::CENTER);
289 Add(*(mDefaultCamera.Get()));
292 void Stage::SetDefaultCameraPosition()
294 mDefaultCamera->SetY( -(static_cast<float>(mTopMargin) * 0.5f) );
297 Actor& Stage::GetDefaultRootActor()
302 CameraActor& Stage::GetDefaultCameraActor()
304 return *mDefaultCamera;
307 unsigned int Stage::GetLayerCount() const
309 return mLayerList->GetLayerCount();
312 Dali::Layer Stage::GetLayer( unsigned int depth ) const
314 return Dali::Layer(mLayerList->GetLayer( depth ));
317 Dali::Layer Stage::GetRootLayer() const
319 return Dali::Layer( mRootLayer.Get() );
322 LayerList& Stage::GetLayerList()
327 Integration::SystemOverlay& Stage::GetSystemOverlay()
329 // Lazily create system-level if requested
330 if( !mSystemOverlay )
332 mSystemOverlay = new Integration::SystemOverlay( SystemOverlay::New( *this ) );
333 DALI_ASSERT_ALWAYS( NULL != mSystemOverlay && "Failed to create system overlay" );
335 mSystemOverlay->GetImpl()->SetSize( mSize.width, mSize.height );
338 return *mSystemOverlay;
341 SystemOverlay* Stage::GetSystemOverlayInternal()
343 SystemOverlay* overlay( NULL );
347 overlay = mSystemOverlay->GetImpl();
353 void Stage::SetViewMode( ViewMode viewMode )
355 if( mViewMode != viewMode )
357 DALI_LOG_INFO( Debug::Filter::gActor, Debug::Concise, "View mode changed from %d to %d\n", mViewMode, viewMode);
359 if( mViewMode == MONO )
361 mDefaultCamera->SetOrientation( Dali::ANGLE_180, Vector3::YAXIS );
362 mRenderTaskList->GetTask(0).SetSourceActor( Dali::Actor() );
364 //Create camera and RenderTask for left eye
365 mLeftCamera = CameraActor::New( Size::ZERO );
366 mLeftCamera->SetParentOrigin( ParentOrigin::CENTER );
367 mDefaultCamera->Add( *mLeftCamera.Get() );
368 mLeftRenderTask = mRenderTaskList->CreateTask();
369 mLeftRenderTask.SetCameraActor( Dali::CameraActor( mLeftCamera.Get() ) );
370 mLeftCamera->SetType( Dali::Camera::FREE_LOOK );
372 //Create camera and RenderTask for right eye
373 mRightCamera = CameraActor::New( Size::ZERO );
374 mRightCamera->SetParentOrigin( ParentOrigin::CENTER );
375 mDefaultCamera->Add( *mRightCamera.Get() );
376 mRightRenderTask = mRenderTaskList->CreateTask();
377 mRightRenderTask.SetClearColor( Vector4( 1.0f,0.0f,0.0f,1.0f));
379 mRightRenderTask.SetCameraActor( Dali::CameraActor( mRightCamera.Get() ) );
380 mRightCamera->SetType( Dali::Camera::FREE_LOOK );
384 mViewMode = viewMode;
390 // delete extra stereoscopic render tasks and cameras
391 mRenderTaskList->RemoveTask( mLeftRenderTask );
392 mDefaultCamera->Remove( *mLeftCamera.Get() );
393 mLeftRenderTask.Reset();
395 mRenderTaskList->RemoveTask( mRightRenderTask );
396 mDefaultCamera->Remove( *mRightCamera.Get() );
397 mRightRenderTask.Reset();
398 mRightCamera.Reset();
399 mDefaultCamera->SetOrientation( Dali::ANGLE_0, Vector3::YAXIS );
400 mDefaultCamera->SetType( Dali::Camera::LOOK_AT_TARGET );
401 mRenderTaskList->GetTask(0).SetSourceActor( Dali::Layer(mRootLayer.Get()) );
405 case STEREO_HORIZONTAL:
407 //Stereo mode with horizontal split is for landscape mode. That's the reason for the cameras being rotated
408 //Top camera renders the scene as seen from the right eye and bottom camera as seen from left.
410 //Calculate separation in pixels along vertical axis ( mStereoBase is defined in millimetres )
411 const float stereoBase( ( (mStereoBase / 25.4f) * GetDpi().y ) * 0.5f );
413 //Calculate aspect ratio
414 float aspect = mSize.width / (mSize.height * 0.5f);
416 mLeftCamera->SetPerspectiveProjection( mSize, Vector2( 0.0f,stereoBase) );
417 mLeftCamera->SetAspectRatio( aspect );
419 mLeftCamera->SetOrientation( -Dali::ANGLE_90, Vector3::ZAXIS );
420 mLeftCamera->SetPosition( Vector3( stereoBase, 0.0f, 0.0f ) );
421 mLeftRenderTask.SetViewport( Viewport(0, mSize.height * 0.5f, mSize.width, mSize.height * 0.5f) );
423 mRightCamera->SetPerspectiveProjection( mSize, Vector2( 0.0, -stereoBase) );
424 mRightCamera->SetAspectRatio( aspect );
425 mRightCamera->SetOrientation( -Dali::ANGLE_90, Vector3::ZAXIS );
426 mRightCamera->SetPosition( Vector3(-stereoBase, 0.0f, 0.0f ) );
427 mRightRenderTask.SetViewport( Viewport(0, 0, mSize.width, mSize.height * 0.5f ) );
431 case STEREO_VERTICAL:
433 //Calculate separation in pixels along horizontal axis
434 const float stereoBase( ( (mStereoBase / 25.4f) * GetDpi().x ) * 0.5f );
436 //Recalculate fov based on viewport size
437 const float fov = 2.0f * std::atan( mSize.y / (2.0f * std::max( mSize.x*0.5f, mSize.y )) );
439 mLeftCamera->SetPerspectiveProjection( Size( mSize.x * 0.5f, mSize.y ), Vector2(stereoBase,0.0f) );
440 mLeftCamera->SetFieldOfView( fov );
441 mLeftCamera->SetOrientation( Dali::ANGLE_0, Vector3::ZAXIS );
442 mLeftCamera->SetPosition( Vector3( stereoBase, 0.0f, 0.0f ) );
443 mLeftRenderTask.SetViewport( Viewport(0, 0, mSize.width * 0.5f, mSize.height ) );
445 mRightCamera->SetPerspectiveProjection( Size( mSize.x * 0.5f, mSize.y ), Vector2(-stereoBase,0.0f) );
446 mRightCamera->SetFieldOfView( fov );
447 mRightCamera->SetOrientation( Dali::ANGLE_0, Vector3::ZAXIS );
448 mRightCamera->SetPosition( Vector3( -stereoBase, 0.0f, 0.0f ) );
449 mRightRenderTask.SetViewport( Viewport(mSize.width * 0.5f, 0, mSize.width * 0.5f, mSize.height ) );
453 case STEREO_INTERLACED:
461 ViewMode Stage::GetViewMode() const
466 void Stage::SetStereoBase( float stereoBase )
468 if( ! Equals( mStereoBase, stereoBase ) )
470 DALI_LOG_INFO( Debug::Filter::gActor, Debug::Concise, "old( %.2f) new(%.2f)\n", mStereoBase, stereoBase );
471 mStereoBase = stereoBase;
475 case STEREO_HORIZONTAL:
477 stereoBase = mStereoBase / 25.4f * GetDpi().y * 0.5f;
478 float aspect = mSize.width / (mSize.height * 0.5f);
480 mLeftCamera->SetPerspectiveProjection( mSize, Vector2( 0.0, stereoBase) );
481 mLeftCamera->SetAspectRatio( aspect );
482 mLeftCamera->SetPosition( Vector3( stereoBase, 0.0f, 0.0f ) );
484 mRightCamera->SetPerspectiveProjection( mSize, Vector2( 0.0, -stereoBase) );
485 mRightCamera->SetAspectRatio( aspect );
486 mRightCamera->SetPosition( Vector3(-stereoBase, 0.0f, 0.0f ) );
490 case STEREO_VERTICAL:
492 stereoBase = mStereoBase / 25.4f * GetDpi().x * 0.5f;
493 const float fov = 2.0f * std::atan( mSize.y / (2.0f * std::max( mSize.x*0.5f, mSize.y )) );
495 mLeftCamera->SetPerspectiveProjection( Size( mSize.x * 0.5f, mSize.y ), Vector2(stereoBase,0.0f) );
496 mLeftCamera->SetFieldOfView( fov );
497 mLeftCamera->SetPosition( Vector3( stereoBase, 0.0f, 0.0f ) );
499 mRightCamera->SetPerspectiveProjection( Size( mSize.x * 0.5f, mSize.y ), Vector2(-stereoBase,0.0f) );
500 mRightCamera->SetFieldOfView( fov );
501 mRightCamera->SetPosition( Vector3(-stereoBase, 0.0f, 0.0f ) );
511 float Stage::GetStereoBase() const
516 void Stage::SetBackgroundColor(Vector4 color)
518 // Cache for public GetBackgroundColor()
519 mBackgroundColor = color;
521 // Send message to change color in next frame
522 SetBackgroundColorMessage( mUpdateManager, color );
525 Vector4 Stage::GetBackgroundColor() const
527 return mBackgroundColor;
530 Vector2 Stage::GetDpi() const
535 void Stage::SetDpi(Vector2 dpi)
540 void Stage::KeepRendering( float durationSeconds )
542 // Send message to keep rendering
543 KeepRenderingMessage( mUpdateManager, durationSeconds );
546 bool Stage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
548 bool connected( true );
549 Stage* stage = static_cast< Stage* >(object); // TypeRegistry guarantees that this is the correct type.
551 if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
553 stage->KeyEventSignal().Connect( tracker, functor );
555 else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT_GENERATED ) )
557 stage->KeyEventGeneratedSignal().Connect( tracker, functor );
559 else if( 0 == strcmp( signalName.c_str(), SIGNAL_EVENT_PROCESSING_FINISHED ) )
561 stage->EventProcessingFinishedSignal().Connect( tracker, functor );
563 else if( 0 == strcmp( signalName.c_str(), SIGNAL_TOUCHED ) )
565 stage->TouchedSignal().Connect( tracker, functor );
567 else if( 0 == strcmp( signalName.c_str(), SIGNAL_TOUCH ) )
569 stage->TouchSignal().Connect( tracker, functor );
571 else if( 0 == strcmp( signalName.c_str(), SIGNAL_WHEEL_EVENT ) )
573 stage->WheelEventSignal().Connect( tracker, functor );
575 else if( 0 == strcmp( signalName.c_str(), SIGNAL_CONTEXT_LOST ) )
577 stage->ContextLostSignal().Connect( tracker, functor );
579 else if( 0 == strcmp( signalName.c_str(), SIGNAL_CONTEXT_REGAINED ) )
581 stage->ContextRegainedSignal().Connect( tracker, functor );
583 else if( 0 == strcmp( signalName.c_str(), SIGNAL_SCENE_CREATED ) )
585 stage->SceneCreatedSignal().Connect( tracker, functor );
589 // signalName does not match any signal
596 void Stage::EmitKeyEventSignal(const KeyEvent& event)
598 // Emit the key event signal when no actor in the stage has gained the key input focus
600 mKeyEventSignal.Emit( event );
603 bool Stage::EmitKeyEventGeneratedSignal(const KeyEvent& event)
605 // Emit the KeyEventGenerated signal when KeyEvent is generated
607 return mKeyEventGeneratedSignal.Emit( event );
610 void Stage::EmitEventProcessingFinishedSignal()
612 mEventProcessingFinishedSignal.Emit();
615 void Stage::EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch )
617 mTouchedSignal.Emit( touchEvent );
618 mTouchSignal.Emit( touch );
621 void Stage::EmitWheelEventSignal(const WheelEvent& event)
623 // Emit the wheel event signal when no actor in the stage has gained the wheel input focus
625 mWheelEventSignal.Emit( event );
628 void Stage::EmitSceneCreatedSignal()
630 mSceneCreatedSignal.Emit();
633 Dali::Stage::KeyEventSignalType& Stage::KeyEventSignal()
635 return mKeyEventSignal;
638 Dali::DevelStage::KeyEventGeneratedSignalType& Stage::KeyEventGeneratedSignal()
640 return mKeyEventGeneratedSignal;
643 Dali::Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSignal()
645 return mEventProcessingFinishedSignal;
648 Dali::Stage::TouchedSignalType& Stage::TouchedSignal()
650 DALI_LOG_WARNING( "Deprecated. Use TouchSignal() instead.\n" );
651 return mTouchedSignal;
654 Dali::Stage::TouchSignalType& Stage::TouchSignal()
659 Dali::Stage::WheelEventSignalType& Stage::WheelEventSignal()
661 return mWheelEventSignal;
664 Dali::Stage::ContextStatusSignal& Stage::ContextLostSignal()
666 return mContextLostSignal;
669 Dali::Stage::ContextStatusSignal& Stage::ContextRegainedSignal()
671 return mContextRegainedSignal;
674 Dali::Stage::SceneCreatedSignalType& Stage::SceneCreatedSignal()
676 return mSceneCreatedSignal;
679 void Stage::NotifyContextLost()
681 mContextLostSignal.Emit();
684 void Stage::NotifyContextRegained()
686 mContextRegainedSignal.Emit();
690 void Stage::RequestRebuildDepthTree()
692 DALI_LOG_INFO(gLogFilter, Debug::General, "RequestRebuildDepthTree()\n");
693 mDepthTreeDirty = true;
696 void Stage::RebuildDepthTree()
698 // If the depth tree needs rebuilding, do it in this frame only.
699 if( mDepthTreeDirty )
701 DALI_LOG_INFO(gLogFilter, Debug::Concise, "RebuildDepthTree() dirty:T\n");
703 ActorPtr actor( mRootLayer.Get() );
704 actor->RebuildDepthTree();
705 mDepthTreeDirty = false;
710 Stage::Stage( AnimationPlaylist& playlist,
711 PropertyNotificationManager& propertyNotificationManager,
712 SceneGraph::UpdateManager& updateManager,
713 NotificationManager& notificationManager,
714 Integration::RenderController& renderController )
715 : mAnimationPlaylist( playlist ),
716 mPropertyNotificationManager( propertyNotificationManager ),
717 mUpdateManager( updateManager ),
718 mNotificationManager( notificationManager ),
719 mRenderController( renderController ),
720 mSize( Vector2::ZERO ),
721 mSurfaceSize( Vector2::ZERO ),
722 mBackgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
724 mStereoBase( DEFAULT_STEREO_BASE ),
726 mDpi( Vector2::ZERO ),
729 mSystemOverlay( NULL ),
731 mKeyEventGeneratedSignal(),
732 mEventProcessingFinishedSignal(),
736 mContextLostSignal(),
737 mContextRegainedSignal(),
738 mSceneCreatedSignal(),
739 mDepthTreeDirty( false ),
740 mForceNextUpdate( false ),
741 mRenderToFbo( false )
745 SceneGraph::UpdateManager& Stage::GetUpdateManager()
747 return mUpdateManager;
750 Integration::RenderController& Stage::GetRenderController()
752 return mRenderController;
755 unsigned int* Stage::ReserveMessageSlot( std::size_t size, bool updateScene )
757 return mUpdateManager.ReserveMessageSlot( size, updateScene );
760 BufferIndex Stage::GetEventBufferIndex() const
762 return mUpdateManager.GetEventBufferIndex();
765 void Stage::ForceNextUpdate()
767 mForceNextUpdate = true;
770 bool Stage::IsNextUpdateForced()
772 bool nextUpdateForced = mForceNextUpdate;
773 mForceNextUpdate = false;
774 return nextUpdateForced;
779 delete mSystemOverlay;
781 mObjectRegistry.Reset();
784 } // namespace Internal