bool NeedsNotification() { return needsNotification; }
/**
+ * Query wheter the default surface rect is changed or not.
+ * @return true if the default surface rect is changed.
+ */
+ bool SurfaceRectChanged() { return surfaceRectChanged; }
+
+ /**
* This method is provided so that FPS can be easily calculated with a release version
* of Core.
* @return the seconds from last frame as float
unsigned int keepUpdating; ///< A bitmask of KeepUpdating values
bool needsNotification;
+ bool surfaceRectChanged;
float secondsFromLastFrame;
};
// Check the Notification Manager message queue to set needsNotification
status.needsNotification = mNotificationManager->MessagesToProcess();
+ // Check if the default surface is changed
+ status.surfaceRectChanged = mUpdateManager->IsDefaultSurfaceRectChanged();
+
// No need to keep update running if there are notifications to process.
// Any message to update will wake it up anyways
}
animationFinishedDuringUpdate( false ),
previousUpdateScene( false ),
renderTaskWaiting( false ),
- renderersAdded( false )
+ renderersAdded( false ),
+ surfaceRectChanged( false )
{
sceneController = new SceneControllerImpl( renderMessageDispatcher, renderQueue, discardQueue );
bool previousUpdateScene; ///< True if the scene was updated in the previous frame (otherwise it was optimized out)
bool renderTaskWaiting; ///< A REFRESH_ONCE render task is waiting to be rendered
bool renderersAdded; ///< Flag to keep track when renderers have been added to avoid unnecessary processing
+ bool surfaceRectChanged; ///< True if the default surface rect is changed
private:
void UpdateManager::SetDefaultSurfaceRect( const Rect<int>& rect )
{
+ mImpl->surfaceRectChanged = true;
+
typedef MessageValue1< RenderManager, Rect<int> > DerivedType;
// Reserve some memory inside the render queue
SortSiblingNodesRecursively( *( mImpl->root ) );
}
+bool UpdateManager::IsDefaultSurfaceRectChanged()
+{
+ bool surfaceRectChanged = mImpl->surfaceRectChanged;
+
+ // Reset the flag
+ mImpl->surfaceRectChanged = false;
+
+ return surfaceRectChanged;
+}
+
void UpdateManager::AddSampler( OwnerPointer< Render::Sampler >& sampler )
{
// Message has ownership of Sampler while in transit from update to render