+inline void AddSceneMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Scene >& scene )
+{
+ typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Scene > > LocalType;
+
+ // Reserve some memory inside the message queue
+ uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+ // Construct message in the message queue memory; note that delete should not be called on the return value
+ new (slot) LocalType( &manager, &UpdateManager::AddScene, scene );
+}
+
+inline void RemoveSceneMessage( UpdateManager& manager, const SceneGraph::Scene& constScene )
+{
+ // The scene-graph thread owns this object so it can safely edit it.
+ Scene& scene = const_cast< Scene& >( constScene );
+
+ typedef MessageValue1< UpdateManager, Scene* > LocalType;
+
+ // Reserve some memory inside the message queue
+ uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+ // Construct message in the message queue memory; note that delete should not be called on the return value
+ new (slot) LocalType( &manager, &UpdateManager::RemoveScene, &scene );
+}
+