Explorar el Código

More documentation

BearishSun hace 11 años
padre
commit
2d2a8e245f

+ 1 - 1
CamelotCore/CamelotCore.vcxproj

@@ -422,7 +422,6 @@
     <ClInclude Include="Source\CmMeshRTTI.h" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="Include\CmMaterialManager.cpp" />
     <ClCompile Include="Source\BsThreadPolicy.cpp" />
     <ClCompile Include="Source\CmBindableGpuParamBlock.cpp" />
     <ClCompile Include="Source\CmBindableGpuParams.cpp" />
@@ -462,6 +461,7 @@
     <ClCompile Include="Source\CmImportOptions.cpp" />
     <ClCompile Include="Source\CmIndexBuffer.cpp" />
     <ClCompile Include="Source\CmIndexData.cpp" />
+    <ClCompile Include="Source\CmMaterialManager.cpp" />
     <ClCompile Include="Source\CmMeshBase.cpp" />
     <ClCompile Include="Source\CmMeshHeap.cpp" />
     <ClCompile Include="Source\CmMeshManager.cpp" />

+ 3 - 3
CamelotCore/CamelotCore.vcxproj.filters

@@ -680,9 +680,6 @@
     <ClCompile Include="Source\CmMeshManager.cpp">
       <Filter>Source Files\RenderSystem</Filter>
     </ClCompile>
-    <ClCompile Include="Include\CmMaterialManager.cpp">
-      <Filter>Source Files\Material</Filter>
-    </ClCompile>
     <ClCompile Include="Source\CmGpuProgIncludeImporter.cpp">
       <Filter>Source Files\Importer</Filter>
     </ClCompile>
@@ -842,5 +839,8 @@
     <ClCompile Include="Source\CmVideoModeInfo.cpp">
       <Filter>Source Files\RenderSystem</Filter>
     </ClCompile>
+    <ClCompile Include="Source\CmMaterialManager.cpp">
+      <Filter>Source Files\Material</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>

+ 7 - 0
CamelotCore/Include/BsGPUProfiler.h

@@ -6,8 +6,15 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Profiler report containing information about GPU sampling data 
+	 *			from a single frame.
+	 */
 	struct GPUProfilerReport
 	{
+		/**
+		 * @brief	Contains various profiler statistics about a single GPU profiling sample
+		 */
 		struct Sample
 		{
 			String name; /**< Name of the sample for easier identification. */

+ 1 - 1
CamelotCore/Include/BsRenderStats.h

@@ -6,7 +6,7 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Object that keeps track of various render statistics.
+	 * @brief	Object that stores various render statistics.
 	 */
 	struct RenderStats
 	{

+ 4 - 0
CamelotCore/Include/BsThreadPolicy.h

@@ -5,6 +5,10 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Banshee thread policy that performs special startup/shutdown on threads
+	 *			managed by thread pool.
+	 */
 	class CM_EXPORT ThreadBansheePolicy
 	{
 	public:

+ 43 - 29
CamelotCore/Include/CmApplication.h

@@ -7,26 +7,29 @@
 
 namespace BansheeEngine
 {
-	class RenderWindow;
-	class Viewport;
-	class GpuProgramManager;
-}
-
-namespace BansheeEngine
-{
+	/**
+	 * @brief	Structure containing parameters for starting the application.
+	 */
 	struct START_UP_DESC
 	{
-		String renderSystem;
-		String renderer;
+		String renderSystem; /**< Name of the render system plugin to use. */
+		String renderer; /**< Name of the renderer plugin to use. */
 
-		String input;
-		String sceneManager;
+		String input; /**< Name of the input plugin to use. */
+		String sceneManager; /**< Name of the scene manager plugin to use. */
 
-		RENDER_WINDOW_DESC primaryWindowDesc;
+		RENDER_WINDOW_DESC primaryWindowDesc; /**< Describes the window to create during start-up. */
 
-		Vector<String> importers;
+		Vector<String> importers; /**< A list of importer plugins to load. */
 	};
 
+	/**
+	 * @brief	Represents the primary entry point to the engine. Handles
+	 *			start-up, shutdown, primary loop and allows you to load and unload
+	 *			plugins.
+	 *
+	 * @note	Sim thread only.
+	 */
 	class CM_EXPORT Application
 	{
 		public:
@@ -34,13 +37,13 @@ namespace BansheeEngine
 
 			/**
 			 * @brief	Starts the application using the specified options. 
-			 * 			This is how you start the engine.
+			 * 			This is how you start the engine. Must be called before any other engine method.
 			 */
 			void startUp(START_UP_DESC& desc);
 
 			/**
-			 * @brief	Executes the main loop. This will cause actually rendering to be performed
-			 * 			and simulation to be run. Usually called immediately after startUp().
+			 * @brief	Executes the main loop. This will update your components and modules, queue objects 
+			 *			for rendering and run the simulation. Usually called immediately after startUp().
 			 * 			
 			 *			This will run infinitely until stopMainLoop is called (usually from another thread or internally).
 			 */
@@ -48,7 +51,6 @@ namespace BansheeEngine
 
 			/**
 			 * @brief	Stops a (infinite) main loop from running. The loop will complete its current cycle before stopping.
-			 * 			You may call this from other threads.
 			 */
 			void stopMainLoop();
 
@@ -57,19 +59,27 @@ namespace BansheeEngine
 			 */
 			void shutDown();
 
+			// DEPRECATED
 			UINT64 getAppWindowId();
 
+			/**
+			 * @brief	
+			 */
 			RenderWindowPtr getPrimaryWindow() const { return mPrimaryWindow; }
 
 			/**
 			 * @brief	Loads a plugin.
 			 *
-			 * @param	pluginName	Name of the plugin to load, without extension.
+			 * @param	pluginName		Name of the plugin to load, without extension.
+			 * @param	[out] library	Specify as not null to receive a reference to 
+			 *							the loaded library.
+			 * 
+			 * @returns	Value returned from the plugin start-up method.
 			 */
 			void* loadPlugin(const String& pluginName, DynLib** library = nullptr);
 
 			/**
-			 * @brief	Unloads a plugin. 
+			 * @brief	Unloads a previously loaded plugin. 
 			 */
 			void unloadPlugin(DynLib* library);
 
@@ -79,16 +89,6 @@ namespace BansheeEngine
 			Event<void()> mainLoopCallback;
 
 	private:
-		RenderWindowPtr mPrimaryWindow;
-
-		DynLib* mSceneManagerPlugin;
-
-		bool mIsFrameRenderingFinished;
-		CM_MUTEX(mFrameRenderingFinishedMutex);
-		CM_THREAD_SYNCHRONISER(mFrameRenderingFinishedCondition);
-
-		volatile bool mRunMainLoop;
-
 		/**
 		 * @brief	Called when the frame finishes rendering.
 		 */
@@ -103,7 +103,21 @@ namespace BansheeEngine
 		 * @brief	Called by the core thread to end profiling.
 		 */
 		void endCoreProfiling();
+
+	private:
+		RenderWindowPtr mPrimaryWindow;
+
+		DynLib* mSceneManagerPlugin;
+
+		bool mIsFrameRenderingFinished;
+		CM_MUTEX(mFrameRenderingFinishedMutex);
+		CM_THREAD_SYNCHRONISER(mFrameRenderingFinishedCondition);
+
+		volatile bool mRunMainLoop;
 	};
 
+	/**
+	 * @brief	Provides easy access to primary entry point for the engine.
+	 */
 	CM_EXPORT Application& gApplication();
 }

+ 17 - 1
CamelotCore/Include/CmPlatformWndProc.h

@@ -6,21 +6,37 @@
 namespace BansheeEngine
 {
 	/**
+	 * @brief	Contains the main message loop
+	 *
 	 * @note	This is separated from the main Platform because we don't want to include various Windows
-	 * 			defines in a lot of our code that includes "Platform.h"
+	 * 			defines in a lot of our code that includes "Platform.h".
 	 */
 	class CM_EXPORT PlatformWndProc : public Platform
 	{
 	public:
+		/**
+		 * @brief	Main message loop callback that processes messages received from windows.
+		 */
 		static LRESULT CALLBACK _win32WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
 
 	private:
 		static bool isShiftPressed;
 		static bool isCtrlPressed;
 
+		/**
+		 * @brief	Translate engine non client area to win32 non client area.
+		 */
 		static LRESULT translateNonClientAreaType(NonClientAreaBorderType type);
 
+		/**
+		 * @brief	Method triggerend whenever a mouse event happens.
+		 */
 		static void getMouseData(HWND hWnd, WPARAM wParam, LPARAM lParam, Vector2I& mousePos, OSPointerButtonStates& btnStates);
+
+		/**
+		 * @brief	Converts a virtual key code into an input command, if possible. Returns true
+		 *			if conversion was done.
+		 */
 		static bool getCommand(unsigned int virtualKeyCode, InputCommandType& command);
 	};
 }

+ 23 - 23
CamelotCore/Include/CmMaterialManager.cpp → CamelotCore/Source/CmMaterialManager.cpp

@@ -1,24 +1,24 @@
-#include "CmMaterialManager.h"
-#include "CmMaterial.h"
-
-namespace BansheeEngine
-{
-	MaterialPtr MaterialManager::create() const
-	{
-		MaterialPtr newMat = cm_core_ptr<Material, PoolAlloc>(new (cm_alloc<Material, PoolAlloc>()) Material());
-		newMat->_setThisPtr(newMat);
-		newMat->initialize();
-
-		return newMat;
-	}
-
-	MaterialPtr MaterialManager::create(ShaderPtr shader) const
-	{
-		MaterialPtr newMat = cm_core_ptr<Material, PoolAlloc>(new (cm_alloc<Material, PoolAlloc>()) Material());
-		newMat->_setThisPtr(newMat);
-		newMat->initialize();
-		newMat->setShader(shader);
-
-		return newMat;
-	}
+#include "CmMaterialManager.h"
+#include "CmMaterial.h"
+
+namespace BansheeEngine
+{
+	MaterialPtr MaterialManager::create() const
+	{
+		MaterialPtr newMat = cm_core_ptr<Material, PoolAlloc>(new (cm_alloc<Material, PoolAlloc>()) Material());
+		newMat->_setThisPtr(newMat);
+		newMat->initialize();
+
+		return newMat;
+	}
+
+	MaterialPtr MaterialManager::create(ShaderPtr shader) const
+	{
+		MaterialPtr newMat = cm_core_ptr<Material, PoolAlloc>(new (cm_alloc<Material, PoolAlloc>()) Material());
+		newMat->_setThisPtr(newMat);
+		newMat->initialize();
+		newMat->setShader(shader);
+
+		return newMat;
+	}
 }