Node* GetSourceNode() const;
/**
+ * Set the ViewportGuideNode.
+ * @param[in] node This node is used to compute viewport of the render task.
+ */
+ void SetViewportGuideNode(Node* node);
+
+ /**
+ * Retrieve the ViewportGuideNode.
+ * @return This node is used to compute viewport of the render task.
+ */
+ Node* GetViewportGuideNode() const;
+
+ /**
* Set whether the RenderTask has exclusive access to the source nodes.
* @param[in] exclusive True if the source nodes will only be rendered by this render-task.
*/
Render::FrameBuffer* GetFrameBuffer();
/**
+ * Update viewport by using viewport guide node
+ * @param[in] updateBufferIndex The current update buffer index.
+ * @param[in] sceneSize The size of scene.
+ * @param[in] cameraPosition The position of default camera of the scene.
+ */
+ void UpdateViewport(BufferIndex updateBufferIndex, Vector2 sceneSize, Vector3 cameraPosition);
+
+ /**
* Set the value of property viewportPosition
* This value will persist only for the current frame.
* @param[in] updateBufferIndex The current update buffer index.
Render::RenderTracker* mRenderSyncTracker;
Node* mSourceNode;
Node* mCameraNode;
+ Node* mViewportGuideNode;
SceneGraph::Camera* mCamera;
Render::FrameBuffer* mFrameBuffer;
new(slot) LocalType(&task, &RenderTask::SetCamera, node, camera);
}
+inline void SetViewportGuideNodeMessage(EventThreadServices& eventThreadServices, const RenderTask& task, const Node* constNode)
+{
+ // Scene graph thread can destroy this object.
+ Node* node = const_cast<Node*>(constNode);
+
+ using LocalType = MessageValue1<RenderTask, Node*>;
+
+ // Reserve some memory inside the message queue
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot(sizeof(LocalType));
+
+ // Construct message in the message queue memory; note that delete should not be called on the return value
+ new(slot) LocalType(&task, &RenderTask::SetViewportGuideNode, node);
+}
+
inline void SetExclusiveMessage(EventThreadServices& eventThreadServices, const RenderTask& task, bool exclusive)
{
using LocalType = MessageValue1<RenderTask, bool>;