فهرست منبع

More documentation

Marko Pintera 11 سال پیش
والد
کامیت
927fb6c3e5

+ 1 - 1
BansheeForwardRenderer/Source/BsForwardRendererPlugin.cpp

@@ -11,7 +11,7 @@ namespace BansheeEngine
 
 
 	extern "C" BS_FWDRND_EXPORT void* loadPlugin()
 	extern "C" BS_FWDRND_EXPORT void* loadPlugin()
 	{
 	{
-		RendererManager::instance().registerFactory(cm_shared_ptr<ForwardRendererFactory>());
+		RendererManager::instance()._registerFactory(cm_shared_ptr<ForwardRendererFactory>());
 
 
 		return nullptr;
 		return nullptr;
 	}
 	}

+ 4 - 0
CamelotCore/Include/CmDefaultRenderQueue.h

@@ -5,6 +5,10 @@
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
+	/**
+	 * @brief	Default implementation of a render queue. Just passes
+	 * 			through elements unmodified as they were queued in.
+	 */
 	class CM_EXPORT DefaultRenderQueue : public RenderQueue
 	class CM_EXPORT DefaultRenderQueue : public RenderQueue
 	{
 	{
 	public:
 	public:

+ 4 - 0
CamelotCore/Include/CmRenderOperation.h

@@ -6,6 +6,10 @@
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
+	/**
+	 * @brief	A render operation describing everything we need for rendering
+	 * 			a single object.
+	 */
 	struct CM_EXPORT RenderOperation
 	struct CM_EXPORT RenderOperation
 	{
 	{
 		RenderOperation()
 		RenderOperation()

+ 33 - 0
CamelotCore/Include/CmRenderQueue.h

@@ -4,6 +4,10 @@
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
+	/**
+	 * @brief	Slightly more fine grained version of RenderOperation, as each pass
+	 * 			is specified as an individual operation. Used for sorting within the RenderQueue.
+	 */
 	struct CM_EXPORT SortedRenderOp
 	struct CM_EXPORT SortedRenderOp
 	{
 	{
 		SortedRenderOp()
 		SortedRenderOp()
@@ -14,15 +18,44 @@ namespace BansheeEngine
 		UINT32 passIdx;
 		UINT32 passIdx;
 	};
 	};
 
 
+	/**
+	 * @brief	Render objects determines rendering order of objects contained within it. Normally the rendering
+	 * 			order is determined by object material, and can influence rendering of transparent or opaque objects,
+	 * 			or be used to improve performance by grouping similar objects together.
+	 * 			
+	 *			You need to provide your own implementation of the render queue sorting method. Likely the sorting method
+	 *			will need to be closely tied to the renderer used.
+	 */
 	class CM_EXPORT RenderQueue
 	class CM_EXPORT RenderQueue
 	{
 	{
 	public:
 	public:
 		RenderQueue();
 		RenderQueue();
 
 
+		/**
+		 * @brief	Adds a new render operation to the rendering queue. These operations will be sorted
+		 * 			and rendered by the Renderer in sorted order.
+		 *
+		 * @param	material	   	The material to use for rendering the object.
+		 * @param	mesh		   	The mesh to render.
+		 * @param	submeshIdx	   	Sub-mesh index in "mesh" to render.
+		 * @param	worldPosForSort	The world position used for sorting.
+		 */
 		void add(const MaterialPtr& material, const MeshBasePtr& mesh, UINT32 submeshIdx, const Vector3& worldPosForSort);
 		void add(const MaterialPtr& material, const MeshBasePtr& mesh, UINT32 submeshIdx, const Vector3& worldPosForSort);
+
+		/**
+		 * @brief	Clears all render operations from the queue.
+		 */
 		void clear();
 		void clear();
 		
 		
+		/**
+		 * @brief	Sorts all the render operations using user-defined rules.
+		 */
 		virtual void sort() = 0;
 		virtual void sort() = 0;
+
+		/**
+		 * @brief	Returns a list of sorted render operations. Caller must ensure
+		 * 			"sort" is called before this method.
+		 */
 		const Vector<SortedRenderOp>::type& getSortedRenderOps() const;
 		const Vector<SortedRenderOp>::type& getSortedRenderOps() const;
 
 
 	protected:
 	protected:

+ 14 - 1
CamelotCore/Include/CmRenderer.h

@@ -6,16 +6,29 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Allows you to customize how are objects rendered. You need to
+	 * 			provide your own implementation of your class.
+	 */
 	class CM_EXPORT Renderer
 	class CM_EXPORT Renderer
 	{
 	{
 	public:
 	public:
+		/**
+		 * @brief	Name of the renderer. Used by materials to find 
+		 * 			an appropriate technique for this renderer.
+		 */
 		virtual const String& getName() const = 0;
 		virtual const String& getName() const = 0;
 
 
 		/**
 		/**
-		 * @brief	Renders all cameras.
+		 * @brief	Called in order to render all currentlx active cameras.
 		 */
 		 */
 		virtual void renderAll() = 0;
 		virtual void renderAll() = 0;
 
 
+		/**
+		 * @brief	Allows you to register a callback for the specified viewport. The callback
+		 * 			will be called before rendering and you will be able to populate the
+		 * 			render queue with render commands that will be executed when rendering.
+		 */
 		void addRenderCallback(const Viewport* viewport, std::function<void(const Viewport*, RenderQueue&)> callback);
 		void addRenderCallback(const Viewport* viewport, std::function<void(const Viewport*, RenderQueue&)> callback);
 
 
 	protected:
 	protected:

+ 16 - 0
CamelotCore/Include/CmRendererFactory.h

@@ -4,10 +4,26 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Factory class for creating Renderer objects. Implement
+	 * 			this class for any custom renderer classes you may have,
+	 * 			and register it with renderer manager.
+	 * 			
+	 * @see		RendererManager
+	 * 			
+	 * @note	Internal class.
+	 */
 	class CM_EXPORT RendererFactory
 	class CM_EXPORT RendererFactory
 	{
 	{
 	public:
 	public:
+		/**
+		 * @brief	Creates a new renderer.
+		 */
 		virtual RendererPtr create() = 0;
 		virtual RendererPtr create() = 0;
+
+		/**
+		 * @brief	Returns the name of the renderer this factory creates.
+		 */
 		virtual const String& name() const = 0;
 		virtual const String& name() const = 0;
 	};
 	};
 }
 }

+ 26 - 2
CamelotCore/Include/CmRendererManager.h

@@ -6,10 +6,24 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Allows you to change and retrieve the active renderer. Active renderer will
+	 * 			be used for rendering all objects in the following frame.
+	 * 			
+	 * @note	No renderer is active by default. You must make a renderer active before doing any rendering.
+	 */
 	class CM_EXPORT RendererManager : public Module<RendererManager>
 	class CM_EXPORT RendererManager : public Module<RendererManager>
 	{
 	{
 	public:
 	public:
+		/**
+		 * @brief	Attempts to find a renderer with the specified name and makes it active.
+		 * 			Exception is thrown if renderer with the specified name doesn't exist.
+		 */
 		void setActive(const String& name);
 		void setActive(const String& name);
+
+		/**
+		 * @brief	Returns the currently active renderer. Null if no renderer is active.
+		 */
 		RendererPtr getActive() { return mActiveRenderer; }
 		RendererPtr getActive() { return mActiveRenderer; }
 
 
 		/**
 		/**
@@ -17,11 +31,21 @@ namespace BansheeEngine
 		 * 			Techniques using this renderer name will report as if they are supported regardless
 		 * 			Techniques using this renderer name will report as if they are supported regardless
 		 * 			of the active renderer.
 		 * 			of the active renderer.
 		 *
 		 *
-		 * @return	The core renderer name.
+		 * @note	Useful when you want to make a technique working on all renderers. (Normally techniques
+		 * 			need to be different as far as render system is concerned but can often be same from
+		 * 			renderers perspective).
+		 * 			
+		 * @see		Technique
 		 */
 		 */
 		static const String& getCoreRendererName();
 		static const String& getCoreRendererName();
 
 
-		void registerFactory(RendererFactoryPtr factory);
+		/**
+		 * @brief	Registers a new renderer factory. Any renderer you try to make active with
+		 * 			"setActive" you will need to have previously registered here.
+		 *
+		 * @note	Internal method.
+		 */
+		void _registerFactory(RendererFactoryPtr factory);
 	private:
 	private:
 		Vector<RendererFactoryPtr>::type mAvailableFactories;
 		Vector<RendererFactoryPtr>::type mAvailableFactories;
 
 

+ 1 - 1
CamelotCore/Source/CmRendererManager.cpp

@@ -31,7 +31,7 @@ namespace BansheeEngine
 		return name;
 		return name;
 	}
 	}
 
 
-	void RendererManager::registerFactory(RendererFactoryPtr factory)
+	void RendererManager::_registerFactory(RendererFactoryPtr factory)
 	{
 	{
 		assert(factory != nullptr);
 		assert(factory != nullptr);
 
 

+ 31 - 7
Inspector.txt

@@ -3,6 +3,37 @@ Test new ScriptObject* system
 
 
 When I change an object in InspectableObject field I probably need to rebuild entire GUI hierarchy for that object. Right now I'm not.
 When I change an object in InspectableObject field I probably need to rebuild entire GUI hierarchy for that object. Right now I'm not.
 
 
+-----------------------------------------------
+FINE GRAINED TASKS
+
+- Add GUIUtility and a way how to calculate GUILayout height for use in inspectors
+
+- Determine how will InspectorFields update child GUI elements. i.e. when number of elements in an array changes.
+
+- Ensure all C++ editor fields have:
+ - onValueChanged
+ - setValue/getValue
+ - undo/redo functionality
+
+- Ensure that focus lost gets sent even when element gets destroyed. Otherwise UndoRedo buffer will fail to be properly cleared.
+
+- Extend text field so it can be multi-line
+- Add label to foldout
+- Extend GameObject field so it can only accept a certain type
+- Add ResourceField to C++
+
+- Port to C#:
+ - IntField
+ - FloatField
+ - ColorField
+ - ToggleField
+ - TextField
+ - Vector2Field
+ - Vector3Field
+ - Vector4Field
+ - GameObjectField
+ - ResourceField
+
 -----------------------------------------------
 -----------------------------------------------
 LESS IMPORTANT
 LESS IMPORTANT
 
 
@@ -16,13 +47,6 @@ A way to close a window & destroy a GUI panel!
 
 
 Ensure that setting depth for GUIArea works properly. It's not properly implemented yet.
 Ensure that setting depth for GUIArea works properly. It's not properly implemented yet.
 
 
-Missing C++ field types:
- - Array field/List field/Dictionary field
- - Matrix3 field
- - Matrix4 field
- - GameObject field
- - Resource field
-
 UndoRedo should work on URI type basis where it remembers object ID, and path across its fields to the field that was modified
 UndoRedo should work on URI type basis where it remembers object ID, and path across its fields to the field that was modified
  - This way it wont keep an unnecessary reference to object
  - This way it wont keep an unnecessary reference to object
  - SerializableField should probably be the type responsible for handling the URI
  - SerializableField should probably be the type responsible for handling the URI