瀏覽代碼

More documentation

BearishSun 11 年之前
父節點
當前提交
7efb8dcfcd
共有 2 個文件被更改,包括 78 次插入11 次删除
  1. 57 8
      CamelotCore/Include/CmMeshManager.h
  2. 21 3
      CamelotCore/Include/CmMultiRenderTexture.h

+ 57 - 8
CamelotCore/Include/CmMeshManager.h

@@ -6,35 +6,84 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Manager that handles creation of Meshes.
+	 */
 	class CM_EXPORT MeshManager : public Module<MeshManager>
 	{
 	public:
 		MeshManager();
 		~MeshManager();
 
-		MeshPtr create(UINT32 numVertices, UINT32 numIndices, 
-			const VertexDataDescPtr& vertexDesc, MeshBufferType bufferType = MeshBufferType::Static, 
+		/**
+		 * @brief	Creates an empty mesh with enough space to store vertex and index data described by the parameters.
+		 *
+		 * @param	numVertices	Number of vertices in the mesh.
+		 * @param	numIndices	Number of indices in the mesh.
+		 * @param	vertexDesc	Vertex description that describes how are vertices organized within the vertex buffer(s).
+		 * @param	bufferType	Type of buffers to use to store mesh vertex and index data. Specify dynamic if you plan on
+		 *						updating the mesh often, or static otherwise.
+		 * @param	drawOp		Informs the render system on how to draw the mesh. Determines how are indices and vertices interpreted.
+		 * @param	indexType	Type of indexes in the index buffer. Determines size of an index.
+		 */
+		MeshPtr create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, MeshBufferType bufferType = MeshBufferType::Static, 
 			 DrawOperationType drawOp = DOT_TRIANGLE_LIST, IndexBuffer::IndexType indexType = IndexBuffer::IT_32BIT);
+
+		/**
+		 * @brief	Creates an mesh with enough space to store vertex and index data described by the parameters, and initializes
+		 *			a portion (or entire) mesh with some data.
+		 *
+		 * @param	numVertices	Number of vertices in the mesh.
+		 * @param	numIndices	Number of indices in the mesh.
+		 * @param	vertexDesc	Vertex description that describes how are vertices organized within the vertex buffer(s).
+		 * @param	initialData	Initial data to initialize the mesh with. Internal offsets in this object will be used to
+		 *						determine where to write the data in the Mesh buffers.
+		 * @param	bufferType	Type of buffers to use to store mesh vertex and index data. Specify dynamic if you plan on
+		 *						updating the mesh often, or static otherwise.
+		 * @param	drawOp		Informs the render system on how to draw the mesh. Determines how are indices and vertices interpreted.
+		 * @param	indexType	Type of indexes in the index buffer. Determines size of an index.
+		 */
 		MeshPtr create(UINT32 numVertices, UINT32 numIndices, const VertexDataDescPtr& vertexDesc, const MeshDataPtr& initialData, 
 			MeshBufferType bufferType = MeshBufferType::Static, DrawOperationType drawOp = DOT_TRIANGLE_LIST, 
 			IndexBuffer::IndexType indexType = IndexBuffer::IT_32BIT);
+
+		/**
+		 * @brief	Creates a mesh and initializes it with the provided data. Mesh will be of exact size needed to hold the data.
+		 *
+		 * @param	initialData	Initial data to initialize the mesh with. Size of the buffers and vertex declaration will be taken
+		 *						from this object.
+		 * @param	bufferType	Type of buffers to use to store mesh vertex and index data. Specify dynamic if you plan on
+		 *						updating the mesh often, or static otherwise.
+		 * @param	drawOp		Informs the render system on how to draw the mesh. Determines how are indices and vertices interpreted.
+		 */
 		MeshPtr create(const MeshDataPtr& initialData, MeshBufferType bufferType = MeshBufferType::Static,
 			DrawOperationType drawOp = DOT_TRIANGLE_LIST);
+
+		/**
+		 * @brief	Creates a new empty and uninitialized mesh. You will need to manually initialize the mesh before using it.
+		 *	
+		 * @note	This should only be used for special cases and is not meant for normal use.
+		 */
 		MeshPtr createEmpty();
 
 		/**
-		 * @brief	Returns empty mesh data. (Technically it is not empty,
-		 * 			as 0 sized buffers will cause problems, so it contains 3 indices
-		 * 			and 1 vertex).
+		 * @brief	Returns some dummy mesh data with one triangle you may use for initializing a mesh.
 		 */
 		MeshDataPtr getDummyMeshData() const { return mDummyMeshData; }
 
+		/**
+		 * @brief	Returns a dummy mesh containing one triangle.
+		 */
 		HMesh getDummyMesh() const { return mDummyMesh; }
-	private:
-		MeshDataPtr mDummyMeshData;
-		HMesh mDummyMesh;
 
 	protected:
+		/**
+		 * @copydoc		Module::onStartUp
+		 */
 		virtual void onStartUp();
+
+	private:
+		MeshDataPtr mDummyMeshData;
+		HMesh mDummyMesh;
 	};
 }

+ 21 - 3
CamelotCore/Include/CmMultiRenderTexture.h

@@ -5,17 +5,29 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Descriptor class used for initializing a MultiRenderTexture.
+	 *			Contains descriptors for each individual color render surface and 
+	 *			their common depth/stencil surface.
+	 */
 	struct CM_EXPORT MULTI_RENDER_TEXTURE_DESC
 	{
 		Vector<RENDER_SURFACE_DESC> colorSurfaces;
 		RENDER_SURFACE_DESC depthStencilSurface;
 	};
 
+	/**
+	 * @brief	Object representing multiple render textures. You may bind this to the pipeline
+	 *			in order to render to all or some of the textures at once.
+	 */
 	class CM_EXPORT MultiRenderTexture : public RenderTarget
 	{
 	public:
 		virtual ~MultiRenderTexture();
 
+		/**
+		 * @copydoc	RenderTarget::initialize
+		 */
 		void initialize(const MULTI_RENDER_TEXTURE_DESC& desc);
 
 		/**
@@ -29,9 +41,6 @@ namespace BansheeEngine
 		bool requiresTextureFlipping() const { return false; }
 
 	protected:
-		Vector<TextureViewPtr> mColorSurfaces;
-		TextureViewPtr mDepthStencilSurface;
-
 		MultiRenderTexture();
 
 		/**
@@ -40,8 +49,17 @@ namespace BansheeEngine
 		virtual void destroy_internal();
 
 	private:
+		/**
+		 * @brief	Checks that all render surfaces and depth/stencil surface match. If they do not match
+		 *			an exception is thrown.
+		 */
 		void throwIfBuffersDontMatch() const;
 
+		// TODO - Not implemented
 		virtual void copyToMemory(const PixelData &dst, FrameBuffer buffer = FB_AUTO);
+
+	protected:
+		Vector<TextureViewPtr> mColorSurfaces;
+		TextureViewPtr mDepthStencilSurface;
 	};
 }