Ver Fonte

More documentation

Marko Pintera há 11 anos atrás
pai
commit
cf1081eeeb

+ 1 - 0
CamelotCore/CamelotCore.vcxproj

@@ -429,6 +429,7 @@
     <ClCompile Include="Source\CmCPUProfiler.cpp" />
     <ClCompile Include="Source\CmCPUProfiler.cpp" />
     <ClCompile Include="Source\CmDefaultRenderQueue.cpp" />
     <ClCompile Include="Source\CmDefaultRenderQueue.cpp" />
     <ClCompile Include="Source\CmDeferredCallManager.cpp" />
     <ClCompile Include="Source\CmDeferredCallManager.cpp" />
+    <ClCompile Include="Source\CmDrawOps.cpp" />
     <ClCompile Include="Source\CmEventQuery.cpp" />
     <ClCompile Include="Source\CmEventQuery.cpp" />
     <ClCompile Include="Source\CmGameObjectHandle.cpp" />
     <ClCompile Include="Source\CmGameObjectHandle.cpp" />
     <ClCompile Include="Source\CmGameObject.cpp" />
     <ClCompile Include="Source\CmGameObject.cpp" />

+ 6 - 6
CamelotCore/CamelotCore.vcxproj.filters

@@ -16,9 +16,6 @@
     <Filter Include="Header Files\Utility">
     <Filter Include="Header Files\Utility">
       <UniqueIdentifier>{2c09857e-4a4a-480f-8ebb-1661a9ce78dd}</UniqueIdentifier>
       <UniqueIdentifier>{2c09857e-4a4a-480f-8ebb-1661a9ce78dd}</UniqueIdentifier>
     </Filter>
     </Filter>
-    <Filter Include="Source Files\Utility">
-      <UniqueIdentifier>{48d2fcc6-cfa6-4d2f-a83c-d16ec65eb96b}</UniqueIdentifier>
-    </Filter>
     <Filter Include="Header Files\RenderSystem">
     <Filter Include="Header Files\RenderSystem">
       <UniqueIdentifier>{3480589d-111c-44b8-b0f1-a178cd00f31e}</UniqueIdentifier>
       <UniqueIdentifier>{3480589d-111c-44b8-b0f1-a178cd00f31e}</UniqueIdentifier>
     </Filter>
     </Filter>
@@ -477,9 +474,6 @@
     <ClInclude Include="Include\CmQueryManager.h">
     <ClInclude Include="Include\CmQueryManager.h">
       <Filter>Header Files\RenderSystem</Filter>
       <Filter>Header Files\RenderSystem</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\CmTimerQuery.h">
-      <Filter>Source Files\RenderSystem</Filter>
-    </ClInclude>
     <ClInclude Include="Include\CmMeshHeap.h">
     <ClInclude Include="Include\CmMeshHeap.h">
       <Filter>Header Files\Resources</Filter>
       <Filter>Header Files\Resources</Filter>
     </ClInclude>
     </ClInclude>
@@ -534,6 +528,9 @@
     <ClInclude Include="Include\BsRenderStats.h">
     <ClInclude Include="Include\BsRenderStats.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
+    <ClInclude Include="Include\CmTimerQuery.h">
+      <Filter>Header Files\RenderSystem</Filter>
+    </ClInclude>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClCompile Include="Source\CmApplication.cpp">
     <ClCompile Include="Source\CmApplication.cpp">
@@ -836,5 +833,8 @@
     <ClCompile Include="Source\BsGPUProfiler.cpp">
     <ClCompile Include="Source\BsGPUProfiler.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
+    <ClCompile Include="Source\CmDrawOps.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 1 - 32
CamelotCore/Include/CmDrawOps.h

@@ -22,36 +22,5 @@ namespace BansheeEngine
 	* @brief	Converts the number of vertices to number of primitives
 	* @brief	Converts the number of vertices to number of primitives
 	* 			based on the specified draw operation.
 	* 			based on the specified draw operation.
 	*/
 	*/
-	UINT32 vertexCountToPrimCount(DrawOperationType type, UINT32 elementCount)
-	{
-		UINT32 primCount = 0;
-		switch (type)
-		{
-		case DOT_POINT_LIST:
-			primCount = elementCount;
-			break;
-
-		case DOT_LINE_LIST:
-			primCount = elementCount / 2;
-			break;
-
-		case DOT_LINE_STRIP:
-			primCount = elementCount - 1;
-			break;
-
-		case DOT_TRIANGLE_LIST:
-			primCount = elementCount / 3;
-			break;
-
-		case DOT_TRIANGLE_STRIP:
-			primCount = elementCount - 2;
-			break;
-
-		case DOT_TRIANGLE_FAN:
-			primCount = elementCount - 2;
-			break;
-		}
-
-		return primCount;
-	}
+	UINT32 CM_UTILITY_EXPORT vertexCountToPrimCount(DrawOperationType type, UINT32 elementCount);
 }
 }

+ 1 - 0
CamelotCore/Include/CmPrerequisites.h

@@ -173,6 +173,7 @@ namespace BansheeEngine
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	typedef std::shared_ptr<RenderSystem> RenderSystemPtr;
 	typedef std::shared_ptr<GpuProgram> GpuProgramPtr;
 	typedef std::shared_ptr<GpuProgram> GpuProgramPtr;
 	typedef std::shared_ptr<PixelBuffer> PixelBufferPtr;
 	typedef std::shared_ptr<PixelBuffer> PixelBufferPtr;
 	typedef std::shared_ptr<VertexBuffer> VertexBufferPtr;
 	typedef std::shared_ptr<VertexBuffer> VertexBufferPtr;

+ 9 - 9
CamelotCore/Include/CmRenderSystemCapabilities.h

@@ -4,17 +4,17 @@
 #include "CmString.h"
 #include "CmString.h"
 #include "CmGpuProgram.h"
 #include "CmGpuProgram.h"
 
 
-#define CAPS_CATEGORY_SIZE 8
-#define CM_CAPS_BITSHIFT (64 - CAPS_CATEGORY_SIZE)
-#define CAPS_CATEGORY_MASK (((1 << CAPS_CATEGORY_SIZE) - 1) << CM_CAPS_BITSHIFT)
-#define CM_CAPS_VALUE(cat, val) ((cat << CM_CAPS_BITSHIFT) | (1 << val))
+#define CAPS_CATEGORY_SIZE 8i64
+#define CM_CAPS_BITSHIFT (64i64 - CAPS_CATEGORY_SIZE)
+#define CAPS_CATEGORY_MASK (((1i64 << CAPS_CATEGORY_SIZE) - 1i64) << CM_CAPS_BITSHIFT)
+#define CM_CAPS_VALUE(cat, val) ((cat << CM_CAPS_BITSHIFT) | (1i64 << val))
 
 
 #define MAX_BOUND_VERTEX_BUFFERS 32
 #define MAX_BOUND_VERTEX_BUFFERS 32
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
 	/// Enumerates the categories of capabilities
 	/// Enumerates the categories of capabilities
-	enum CapabilitiesCategory
+	enum CapabilitiesCategory : UINT64
 	{
 	{
 		CAPS_CATEGORY_COMMON = 0,
 		CAPS_CATEGORY_COMMON = 0,
 		CAPS_CATEGORY_D3D9 = 1,
 		CAPS_CATEGORY_D3D9 = 1,
@@ -311,7 +311,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void setCapability(const Capabilities c) 
 		void setCapability(const Capabilities c) 
 		{ 
 		{ 
-			int index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
+			UINT64 index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
 			mCapabilities[index] |= (c & ~CAPS_CATEGORY_MASK);
 			mCapabilities[index] |= (c & ~CAPS_CATEGORY_MASK);
 		}
 		}
 
 
@@ -321,7 +321,7 @@ namespace BansheeEngine
 		 */
 		 */
 		void unsetCapability(const Capabilities c) 
 		void unsetCapability(const Capabilities c) 
 		{ 
 		{ 
-			int index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
+			UINT64 index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
 			mCapabilities[index] &= (~c | CAPS_CATEGORY_MASK);
 			mCapabilities[index] &= (~c | CAPS_CATEGORY_MASK);
 		}
 		}
 
 
@@ -330,9 +330,9 @@ namespace BansheeEngine
 		 */
 		 */
 		bool hasCapability(const Capabilities c) const
 		bool hasCapability(const Capabilities c) const
 		{
 		{
-			int index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
+			UINT64 index = (CAPS_CATEGORY_MASK & c) >> CM_CAPS_BITSHIFT;
 
 
-			return (mCapabilities[index] & (c & ~CAPS_CATEGORY_MASK));
+			return (mCapabilities[index] & (c & ~CAPS_CATEGORY_MASK)) != 0;
 		}
 		}
 
 
 		/**
 		/**

+ 11 - 3
CamelotCore/Include/CmRenderSystemFactory.h

@@ -4,13 +4,21 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
-	class RenderSystem;
-	typedef std::shared_ptr<RenderSystem> RenderSystemPtr;
-
+	/**
+	 * @brief	Factory class that you may specialize in order to start up
+	 *			a specific render system.
+	 */
 	class RenderSystemFactory
 	class RenderSystemFactory
 	{
 	{
 	public:
 	public:
+		/**
+		 * @brief	Creates and starts up the render system managed by this factory. 
+		 */
 		virtual void create() = 0;
 		virtual void create() = 0;
+
+		/**
+		 * @brief	Returns the name of the render system this factory creates.
+		 */
 		virtual const String& name() const = 0;
 		virtual const String& name() const = 0;
 	};
 	};
 }
 }

+ 15 - 0
CamelotCore/Include/CmRenderSystemManager.h

@@ -8,14 +8,29 @@ namespace BansheeEngine
 {
 {
 	typedef std::shared_ptr<RenderSystemFactory> RenderSystemFactoryPtr;
 	typedef std::shared_ptr<RenderSystemFactory> RenderSystemFactoryPtr;
 
 
+	/**
+	 * @brief	Manager that handles render system start up.
+	 */
 	class CM_EXPORT RenderSystemManager : public Module<RenderSystemManager>
 	class CM_EXPORT RenderSystemManager : public Module<RenderSystemManager>
 	{
 	{
 	public:
 	public:
 		RenderSystemManager();
 		RenderSystemManager();
 		~RenderSystemManager();
 		~RenderSystemManager();
 
 
+		/**
+		 * @brief	Starts the render system with the provided name and creates the primary render window.
+		 *
+		 * @param	name				Name of the render system to start. Factory for this render system must be previously
+		 *								registered.
+		 * @param	primaryWindowDesc	Contains options used for creating the primary window.
+		 *
+		 * @returns	Created render window if initialization is successful, null otherwise.
+		 */
 		RenderWindowPtr initialize(const String& name, RENDER_WINDOW_DESC& primaryWindowDesc);
 		RenderWindowPtr initialize(const String& name, RENDER_WINDOW_DESC& primaryWindowDesc);
 
 
+		/**
+		 * @brief	Registers a new render system factory responsible for creating a specific render system type.
+		 */
 		void registerRenderSystemFactory(RenderSystemFactoryPtr factory);
 		void registerRenderSystemFactory(RenderSystemFactoryPtr factory);
 	private:
 	private:
 		Vector<RenderSystemFactoryPtr> mAvailableFactories;
 		Vector<RenderSystemFactoryPtr> mAvailableFactories;

+ 87 - 30
CamelotCore/Include/CmRenderTarget.h

@@ -1,34 +1,6 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #pragma once
 #pragma once
 
 
 #include "CmPrerequisites.h"
 #include "CmPrerequisites.h"
-
 #include "CmString.h"
 #include "CmString.h"
 #include "CmPixelUtil.h"
 #include "CmPixelUtil.h"
 #include "CmViewport.h"
 #include "CmViewport.h"
@@ -37,6 +9,10 @@ THE SOFTWARE.
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
+	/**
+	 * @brief	Structure that contains information about
+	 *			what part of the texture represents the render surface.
+	 */
 	struct CM_EXPORT RENDER_SURFACE_DESC
 	struct CM_EXPORT RENDER_SURFACE_DESC
 	{
 	{
 		TexturePtr texture;
 		TexturePtr texture;
@@ -45,9 +21,18 @@ namespace BansheeEngine
 		UINT32 mipLevel;
 		UINT32 mipLevel;
 	};
 	};
 
 
+	/**
+	 * @brief	Render target is a frame buffer or a texture that the render
+	 *			system renders to.
+	 *
+	 * @note	Thread safe, except where noted otherwise.
+	 */
     class CM_EXPORT RenderTarget : public CoreObject
     class CM_EXPORT RenderTarget : public CoreObject
     {
     {
     public:
     public:
+		/**
+		 * @brief	Frame buffer type when double-buffering is used.
+		 */
 		enum FrameBuffer
 		enum FrameBuffer
 		{
 		{
 			FB_FRONT,
 			FB_FRONT,
@@ -57,35 +42,88 @@ namespace BansheeEngine
 
 
         virtual ~RenderTarget();
         virtual ~RenderTarget();
 
 
+		/**
+		 * @brief	Returns a name of the render target, used for easier identification.
+		 */
         const String& getName() const { return mName; }
         const String& getName() const { return mName; }
+
+		/**
+		 * @brief	Returns width of the render target, in pixels.
+		 */
         UINT32 getWidth() const { return mWidth; }
         UINT32 getWidth() const { return mWidth; }
+
+		/**
+		 * @brief	Returns height of the render target, in pixels.
+		 */
         UINT32 getHeight() const { return mHeight; }
         UINT32 getHeight() const { return mHeight; }
+
+		/**
+		 * @brief	Returns the number of bits a single color value of the 
+		 *			render target format takes.
+		 */
 		UINT32 getColorDepth() const { return mColorDepth; }
 		UINT32 getColorDepth() const { return mColorDepth; }
+
+		/**
+		 * @brief	Returns full screen antialiasing amount. Meaning of this value
+		 *			depends on anti-aliasing type used.
+		 */
 		UINT32 getFSAA() const { return mFSAA; }
 		UINT32 getFSAA() const { return mFSAA; }
+
+		/**
+		 * @brief	Returns a hint used for telling render system what type of 
+		 *			antialiasing to use.
+		 */
 		const String& getFSAAHint() const { return mFSAAHint; }
 		const String& getFSAAHint() const { return mFSAAHint; }
 
 
 		/**
 		/**
-		 * @brief	Returns true if the render target will wait for vertical sync before swapping buffers.
+		 * @brief	Returns true if the render target will wait for vertical sync 
+		 *			before swapping buffers. This will eliminate tearing but may increase
+		 *			input latency.
 		 */
 		 */
 		bool getVSync() const { return mVSync; }
 		bool getVSync() const { return mVSync; }
 
 
+		/**
+		 * @brief	Queries the render target for a custom attribute. This may be anything and is
+		 *			implementation specific.
+		 *
+		 * @note	Core thread only.
+		 */
 		virtual void getCustomAttribute(const String& name, void* pData) const;
 		virtual void getCustomAttribute(const String& name, void* pData) const;
 
 
 		/**
 		/**
 		 * @brief	Returns true if the render target is a render window.
 		 * @brief	Returns true if the render target is a render window.
 		 */
 		 */
 		virtual bool isWindow() const = 0;
 		virtual bool isWindow() const = 0;
+
+		/**
+		 * @brief	Returns true if the render target can be used for rendering.
+		 *
+		 * @note	Core thread only.
+		 */
 		bool isActive() const { return mActive; }
 		bool isActive() const { return mActive; }
+
+		/**
+		 * @brief	Returns true if pixels written to the render target will be gamma corrected.
+		 */
 		bool isHwGammaEnabled() const { return mHwGamma; }
 		bool isHwGammaEnabled() const { return mHwGamma; }
 
 
+		/**
+		 * @brief	Makes the render target active or inactive. (e.g. for a window, it will hide or restore the window).
+		 *
+		 * @note	Core thread only.
+		 */
 		virtual void setActive(bool state) { mActive = state; }
 		virtual void setActive(bool state) { mActive = state; }
 
 
+		/**
+		 * @brief	Returns render target priority. Targets with higher priority will be 
+		 *			rendered before ones with lower priority.
+		 */
 		INT32 getPriority() const { return mPriority; }
 		INT32 getPriority() const { return mPriority; }
 
 
 		/**
 		/**
 		 * @brief	Sets a priority that determines in which orders the render targets the processed.
 		 * @brief	Sets a priority that determines in which orders the render targets the processed.
 		 * 			
 		 * 			
-		 * @param	priority	The priority. Higher value means the target will be rendered to sooner.
+		 * @param	priority	The priority. Higher value means the target will be rendered sooner.
 		 */
 		 */
 		void setPriority(INT32 priority) { mPriority = priority; }
 		void setPriority(INT32 priority) { mPriority = priority; }
 
 
@@ -95,9 +133,28 @@ namespace BansheeEngine
 		 * @note	Core thread only.
 		 * @note	Core thread only.
          */
          */
 		virtual void swapBuffers() {};
 		virtual void swapBuffers() {};
+
+		/**
+		 * @brief	Copy data from the render target into the provided pixel buffer. 
+		 *
+		 * @param	dst		Destination buffer to copy the data to. Caller must ensure the buffer is of adequate size.
+		 * @param	buffer	Which buffer is data taken from. This is irrelevant for single buffer render targets.
+		 *
+		 * @note	Core thread only.
+		 */
 		virtual void copyToMemory(const PixelData &dst, FrameBuffer buffer = FB_AUTO) = 0;
 		virtual void copyToMemory(const PixelData &dst, FrameBuffer buffer = FB_AUTO) = 0;
+
+		/**
+		 * @brief	Does the texture need to be vertically flipped because of different screen space coordinate systems.
+		 *			(i.e. is origin top left or bottom left. Engine default is top left.)
+		 */
 		virtual bool requiresTextureFlipping() const = 0;
 		virtual bool requiresTextureFlipping() const = 0;
 
 
+		/**
+		 * @brief	Event that gets triggered whenever the render target is resized.
+		 *
+		 * @note	Sim thread only.
+		 */
 		mutable Event<void()> onResized;
 		mutable Event<void()> onResized;
     protected:
     protected:
 		RenderTarget();
 		RenderTarget();

+ 53 - 34
CamelotCore/Include/CmRenderTexture.h

@@ -1,30 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #pragma once
 #pragma once
 
 
 #include "CmPrerequisites.h"
 #include "CmPrerequisites.h"
@@ -33,23 +6,43 @@ THE SOFTWARE.
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {    
 {    
+	/**
+	 * @brief	Structure that describes a render texture color and depth/stencil surfaces.
+	 */
 	struct CM_EXPORT RENDER_TEXTURE_DESC
 	struct CM_EXPORT RENDER_TEXTURE_DESC
 	{
 	{
 		RENDER_SURFACE_DESC colorSurface;
 		RENDER_SURFACE_DESC colorSurface;
 		RENDER_SURFACE_DESC depthStencilSurface;
 		RENDER_SURFACE_DESC depthStencilSurface;
 	};
 	};
 
 
+	/**
+	 * @brief	Render target specialization that allows you to render into a texture you may
+	 *			later bind in further render operations.
+	 *
+	 * @note	Thread safe, except where noted otherwise.
+	 */
     class CM_EXPORT RenderTexture : public RenderTarget
     class CM_EXPORT RenderTexture : public RenderTarget
     {
     {
 	public:
 	public:
 		virtual ~RenderTexture();
 		virtual ~RenderTexture();
 
 
+		/**
+		 * @brief	Creates a new render texture with color and optionally depth/stencil surfaces.
+		 *
+		 * @param	textureType			Type of texture to render to.
+		 * @param	width				Width of the render texture, in pixels.
+		 * @param	height				Height of the render texture, in pixels.
+		 * @param	format				Pixel format used by the texture color surface.
+		 * @param	hwGamma				Should the written pixels be gamma corrected.
+		 * @param	fsaa				Amount of full screen anti-aliasing the render texture supports.
+		 * @param	fsaaHint			Hint about what type of anti-aliasing the render texture supports.
+		 * @param	createDepth			Should a depth/stencil surface be created along with the color surface.
+		 * @param	depthStencilFormat	Format used by the depth stencil surface, if one is created.
+		 */
 		static RenderTexturePtr create(TextureType textureType, UINT32 width, UINT32 height, 
 		static RenderTexturePtr create(TextureType textureType, UINT32 width, UINT32 height, 
 			PixelFormat format = PF_R8G8B8A8, bool hwGamma = false, UINT32 fsaa = 0, const String& fsaaHint = "", 
 			PixelFormat format = PF_R8G8B8A8, bool hwGamma = false, UINT32 fsaa = 0, const String& fsaaHint = "", 
 			bool createDepth = true, PixelFormat depthStencilFormat = PF_D24S8);
 			bool createDepth = true, PixelFormat depthStencilFormat = PF_D24S8);
 
 
-		void initialize(const RENDER_TEXTURE_DESC& desc);
-
 		/**
 		/**
 		 * @copydoc RenderTarget::isWindow.
 		 * @copydoc RenderTarget::isWindow.
 		 */
 		 */
@@ -60,24 +53,50 @@ namespace BansheeEngine
 		 */
 		 */
 		bool requiresTextureFlipping() const { return false; }
 		bool requiresTextureFlipping() const { return false; }
 
 
+		/**
+		 * @brief	Returns a color surface texture you may bind as an input to an GPU program.
+		 *
+		 * @note	Be aware that you cannot bind a render texture for reading and writing at the same time.
+		 */
 		const HTexture& getBindableColorTexture() const { return mBindableColorTex; }
 		const HTexture& getBindableColorTexture() const { return mBindableColorTex; }
+
+		/**
+		* @brief	Returns a depth/stencil surface texture you may bind as an input to an GPU program.
+		*
+		* @note		Be aware that you cannot bind a render texture for reading and writing at the same time.
+		*/
 		const HTexture& getBindableDepthStencilTexture() const { return mBindableDepthStencilTex; }
 		const HTexture& getBindableDepthStencilTexture() const { return mBindableDepthStencilTex; }
-	protected:
-		TextureViewPtr mColorSurface;
-		TextureViewPtr mDepthStencilSurface;
 
 
-		HTexture mBindableColorTex;
-		HTexture mBindableDepthStencilTex;
+	protected:
+		friend class TextureManager;
 
 
 		RenderTexture();
 		RenderTexture();
 
 
+		/**
+		 * @copydoc	RenderTarget::initialize
+		 */
+		void initialize(const RENDER_TEXTURE_DESC& desc);
+
 		/**
 		/**
 		 * @copydoc RenderTarget::destroy_internal()
 		 * @copydoc RenderTarget::destroy_internal()
 		 */
 		 */
 		virtual void destroy_internal();
 		virtual void destroy_internal();
 	private:
 	private:
+		/**
+		 * @brief	Throws an exception of the color and depth/stencil buffers aren't compatible.
+		 */
 		void throwIfBuffersDontMatch() const;
 		void throwIfBuffersDontMatch() const;
 
 
+		/**
+		 * @copydoc	RenderTarget::copyToMemory
+		 */
 		virtual void copyToMemory(const PixelData &dst, FrameBuffer buffer = FB_AUTO);
 		virtual void copyToMemory(const PixelData &dst, FrameBuffer buffer = FB_AUTO);
+
+	protected:
+		TextureViewPtr mColorSurface;
+		TextureViewPtr mDepthStencilSurface;
+
+		HTexture mBindableColorTex;
+		HTexture mBindableDepthStencilTex;
 	};
 	};
 }
 }

+ 81 - 59
CamelotCore/Include/CmRenderWindow.h

@@ -1,28 +1,3 @@
-/*-------------------------------------------------------------------------
-This source file is a part of OGRE
-(Object-oriented Graphics Rendering Engine)
-
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE
--------------------------------------------------------------------------*/
 #pragma once
 #pragma once
 
 
 #include "CmPrerequisites.h"
 #include "CmPrerequisites.h"
@@ -32,6 +7,9 @@ THE SOFTWARE
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Enum that defines possible window border styles.
+	 */
 	enum class WindowBorder
 	enum class WindowBorder
 	{
 	{
 		Normal,
 		Normal,
@@ -39,6 +17,9 @@ namespace BansheeEngine
 		Fixed
 		Fixed
 	};
 	};
 
 
+	/**
+	 * @brief	Structure that is used for initializing a render window.
+	 */
 	struct CM_EXPORT RENDER_WINDOW_DESC
 	struct CM_EXPORT RENDER_WINDOW_DESC
 	{
 	{
 		RENDER_WINDOW_DESC()
 		RENDER_WINDOW_DESC()
@@ -50,54 +31,68 @@ namespace BansheeEngine
 			, monitorIndex(-1), toolWindow(false), modal(false)
 			, monitorIndex(-1), toolWindow(false), modal(false)
 		{ }
 		{ }
 
 
-		UINT32 width;
-		UINT32 height;
-		bool fullscreen;
-		bool vsync;
-		UINT32 vsyncInterval;
-		bool hidden;
-		UINT32 displayFrequency;
-		UINT32 colorDepth;
-		bool depthBuffer;
-		UINT32 FSAA;
-		String FSAAHint;
-		bool gamma;
-		INT32 left; // -1 == screen center
-		INT32 top; // -1 == screen center
-		String title;
-		WindowBorder border;
-		bool outerDimensions;
-		bool enableDoubleClick;
-		bool toolWindow;
-		bool modal;
-		INT32 monitorIndex; // -1 == select based on coordinates
-
-		NameValuePairList platformSpecific;
+		UINT32 width; /**< Width of the window in pixels. */
+		UINT32 height; /**< Height of the window in pixels. */
+		bool fullscreen; /**< Should the window be created in full-screen mode. */
+		bool vsync; /**< Should the window wait for vertical sync before swapping buffers. */
+		UINT32 vsyncInterval; /**< Determines how many vsync intervals occur per frame. FPS = refreshRate/interval. Usually 1 when vsync active. */
+		bool hidden; /**< Should the window be hidden. */
+		UINT32 displayFrequency; /**< Display frequency of the screen to use in hertz. */
+		UINT32 colorDepth; /**< Depth of the color buffer in bits. This is the size of a single pixel in color buffer. */
+		bool depthBuffer; /**< Should the window be created with a depth/stencil buffer. */
+		UINT32 FSAA; /**< Amount of full-screen anti-aliasing. Usually means number of samples per pixel. */
+		String FSAAHint; /**< Hint to the render system as to which anti-aliasing method to use. */
+		bool gamma; /**< Should the written color pixels be gamma corrected before write. */
+		INT32 left; /**< Window origin on X axis in pixels. -1 == screen center. */
+		INT32 top; /**< Window origin on Y axis in pixels. -1 == screen center. */
+		String title; /**< Title of the window. */
+		WindowBorder border; /**< Type of border to create the window with. */
+		bool outerDimensions; /**< Do our dimensions include space for things like title-bar and border. */
+		bool enableDoubleClick; /**< Does window accept double-clicks. */
+		bool toolWindow; /**< Tool windows don't include standard window controls. */
+		bool modal; /**< When a modal window is open all other windows will be locked until modal window is closed. */
+		INT32 monitorIndex; /**< Index of the monitor to create the window on. -1 == select based on coordinates */
+
+		NameValuePairList platformSpecific; /**< Platform-specific creation options. */
 	};
 	};
 
 
+	/**
+	 * @brief	Render target specialization that allows you to render into window
+	 *			frame buffer(s).
+	 *
+	 * @note	Thread safe, except where noted otherwise.
+	 */
     class CM_EXPORT RenderWindow : public RenderTarget
     class CM_EXPORT RenderWindow : public RenderTarget
     {
     {
     public:
     public:
 		virtual ~RenderWindow();
 		virtual ~RenderWindow();
 
 
 		/** 
 		/** 
-		 *	@brief Core method. Alter fullscreen mode options.
+		 * @brief	Toggle between full-screen and windowed mode, and optionally
+		 *			change resolution.
+		 *
+		 * @note	Core thread.
 		 */
 		 */
-		virtual void setFullscreen(bool fullScreen, UINT32 width, UINT32 height)
-                { (void)fullScreen; (void)width; (void)height; }
+		virtual void setFullscreen(bool fullScreen, UINT32 width, UINT32 height) { }
 
 
         /**
         /**
-         * @brief	Core method. Set the visibility state.
+         * @brief	Hide or show the window.
+		 *
+		 * @note	Core thread.
          */
          */
         virtual void setHidden(bool hidden);
         virtual void setHidden(bool hidden);
 
 
         /**
         /**
-         * @brief	Core method. Alter the size of the window.
+         * @brief	Change the size of the window.
+		 *
+		 * @note	Core thread.
          */
          */
         virtual void resize(UINT32 width, UINT32 height) = 0;
         virtual void resize(UINT32 width, UINT32 height) = 0;
 
 
         /**
         /**
-         * @brief	Core method. Reposition the window.
+         * @brief	Reposition the window.
+		 *
+		 * @note	Core thread.
          */
          */
         virtual void move(INT32 left, INT32 top) = 0;
         virtual void move(INT32 left, INT32 top) = 0;
 
 
@@ -117,12 +112,12 @@ namespace BansheeEngine
         virtual bool isActive() const { return mActive && isVisible(); }
         virtual bool isActive() const { return mActive && isVisible(); }
 
 
         /** 
         /** 
-        * @brief Indicates whether the window has been closed by the user.
+        * @brief	Indicates whether the window has been closed by the user.
 		*/
 		*/
         virtual bool isClosed() const = 0;
         virtual bool isClosed() const = 0;
         
         
         /** 
         /** 
-        * @brief Returns true if window is running in fullscreen mode.
+        * @brief	Returns true if window is running in fullscreen mode.
 		*/
 		*/
         virtual bool isFullScreen() const;
         virtual bool isFullScreen() const;
 
 
@@ -131,7 +126,14 @@ namespace BansheeEngine
 		 */
 		 */
 		bool isModal() const { return mDesc.modal; }
 		bool isModal() const { return mDesc.modal; }
 
 
+		/**
+		 * @brief	Gets the horizontal origin of the window in pixels.
+		 */
 		INT32 getLeft() const { return mLeft; }
 		INT32 getLeft() const { return mLeft; }
+
+		/**
+		 * @brief	Gets the vertical origin of the window in pixels.
+		 */
 		INT32 getTop() const { return mTop; }
 		INT32 getTop() const { return mTop; }
 
 
 		/**
 		/**
@@ -139,11 +141,25 @@ namespace BansheeEngine
 		 */
 		 */
 		bool hasFocus() const { return mHasFocus; }
 		bool hasFocus() const { return mHasFocus; }
 
 
+		/**
+		 * @brief	Converts screen position into window local position.
+		 */
 		virtual Vector2I screenToWindowPos(const Vector2I& screenPos) const = 0;
 		virtual Vector2I screenToWindowPos(const Vector2I& screenPos) const = 0;
+
+		/**
+		 * @brief	Converts window local position to screen position.
+		 */
 		virtual Vector2I windowToScreenPos(const Vector2I& windowPos) const = 0;
 		virtual Vector2I windowToScreenPos(const Vector2I& windowPos) const = 0;
 
 
+		/**
+		 * @copydoc	RenderTarget::destroy
+		 */
 		virtual void destroy();
 		virtual void destroy();
 
 
+		/**
+		 * @brief	Creates a new render window using the specified options. Optionally
+		 *			makes the created window a child of another window.
+		 */
 		static RenderWindowPtr create(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow = nullptr);
 		static RenderWindowPtr create(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow = nullptr);
 
 
     protected:
     protected:
@@ -152,17 +168,23 @@ namespace BansheeEngine
         RenderWindow(const RENDER_WINDOW_DESC& desc);
         RenderWindow(const RENDER_WINDOW_DESC& desc);
 
 
 		/**
 		/**
-         * @brief	Internal method. Core method. Called when window is moved or resized.
+         * @brief	Called when window is moved or resized.
+		 *
+		 * @note	Core thread.
          */
          */
         virtual void _windowMovedOrResized();
         virtual void _windowMovedOrResized();
 
 
 		/**
 		/**
-         * @brief	Internal method. Core method. Called when window has received focus.
+         * @brief	Called when window has received focus.
+		 *
+		 * @note	Core thread.
          */
          */
 		virtual void _windowFocusReceived();
 		virtual void _windowFocusReceived();
 
 
 		/**
 		/**
-         * @brief	Internal method. Core method. Called when window has lost focus.
+         * @brief	Called when window has lost focus.
+		 *
+		 * @note	Core thread.
          */
          */
 		virtual void _windowFocusLost();
 		virtual void _windowFocusLost();
         
         

+ 48 - 11
CamelotCore/Include/CmRenderWindowManager.h

@@ -7,40 +7,77 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Handles creation and internal updates relating to render windows.
+	 *
+	 * @note	Sim thread.
+	 */
 	class CM_EXPORT RenderWindowManager : public Module<RenderWindowManager>
 	class CM_EXPORT RenderWindowManager : public Module<RenderWindowManager>
 	{
 	{
 	public:
 	public:
 		RenderWindowManager();
 		RenderWindowManager();
 
 
 		/**
 		/**
-		 * @brief	Creates a new rendering window.
-		 */
+		* @brief	Creates a new render window using the specified options. Optionally
+		*			makes the created window a child of another window.
+		*/
 		RenderWindowPtr create(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow);
 		RenderWindowPtr create(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow);
 
 
 		/**
 		/**
-		 * @brief	Called once per frame. Dispatches events. Internal method.
+		 * @brief	Called once per frame. Dispatches events.
+		 * 
+		 * @note	Internal method.
 		 */
 		 */
-		void update();
+		void _update();
 
 
+		/**
+		 * @brief	Returns a list of all open render windows.
+		 */
 		Vector<RenderWindow*> getRenderWindows() const;
 		Vector<RenderWindow*> getRenderWindows() const;
 
 
+		/**
+		 * @brief	Event that is triggered when a window gains focus.
+		 */
 		Event<void(RenderWindow&)> onFocusGained;
 		Event<void(RenderWindow&)> onFocusGained;
+
+		/**
+		 * @brief	Event that is triggered when a window loses focus.
+		 */
 		Event<void(RenderWindow&)> onFocusLost;
 		Event<void(RenderWindow&)> onFocusLost;
 	protected:
 	protected:
 		friend class RenderWindow;
 		friend class RenderWindow;
 
 
-		CM_MUTEX(mWindowMutex);
-		Vector<RenderWindow*> mCreatedWindows;
-
-		RenderWindow* mWindowInFocus;
-		RenderWindow* mNewWindowInFocus;
-		Vector<RenderWindow*> mMovedOrResizedWindows;
-
+		/**
+		 * @copydoc	create
+		 */
 		virtual RenderWindowPtr createImpl(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow) = 0;
 		virtual RenderWindowPtr createImpl(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow) = 0;
 
 
+		/**
+		 * @brief	Called by the core thread when window is destroyed.
+		 */
 		void windowDestroyed(RenderWindow* window);
 		void windowDestroyed(RenderWindow* window);
+
+		/**
+		 * @brief	Called by the core thread when window receives focus.
+		 */
 		void windowFocusReceived(RenderWindow* window);
 		void windowFocusReceived(RenderWindow* window);
+
+		/**
+		 * @brief	Called by the core thread when window loses focus.
+		 */
 		void windowFocusLost(RenderWindow* window);
 		void windowFocusLost(RenderWindow* window);
+
+		/**
+		 * @brief	Called by the core thread when window is moved or resized.
+		 */
 		void windowMovedOrResized(RenderWindow* window);
 		void windowMovedOrResized(RenderWindow* window);
+
+	protected:
+		CM_MUTEX(mWindowMutex);
+		Vector<RenderWindow*> mCreatedWindows;
+
+		RenderWindow* mWindowInFocus;
+		RenderWindow* mNewWindowInFocus;
+		Vector<RenderWindow*> mMovedOrResizedWindows;
 	};
 	};
 }
 }

+ 40 - 33
CamelotCore/Include/CmSamplerState.h

@@ -11,26 +11,24 @@
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
+	/**
+	 * @brief	Structure used for initializing a SamplerState.
+	 *
+	 * @see		SamplerState
+	 */
 	struct CM_EXPORT SAMPLER_STATE_DESC
 	struct CM_EXPORT SAMPLER_STATE_DESC
 	{
 	{
 		SAMPLER_STATE_DESC()
 		SAMPLER_STATE_DESC()
-			: minFilter(FO_LINEAR)
-			, magFilter(FO_LINEAR)
-			, mipFilter(FO_POINT)
-			, maxAniso(0)
-			, mipmapBias(0)
-			, comparisonFunc(CMPF_ALWAYS_FAIL)
-			, mipMin(-FLT_MAX)
-			, mipMax(FLT_MAX)
-			, borderColor(Color::White)
-		{
-		}
+			: minFilter(FO_LINEAR), magFilter(FO_LINEAR), mipFilter(FO_POINT), 
+			maxAniso(0), mipmapBias(0), comparisonFunc(CMPF_ALWAYS_FAIL), mipMin(-FLT_MAX), 
+			mipMax(FLT_MAX), borderColor(Color::White)
+		{ }
 
 
 		UVWAddressingMode addressMode;
 		UVWAddressingMode addressMode;
 		FilterOptions minFilter;
 		FilterOptions minFilter;
 		FilterOptions magFilter;
 		FilterOptions magFilter;
 		FilterOptions mipFilter;
 		FilterOptions mipFilter;
-		unsigned int maxAniso;
+		UINT32 maxAniso;
 		float mipmapBias;
 		float mipmapBias;
 		float mipMin;
 		float mipMin;
 		float mipMax;
 		float mipMax;
@@ -38,33 +36,33 @@ namespace BansheeEngine
 		CompareFunction comparisonFunc;
 		CompareFunction comparisonFunc;
 	};
 	};
 
 
-	// TODO Low priority - Write doc explaining various states
 	/**
 	/**
-	* @brief	Class representing the state of a single sampler unit during a Pass of a Technique, of a Material.
+	* @brief	Class representing the state of a texture sampler.
 	*	
 	*	
-	* @note		Sampler units are pipelines for retrieving texture data for rendering onto
-	*			your objects in the world.
-	*
-	*			Try not to make modifications to a created sampler state. Any modification will require the sampler state to
-	*			be recreated internally (depending on used render system). It is better to have multiple SamplerState objects with different
-	*			configurations and re-use them.
+	* @note		Sampler units are used for retrieving and filtering data from
+	*			textures set in a GPU program.
+	*			Sampler states are immutable. Thread safe.
 	*/
 	*/
 	class CM_EXPORT SamplerState : public Resource
 	class CM_EXPORT SamplerState : public Resource
     {
     {
     public:
     public:
 		virtual ~SamplerState() {}
 		virtual ~SamplerState() {}
 
 
-        /** Gets the texture addressing mode for a given coordinate, 
-		 	i.e. what happens at uv values above 1.0.
-        @note
-        	The default is TAM_WRAP i.e. the texture repeats over values of 1.0.
-        */
+		/**
+		 * @brief	Returns texture addressing mode for each possible texture coordinate. Addressing
+		 *			modes determine how are texture coordinates outside of [0, 1] range handled.
+		 */
 		const UVWAddressingMode& getTextureAddressingMode() const { return mData.addressMode; }
 		const UVWAddressingMode& getTextureAddressingMode() const { return mData.addressMode; }
 
 
-        // get the texture filtering for the given type
+		/**
+		 * @brief	Gets the filtering used when sampling from a texture.
+		 */
         FilterOptions getTextureFiltering(FilterType ftpye) const;
         FilterOptions getTextureFiltering(FilterType ftpye) const;
 
 
-        // get this layer texture anisotropy level
+		/**
+		 * @brief	Gets the anisotropy level. Higher anisotropy means better filtering
+		 *			for textures displayed on an angled slope relative to the viewer.
+		 */
 		unsigned int getTextureAnisotropy() const { return mData.maxAniso; }
 		unsigned int getTextureAnisotropy() const { return mData.maxAniso; }
 
 
 		/**
 		/**
@@ -72,36 +70,45 @@ namespace BansheeEngine
 		 */
 		 */
 		CompareFunction getComparisonFunction() const { return mData.comparisonFunc; }
 		CompareFunction getComparisonFunction() const { return mData.comparisonFunc; }
 
 
-		/** Gets the bias value applied to the mipmap calculation.
-		@see TextureUnitState::setTextureMipmapBias
+		/**
+		* @brief	Mipmap bias allows you to adjust the mipmap selection calculation. Negative values 
+		*			force a larger mipmap to be used, and positive values smaller. Units are in values
+		*			of mip levels, so -1 means use a mipmap one level higher than default.
 		*/
 		*/
 		float getTextureMipmapBias() const { return mData.mipmapBias; }
 		float getTextureMipmapBias() const { return mData.mipmapBias; }
 
 
 		/**
 		/**
-		 * @brief	Returns the minimum mip level limit.
+		 * @brief	Returns the minimum mip map level.
 		 */
 		 */
 		float getMinimumMip() const { return mData.mipMin; }
 		float getMinimumMip() const { return mData.mipMin; }
 
 
 		/**
 		/**
-		 * @brief	Returns the maximum mip level limit.
+		 * @brief	Returns the maximum mip map level.
 		 */
 		 */
 		float getMaximumMip() const { return mData.mipMax; }
 		float getMaximumMip() const { return mData.mipMax; }
 
 
 		/**
 		/**
-		 * @brief	Gets the border color
+		 * @brief	Gets the border color that will be used when border texture addressing is used
+		 *			and texture address is outside of the valid range.
 		 */
 		 */
 		const Color& getBorderColor() const;
 		const Color& getBorderColor() const;
 
 
+		/**
+		 * @brief	Creates a new sampler state using the provided descriptor structure.
+		 */
 		static HSamplerState create(const SAMPLER_STATE_DESC& desc);
 		static HSamplerState create(const SAMPLER_STATE_DESC& desc);
 
 
 		/**
 		/**
-		 * @brief	Returns the default sampler state;
+		 * @brief	Returns the default sampler state.
 		 */
 		 */
 		static const SamplerStatePtr& getDefault();
 		static const SamplerStatePtr& getDefault();
 
 
 	protected:
 	protected:
 		friend class RenderStateManager;
 		friend class RenderStateManager;
 
 
+		/**
+		* @brief	Initializes the sampler state. Must be called right after construction.
+		*/
 		virtual void initialize(const SAMPLER_STATE_DESC& desc);
 		virtual void initialize(const SAMPLER_STATE_DESC& desc);
 
 
         SAMPLER_STATE_DESC mData;
         SAMPLER_STATE_DESC mData;

+ 4 - 0
CamelotCore/Include/CmSubMesh.h

@@ -5,6 +5,10 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Contains a data about sub-mesh range and the type of
+	 *			primitives contained in the range.
+	 */
 	struct CM_EXPORT SubMesh
 	struct CM_EXPORT SubMesh
 	{
 	{
 		SubMesh()
 		SubMesh()

+ 3 - 0
CamelotCore/Include/CmTextureView.h

@@ -6,6 +6,9 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	/**
+	 * @brief	Data describing a texture view.
+	 */
 	struct CM_EXPORT TEXTURE_VIEW_DESC
 	struct CM_EXPORT TEXTURE_VIEW_DESC
 	{
 	{
 		UINT32 mostDetailMip;
 		UINT32 mostDetailMip;

+ 1 - 1
CamelotCore/Source/CmApplication.cpp

@@ -108,7 +108,7 @@ namespace BansheeEngine
 			gCoreThread().update();
 			gCoreThread().update();
 			Platform::_update();
 			Platform::_update();
 			DeferredCallManager::instance().update();
 			DeferredCallManager::instance().update();
-			RenderWindowManager::instance().update();
+			RenderWindowManager::instance()._update();
 			gInput()._update();
 			gInput()._update();
 
 
 			PROFILE_CALL(gSceneManager().update(), "SceneManager");
 			PROFILE_CALL(gSceneManager().update(), "SceneManager");

+ 37 - 0
CamelotCore/Source/CmDrawOps.cpp

@@ -0,0 +1,37 @@
+#include "CmDrawOps.h"
+
+namespace BansheeEngine
+{
+	UINT32 vertexCountToPrimCount(DrawOperationType type, UINT32 elementCount)
+	{
+		UINT32 primCount = 0;
+		switch (type)
+		{
+		case DOT_POINT_LIST:
+			primCount = elementCount;
+			break;
+
+		case DOT_LINE_LIST:
+			primCount = elementCount / 2;
+			break;
+
+		case DOT_LINE_STRIP:
+			primCount = elementCount - 1;
+			break;
+
+		case DOT_TRIANGLE_LIST:
+			primCount = elementCount / 3;
+			break;
+
+		case DOT_TRIANGLE_STRIP:
+			primCount = elementCount - 2;
+			break;
+
+		case DOT_TRIANGLE_FAN:
+			primCount = elementCount - 2;
+			break;
+		}
+
+		return primCount;
+	}
+}

+ 0 - 28
CamelotCore/Source/CmPixelUtil.cpp

@@ -1,31 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
 #include "CmPixelUtil.h"
 #include "CmPixelUtil.h"
 #include "CmBitwise.h"
 #include "CmBitwise.h"
 #include "CmColor.h"
 #include "CmColor.h"

+ 2 - 30
CamelotCore/Source/CmRenderTarget.cpp

@@ -1,38 +1,10 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmRenderTarget.h"
 #include "CmRenderTarget.h"
-
 #include "CmViewport.h"
 #include "CmViewport.h"
 #include "CmException.h"
 #include "CmException.h"
 #include "CmRenderSystem.h"
 #include "CmRenderSystem.h"
 
 
-namespace BansheeEngine {
-
+namespace BansheeEngine 
+{
     RenderTarget::RenderTarget()
     RenderTarget::RenderTarget()
 		:mActive(true), mHwGamma(false), mVSync(false), mFSAA(0),
 		:mActive(true), mHwGamma(false), mVSync(false), mFSAA(0),
 		mWidth(0), mHeight(0), mColorDepth(0), mPriority(0)
 		mWidth(0), mHeight(0), mColorDepth(0), mPriority(0)

+ 0 - 28
CamelotCore/Source/CmRenderTexture.cpp

@@ -1,31 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
 #include "CmRenderTexture.h"
 #include "CmRenderTexture.h"
 #include "CmException.h"
 #include "CmException.h"
 #include "CmPixelBuffer.h"
 #include "CmPixelBuffer.h"

+ 0 - 27
CamelotCore/Source/CmRenderWindow.cpp

@@ -1,30 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmRenderWindow.h"
 #include "CmRenderWindow.h"
 #include "CmCoreThread.h"
 #include "CmCoreThread.h"
 #include "CmRenderWindowManager.h"
 #include "CmRenderWindowManager.h"

+ 1 - 1
CamelotCore/Source/CmRenderWindowManager.cpp

@@ -85,7 +85,7 @@ namespace BansheeEngine
 			mMovedOrResizedWindows.push_back(window);
 			mMovedOrResizedWindows.push_back(window);
 	}
 	}
 
 
-	void RenderWindowManager::update()
+	void RenderWindowManager::_update()
 	{
 	{
 		RenderWindow* newWinInFocus = nullptr;
 		RenderWindow* newWinInFocus = nullptr;
 		Vector<RenderWindow*> movedOrResizedWindows;
 		Vector<RenderWindow*> movedOrResizedWindows;

+ 0 - 27
CamelotCore/Source/CmTexture.cpp

@@ -1,30 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmPixelBuffer.h"
 #include "CmPixelBuffer.h"
 #include "CmTexture.h"
 #include "CmTexture.h"
 #include "CmTextureRTTI.h"
 #include "CmTextureRTTI.h"

+ 0 - 27
CamelotCore/Source/CmTextureManager.cpp

@@ -1,30 +1,3 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
 #include "CmTextureManager.h"
 #include "CmTextureManager.h"
 #include "CmException.h"
 #include "CmException.h"
 #include "CmPixelUtil.h"
 #include "CmPixelUtil.h"