Просмотр исходного кода

Made getCustomAttribute const
Some work on GUI input

Marko Pintera 12 лет назад
Родитель
Сommit
1e0c79d624
28 измененных файлов с 114 добавлено и 115 удалено
  1. 1 9
      BansheeEngine/Include/BsGUIManager.h
  2. 17 19
      BansheeEngine/Source/BsGUIManager.cpp
  3. 1 1
      CamelotCore/Include/CmRenderTarget.h
  4. 2 4
      CamelotCore/Include/CmRenderWindowManager.h
  5. 1 1
      CamelotCore/Source/CmRenderTarget.cpp
  6. 19 10
      CamelotCore/Source/CmRenderWindowManager.cpp
  7. 1 1
      CamelotD3D11RenderSystem/Include/CmD3D11MultiRenderTexture.h
  8. 1 1
      CamelotD3D11RenderSystem/Include/CmD3D11RenderTexture.h
  9. 1 1
      CamelotD3D11RenderSystem/Include/CmD3D11RenderWindow.h
  10. 1 1
      CamelotD3D11RenderSystem/Source/CmD3D11MultiRenderTexture.cpp
  11. 1 1
      CamelotD3D11RenderSystem/Source/CmD3D11RenderTexture.cpp
  12. 1 1
      CamelotD3D11RenderSystem/Source/CmD3D11RenderWindow.cpp
  13. 16 16
      CamelotD3D9Renderer/Include/CmD3D9Device.h
  14. 1 1
      CamelotD3D9Renderer/Include/CmD3D9MultiRenderTexture.h
  15. 3 3
      CamelotD3D9Renderer/Include/CmD3D9RenderSystem.h
  16. 1 1
      CamelotD3D9Renderer/Include/CmD3D9RenderTexture.h
  17. 5 5
      CamelotD3D9Renderer/Include/CmD3D9RenderWindow.h
  18. 19 20
      CamelotD3D9Renderer/Source/CmD3D9Device.cpp
  19. 1 1
      CamelotD3D9Renderer/Source/CmD3D9MultiRenderTexture.cpp
  20. 3 3
      CamelotD3D9Renderer/Source/CmD3D9RenderSystem.cpp
  21. 1 1
      CamelotD3D9Renderer/Source/CmD3D9RenderTexture.cpp
  22. 11 8
      CamelotD3D9Renderer/Source/CmD3D9RenderWindow.cpp
  23. 1 1
      CamelotGLRenderer/Include/CmGLMultiRenderTexture.h
  24. 1 1
      CamelotGLRenderer/Include/CmGLRenderTexture.h
  25. 1 1
      CamelotGLRenderer/Include/CmWin32Window.h
  26. 1 1
      CamelotGLRenderer/Source/CmGLMultiRenderTexture.cpp
  27. 1 1
      CamelotGLRenderer/Source/CmGLRenderTexture.cpp
  28. 1 1
      CamelotGLRenderer/Source/CmWin32Window.cpp

+ 1 - 9
BansheeEngine/Include/BsGUIManager.h

@@ -3,8 +3,6 @@
 #include "BsPrerequisites.h"
 #include "CmModule.h"
 
-#include "boost/signals/connection.hpp"
-
 namespace BansheeEngine
 {
 	/**
@@ -27,13 +25,7 @@ namespace BansheeEngine
 
 		void update();
 	private:
-		boost::signals::connection windowCreateConn;
-		boost::signals::connection windowDestroyConn;
-
 		std::vector<GUIWidget*> mWidgets;
-		std::unordered_map<const CM::RenderWindow*, std::vector<GUIWidget*>> mInputMap;
-
-		void doOnWindowCreated(CM::RenderWindow* window);
-		void doOnWindowDestroyed(CM::RenderWindow* window);
+		std::unordered_map<const CM::RenderWindow*, std::vector<GUIWidget*>> mWindowWidgetMap;
 	};
 }

+ 17 - 19
BansheeEngine/Source/BsGUIManager.cpp

@@ -6,6 +6,7 @@
 #include "CmMesh.h"
 #include "CmUtil.h"
 #include "CmRenderWindowManager.h"
+#include "CmCursor.h"
 #include "CmException.h"
 
 using namespace CamelotFramework;
@@ -36,7 +37,7 @@ namespace BansheeEngine
 		if(findIter != end(mWidgets))
 			mWidgets.erase(findIter);
 
-		for(auto& windowMap : mInputMap)
+		for(auto& windowMap : mWindowWidgetMap)
 		{
 			auto& widgets = windowMap.second;
 			auto iterFind = std::find(begin(widgets), end(widgets), widget);
@@ -48,10 +49,13 @@ namespace BansheeEngine
 
 	void GUIManager::attachWidgetToWindow(const RenderWindow* window, GUIWidget* widget)
 	{
-		auto findIter = mInputMap.find(window);
+		auto findIter = mWindowWidgetMap.find(window);
 
-		if(findIter == mInputMap.end())
-			CM_EXCEPT(InternalErrorException, "Cannot find specified window in the window list.");
+		if(findIter == mWindowWidgetMap.end())
+		{
+			mWindowWidgetMap.insert(std::make_pair(window, std::vector<GUIWidget*>()));
+			findIter = mWindowWidgetMap.find(window);
+		}
 
 		std::vector<GUIWidget*>& widgets = findIter->second;
 
@@ -71,21 +75,15 @@ namespace BansheeEngine
 
 	void GUIManager::update()
 	{
+		for(auto& window : mWindowWidgetMap)
+		{
+			if(!window.first->getHasFocus())
+				continue;
 
-	}
-
-	void GUIManager::doOnWindowCreated(RenderWindow* window)
-	{
-		mInputMap.insert(std::make_pair(window, std::vector<GUIWidget*>()));
-	}
-
-	void GUIManager::doOnWindowDestroyed(RenderWindow* window)
-	{
-		auto findIter = mInputMap.find(window);
-
-		if(findIter == mInputMap.end())
-			CM_EXCEPT(InternalErrorException, "Cannot find specified window in the window list.");
-
-		mInputMap.erase(findIter);
+			for(auto& widget : mWidgets)
+			{
+				//Int2 screenPos = Cursor::getWindowPosition(*window.first);
+			}
+		}
 	}
 }

+ 1 - 1
CamelotCore/Include/CmRenderTarget.h

@@ -112,7 +112,7 @@ namespace CamelotFramework
             @param
                 pData Pointer to memory of the right kind of structure to receive the info.
         */
-        virtual void getCustomAttribute(const String& name, void* pData);
+        virtual void getCustomAttribute(const String& name, void* pData) const;
 
 		/** Sets the priority of this render target in relation to the others. 
         @remarks

+ 2 - 4
CamelotCore/Include/CmRenderWindowManager.h

@@ -4,8 +4,6 @@
 #include "CmModule.h"
 #include "CmRenderWindow.h"
 
-#include "boost/signal.hpp"
-
 namespace CamelotFramework
 {
 	class CM_EXPORT RenderWindowManager : public Module<RenderWindowManager>
@@ -15,11 +13,11 @@ namespace CamelotFramework
 		*/
 		RenderWindowPtr create(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow);
 
-		boost::signal<void(RenderWindow*)> onWindowCreated;
-		boost::signal<void(RenderWindow*)> onWindowDestroyed;
+		std::vector<RenderWindow*> getRenderWindows() const;
 	protected:
 		friend class RenderWindow;
 
+		CM_MUTEX(mWindowMutex);
 		std::vector<RenderWindow*> mCreatedWindows;
 
 		virtual RenderWindowPtr createImpl(RENDER_WINDOW_DESC& desc, RenderWindowPtr parentWindow) = 0;

+ 1 - 1
CamelotCore/Source/CmRenderTarget.cpp

@@ -72,7 +72,7 @@ namespace CamelotFramework {
         return mColorDepth;
     }
 
-	void RenderTarget::getCustomAttribute(const String& name, void* pData)
+	void RenderTarget::getCustomAttribute(const String& name, void* pData) const
     {
         CM_EXCEPT(InvalidParametersException, "Attribute not found.");
     }

+ 19 - 10
CamelotCore/Source/CmRenderWindowManager.cpp

@@ -8,24 +8,33 @@ namespace CamelotFramework
 		renderWindow->setThisPtr(renderWindow);
 		renderWindow->initialize();
 
-		mCreatedWindows.push_back(renderWindow.get());
-		
-		if(!onWindowCreated.empty())
-			onWindowCreated(renderWindow.get());
+		{
+			CM_LOCK_MUTEX(mWindowMutex);
 
+			mCreatedWindows.push_back(renderWindow.get());
+		}
+		
 		return renderWindow;
 	}
 
 	void RenderWindowManager::windowDestroyed(RenderWindow* window)
 	{
-		auto iterFind = std::find(begin(mCreatedWindows), end(mCreatedWindows), window);
+		{
+			CM_LOCK_MUTEX(mWindowMutex);
+
+			auto iterFind = std::find(begin(mCreatedWindows), end(mCreatedWindows), window);
 
-		if(iterFind == mCreatedWindows.end())
-			CM_EXCEPT(InternalErrorException, "Trying to destroy a window that is not in the created windows list.");
+			if(iterFind == mCreatedWindows.end())
+				CM_EXCEPT(InternalErrorException, "Trying to destroy a window that is not in the created windows list.");
 
-		if(!onWindowDestroyed.empty())
-			onWindowDestroyed(window);
+			mCreatedWindows.erase(iterFind);
+		}
+	}
+
+	std::vector<RenderWindow*> RenderWindowManager::getRenderWindows() const
+	{
+		CM_LOCK_MUTEX(mWindowMutex);
 
-		mCreatedWindows.erase(iterFind);
+		return mCreatedWindows;
 	}
 }

+ 1 - 1
CamelotD3D11RenderSystem/Include/CmD3D11MultiRenderTexture.h

@@ -11,7 +11,7 @@ namespace CamelotFramework
 		virtual ~D3D11MultiRenderTexture();
 
 		bool requiresTextureFlipping() const { return false; }
-		void getCustomAttribute(const String& name, void* pData);
+		void getCustomAttribute(const String& name, void* pData) const;
 	protected:
 		friend class D3D11TextureManager;
 

+ 1 - 1
CamelotD3D11RenderSystem/Include/CmD3D11RenderTexture.h

@@ -12,7 +12,7 @@ namespace CamelotFramework
 		virtual ~D3D11RenderTexture();
 
 		bool requiresTextureFlipping() const { return false; }
-		void getCustomAttribute(const String& name, void* pData);
+		void getCustomAttribute(const String& name, void* pData) const;
 
 	protected:
 		friend class D3D11TextureManager;

+ 1 - 1
CamelotD3D11RenderSystem/Include/CmD3D11RenderWindow.h

@@ -25,7 +25,7 @@ namespace CamelotFramework
 		bool isClosed() const									{ return mClosed; }
 		bool isHidden() const									{ return mHidden; }
 
-		void getCustomAttribute( const String& name, void* pData );
+		void getCustomAttribute( const String& name, void* pData ) const;
 		DXGI_SWAP_CHAIN_DESC* getPresentationParameters(void)	{ return &mSwapChainDesc; }
 		HWND getWindowHandle() const							{ return mHWnd; }
 

+ 1 - 1
CamelotD3D11RenderSystem/Source/CmD3D11MultiRenderTexture.cpp

@@ -16,7 +16,7 @@ namespace CamelotFramework
 
 	}
 
-	void D3D11MultiRenderTexture::getCustomAttribute(const String& name, void* pData)
+	void D3D11MultiRenderTexture::getCustomAttribute(const String& name, void* pData) const
 	{
 		if(name == "RTV")
 		{

+ 1 - 1
CamelotD3D11RenderSystem/Source/CmD3D11RenderTexture.cpp

@@ -24,7 +24,7 @@ namespace CamelotFramework
 		// Do nothing
 	}
 
-	void D3D11RenderTexture::getCustomAttribute(const String& name, void* pData)
+	void D3D11RenderTexture::getCustomAttribute(const String& name, void* pData) const
 	{
 		if(name == "RTV")
 		{

+ 1 - 1
CamelotD3D11RenderSystem/Source/CmD3D11RenderWindow.cpp

@@ -434,7 +434,7 @@ namespace CamelotFramework
 		}
 	} 
 
-	void D3D11RenderWindow::getCustomAttribute( const String& name, void* pData )
+	void D3D11RenderWindow::getCustomAttribute( const String& name, void* pData ) const
 	{
 		if(name == "WINDOW")
 		{

+ 16 - 16
CamelotD3D9Renderer/Include/CmD3D9Device.h

@@ -44,8 +44,8 @@ namespace CamelotFramework {
 
 	// Interface.
 	public:
-		void					attachRenderWindow		(D3D9RenderWindow* renderWindow);
-		void					detachRenderWindow		(D3D9RenderWindow* renderWindow);
+		void					attachRenderWindow		(const D3D9RenderWindow* renderWindow);
+		void					detachRenderWindow		(const D3D9RenderWindow* renderWindow);
 	
 		bool					acquire					();
 		
@@ -53,7 +53,7 @@ namespace CamelotFramework {
 		void					destroy					();		
 		
 		bool					isDeviceLost			();				
-		IDirect3DDevice9*		getD3D9Device			();
+		IDirect3DDevice9*		getD3D9Device			() const;
 					
 		UINT					getAdapterNumber		() const;
 		D3DDEVTYPE				getDeviceType			() const;
@@ -65,17 +65,17 @@ namespace CamelotFramework {
 		D3DFORMAT				getDepthStencilFormat	() const;
 
 		bool					validate				(D3D9RenderWindow* renderWindow);
-		void					invalidate				(D3D9RenderWindow* renderWindow);
+		void					invalidate				(const D3D9RenderWindow* renderWindow);
 
-		void					present					(D3D9RenderWindow* renderWindow);
+		void					present					(const D3D9RenderWindow* renderWindow);
 		
-		IDirect3DSurface9*		getDepthBuffer			(D3D9RenderWindow* renderWindow);
-		IDirect3DSurface9*		getBackBuffer			(D3D9RenderWindow* renderWindow);
+		IDirect3DSurface9*		getDepthBuffer			(const D3D9RenderWindow* renderWindow);
+		IDirect3DSurface9*		getBackBuffer			(const D3D9RenderWindow* renderWindow);
 
 		UINT32					getLastPresentFrame		() const { return mLastPresentFrame; }
 
-		void					setAdapterOrdinalIndex  (D3D9RenderWindow* renderWindow, UINT32 adapterOrdinalInGroupIndex);
-		void					copyContentsToMemory(D3D9RenderWindow* window, const PixelData &dst, RenderTarget::FrameBuffer buffer);
+		void					setAdapterOrdinalIndex  (const D3D9RenderWindow* renderWindow, UINT32 adapterOrdinalInGroupIndex);
+		void					copyContentsToMemory(const D3D9RenderWindow* window, const PixelData &dst, RenderTarget::FrameBuffer buffer);
 		void					clearDeviceStreams		();
 	
 	public:
@@ -114,16 +114,16 @@ namespace CamelotFramework {
 			D3DPRESENT_PARAMETERS	presentParameters;				// Present parameters of the render window.
 			bool					acquired;						// True if resources acquired.			
 		};		
-		typedef map<D3D9RenderWindow*, RenderWindowResources*>::type RenderWindowToResorucesMap;
+		typedef map<const D3D9RenderWindow*, RenderWindowResources*>::type RenderWindowToResorucesMap;
 		typedef RenderWindowToResorucesMap::iterator				 RenderWindowToResorucesIterator;
 
 		RenderWindowToResorucesMap mMapRenderWindowToResoruces;		// Map between render window to resources.
 
 
 	protected:
-		RenderWindowToResorucesIterator getRenderWindowIterator (D3D9RenderWindow* renderWindow);
+		RenderWindowToResorucesIterator getRenderWindowIterator (const D3D9RenderWindow* renderWindow);
 
-		bool					acquire							(D3D9RenderWindow* renderWindow);
+		bool					acquire							(const D3D9RenderWindow* renderWindow);
 		bool					reset							();
 		void					updatePresentationParameters	();
 		void					updateRenderWindowsIndices		();
@@ -135,11 +135,11 @@ namespace CamelotFramework {
 		void					notifyDeviceLost				();
 
 		void					validateFocusWindow				();
-		void					validateBackBufferSize			(D3D9RenderWindow* renderWindow);
+		void					validateBackBufferSize			(const D3D9RenderWindow* renderWindow);
 		bool					validateDisplayMonitor			(D3D9RenderWindow* renderWindow);
-		bool					validateDeviceState				(D3D9RenderWindow* renderWindow);
-		bool					isSwapChainWindow				(D3D9RenderWindow* renderWindow);
-		D3D9RenderWindow*		getPrimaryWindow				();
+		bool					validateDeviceState				(const D3D9RenderWindow* renderWindow);
+		bool					isSwapChainWindow				(const D3D9RenderWindow* renderWindow);
+		const D3D9RenderWindow*	getPrimaryWindow				();
 		void					setSharedWindowHandle			(HWND hSharedHWND);
 
 	private:

+ 1 - 1
CamelotD3D9Renderer/Include/CmD3D9MultiRenderTexture.h

@@ -11,7 +11,7 @@ namespace CamelotFramework
 		virtual ~D3D9MultiRenderTexture();
 
 		bool requiresTextureFlipping() const { return false; }
-		void getCustomAttribute(const String& name, void* pData);
+		void getCustomAttribute(const String& name, void* pData) const;
 
 	protected:
 		friend class D3D9TextureManager;

+ 3 - 3
CamelotD3D9Renderer/Include/CmD3D9RenderSystem.h

@@ -174,7 +174,7 @@ namespace CamelotFramework
 
 		/// Take in some requested FSAA settings and output supported D3D settings
 		void determineFSAASettings(IDirect3DDevice9* d3d9Device, UINT32 fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat, 
-			bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality);
+			bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality) const;
 
 		void registerWindow(RenderWindow& renderWindow);
 
@@ -188,7 +188,7 @@ namespace CamelotFramework
 		// Scissor test rectangle
 		RECT mScissorRect;
 		/// List of D3D drivers installed (video cards)
-		D3D9DriverList* mDriverList;
+		mutable D3D9DriverList* mDriverList; // TODO - Mutable because it gets constructed in getDirect3DDrivers(). Change that.
 		/// Currently active driver
 		D3D9Driver* mActiveD3DDriver;
 		/// NVPerfHUD allowed?
@@ -214,7 +214,7 @@ namespace CamelotFramework
 		UINT32 mNumTexStages;
 		sD3DTextureStageDesc* mTexStageDesc;
 
-		D3D9DriverList* getDirect3DDrivers();
+		D3D9DriverList* getDirect3DDrivers() const;
 				
 		// state management methods, very primitive !!!
 		HRESULT __SetRenderState(D3DRENDERSTATETYPE state, DWORD value);

+ 1 - 1
CamelotD3D9Renderer/Include/CmD3D9RenderTexture.h

@@ -12,7 +12,7 @@ namespace CamelotFramework
 		virtual ~D3D9RenderTexture();
 
 		bool requiresTextureFlipping() const { return false; }
-		virtual void getCustomAttribute(const String& name, void* pData);
+		virtual void getCustomAttribute(const String& name, void* pData) const;
 
 	protected:
 		friend class D3D9TextureManager;

+ 5 - 5
CamelotD3D9Renderer/Include/CmD3D9RenderWindow.h

@@ -47,11 +47,11 @@ namespace CamelotFramework
 		void 				reposition			(int left, int top);
 		void 				resize				(unsigned int width, unsigned int height);
 		HWND 				getWindowHandle		() const { return mHWnd; }				
-		IDirect3DDevice9*	getD3D9Device		();
-		D3D9Device*			getDevice			();
+		IDirect3DDevice9*	getD3D9Device		() const;
+		D3D9Device*			getDevice			() const;
 		void				setDevice			(D3D9Device* device);
 
-		void				getCustomAttribute	(const String& name, void* pData);
+		void				getCustomAttribute	(const String& name, void* pData) const;
 		
 		/** Overridden - see RenderTarget.
 		*/
@@ -64,10 +64,10 @@ namespace CamelotFramework
 		void				windowMovedOrResized	();
 	
 		/// Build the presentation parameters used with this window
-		void				buildPresentParameters	(D3DPRESENT_PARAMETERS* presentParams);
+		void				buildPresentParameters	(D3DPRESENT_PARAMETERS* presentParams) const;
 		
 		/// Accessor for render surface
-		IDirect3DSurface9* getRenderSurface();
+		IDirect3DSurface9* getRenderSurface() const;
 
 		/// Are we in the middle of switching between fullscreen and windowed
 		bool _getSwitchingFullscreen() const;

+ 19 - 20
CamelotD3D9Renderer/Source/CmD3D9Device.cpp

@@ -67,7 +67,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	D3D9Device::RenderWindowToResorucesIterator D3D9Device::getRenderWindowIterator(D3D9RenderWindow* renderWindow)
+	D3D9Device::RenderWindowToResorucesIterator D3D9Device::getRenderWindowIterator(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = mMapRenderWindowToResoruces.find(renderWindow);
 
@@ -78,7 +78,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	void D3D9Device::attachRenderWindow(D3D9RenderWindow* renderWindow)
+	void D3D9Device::attachRenderWindow(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = mMapRenderWindowToResoruces.find(renderWindow);
 
@@ -95,7 +95,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	void D3D9Device::detachRenderWindow(D3D9RenderWindow* renderWindow)
+	void D3D9Device::detachRenderWindow(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = mMapRenderWindowToResoruces.find(renderWindow);
 
@@ -218,7 +218,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	bool D3D9Device::acquire(D3D9RenderWindow* renderWindow)
+	bool D3D9Device::acquire(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);
 		
@@ -243,7 +243,7 @@ namespace CamelotFramework
 	}	
 
 	//---------------------------------------------------------------------
-	IDirect3DSurface9* D3D9Device::getDepthBuffer(D3D9RenderWindow* renderWindow)
+	IDirect3DSurface9* D3D9Device::getDepthBuffer(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);		
 
@@ -251,14 +251,14 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	IDirect3DSurface9* D3D9Device::getBackBuffer(D3D9RenderWindow* renderWindow)
+	IDirect3DSurface9* D3D9Device::getBackBuffer(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);
 	
 		return it->second->backBuffer;		
 	}
 	//---------------------------------------------------------------------
-	void D3D9Device::setAdapterOrdinalIndex(D3D9RenderWindow* renderWindow, UINT32 adapterOrdinalInGroupIndex)
+	void D3D9Device::setAdapterOrdinalIndex(const D3D9RenderWindow* renderWindow, UINT32 adapterOrdinalInGroupIndex)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);
 
@@ -461,7 +461,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	IDirect3DDevice9* D3D9Device::getD3D9Device()
+	IDirect3DDevice9* D3D9Device::getD3D9Device() const
 	{
 		return mpDevice;
 	}
@@ -483,7 +483,7 @@ namespace CamelotFramework
 
 			while (it != mMapRenderWindowToResoruces.end())
 			{
-				D3D9RenderWindow* renderWindow = it->first;
+				const D3D9RenderWindow* renderWindow = it->first;
 				RenderWindowResources* renderWindowResources = it->second;
 
 				// Ask the render window to build it's own parameters.
@@ -598,7 +598,7 @@ namespace CamelotFramework
 	void D3D9Device::createD3D9Device()
 	{		
 		// Update focus window.
-		D3D9RenderWindow* primaryRenderWindow = getPrimaryWindow();
+		const D3D9RenderWindow* primaryRenderWindow = getPrimaryWindow();
 
 		// Case we have to share the same focus window.
 		if (msSharedFocusWindow != NULL)
@@ -732,7 +732,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	void D3D9Device::invalidate(D3D9RenderWindow* renderWindow)
+	void D3D9Device::invalidate(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);
 
@@ -778,7 +778,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	bool D3D9Device::validateDeviceState(D3D9RenderWindow* renderWindow)
+	bool D3D9Device::validateDeviceState(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);		
 		RenderWindowResources* renderWindowResources =  it->second;
@@ -841,7 +841,7 @@ namespace CamelotFramework
 		
 
 	//---------------------------------------------------------------------
-	void D3D9Device::validateBackBufferSize(D3D9RenderWindow* renderWindow)
+	void D3D9Device::validateBackBufferSize(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);
 		RenderWindowResources*	renderWindowResources = it->second;
@@ -870,7 +870,6 @@ namespace CamelotFramework
 		if (renderWindow->isFullScreen())
 			return true;
 
-		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);
 		HMONITOR	hRenderWindowMonitor = NULL;
 
 		// Find the monitor this render window belongs to.
@@ -899,7 +898,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	void D3D9Device::present(D3D9RenderWindow* renderWindow)
+	void D3D9Device::present(const D3D9RenderWindow* renderWindow)
 	{		
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);
 		RenderWindowResources*	renderWindowResources = it->second;				
@@ -950,7 +949,7 @@ namespace CamelotFramework
 	void D3D9Device::acquireRenderWindowResources(RenderWindowToResorucesIterator it)
 	{
 		RenderWindowResources*	renderWindowResources = it->second;
-		D3D9RenderWindow*		renderWindow = it->first;			
+		const D3D9RenderWindow*	renderWindow = it->first;			
 		
 		releaseRenderWindowResources(renderWindowResources);
 
@@ -1036,7 +1035,7 @@ namespace CamelotFramework
 		renderWindowResources->acquired = true; 
 	}
 	//---------------------------------------------------------------------
-	bool D3D9Device::isSwapChainWindow(D3D9RenderWindow* renderWindow)
+	bool D3D9Device::isSwapChainWindow(const D3D9RenderWindow* renderWindow)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);
 		
@@ -1047,7 +1046,7 @@ namespace CamelotFramework
 	}
 
 	//---------------------------------------------------------------------
-	D3D9RenderWindow* D3D9Device::getPrimaryWindow()
+	const D3D9RenderWindow* D3D9Device::getPrimaryWindow()
 	{		
 		RenderWindowToResorucesIterator it = mMapRenderWindowToResoruces.begin();
 	
@@ -1093,7 +1092,7 @@ namespace CamelotFramework
 			UINT32 nextPresParamIndex = 0;
 
 			RenderWindowToResorucesIterator it;
-			D3D9RenderWindow* deviceFocusWindow = NULL;
+			const D3D9RenderWindow* deviceFocusWindow = NULL;
 
 			// In case a d3d9 device exists - try to keep the present parameters order
 			// so that the window that the device is focused on will stay the same and we
@@ -1129,7 +1128,7 @@ namespace CamelotFramework
 		}
 	}
 	//---------------------------------------------------------------------
-	void D3D9Device::copyContentsToMemory(D3D9RenderWindow* renderWindow, 
+	void D3D9Device::copyContentsToMemory(const D3D9RenderWindow* renderWindow, 
 		const PixelData &dst, RenderTarget::FrameBuffer buffer)
 	{
 		RenderWindowToResorucesIterator it = getRenderWindowIterator(renderWindow);

+ 1 - 1
CamelotD3D9Renderer/Source/CmD3D9MultiRenderTexture.cpp

@@ -49,7 +49,7 @@ namespace CamelotFramework
 		MultiRenderTexture::initialize_internal();
 	}
 
-	void D3D9MultiRenderTexture::getCustomAttribute(const String& name, void* pData)
+	void D3D9MultiRenderTexture::getCustomAttribute(const String& name, void* pData) const
 	{
 		if(name == "DDBACKBUFFER")
 		{

+ 3 - 3
CamelotD3D9Renderer/Source/CmD3D9RenderSystem.cpp

@@ -1570,7 +1570,7 @@ namespace CamelotFramework
 	/************************************************************************/
 
 	//---------------------------------------------------------------------
-	D3D9DriverList* D3D9RenderSystem::getDirect3DDrivers()
+	D3D9DriverList* D3D9RenderSystem::getDirect3DDrivers() const
 	{
 		if( !mDriverList )
 			mDriverList = CM_NEW(D3D9DriverList, GenAlloc) D3D9DriverList();
@@ -2292,7 +2292,7 @@ namespace CamelotFramework
 		for (UINT32 i = 0; i < mDeviceManager->getDeviceCount(); ++i)
 		{
 			D3D9Device* currDevice = mDeviceManager->getDevice(i);
-			D3D9RenderWindow* currDevicePrimaryWindow = currDevice->getPrimaryWindow();
+			const D3D9RenderWindow* currDevicePrimaryWindow = currDevice->getPrimaryWindow();
 			IDirect3DSurface9* pSurface = currDevicePrimaryWindow->getRenderSurface();
 			D3DSURFACE_DESC srfDesc;
 
@@ -2376,7 +2376,7 @@ namespace CamelotFramework
 	//---------------------------------------------------------------------
 	void D3D9RenderSystem::determineFSAASettings(IDirect3DDevice9* d3d9Device,
 		UINT32 fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat, 
-		bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality)
+		bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality) const
 	{
 		bool ok = false;
 		bool qualityHint = fsaaHint.find("Quality") != String::npos;

+ 1 - 1
CamelotD3D9Renderer/Source/CmD3D9RenderTexture.cpp

@@ -17,7 +17,7 @@ namespace CamelotFramework
 
 	}
 
-	void D3D9RenderTexture::getCustomAttribute(const String& name, void* pData)
+	void D3D9RenderTexture::getCustomAttribute(const String& name, void* pData) const
 	{
 		if(name == "DDBACKBUFFER")
 		{

+ 11 - 8
CamelotD3D9Renderer/Source/CmD3D9RenderWindow.cpp

@@ -426,7 +426,7 @@ namespace CamelotFramework
 		mSwitchingFullscreen = false;
 	}
 	
-	void D3D9RenderWindow::buildPresentParameters(D3DPRESENT_PARAMETERS* presentParams)
+	void D3D9RenderWindow::buildPresentParameters(D3DPRESENT_PARAMETERS* presentParams) const
 	{		
 		// Set up the presentation parameters		
 		IDirect3D9* pD3D = D3D9RenderSystem::getDirect3D9();
@@ -544,12 +544,15 @@ namespace CamelotFramework
 
 		D3D9RenderSystem* rsys = static_cast<D3D9RenderSystem*>(CamelotFramework::RenderSystem::instancePtr());
 
+		D3DMULTISAMPLE_TYPE fsaaType;
+		DWORD fsaaQuality;
+
 		rsys->determineFSAASettings(mDevice->getD3D9Device(),
 			mFSAA, mFSAAHint, presentParams->BackBufferFormat, mIsFullScreen, 
-			&mFSAAType, &mFSAAQuality);
+			&fsaaType, &fsaaQuality);
 
-		presentParams->MultiSampleType = mFSAAType;
-		presentParams->MultiSampleQuality = (mFSAAQuality == 0) ? 0 : mFSAAQuality;
+		presentParams->MultiSampleType = fsaaType;
+		presentParams->MultiSampleQuality = (fsaaQuality == 0) ? 0 : fsaaQuality;
 
 		// Check sRGB
 		if (mHwGamma)
@@ -614,7 +617,7 @@ namespace CamelotFramework
 			mDevice->present(this);		
 	}
 
-	void D3D9RenderWindow::getCustomAttribute( const String& name, void* pData )
+	void D3D9RenderWindow::getCustomAttribute( const String& name, void* pData ) const
 	{
 		// Valid attributes and their equvalent native functions:
 		// D3DDEVICE			: getD3DDevice
@@ -664,13 +667,13 @@ namespace CamelotFramework
 		mDevice->copyContentsToMemory(this, dst, buffer);
 	}
 	//-----------------------------------------------------------------------------
-	IDirect3DDevice9* D3D9RenderWindow::getD3D9Device()
+	IDirect3DDevice9* D3D9RenderWindow::getD3D9Device() const
 	{
 		return mDevice->getD3D9Device();
 	}
 
 	//-----------------------------------------------------------------------------
-	IDirect3DSurface9* D3D9RenderWindow::getRenderSurface()
+	IDirect3DSurface9* D3D9RenderWindow::getRenderSurface() const 
 	{
 		return mDevice->getBackBuffer(this);
 	}
@@ -682,7 +685,7 @@ namespace CamelotFramework
 	}
 
 	//-----------------------------------------------------------------------------
-	D3D9Device* D3D9RenderWindow::getDevice()
+	D3D9Device* D3D9RenderWindow::getDevice() const
 	{
 		return mDevice;
 	}

+ 1 - 1
CamelotGLRenderer/Include/CmGLMultiRenderTexture.h

@@ -12,7 +12,7 @@ namespace CamelotFramework
 		virtual ~GLMultiRenderTexture();
 
 		bool requiresTextureFlipping() const { return true; }
-		void getCustomAttribute(const String& name, void* pData);
+		void getCustomAttribute(const String& name, void* pData) const;
 	protected:
 		friend class GLTextureManager;
 

+ 1 - 1
CamelotGLRenderer/Include/CmGLRenderTexture.h

@@ -47,7 +47,7 @@ namespace CamelotFramework
 		virtual ~GLRenderTexture();
 
 		bool requiresTextureFlipping() const { return true; }
-		virtual void getCustomAttribute(const String& name, void* pData);
+		virtual void getCustomAttribute(const String& name, void* pData) const;
 
 	protected:
 		friend class GLTextureManager;

+ 1 - 1
CamelotGLRenderer/Include/CmWin32Window.h

@@ -58,7 +58,7 @@ namespace CamelotFramework {
 		// Method for dealing with resize / move & 3d library
 		virtual void windowMovedOrResized(void);
 
-		void getCustomAttribute( const String& name, void* pData );
+		void getCustomAttribute( const String& name, void* pData ) const;
 
         /** Used to set the active state of the render target.
         */

+ 1 - 1
CamelotGLRenderer/Source/CmGLMultiRenderTexture.cpp

@@ -66,7 +66,7 @@ namespace CamelotFramework
 		MultiRenderTexture::destroy_internal();
 	}
 
-	void GLMultiRenderTexture::getCustomAttribute(const String& name, void* pData)
+	void GLMultiRenderTexture::getCustomAttribute(const String& name, void* pData) const
 	{
 		if(name=="FBO")
 		{

+ 1 - 1
CamelotGLRenderer/Source/CmGLRenderTexture.cpp

@@ -76,7 +76,7 @@ namespace CamelotFramework
 		RenderTexture::initialize_internal();
 	}
 
-	void GLRenderTexture::getCustomAttribute(const String& name, void* pData)
+	void GLRenderTexture::getCustomAttribute(const String& name, void* pData) const
 	{
 		if(name=="FBO")
 		{

+ 1 - 1
CamelotGLRenderer/Source/CmWin32Window.cpp

@@ -676,7 +676,7 @@ namespace CamelotFramework {
 		}
 	}
 
-	void Win32Window::getCustomAttribute( const String& name, void* pData )
+	void Win32Window::getCustomAttribute( const String& name, void* pData ) const
 	{
 		if( name == "GLCONTEXT" ) {
 			*static_cast<GLContext**>(pData) = mContext;