Forráskód Böngészése

More documentation

Marko Pintera 11 éve
szülő
commit
8d97ad0802
28 módosított fájl, 587 hozzáadás és 198 törlés
  1. 25 0
      BansheeCore/Include/BsTextureView.h
  2. 10 0
      BansheeD3D11RenderSystem/Include/BsD3D11MultiRenderTexture.h
  3. 15 12
      BansheeD3D11RenderSystem/Include/BsD3D11OcclusionQuery.h
  4. 3 0
      BansheeD3D11RenderSystem/Include/BsD3D11QueryManager.h
  5. 6 2
      BansheeD3D11RenderSystem/Include/BsD3D11RasterizerState.h
  6. 18 0
      BansheeD3D11RenderSystem/Include/BsD3D11RenderStateManager.h
  7. 119 13
      BansheeD3D11RenderSystem/Include/BsD3D11RenderSystem.h
  8. 14 0
      BansheeD3D11RenderSystem/Include/BsD3D11RenderSystemFactory.h
  9. 10 0
      BansheeD3D11RenderSystem/Include/BsD3D11RenderTexture.h
  10. 19 2
      BansheeD3D11RenderSystem/Include/BsD3D11RenderUtility.h
  11. 37 5
      BansheeD3D11RenderSystem/Include/BsD3D11RenderWindow.h
  12. 4 1
      BansheeD3D11RenderSystem/Include/BsD3D11RenderWindowManager.h
  13. 6 2
      BansheeD3D11RenderSystem/Include/BsD3D11SamplerState.h
  14. 106 26
      BansheeD3D11RenderSystem/Include/BsD3D11Texture.h
  15. 17 1
      BansheeD3D11RenderSystem/Include/BsD3D11TextureManager.h
  16. 93 12
      BansheeD3D11RenderSystem/Include/BsD3D11TextureView.h
  17. 5 2
      BansheeD3D11RenderSystem/Include/BsD3D11TimerQuery.h
  18. 6 0
      BansheeD3D11RenderSystem/Include/BsD3D11VertexBuffer.h
  19. 1 12
      BansheeD3D11RenderSystem/Source/BsD3D11RenderSystem.cpp
  20. 0 8
      BansheeD3D11RenderSystem/Source/BsD3D11RenderWindow.cpp
  21. 14 14
      BansheeD3D11RenderSystem/Source/BsD3D11TextureView.cpp
  22. 1 1
      BansheeD3D9RenderSystem/Include/BsD3D9MultiRenderTexture.h
  23. 0 6
      BansheeD3D9RenderSystem/Include/BsD3D9RenderSystem.h
  24. 31 17
      BansheeD3D9RenderSystem/Include/BsD3D9RenderSystemFactory.h
  25. 1 1
      BansheeD3D9RenderSystem/Include/BsD3D9RenderWindow.h
  26. 0 60
      BansheeD3D9RenderSystem/Source/BsD3D9RenderSystem.cpp
  27. 1 1
      BansheeGLRenderSystem/Include/BsWin32Window.h
  28. 25 0
      Polish.txt

+ 25 - 0
BansheeCore/Include/BsTextureView.h

@@ -10,10 +10,35 @@ namespace BansheeEngine
 	 */
 	struct BS_CORE_EXPORT TEXTURE_VIEW_DESC
 	{
+		/**
+		 * First mip level of the parent texture the view binds (0 - base level). 
+		 * This applied to all array slices specified below.
+		 */
 		UINT32 mostDetailMip;
+
+		/**
+		 * Number of mip levels to bind to the view. 
+		 * This applied to all array slices specified below.
+		 */
 		UINT32 numMips;
+
+		/**
+		 * First array slice the view binds to. This will be array index for 
+		 * 1D and 2D array textures, texture slice index for 3D textures, and 
+		 * face index for cube textures(cube index * 6).
+ 		 */
 		UINT32 firstArraySlice;
+
+		/**
+		 * Number of array slices to bind tot he view. This will be number of
+		 * array elements for 1D and 2D array textures, number of slices for 3D textures,
+		 * and number of cubes for cube textures.
+		 */
 		UINT32 numArraySlices;
+
+		/**
+		 *	Type of texture view.
+		 */
 		GpuViewUsage usage;
 	};
 

+ 10 - 0
BansheeD3D11RenderSystem/Include/BsD3D11MultiRenderTexture.h

@@ -5,12 +5,22 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	DirectX 11 implementation of a render texture with multiple color surfaces.
+	 */
 	class BS_D3D11_EXPORT D3D11MultiRenderTexture : public MultiRenderTexture
 	{
 	public:
 		virtual ~D3D11MultiRenderTexture();
 
+		/**
+		 * @copydoc	MultiRenderTexture::requiresTextureFlipping
+		 */
 		bool requiresTextureFlipping() const { return false; }
+
+		/**
+		 * @copydoc	MultiRenderTexture::getCustomAttribute
+		 */
 		void getCustomAttribute(const String& name, void* pData) const;
 	protected:
 		friend class D3D11TextureManager;

+ 15 - 12
BansheeD3D11RenderSystem/Include/BsD3D11OcclusionQuery.h

@@ -6,8 +6,8 @@
 namespace BansheeEngine
 {
 	/**
-	* @copydoc OcclusionQuery
-	*/
+	 * @copydoc OcclusionQuery
+	 */
 	class BS_D3D11_EXPORT D3D11OcclusionQuery : public OcclusionQuery
 	{
 	public:
@@ -15,35 +15,38 @@ namespace BansheeEngine
 		~D3D11OcclusionQuery();
 
 		/**
-		* @copydoc OcclusionQuery::begin
-		*/
+		 * @copydoc OcclusionQuery::begin
+		 */
 		virtual void begin();
 
 		/**
-		* @copydoc OcclusionQuery::end
-		*/
+		 * @copydoc OcclusionQuery::end
+		 */
 		virtual void end();
 
 		/**
-		* @copydoc OcclusionQuery::isReady
-		*/
+		 * @copydoc OcclusionQuery::isReady
+		 */
 		virtual bool isReady() const;
 
 		/**
-		* @copydoc OcclusionQuery::getNumFragments
-		*/
+		 * @copydoc OcclusionQuery::getNumFragments
+		 */
 		virtual UINT32 getNumSamples();
 
 	private:
 		friend class QueryManager;
 
+		/**
+		 * @brief	Resolves query results after it is ready.
+		 */
+		void finalize();
+
 		ID3D11Query* mQuery;
 		ID3D11DeviceContext* mContext;
 		bool mFinalized;
 		bool mQueryEndCalled;
 
 		UINT32 mNumSamples;
-
-		void finalize();
 	};
 }

+ 3 - 0
BansheeD3D11RenderSystem/Include/BsD3D11QueryManager.h

@@ -5,6 +5,9 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Handles creation of DirectX 11 queries.
+	 */
 	class BS_D3D11_EXPORT D3D11QueryManager : public QueryManager
 	{
 	public:

+ 6 - 2
BansheeD3D11RenderSystem/Include/BsD3D11RasterizerState.h

@@ -5,6 +5,10 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	DirectX 11 implementation of a rasterizer state. Wraps a DX11
+	 *			rasterizer state object.
+	 */
 	class BS_D3D11_EXPORT D3D11RasterizerState : public RasterizerState
 	{
 	public:
@@ -17,12 +21,12 @@ namespace BansheeEngine
 		D3D11RasterizerState();
 
 		/**
-		 * @copydoc RasterizerState::initialize_internal().
+		 * @copydoc RasterizerState::initialize_internal
 		 */
 		void initialize_internal();
 
 		/**
-		 * @copydoc RasterizerState::destroy_internal().
+		 * @copydoc RasterizerState::destroy_internal
 		 */
 		void destroy_internal();
 

+ 18 - 0
BansheeD3D11RenderSystem/Include/BsD3D11RenderStateManager.h

@@ -5,12 +5,30 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Handles creation of DirectX 11 pipeline states.
+	 */
 	class BS_D3D11_EXPORT D3D11RenderStateManager : public RenderStateManager
 	{
 	protected:
+		/**
+		 * @copydoc	RenderStateManager::createSamplerStateImpl
+		 */
 		virtual SamplerStatePtr createSamplerStateImpl() const;
+
+		/**
+		 * @copydoc	RenderStateManager::createBlendStateImpl
+		 */
 		virtual BlendStatePtr createBlendStateImpl() const;
+
+		/**
+		 * @copydoc	RenderStateManager::createRasterizerStateImpl
+		 */
 		virtual RasterizerStatePtr createRasterizerStateImpl() const;
+
+		/**
+		 * @copydoc	RenderStateManager::createDepthStencilStateImpl
+		 */
 		virtual DepthStencilStatePtr createDepthStencilStateImpl() const;
 	};
 }

+ 119 - 13
BansheeD3D11RenderSystem/Include/BsD3D11RenderSystem.h

@@ -5,6 +5,10 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Implementation of a render system using DirectX 11. Provides abstracted
+	 *			access to various low level DX11 methods.
+	 */
 	class BS_D3D11_EXPORT D3D11RenderSystem : public RenderSystem
 	{
 	public:
@@ -12,49 +16,108 @@ namespace BansheeEngine
 		~D3D11RenderSystem();
 
 		/**
-		 * @copydoc RenderSystem::getName()
+		 * @copydoc RenderSystem::getName
 		 */
 		const String& getName() const;
 		
 		/**
-		 * @copydoc RenderSystem::getShadingLanguageName()
+		 * @copydoc RenderSystem::getShadingLanguageName
 		 */
 		const String& getShadingLanguageName() const;
 
+		/**
+		 * @copydoc	RenderSystem::setBlendState
+		 */
 		void setBlendState(const BlendStatePtr& blendState);
+
+		/**
+		 * @copydoc	RenderSystem::setRasterizerState
+		 */
 		void setRasterizerState(const RasterizerStatePtr& rasterizerState);
+
+		/**
+		 * @copydoc	RenderSystem::setDepthStencilState
+		 */
 		void setDepthStencilState(const DepthStencilStatePtr& depthStencilState, UINT32 stencilRefValue);
 
+		/**
+		 * @copydoc	RenderSystem::setSamplerState
+		 */
 		void setSamplerState(GpuProgramType gptype, UINT16 texUnit, const SamplerStatePtr& samplerState);
+
+		/**
+		 * @copydoc	RenderSystem::setTexture
+		 */
 		void setTexture(GpuProgramType gptype, UINT16 unit, bool enabled, const TexturePtr &texPtr);
+
+		/**
+		 * @copydoc	RenderSystem::disableTextureUnit
+		 */
 		void disableTextureUnit(GpuProgramType gptype, UINT16 texUnit);
 
+		/**
+		 * @copydoc	RenderSystem::beginFrame
+		 */
 		void beginFrame();
+
+		/**
+		 * @copydoc	RenderSystem::endFrame
+		 */
 		void endFrame();
 
 		/**
-		 * @copydoc RenderSystem::clearRenderTarget()
+		 * @copydoc RenderSystem::clearRenderTarget
 		 */
 		void clearRenderTarget(UINT32 buffers, const Color& color = Color::Black, float depth = 1.0f, UINT16 stencil = 0);
 
 		/**
-		 * @copydoc RenderSystem::clearViewport()
+		 * @copydoc RenderSystem::clearViewport
 		 */
 		void clearViewport(UINT32 buffers, const Color& color = Color::Black, float depth = 1.0f, UINT16 stencil = 0);
 
+		/**
+		 * @copydoc	RenderSystem::setRenderTarget
+		 */
 		void setRenderTarget(RenderTargetPtr target);
+
+		/**
+		 * @copydoc	RenderSystem::setViewport
+		 */
 		void setViewport(Viewport vp);
+
+		/**
+		 * @copydoc	RenderSystem::setScissorRect
+		 */
 		void setScissorRect(UINT32 left, UINT32 top, UINT32 right, UINT32 bottom);
 
+		/**
+		 * @copydoc	RenderSystem::setVertexBuffers
+		 */
 		void setVertexBuffers(UINT32 index, VertexBufferPtr* buffers, UINT32 numBuffers);
+
+		/**
+		 * @copydoc	RenderSystem::setIndexBuffer
+		 */
 		void setIndexBuffer(const IndexBufferPtr& buffer);
+
+		/**
+		 * @copydoc	RenderSystem::setVertexDeclaration
+		 */
 		void setVertexDeclaration(VertexDeclarationPtr vertexDeclaration);
+
+		/**
+		 * @copydoc	RenderSystem::setDrawOperation
+		 */
 		void setDrawOperation(DrawOperationType op);
 
-		/** @copydoc RenderSystem::draw() */
+		/**
+		 * @copydoc	RenderSystem::draw
+		 */
 		void draw(UINT32 vertexOffset, UINT32 vertexCount);
 
-		/** @copydoc RenderSystem::drawIndexed() */
+		/**
+		 * @copydoc	RenderSystem::drawIndexed
+		 */
 		void drawIndexed(UINT32 startIndex, UINT32 indexCount, UINT32 vertexOffset, UINT32 vertexCount);
 
 		/** 
@@ -72,30 +135,67 @@ namespace BansheeEngine
 		 */
 		void bindGpuParams(GpuProgramType gptype, GpuParamsPtr params);
 		
+		/**
+		 * @copydoc	RenderSystem::setClipPlanesImpl
+		 */
 		void setClipPlanesImpl(const PlaneList& clipPlanes);
 
-		RenderSystemCapabilities* createRenderSystemCapabilities() const;
-		void initialiseFromRenderSystemCapabilities(RenderSystemCapabilities* caps);
-
+		/**
+		 * @copydoc	RenderSystem::convertProjectionMatrix
+		 */
 		void convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, bool forGpuProgram = false);
+
+		/**
+		 * @copydoc	RenderSystem::getColorVertexElementType
+		 */
 		VertexElementType getColorVertexElementType() const;
+
+		/**
+		 * @copydoc	RenderSystem::getHorizontalTexelOffset
+		 */
 		float getHorizontalTexelOffset();
+
+		/**
+		 * @copydoc	RenderSystem::getVerticalTexelOffset
+		 */
 		float getVerticalTexelOffset();
+
+		/**
+		 * @copydoc	RenderSystem::getMinimumDepthInputValue
+		 */
 		float getMinimumDepthInputValue();
+
+		/**
+		 * @copydoc	RenderSystem::getMaximumDepthInputValue
+		 */
 		float getMaximumDepthInputValue();
 
 		/************************************************************************/
 		/* 				Internal use by DX11 RenderSystem only                  */
 		/************************************************************************/
 
+		/**
+		 * @brief	Determines DXGI multisample settings from the provided parameters.
+		 *
+		 * @param	multisampleCount	Number of requested samples.
+		 * @param	multisampleHint		String describing an optional hint to which multisample method to use.
+		 * @param	format				Pixel format used by the render target.
+		 * @param	outputSampleDesc	Output structure that will contain the requested multisample settings.
+		 */
 		void determineMultisampleSettings(UINT32 multisampleCount, const String& multisampleHint, DXGI_FORMAT format, DXGI_SAMPLE_DESC* outputSampleDesc);
-		bool checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage);
 
+		/**
+		 * @brief	Returns the main DXGI factory object.
+		 */
 		IDXGIFactory* getDXGIFactory() const { return mDXGIFactory; }
+
+		/**
+		 * @brief	Returns the primary DX11 device object.
+		 */
 		D3D11Device& getPrimaryDevice() const { return *mDevice; }
 		
 		/**
-		 * @brief	Returns a total number of outputs (e.g. monitors), across all adapters.
+		 * @brief	Returns information describing all available drivers.
 		 */
 		D3D11DriverList* getDriverList() const { return mDriverList; }
 
@@ -103,12 +203,12 @@ namespace BansheeEngine
 		friend class D3D11RenderSystemFactory;
 
 		/**
-		 * @copydoc	RenderSystem::initialize_internal().
+		 * @copydoc	RenderSystem::initialize_internal
 		 */
 		void initialize_internal(AsyncOp& asyncOp);
 
 		/**
-		 * @copydoc	RenderSystem::destroy_internal().
+		 * @copydoc	RenderSystem::destroy_internal
 		 */
         void destroy_internal();
 
@@ -120,6 +220,12 @@ namespace BansheeEngine
 		 */
 		void applyInputLayout();
 
+		/**
+		 * @brief	Creates and populates a set of render system capabilities describing which functionality
+		 *			is available.
+		 */
+		RenderSystemCapabilities* createRenderSystemCapabilities() const;
+
 	private:
 		IDXGIFactory* mDXGIFactory;
 		D3D11Device* mDevice;

+ 14 - 0
BansheeD3D11RenderSystem/Include/BsD3D11RenderSystemFactory.h

@@ -9,13 +9,27 @@ namespace BansheeEngine
 {
 	const String SystemName = "BansheeD3D11RenderSystem";
 
+	/**
+	 * @brief	Handles creation of the DX11 render system.
+	 */
 	class D3D11RenderSystemFactory : public RenderSystemFactory
 	{
 	public:
+		/**
+		 * @copydoc	RenderSystemFactory::create
+		 */
 		virtual void create();
+
+		/**
+		 * @copydoc	RenderSystemFactory::name
+		 */
 		virtual const String& name() const { return SystemName; }
 
 	private:
+
+		/**
+		 * @brief	Registers the factory with the render system manager when constructed.
+		 */
 		class InitOnStart
 		{
 		public:

+ 10 - 0
BansheeD3D11RenderSystem/Include/BsD3D11RenderTexture.h

@@ -6,12 +6,22 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	DirectX 11 implementation of a render texture.
+	 */
 	class D3D11RenderTexture : public RenderTexture
 	{
 	public:
 		virtual ~D3D11RenderTexture();
 
+		/**
+		 * @copydoc	RenderTexture::requiresTextureFlipping
+		 */
 		bool requiresTextureFlipping() const { return false; }
+
+		/**
+		 * @copydoc	RenderTexture::getCustomAttribute
+		 */
 		void getCustomAttribute(const String& name, void* pData) const;
 
 	protected:

+ 19 - 2
BansheeD3D11RenderSystem/Include/BsD3D11RenderUtility.h

@@ -5,19 +5,36 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Helper class for DX11 rendering.
+	 */
 	class D3D11RenderUtility : public Module<D3D11RenderUtility>
 	{
 	public:
 		D3D11RenderUtility(D3D11Device* device);
 		~D3D11RenderUtility();
 
+		/**
+		 * @brief	Draws a quad that clears the current viewport. This is supposed to emulate functionality
+		 *			available with other APIs like DX9 and OpenGL where you can clear only a part of the render target.
+		 *			(DX11 API only provides a way to clear the entire render target).
+		 *
+		 * @param	buffers			Combination of one or more elements of FrameBufferType
+		 *							denoting which buffers are to be cleared.
+		 * @param	color			(optional) The color to clear the color buffer with, if enabled.
+		 * @param	depth			(optional) The value to initialize the depth buffer with, if enabled.
+		 * @param	stencil			(optional) The value to initialize the stencil buffer with, if enabled.
+		 */
 		void drawClearQuad(UINT32 clearBuffers, const Color& color, float depth, UINT16 stencil);
 
 	protected:
-		D3D11Device* mDevice;
-
+		/**
+		 * @brief	Initializes resources needed for drawing the clear quad. Should be called one time at start-up.
+		 */
 		void initClearQuadResources();
 
+		D3D11Device* mDevice;
+
 		ID3D11Buffer* mClearQuadIB;
 		ID3D11Buffer* mClearQuadVB;
 		ID3D11InputLayout* mClearQuadIL;

+ 37 - 5
BansheeD3D11RenderSystem/Include/BsD3D11RenderWindow.h

@@ -5,13 +5,16 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	Render window implementation for Windows and DirectX 11.
+	 */
 	class BS_D3D11_EXPORT D3D11RenderWindow : public RenderWindow
 	{
 	public:
 		~D3D11RenderWindow();
 
 		/**
-		 * @copydoc RenderWindow::reposition
+		 * @copydoc RenderWindow::move
 		 */
 		void move(INT32 left, INT32 top);
 
@@ -85,32 +88,61 @@ namespace BansheeEngine
 		 */
 		bool requiresTextureFlipping() const { return false; }
 
+		/**
+		 * @copydoc	RenderWindow::_windowMovedOrResized
+		 */
 		void _windowMovedOrResized();
 
+		/**
+		 * @brief	Returns presentation parameters used for creating the window swap chain.
+		 */
 		DXGI_SWAP_CHAIN_DESC* _getPresentationParameters() { return &mSwapChainDesc; }
+
+		/**
+		 * @brief	Returns internal window handle.
+		 */
 		HWND _getWindowHandle() const { return mHWnd; }
 
 	protected:
 		friend class D3D11RenderWindowManager;
+
+		/**
+		 * @copydoc	RenderWindow::RenderWindow
+		 */
 		D3D11RenderWindow(const RENDER_WINDOW_DESC& desc, D3D11Device& device, IDXGIFactory* DXGIFactory);
 
+		/**
+		 * @brief	Creates internal resources dependent on window size.
+		 */
 		void createSizeDependedD3DResources();
+
+		/**
+		 * @brief	Destroys internal resources dependent on window size.
+		 */
 		void destroySizeDependedD3DResources();
 
+		/**
+		 * @brief	Queries the current DXGI device. Make sure to release the returned object when done with it.
+		 */
 		IDXGIDevice* queryDxgiDevice(); 
 
-		bool checkMultiSampleQuality(UINT32 SampleCount, UINT32 *outQuality, DXGI_FORMAT format);
-
+		/**
+		 * @brief	Creates a swap chain for the window.
+		 */
 		void createSwapChain();
+
+		/**
+		 * @brief	Resizes all buffers attached to the swap chain to the specified size.
+		 */
 		void resizeSwapChainBuffers(UINT32 width, UINT32 height);
 		
 		/**
-		 * @copydoc RenderWindow::initialize_internal().
+		 * @copydoc RenderWindow::initialize_internal
 		 */
 		void initialize_internal();
 
 		/**
-		 * @copydoc RenderWindow::destroy_internal().
+		 * @copydoc RenderWindow::destroy_internal
 		 */
 		void destroy_internal();
 	protected:

+ 4 - 1
BansheeD3D11RenderSystem/Include/BsD3D11RenderWindowManager.h

@@ -5,6 +5,9 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @copydoc	RenderWindowManager
+	 */
 	class BS_D3D11_EXPORT D3D11RenderWindowManager : public RenderWindowManager
 	{
 	public:
@@ -12,7 +15,7 @@ namespace BansheeEngine
 
 	protected:
 		/**
-		 * @copydoc RenderWindowManager::createImpl()
+		 * @copydoc RenderWindowManager::createImpl
 		 */
 		RenderWindowPtr createImpl(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow);
 

+ 6 - 2
BansheeD3D11RenderSystem/Include/BsD3D11SamplerState.h

@@ -5,6 +5,10 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	DirectX 11 implementation of a sampler state. Wraps a DX11
+	 *			sampler state object.
+	 */
 	class BS_D3D11_EXPORT D3D11SamplerState : public SamplerState
 	{
 	public:
@@ -17,12 +21,12 @@ namespace BansheeEngine
 		D3D11SamplerState();
 
 		/**
-		 * @copydoc SamplerState::initialize_internal().
+		 * @copydoc SamplerState::initialize_internal
 		 */
 		void initialize_internal();
 
 		/**
-		 * @copydoc SamplerState::destroy_internal().
+		 * @copydoc SamplerState::destroy_internal
 		 */
 		void destroy_internal();
 

+ 106 - 26
BansheeD3D11RenderSystem/Include/BsD3D11Texture.h

@@ -5,14 +5,27 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	DirectX 11 implementation of a texture.
+	 */
 	class D3D11Texture : public Texture
 	{
 	public:
 		~D3D11Texture();
 
+		/**
+		 * @brief	Returns internal DX11 texture resource object.
+		 */
 		ID3D11Resource* getDX11Resource() const { return mTex; }
+
+		/**
+		 * @brief	Returns shader resource view associated with the texture.
+		 */
 		ID3D11ShaderResourceView* getSRV() const { return mShaderResourceView; }
-		D3D11_SRV_DIMENSION getDimension() const { return mDimension; }
+
+		/**
+		 * @brief	Returns DXGI pixel format used by the texture.
+		 */
 		DXGI_FORMAT getDXGIFormat() const { return mDXGIFormat; }
 
 	protected:
@@ -20,33 +33,28 @@ namespace BansheeEngine
 
 		D3D11Texture();
 
-		ID3D11Texture1D* m1DTex;
-		ID3D11Texture2D* m2DTex;
-		ID3D11Texture3D* m3DTex;	
-		ID3D11Resource* mTex;		
-
-		ID3D11ShaderResourceView* mShaderResourceView;
-		D3D11_SHADER_RESOURCE_VIEW_DESC mSRVDesc;
-		D3D11_SRV_DIMENSION mDimension;
-		DXGI_FORMAT mDXGIFormat;
+		/**
+		* @copydoc	Texture::initialize_internal()
+		*/
+		void initialize_internal();
 
-		ID3D11Resource* mStagingBuffer;
-		PixelData* mStaticBuffer;
-		UINT32 mLockedSubresourceIdx;
-		bool mLockedForReading;
+		/**
+		* @copydoc Texture::destroy_internal()
+		*/
+		void destroy_internal();
 
 		/**
-		 * @copydoc Texture::lock
+		 * @copydoc Texture::lockImpl
 		 */
 		PixelData lockImpl(GpuLockOptions options, UINT32 mipLevel = 0, UINT32 face = 0);
 
 		/**
-		 * @copydoc Texture::unlock
+		 * @copydoc Texture::unlockImpl
 		 */
 		void unlockImpl();
 
 		/**
-		 * @copydoc Texture::copy
+		 * @copydoc Texture::copyImpl
 		 */
 		void copyImpl(TexturePtr& target);
 
@@ -60,34 +68,106 @@ namespace BansheeEngine
 		 */
 		void writeData(const PixelData& src, UINT32 mipLevel = 0, UINT32 face = 0, bool discardWholeBuffer = false);
 
-		/// internal method, create a blank normal 1D Dtexture
+		/**
+		 * @brief	Creates a blank DX11 1D texture object.
+		 */
 		void create1DTex();
-		/// internal method, create a blank normal 2D texture
+
+		/**
+		 * @brief	Creates a blank DX11 2D texture object.
+		 */
 		void create2DTex();
-		/// internal method, create a blank cube texture
+
+		/**
+		 * @brief	Creates a blank DX11 3D texture object.
+		 */
 		void create3DTex();
 
+		/**
+		 * @brief	Creates a staging buffer that is used as a temporary buffer for read operations on textures
+		 *			that do not support direct reading.
+		 */
 		void createStagingBuffer();
 
+		/**
+		 * @brief	Maps the specified texture surface for reading/writing. 
+		 *
+		 * @param	res			Texture resource to map.
+		 * @param	flags		Mapping flags that let the API know what are we planning to do with mapped memory.
+		 * @param	mipLevel	Mip level to map (0 being the base level).
+		 * @param	face		Texture face to map, in case texture has more than one.
+		 * @param	rowPitch	Output size of a single row in bytes.
+		 * @param	slicePitch	Output size of a single slice in bytes (relevant only for 3D textures).
+		 *
+		 * @returns	Pointer to the mapped area of memory.
+		 *
+		 * @note	Non-staging textures must be dynamic in order to be mapped directly and only for writing.
+		 *			No restrictions are made on staging textures.
+		 */
 		void* map(ID3D11Resource* res, D3D11_MAP flags, UINT32 mipLevel, UINT32 face, UINT32& rowPitch, UINT32& slicePitch);
+
+		/**
+		 * @brief	Unmaps a previously mapped texture.
+		 */
 		void unmap(ID3D11Resource* res);
 
+		/**
+		 * @brief	Copies texture data into a staging buffer and maps the staging buffer. Will create a staging
+		 *			buffer if one doesn't already exist (potentially wasting a lot of memory).
+		 *
+		 * @param	flags		Mapping flags that let the API know what are we planning to do with mapped memory.
+		 * @param	mipLevel	Mip level to map (0 being the base level).
+		 * @param	face		Texture face to map, in case texture has more than one.
+		 * @param	rowPitch	Output size of a single row in bytes.
+		 * @param	slicePitch	Output size of a single slice in bytes (relevant only for 3D textures).
+		 *
+		 * @returns	Pointer to the mapped area of memory.
+		 */
 		void* mapstagingbuffer(D3D11_MAP flags, UINT32 mipLevel, UINT32 face, UINT32& rowPitch, UINT32& slicePitch);
+
+		/**
+		 * @brief	Unmaps a previously mapped staging buffer.
+		 */
 		void unmapstagingbuffer();
 		
+		/**
+		 * @brief	Maps a static buffer, for writing only. Returned pointer points to temporary CPU memory
+		 *			that will be copied to the mapped resource on "unmap" call.
+		 *
+		 * @param	flags		Mapping flags that let the API know what are we planning to do with mapped memory.
+		 * @param	mipLevel	Mip level to map (0 being the base level).
+		 * @param	face		Texture face to map, in case texture has more than one.
+		 * @param	rowPitch	Output size of a single row in bytes.
+		 * @param	slicePitch	Output size of a single slice in bytes (relevant only for 3D textures).
+		 *
+		 * @returns	Pointer to the mapped area of memory.
+		 */
 		void* mapstaticbuffer(PixelData lock, UINT32 mipLevel, UINT32 slice);
-		void unmapstaticbuffer();
 
 		/**
-		 * @copydoc	Texture::initialize_internal()
+		 * @brief	Unmaps a previously mapped static buffer and flushes its data to the actual GPU buffer.
 		 */
-		void initialize_internal();
+		void unmapstaticbuffer();
 
 		/**
-		 * @copydoc Texture::destroy_internal()
+		 * @brief	Creates an empty and uninitialized texture view object.
 		 */
-		void destroy_internal();
-
 		TextureViewPtr createView();
+
+	protected:
+		ID3D11Texture1D* m1DTex;
+		ID3D11Texture2D* m2DTex;
+		ID3D11Texture3D* m3DTex;
+		ID3D11Resource* mTex;
+
+		ID3D11ShaderResourceView* mShaderResourceView;
+		D3D11_SHADER_RESOURCE_VIEW_DESC mSRVDesc;
+		D3D11_SRV_DIMENSION mDimension;
+		DXGI_FORMAT mDXGIFormat;
+
+		ID3D11Resource* mStagingBuffer;
+		PixelData* mStaticBuffer;
+		UINT32 mLockedSubresourceIdx;
+		bool mLockedForReading;
 	};
 }

+ 17 - 1
BansheeD3D11RenderSystem/Include/BsD3D11TextureManager.h

@@ -5,18 +5,34 @@
 
 namespace BansheeEngine 
 {
+	/**
+	 * @brief	Handles creation of DirectX 11 textures.
+	 */
 	class BS_D3D11_EXPORT D3D11TextureManager : public TextureManager
 	{
 	public:
 		D3D11TextureManager();
 		~D3D11TextureManager();
 
-		/// @copydoc TextureManager::getNativeFormat
+		/**
+		 * @copydoc	TextureManager::getNativeFormat
+		 */
 		PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage, bool hwGamma);
 
 	protected:		
+		/**
+		 * @copydoc	TextureManager::createTextureImpl
+		 */
 		TexturePtr createTextureImpl();
+
+		/**
+		 * @copydoc	TextureManager::createRenderTextureImpl
+		 */
 		RenderTexturePtr createRenderTextureImpl();
+
+		/**
+		 * @copydoc	TextureManager::createMultiRenderTextureImpl
+		 */
 		MultiRenderTexturePtr createMultiRenderTextureImpl();
 	};
 }

+ 93 - 12
BansheeD3D11RenderSystem/Include/BsD3D11TextureView.h

@@ -5,39 +5,120 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	DirectX implementation of a texture resource view.
+	 */
 	class BS_D3D11_EXPORT D3D11TextureView : public TextureView
 	{
 	public:
-		ID3D11ShaderResourceView*	getSRV() const { return mSRV; }
-		ID3D11RenderTargetView*		getRTV() const { return mRTV; }
-		ID3D11UnorderedAccessView*	getUAV() const { return mUAV; }
-		ID3D11DepthStencilView*		getDSV() const { return mDSV; }
+		/**
+		 * @brief	Returns a shader resource view. Caller must take care this texture view
+		 *			actually contains a shader resource view, otherwise it returns null.
+		 */
+		ID3D11ShaderResourceView* getSRV() const { return mSRV; }
+
+		/**
+		 * @brief	Returns a render target view. Caller must take care this texture view
+		 *			actually contains a render target view, otherwise it returns null.
+		 */
+		ID3D11RenderTargetView*	getRTV() const { return mRTV; }
+
+		/**
+		 * @brief	Returns a unordered access view. Caller must take care this texture view
+		 *			actually contains a unordered access view, otherwise it returns null.
+		 */
+		ID3D11UnorderedAccessView* getUAV() const { return mUAV; }
+
+		/**
+		 * @brief	Returns a depth stencil view. Caller must take care this texture view
+		 *			actually contains a depth stencil view, otherwise it returns null.
+		 */
+		ID3D11DepthStencilView*	getDSV() const { return mDSV; }
 
 	protected:
 		friend class D3D11Texture;
 
 		D3D11TextureView();
 
+		/**
+		 * @copydoc	TextureView::initialize_internal
+		 */
 		void initialize_internal();
 
+		/**
+		 * @copydoc	TextureView::destroy_internal
+		 */
 		void destroy_internal();
 
 	private:
-		ID3D11ShaderResourceView*	mSRV;
-		ID3D11RenderTargetView*		mRTV;
-		ID3D11UnorderedAccessView*	mUAV;
-		ID3D11DepthStencilView*		mDSV;
-
+		/**
+		 * @brief	Creates a shader resource view that allows the provided surfaces 
+		 *			to be bound as normal shader resources.
+		 *
+		 * @param	texture			Texture to create the resource view for.
+		 * @param	mostDetailMip	First mip level to create the resource view for (0 - base level). 
+		 * @param	numMips			Number of mip levels to create the view for.
+		 * @param	firstArraySlice	First array slice to create the view for. This will be array index 
+		 *							for 1D and 2D array textures, texture slice index for 3D textures, and face
+		 *							index for cube textures (cube index * 6).
+		 * @param	nuMArraySlices	Number of array slices to create the view for. This will be number of
+		 *							array elements for 1D and 2D array textures, number of slices for 3D textures,
+		 *							and number of cubes for cube textures.
+		 */
 		ID3D11ShaderResourceView* createSRV(D3D11Texture* texture, 
 			UINT32 mostDetailMip, UINT32 numMips, UINT32 firstArraySlice, UINT32 numArraySlices);
 
+		/**
+		 * @brief	Creates a shader resource view that allows the provided surfaces 
+		 *			to be bound as render targets.
+		 *
+		 * @param	texture			Texture to create the resource view for.
+		 * @param	mipSlice		Mip level to create the resource view for (0 - base level).
+		 * @param	firstArraySlice	First array slice to create the view for. This will be array index 
+		 *							for 1D and 2D array textures, texture slice index for 3D textures, and face
+		 *							index for cube textures (cube index * 6).
+		 * @param	nuMArraySlices	Number of array slices to create the view for. This will be number of
+		 *							array elements for 1D and 2D array textures, number of slices for 3D textures,
+		 *							and number of cubes for cube textures.
+		 */
 		ID3D11RenderTargetView* createRTV(D3D11Texture* texture, 
-			UINT32 mostDetailMip, UINT32 numMips, UINT32 firstArraySlice, UINT32 numArraySlices);
+			UINT32 mipSlice, UINT32 firstArraySlice, UINT32 numArraySlices);
 
+		/**
+		 * @brief	Creates a shader resource view that allows the provided surfaces 
+		 *			to be bound as unordered access buffers.
+		 *
+		 * @param	texture			Texture to create the resource view for.
+		 * @param	mipSlice		Mip level to create the resource view for (0 - base level).
+		 * @param	firstArraySlice	First array slice to create the view for. This will be array index
+		 *							for 1D and 2D array textures, texture slice index for 3D textures, and face
+		 *							index for cube textures (cube index * 6).
+		 * @param	nuMArraySlices	Number of array slices to create the view for. This will be number of
+		 *							array elements for 1D and 2D array textures, number of slices for 3D textures,
+		 *							and number of cubes for cube textures.
+		 */
 		ID3D11UnorderedAccessView* createUAV(D3D11Texture* texture, 
-			UINT32 mostDetailMip, UINT32 numMips, UINT32 firstArraySlice, UINT32 numArraySlices);
+			UINT32 mipSlice, UINT32 firstArraySlice, UINT32 numArraySlices);
 
+		/**
+		 * @brief	Creates a shader resource view that allows the provided surfaces 
+		 *			to be bound as depth stencil buffers.
+		 *
+		 * @param	texture			Texture to create the resource view for.
+		 * @param	mipSlice		Mip level to create the resource view for (0 - base level).
+		 * @param	firstArraySlice	First array slice to create the view for. This will be array index
+		 *							for 1D and 2D array textures, texture slice index for 3D textures, and face
+		 *							index for cube textures (cube index * 6).
+		 * @param	nuMArraySlices	Number of array slices to create the view for. This will be number of
+		 *							array elements for 1D and 2D array textures, number of slices for 3D textures,
+		 *							and number of cubes for cube textures.
+		 */
 		ID3D11DepthStencilView* createDSV(D3D11Texture* texture, 
-			UINT32 mostDetailMip, UINT32 numMips, UINT32 firstArraySlice, UINT32 numArraySlices);
+			UINT32 mipSlice, UINT32 firstArraySlice, UINT32 numArraySlices);
+
+		ID3D11ShaderResourceView* mSRV;
+		ID3D11RenderTargetView* mRTV;
+		ID3D11UnorderedAccessView* mUAV;
+		ID3D11DepthStencilView*	mDSV;
 	};
 }

+ 5 - 2
BansheeD3D11RenderSystem/Include/BsD3D11TimerQuery.h

@@ -35,6 +35,11 @@ namespace BansheeEngine
 		virtual float getTimeMs();
 
 	private:
+		/**
+		 * @brief	Resolve timing information after the query has finished.
+		 */
+		void finalize();
+
 		bool mFinalized;
 		bool mQueryEndCalled;
 		float mTimeDelta;
@@ -43,7 +48,5 @@ namespace BansheeEngine
 		ID3D11Query* mEndQuery;
 		ID3D11Query* mDisjointQuery;
 		ID3D11DeviceContext* mContext;
-
-		void finalize();
 	};
 }

+ 6 - 0
BansheeD3D11RenderSystem/Include/BsD3D11VertexBuffer.h

@@ -6,6 +6,9 @@
 
 namespace BansheeEngine
 {
+	/**
+	 * @brief	DirectX 11 implementation of a vertex buffer.
+	 */
 	class BS_D3D11_EXPORT D3D11VertexBuffer : public VertexBuffer
 	{
 	public:
@@ -34,6 +37,9 @@ namespace BansheeEngine
 	protected: 
 		friend class D3D11HardwareBufferManager;
 
+		/**
+		 * @copydoc	VertexBuffer::VertexBuffer
+		 */
 		D3D11VertexBuffer(D3D11Device& device, UINT32 vertexSize, UINT32 numVertices, 
 			GpuBufferUsage usage, bool useSystemMem, bool streamOut);
 

+ 1 - 12
BansheeD3D11RenderSystem/Source/BsD3D11RenderSystem.cpp

@@ -836,8 +836,7 @@ namespace BansheeEngine
 		// Adapter details
 		const DXGI_ADAPTER_DESC& adapterID = mActiveD3DDriver->getAdapterIdentifier();
 
-		// determine vendor
-		// Full list of vendors here: http://www.pcidatabase.com/vendors.php?sort=id
+		// Determine vendor
 		switch(adapterID.VendorId)
 		{
 		case 0x10DE:
@@ -878,11 +877,6 @@ namespace BansheeEngine
 		return rsc;
 	}
 
-	void D3D11RenderSystem::initialiseFromRenderSystemCapabilities(RenderSystemCapabilities* caps)
-	{
-		// Do nothing
-	}
-
 	void D3D11RenderSystem::determineMultisampleSettings(UINT32 multisampleCount, const String& multisampleHint, DXGI_FORMAT format, DXGI_SAMPLE_DESC* outputSampleDesc)
 	{
 		bool ok = false;
@@ -985,11 +979,6 @@ namespace BansheeEngine
 		} // while !ok
 	}
 
-	bool D3D11RenderSystem::checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage)
-	{
-		return true;
-	}
-
 	VertexElementType D3D11RenderSystem::getColorVertexElementType() const
 	{
 		return VET_COLOR_ABGR;

+ 0 - 8
BansheeD3D11RenderSystem/Source/BsD3D11RenderWindow.cpp

@@ -735,12 +735,4 @@ namespace BansheeEngine
 
 		return pDXGIDevice;
 	}
-
-	bool D3D11RenderWindow::checkMultiSampleQuality(UINT32 SampleCount, UINT32 *outQuality, DXGI_FORMAT format)
-	{
-		if (SUCCEEDED(mDevice.getD3D11Device()->CheckMultisampleQualityLevels(format, SampleCount, outQuality)))
-			return true;
-		else
-			return false;
-	}
 }

+ 14 - 14
BansheeD3D11RenderSystem/Source/BsD3D11TextureView.cpp

@@ -19,11 +19,11 @@ namespace BansheeEngine
 		D3D11Texture* d3d11Texture = static_cast<D3D11Texture*>(mOwnerTexture.get());
 
 		if((mDesc.usage & GVU_RANDOMWRITE) != 0)
-			mUAV = createUAV(d3d11Texture, mDesc.mostDetailMip, mDesc.numMips, mDesc.firstArraySlice, mDesc.numArraySlices);
+			mUAV = createUAV(d3d11Texture, mDesc.mostDetailMip, mDesc.firstArraySlice, mDesc.numArraySlices);
 		else if((mDesc.usage & GVU_RENDERTARGET) != 0)
-			mRTV = createRTV(d3d11Texture, mDesc.mostDetailMip, mDesc.numMips, mDesc.firstArraySlice, mDesc.numArraySlices);
+			mRTV = createRTV(d3d11Texture, mDesc.mostDetailMip, mDesc.firstArraySlice, mDesc.numArraySlices);
 		else if((mDesc.usage & GVU_DEPTHSTENCIL) != 0)
-			mDSV = createDSV(d3d11Texture, mDesc.mostDetailMip, mDesc.numMips, mDesc.firstArraySlice, mDesc.numArraySlices);
+			mDSV = createDSV(d3d11Texture, mDesc.mostDetailMip, mDesc.firstArraySlice, mDesc.numArraySlices);
 		else
 			mSRV = createSRV(d3d11Texture, mDesc.mostDetailMip, mDesc.numMips, mDesc.firstArraySlice, mDesc.numArraySlices);
 
@@ -94,7 +94,7 @@ namespace BansheeEngine
 	}
 
 	ID3D11RenderTargetView* D3D11TextureView::createRTV(D3D11Texture* texture, 
-		UINT32 mostDetailMip, UINT32 numMips, UINT32 firstArraySlice, UINT32 numArraySlices)
+		UINT32 mipSlice, UINT32 firstArraySlice, UINT32 numArraySlices)
 	{
 		D3D11_RENDER_TARGET_VIEW_DESC desc;
 		ZeroMemory(&desc, sizeof(desc));
@@ -102,18 +102,18 @@ namespace BansheeEngine
 		switch(texture->getTextureType())
 		{
 		case TEX_TYPE_1D:
-			desc.Texture1D.MipSlice = mostDetailMip;
+			desc.Texture1D.MipSlice = mipSlice;
 			desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE1D;
 			break;
 		case TEX_TYPE_2D:
-			desc.Texture2D.MipSlice = mostDetailMip;
+			desc.Texture2D.MipSlice = mipSlice;
 			if(texture->getMultisampleCount() > 0)
 				desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMS;
 			else
 				desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
 			break;
 		case TEX_TYPE_3D:
-			desc.Texture3D.MipSlice = mostDetailMip;
+			desc.Texture3D.MipSlice = mipSlice;
 			desc.Texture3D.FirstWSlice = firstArraySlice;
 			desc.Texture3D.WSize = numArraySlices;
 			desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE3D;
@@ -139,7 +139,7 @@ namespace BansheeEngine
 	}
 
 	ID3D11UnorderedAccessView* D3D11TextureView::createUAV(D3D11Texture* texture,
-		UINT32 mostDetailMip, UINT32 numMips, UINT32 firstArraySlice, UINT32 numArraySlices)
+		UINT32 mipSlice, UINT32 firstArraySlice, UINT32 numArraySlices)
 	{
 		D3D11_UNORDERED_ACCESS_VIEW_DESC desc;
 		ZeroMemory(&desc, sizeof(desc));
@@ -147,15 +147,15 @@ namespace BansheeEngine
 		switch(texture->getTextureType())
 		{
 		case TEX_TYPE_1D:
-			desc.Texture1D.MipSlice = mostDetailMip;
+			desc.Texture1D.MipSlice = mipSlice;
 			desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE1D;
 			break;
 		case TEX_TYPE_2D:
-			desc.Texture2D.MipSlice = mostDetailMip;
+			desc.Texture2D.MipSlice = mipSlice;
 			desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D;
 			break;
 		case TEX_TYPE_3D:
-			desc.Texture3D.MipSlice = mostDetailMip;
+			desc.Texture3D.MipSlice = mipSlice;
 			desc.Texture3D.FirstWSlice = firstArraySlice;
 			desc.Texture3D.WSize = numArraySlices;
 			desc.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE3D;
@@ -181,7 +181,7 @@ namespace BansheeEngine
 	}
 
 	ID3D11DepthStencilView* D3D11TextureView::createDSV(D3D11Texture* texture, 
-		UINT32 mostDetailMip, UINT32 numMips, UINT32 firstArraySlice, UINT32 numArraySlices)
+		UINT32 mipSlice, UINT32 firstArraySlice, UINT32 numArraySlices)
 	{
 		D3D11_DEPTH_STENCIL_VIEW_DESC desc;
 		ZeroMemory(&desc, sizeof(desc));
@@ -189,11 +189,11 @@ namespace BansheeEngine
 		switch(texture->getTextureType())
 		{
 		case TEX_TYPE_1D:
-			desc.Texture1D.MipSlice = mostDetailMip;
+			desc.Texture1D.MipSlice = mipSlice;
 			desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE1D;
 			break;
 		case TEX_TYPE_2D:
-			desc.Texture2D.MipSlice = mostDetailMip;
+			desc.Texture2D.MipSlice = mipSlice;
 			if(texture->getMultisampleCount() > 0)
 				desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DMS;
 			else

+ 1 - 1
BansheeD3D9RenderSystem/Include/BsD3D9MultiRenderTexture.h

@@ -6,7 +6,7 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	DirectX 9 implementation of a multi-render texture.
+	 * @brief	DirectX 9 implementation of a render texture with multiple color surfaces.
 	 */
 	class BS_D3D9_EXPORT D3D9MultiRenderTexture : public MultiRenderTexture
 	{

+ 0 - 6
BansheeD3D9RenderSystem/Include/BsD3D9RenderSystem.h

@@ -321,12 +321,6 @@ namespace BansheeEngine
 		 */
 		D3DPRIMITIVETYPE getD3D9PrimitiveType() const;
 
-		/**
-		 * @brief	Check whether or not filtering is supported for the precise texture format requested
-		 *			with the given usage options.
-		 */
-        bool checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage);
-
 		/************************************************************************/
 		/* 							Sampler states                     			*/
 		/************************************************************************/

+ 31 - 17
BansheeD3D9RenderSystem/Include/BsD3D9RenderSystemFactory.h

@@ -9,27 +9,41 @@ namespace BansheeEngine
 {
 	const String SystemName = "BansheeD3D9RenderSystem";
 
+	/**
+	 * @brief	Handles creation of the DX9 render system.
+	 */
 	class D3D9RenderSystemFactory : public RenderSystemFactory
 	{
-		public:
-			virtual void create();
-			virtual const String& name() const { return SystemName; }
+	public:
+		/**
+		 * @copydoc	RenderSystemFactory::create
+		 */
+		virtual void create();
 
-		private:
-			class InitOnStart
-			{
-				public:
-					InitOnStart() 
-					{ 
-						static RenderSystemFactoryPtr newFactory;
-						if(newFactory == nullptr)
-						{
-							newFactory = bs_shared_ptr<D3D9RenderSystemFactory>();
-							RenderSystemManager::instance().registerRenderSystemFactory(newFactory);
-						}
+		/**
+		 * @copydoc	RenderSystemFactory::name
+		 */
+		virtual const String& name() const { return SystemName; }
+
+	private:
+
+		/**
+		 * @brief	Registers the factory with the render system manager when constructed.
+		 */
+		class InitOnStart
+		{
+			public:
+				InitOnStart() 
+				{ 
+					static RenderSystemFactoryPtr newFactory;
+					if(newFactory == nullptr)
+					{
+						newFactory = bs_shared_ptr<D3D9RenderSystemFactory>();
+						RenderSystemManager::instance().registerRenderSystemFactory(newFactory);
 					}
-			};
+				}
+		};
 
-			static InitOnStart initOnStart; // Makes sure factory is registered on program start
+		static InitOnStart initOnStart; // Makes sure factory is registered on program start
 	};
 }

+ 1 - 1
BansheeD3D9RenderSystem/Include/BsD3D9RenderWindow.h

@@ -55,7 +55,7 @@ namespace BansheeEngine
 		bool isVSync() const { return mVSync; }
 
 		/**
-		 * @copydoc RenderWindow::reposition
+		 * @copydoc RenderWindow::move
 		 */
 		void move(INT32 left, INT32 top);
 

+ 0 - 60
BansheeD3D9RenderSystem/Source/BsD3D9RenderSystem.cpp

@@ -2080,66 +2080,6 @@ namespace BansheeEngine
 		}
 	}
 
-	bool D3D9RenderSystem::checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage)
-	{
-		// Gets D3D format
-		D3DFORMAT d3dPF = D3D9Mappings::_getPF(format);
-		if (d3dPF == D3DFMT_UNKNOWN)
-			return false;
-
-		for (UINT32 i = 0; i < mDeviceManager->getDeviceCount(); ++i)
-		{
-			D3D9Device* currDevice = mDeviceManager->getDevice(i);
-			const D3D9RenderWindow* currDevicePrimaryWindow = currDevice->getPrimaryWindow();
-			IDirect3DSurface9* pSurface = currDevicePrimaryWindow->_getRenderSurface();
-			D3DSURFACE_DESC srfDesc;
-
-			// Get surface desc
-			if (FAILED(pSurface->GetDesc(&srfDesc)))
-				return false;
-
-			// Calculate usage
-			DWORD d3dusage = D3DUSAGE_QUERY_FILTER;
-			if (usage & TU_RENDERTARGET) 
-				d3dusage |= D3DUSAGE_RENDERTARGET;
-			if (usage & TU_DEPTHSTENCIL) 
-				d3dusage |= D3DUSAGE_DEPTHSTENCIL;
-			if (usage & TU_DYNAMIC)
-				d3dusage |= D3DUSAGE_DYNAMIC;
-
-			// Detect resource type
-			D3DRESOURCETYPE rtype;
-			switch(ttype)
-			{
-			case TEX_TYPE_1D:
-			case TEX_TYPE_2D:
-				rtype = D3DRTYPE_TEXTURE;
-				break;
-			case TEX_TYPE_3D:
-				rtype = D3DRTYPE_VOLUMETEXTURE;
-				break;
-			case TEX_TYPE_CUBE_MAP:
-				rtype = D3DRTYPE_CUBETEXTURE;
-				break;
-			default:
-				return false;
-			}
-
-			HRESULT hr = mpD3D->CheckDeviceFormat(
-				currDevice->getAdapterNumber(),
-				currDevice->getDeviceType(),
-				srfDesc.Format,
-				d3dusage,
-				rtype,
-				d3dPF);
-
-			if (FAILED(hr))
-				return false;
-		}
-
-		return true;		
-	}
-
 	String D3D9RenderSystem::getErrorDescription(long errorNumber) const
 	{
 		const String errMsg = DXGetErrorDescription(errorNumber);

+ 1 - 1
BansheeGLRenderSystem/Include/BsWin32Window.h

@@ -49,7 +49,7 @@ namespace BansheeEngine
 		bool isClosed() const;
 
 		/**
-		 * @copydoc RenderWindow::reposition
+		 * @copydoc RenderWindow::move
 		 */
 		void move(INT32 left, INT32 top);
 

+ 25 - 0
Polish.txt

@@ -3,6 +3,8 @@ Polish TODO:
  - Fix FBX importer so proper number of vertices show
  - Test and fix full-screen transitions
  - Add virtual input axes
+   - Update Input so it can return multiple joystick and mouse axes
+   - Add better smoothing (look into UE4)
  - Compress and generate mips for texture on input (testing NVTT stuff)
  - Add frustum culling and sorting code
  - Finalize example
@@ -12,6 +14,29 @@ Polish TODO:
  - Make a separate release branch with no editor/script stuff, and without .txt files and other development data
  - (HIGHLY OPTIONAL) Make a Getting Started guide, along with the example project. Or just finish up the manual.
 
+ Input:
+ Modify Input so it  has:
+ - getHorizonalAxis(Device, Index)
+ - getVerticalAxis(Device, Index)
+
+Where Device is Mouse, Gamepad, etc.
+Index is index of the device (e.g. 1 and 2 if two Gamepads are connected)
+
+Then in VirtualInput I should add VirtualAxis
+ - Represented by device, axis index and optionally other properties
+ - Virtual axes are registered with InputConfiguration same as virtual buttons
+
+Rename Joystick -> Gamepad
+
+OIS has getNumberOfDevices and listFreeDevices that I don't currently use. I should use that for Gamepad input.
+
+Optional VirtualInput axis data
+ - Axis sensitivity
+ - Axis invert
+ - Dead zone, exponent (See UE4 PlayerInput.cpp MassageAxisInput)
+ - Should smoothing be part of this as well? Probably, especially if I plan to add fake axes like keyboard ones
+  - See http://www.flipcode.com/archives/Smooth_Mouse_Filtering.shtml
+
 -----------------
 
 There's still a crash regarding an uninitialized mCachedPtr on a C# class when shutting down. Attempt to find consistent repro steps.