瀏覽代碼

GLRenderSystem ported to x64

Marko Pintera 13 年之前
父節點
當前提交
c138b62b72
共有 38 個文件被更改,包括 262 次插入196 次删除
  1. 2 2
      CamelotD3D9Renderer/Include/CmD3D9MultiRenderTarget.h
  2. 11 11
      CamelotD3D9Renderer/Include/CmD3D9RenderSystem.h
  3. 4 4
      CamelotD3D9Renderer/Source/CmD3D9MultiRenderTarget.cpp
  4. 24 24
      CamelotD3D9Renderer/Source/CmD3D9RenderSystem.cpp
  5. 65 0
      CamelotGLRenderer/CamelotGLRenderer.vcxproj
  6. 2 2
      CamelotGLRenderer/Include/CmGLFBOMultiRenderTarget.h
  7. 6 6
      CamelotGLRenderer/Include/CmGLFBORenderTexture.h
  8. 5 5
      CamelotGLRenderer/Include/CmGLFrameBufferObject.h
  9. 2 2
      CamelotGLRenderer/Include/CmGLPBRenderTexture.h
  10. 4 4
      CamelotGLRenderer/Include/CmGLPBuffer.h
  11. 2 2
      CamelotGLRenderer/Include/CmGLPixelFormat.h
  12. 10 10
      CamelotGLRenderer/Include/CmGLRenderSystem.h
  13. 1 1
      CamelotGLRenderer/Include/CmGLRenderTexture.h
  14. 1 1
      CamelotGLRenderer/Include/CmWin32GLSupport.h
  15. 1 1
      CamelotGLRenderer/Include/CmWin32RenderTexture.h
  16. 2 2
      CamelotGLRenderer/Source/CmGLFBOMultiRenderTarget.cpp
  17. 7 7
      CamelotGLRenderer/Source/CmGLFBORenderTexture.cpp
  18. 11 11
      CamelotGLRenderer/Source/CmGLFrameBufferObject.cpp
  19. 2 2
      CamelotGLRenderer/Source/CmGLGpuProgram.cpp
  20. 3 3
      CamelotGLRenderer/Source/CmGLPBRenderTexture.cpp
  21. 3 3
      CamelotGLRenderer/Source/CmGLPixelFormat.cpp
  22. 11 11
      CamelotGLRenderer/Source/CmGLRenderSystem.cpp
  23. 4 4
      CamelotGLRenderer/Source/CmGLTextureManager.cpp
  24. 1 1
      CamelotGLRenderer/Source/CmWin32GLSupport.cpp
  25. 1 1
      CamelotGLRenderer/Source/CmWin32RenderTexture.cpp
  26. 3 3
      CamelotGLRenderer/Source/GLSL/src/CmGLSLPreprocessor.cpp
  27. 4 4
      CamelotGLRenderer/Source/atifs/include/Compiler2Pass.h
  28. 2 2
      CamelotGLRenderer/Source/atifs/src/ATI_FS_GLGpuProgram.cpp
  29. 7 7
      CamelotGLRenderer/Source/atifs/src/Compiler2Pass.cpp
  30. 2 2
      CamelotGLRenderer/Source/atifs/src/ps_1_4.cpp
  31. 1 1
      CamelotRenderer.sln
  32. 27 27
      CamelotRenderer/Include/CmRenderSystem.h
  33. 9 9
      CamelotRenderer/Include/CmRenderTexture.h
  34. 18 18
      CamelotRenderer/Source/CmRenderSystem.cpp
  35. 1 1
      CamelotRenderer/Source/CmRenderTexture.cpp
  36. 1 0
      CamelotRenderer/TODO.txt
  37. 1 1
      CamelotUtility/Include/CmPixelUtil.h
  38. 1 1
      CamelotUtility/Source/CmPixelUtil.cpp

+ 2 - 2
CamelotD3D9Renderer/Include/CmD3D9MultiRenderTarget.h

@@ -48,8 +48,8 @@ namespace CamelotEngine {
 		bool requiresTextureFlipping() const { return false; }
 	private:
 		D3D9HardwarePixelBuffer *mRenderTargets[CM_MAX_MULTIPLE_RENDER_TARGETS];
-		virtual void bindSurfaceImpl(size_t attachment, RenderTexture *target);
-		virtual void unbindSurfaceImpl(size_t attachment);
+		virtual void bindSurfaceImpl(UINT32 attachment, RenderTexture *target);
+		virtual void unbindSurfaceImpl(UINT32 attachment);
 
 		/** Check surfaces and update RenderTarget extent */
 		void checkAndUpdate();

+ 11 - 11
CamelotD3D9Renderer/Include/CmD3D9RenderSystem.h

@@ -203,7 +203,7 @@ namespace CamelotEngine
 			multisample type.
 			@returns A directx surface, or 0 if there is no compatible depthstencil possible.
 		*/
-		IDirect3DSurface9* getDepthStencilFor(D3DFORMAT fmt, D3DMULTISAMPLE_TYPE multisample, DWORD multisample_quality, size_t width, size_t height);
+		IDirect3DSurface9* getDepthStencilFor(D3DFORMAT fmt, D3DMULTISAMPLE_TYPE multisample, DWORD multisample_quality, UINT16 width, UINT16 height);
 
 		/** Clear all cached depth stencil surfaces
 		*/
@@ -215,7 +215,7 @@ namespace CamelotEngine
         bool checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage);
 
 		/// Take in some requested FSAA settings and output supported D3D settings
-		void determineFSAASettings(IDirect3DDevice9* d3d9Device, size_t fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat, 
+		void determineFSAASettings(IDirect3DDevice9* d3d9Device, UINT16 fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat, 
 			bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality);
 	public:
 		// constructor
@@ -248,12 +248,12 @@ namespace CamelotEngine
 		// Low-level overridden members, mainly for internal use
 		void setPointParameters_internal(float size, bool attenuationEnabled, 
 			float constant, float linear, float quadratic, float minSize, float maxSize);
-		void setTexture_internal(size_t unit, bool enabled, const TexturePtr &texPtr);
-		void setVertexTexture_internal(size_t unit, const TexturePtr& tex);
-		void disableTextureUnit_internal(size_t texUnit);
-        void setTextureAddressingMode_internal(size_t stage, const SamplerState::UVWAddressingMode& uvw);
-        void setTextureBorderColor_internal(size_t stage, const Color& colour);
-		void setTextureMipmapBias_internal(size_t unit, float bias);
+		void setTexture_internal(UINT16 unit, bool enabled, const TexturePtr &texPtr);
+		void setVertexTexture_internal(UINT16 unit, const TexturePtr& tex);
+		void disableTextureUnit_internal(UINT16 texUnit);
+        void setTextureAddressingMode_internal(UINT16 stage, const SamplerState::UVWAddressingMode& uvw);
+        void setTextureBorderColor_internal(UINT16 stage, const Color& colour);
+		void setTextureMipmapBias_internal(UINT16 unit, float bias);
 		void setSceneBlending_internal( SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendOperation op );
 		void setSeparateSceneBlending_internal( SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendFactor sourceFactorAlpha, SceneBlendFactor destFactorAlpha, SceneBlendOperation op, SceneBlendOperation alphaOp );
 		void setAlphaRejectSettings_internal( CompareFunction func, unsigned char value, bool alphaToCoverage );
@@ -269,13 +269,13 @@ namespace CamelotEngine
 		void setDepthBias_internal(float constantBias, float slopeScaleBias);
 		void convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, bool forGpuProgram = false);
 		void setPolygonMode_internal(PolygonMode level);
-        void setTextureFiltering_internal(size_t unit, FilterType ftype, FilterOptions filter);
-		void setTextureAnisotropy_internal(size_t unit, unsigned int maxAnisotropy);
+        void setTextureFiltering_internal(UINT16 unit, FilterType ftype, FilterOptions filter);
+		void setTextureAnisotropy_internal(UINT16 unit, unsigned int maxAnisotropy);
 		void setVertexDeclaration_internal(VertexDeclarationPtr decl);
 		void setVertexBufferBinding_internal(VertexBufferBinding* binding);
         void render_internal(const RenderOperation& op);
 
-        void setScissorTest_internal(bool enabled, size_t left = 0, size_t top = 0, size_t right = 800, size_t bottom = 600);
+        void setScissorTest_internal(bool enabled, UINT32 left = 0, UINT32 top = 0, UINT32 right = 800, UINT32 bottom = 600);
         void clearFrameBuffer_internal(unsigned int buffers, 
             const Color& colour = Color::Black, 
             float depth = 1.0f, unsigned short stencil = 0);

+ 4 - 4
CamelotD3D9Renderer/Source/CmD3D9MultiRenderTarget.cpp

@@ -40,7 +40,7 @@ namespace CamelotEngine
 		MultiRenderTarget(name)
 	{
 		/// Clear targets
-		for(size_t x=0; x<CM_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+		for(UINT32 x=0; x<CM_MAX_MULTIPLE_RENDER_TARGETS; ++x)
 		{
 			mRenderTargets[x] = 0;
 		}
@@ -49,7 +49,7 @@ namespace CamelotEngine
 	{
 	}
 
-	void D3D9MultiRenderTarget::bindSurfaceImpl(size_t attachment, RenderTexture *target)
+	void D3D9MultiRenderTarget::bindSurfaceImpl(UINT32 attachment, RenderTexture *target)
 	{
 		assert(attachment<CM_MAX_MULTIPLE_RENDER_TARGETS);
 		/// Get buffer and surface to bind to
@@ -82,7 +82,7 @@ namespace CamelotEngine
 		checkAndUpdate();
 	}
 
-	void D3D9MultiRenderTarget::unbindSurfaceImpl(size_t attachment)
+	void D3D9MultiRenderTarget::unbindSurfaceImpl(UINT32 attachment)
 	{
 		assert(attachment<CM_MAX_MULTIPLE_RENDER_TARGETS);
 		mRenderTargets[attachment] = 0;
@@ -121,7 +121,7 @@ namespace CamelotEngine
         {
             IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
 			/// Transfer surfaces
-			for(size_t x=0; x<CM_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+			for(UINT32 x=0; x<CM_MAX_MULTIPLE_RENDER_TARGETS; ++x)
 			{
 				if(mRenderTargets[x] != NULL)								
 					pSurf[x] = mRenderTargets[x]->getSurface(D3D9RenderSystem::getActiveD3D9Device());			

+ 24 - 24
CamelotD3D9Renderer/Source/CmD3D9RenderSystem.cpp

@@ -346,7 +346,7 @@ namespace CamelotEngine
 				{
 					if (i->second.variability & variability)
 					{
-						size_t logicalIndex = i->first;
+						UINT32 logicalIndex = i->first;
 						TextureHandle texture = params->getTexture(i->second.physicalIndex);
 
 						if(!texture.isLoaded())
@@ -371,9 +371,9 @@ namespace CamelotEngine
 					{
 						if (i->second.variability & variability)
 						{
-							size_t logicalIndex = i->first;
+							UINT32 logicalIndex = i->first;
 							const float* pFloat = params->getFloatPointer(i->second.physicalIndex);
-							size_t slotCount = i->second.currentSize / 4;
+							UINT32 slotCount = i->second.currentSize / 4;
 							assert (i->second.currentSize % 4 == 0 && "Should not have any "
 								"elements less than 4 wide for D3D9");
 
@@ -396,9 +396,9 @@ namespace CamelotEngine
 					{
 						if (i->second.variability & variability)
 						{
-							size_t logicalIndex = i->first;
+							UINT32 logicalIndex = i->first;
 							const int* pInt = params->getIntPointer(i->second.physicalIndex);
-							size_t slotCount = i->second.currentSize / 4;
+							UINT32 slotCount = i->second.currentSize / 4;
 							assert (i->second.currentSize % 4 == 0 && "Should not have any "
 								"elements less than 4 wide for D3D9");
 
@@ -423,9 +423,9 @@ namespace CamelotEngine
 					{
 						if (i->second.variability & variability)
 						{
-							size_t logicalIndex = i->first;
+							UINT32 logicalIndex = i->first;
 							const float* pFloat = params->getFloatPointer(i->second.physicalIndex);
-							size_t slotCount = i->second.currentSize / 4;
+							UINT32 slotCount = i->second.currentSize / 4;
 							assert (i->second.currentSize % 4 == 0 && "Should not have any "
 								"elements less than 4 wide for D3D9");
 
@@ -447,9 +447,9 @@ namespace CamelotEngine
 					{
 						if (i->second.variability & variability)
 						{
-							size_t logicalIndex = i->first;
+							UINT32 logicalIndex = i->first;
 							const int* pInt = params->getIntPointer(i->second.physicalIndex);
-							size_t slotCount = i->second.currentSize / 4;
+							UINT32 slotCount = i->second.currentSize / 4;
 							assert (i->second.currentSize % 4 == 0 && "Should not have any "
 								"elements less than 4 wide for D3D9");
 
@@ -519,7 +519,7 @@ namespace CamelotEngine
 
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::setTexture_internal( size_t stage, bool enabled, const TexturePtr& tex )
+	void D3D9RenderSystem::setTexture_internal( UINT16 stage, bool enabled, const TexturePtr& tex )
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -579,7 +579,7 @@ namespace CamelotEngine
 		}
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::setVertexTexture_internal(size_t stage, const TexturePtr& tex)
+	void D3D9RenderSystem::setVertexTexture_internal(UINT16 stage, const TexturePtr& tex)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -622,7 +622,7 @@ namespace CamelotEngine
 
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::disableTextureUnit_internal(size_t texUnit)
+	void D3D9RenderSystem::disableTextureUnit_internal(UINT16 texUnit)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -632,7 +632,7 @@ namespace CamelotEngine
 		setVertexTexture_internal(texUnit, nullPtr);
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::setTextureMipmapBias_internal(size_t unit, float bias)
+	void D3D9RenderSystem::setTextureMipmapBias_internal(UINT16 unit, float bias)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -647,7 +647,7 @@ namespace CamelotEngine
 		}
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::setTextureAddressingMode_internal( size_t stage, 
+	void D3D9RenderSystem::setTextureAddressingMode_internal( UINT16 stage, 
 		const SamplerState::UVWAddressingMode& uvw )
 	{
 		THROW_IF_NOT_RENDER_THREAD;
@@ -661,7 +661,7 @@ namespace CamelotEngine
 			CM_EXCEPT(RenderingAPIException, "Failed to set texture addressing mode for W");
 	}
 	//-----------------------------------------------------------------------------
-	void D3D9RenderSystem::setTextureBorderColor_internal(size_t stage,
+	void D3D9RenderSystem::setTextureBorderColor_internal(UINT16 stage,
 		const Color& colour)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
@@ -997,7 +997,7 @@ namespace CamelotEngine
 			CM_EXCEPT(RenderingAPIException, "Error setting stencil pass operation.");
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::setTextureFiltering_internal(size_t unit, FilterType ftype, 
+	void D3D9RenderSystem::setTextureFiltering_internal(UINT16 unit, FilterType ftype, 
 		FilterOptions filter)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
@@ -1011,7 +1011,7 @@ namespace CamelotEngine
 	}
 
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::setTextureAnisotropy_internal(size_t unit, unsigned int maxAnisotropy)
+	void D3D9RenderSystem::setTextureAnisotropy_internal(UINT16 unit, unsigned int maxAnisotropy)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -1327,8 +1327,8 @@ namespace CamelotEngine
 	}
 	
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::setScissorTest_internal(bool enabled, size_t left, size_t top, size_t right,
-		size_t bottom)
+	void D3D9RenderSystem::setScissorTest_internal(bool enabled, UINT32 left, UINT32 top, UINT32 right,
+		UINT32 bottom)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -2516,17 +2516,17 @@ namespace CamelotEngine
 		mActiveViewport = Viewport();
 
 		// Reset the texture stages, they will need to be rebound
-		for (size_t i = 0; i < CM_MAX_TEXTURE_LAYERS; ++i)
+		for (UINT16 i = 0; i < CM_MAX_TEXTURE_LAYERS; ++i)
 			setTexture_internal(i, false, TexturePtr());
 	}
 	//---------------------------------------------------------------------
 	void D3D9RenderSystem::determineFSAASettings(IDirect3DDevice9* d3d9Device,
-		size_t fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat, 
+		UINT32 fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat, 
 		bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality)
 	{
 		bool ok = false;
 		bool qualityHint = fsaaHint.find("Quality") != String::npos;
-		size_t origFSAA = fsaa;
+		UINT32 origFSAA = fsaa;
 
 		D3D9DriverList* driverList = getDirect3DDrivers();
 		D3D9Driver* deviceDriver = mActiveD3DDriver;
@@ -2699,7 +2699,7 @@ namespace CamelotEngine
 		return dsfmt;
 	}
 	IDirect3DSurface9* D3D9RenderSystem::getDepthStencilFor(D3DFORMAT fmt, 
-		D3DMULTISAMPLE_TYPE multisample, DWORD multisample_quality, size_t width, size_t height)
+		D3DMULTISAMPLE_TYPE multisample, DWORD multisample_quality, UINT32 width, UINT32 height)
 	{
 		D3DFORMAT dsfmt = getDepthStencilFormatFor(fmt);
 		if(dsfmt == D3DFMT_UNKNOWN)
@@ -2898,7 +2898,7 @@ namespace CamelotEngine
 		}
 	}
 	//---------------------------------------------------------------------
-	DWORD D3D9RenderSystem::_getCurrentAnisotropy(size_t unit)
+	DWORD D3D9RenderSystem::_getCurrentAnisotropy(UINT32 unit)
 	{
 		DWORD oldVal;
 		getActiveD3D9Device()->GetSamplerState(static_cast<DWORD>(unit), D3DSAMP_MAXANISOTROPY, &oldVal);

+ 65 - 0
CamelotGLRenderer/CamelotGLRenderer.vcxproj

@@ -5,10 +5,18 @@
       <Configuration>Debug</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}</ProjectGuid>
@@ -22,6 +30,12 @@
     <PlatformToolset>v110</PlatformToolset>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v110</PlatformToolset>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
     <UseDebugLibraries>false</UseDebugLibraries>
@@ -29,22 +43,41 @@
     <WholeProgramOptimization>true</WholeProgramOptimization>
     <CharacterSet>NotSet</CharacterSet>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v110</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
   </ImportGroup>
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <OutDir>..\bin\$(Configuration)\</OutDir>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <OutDir>..\bin\$(Configuration)\</OutDir>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <OutDir>..\bin\$(Platform)\$(Configuration)\</OutDir>
+  </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
@@ -59,6 +92,20 @@
       <AdditionalLibraryDirectories>..\lib\$(Configuration);..\Dependencies\lib\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>./Source/win32;./Source/GLSL/include;./Source/atifs/include;../CamelotUtility/Include;../CamelotRenderer/Include;./Include;../Dependencies/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_WINDLL;CM_RSGL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>glu32.lib;opengl32.lib;CamelotRenderer.lib;CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ImportLibrary>..lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
+      <AdditionalLibraryDirectories>..\lib\$(Platform)\$(Configuration);..\Dependencies\lib\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
@@ -77,6 +124,24 @@
       <AdditionalLibraryDirectories>..\lib\$(Configuration);..\Dependencies\lib\Release</AdditionalLibraryDirectories>
     </Link>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <AdditionalIncludeDirectories>./Source/win32;./Source/GLSL/include;./Source/atifs/include;../CamelotUtility/Include;../CamelotRenderer/Include;./Include;../Dependencies/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_WINDLL;CM_RSGL_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>glu32.lib;opengl32.lib;CamelotRenderer.lib;CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ImportLibrary>..lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
+      <AdditionalLibraryDirectories>..\lib\$(Platform)\$(Configuration);..\Dependencies\lib\x64\Release</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="Include\CmGLATIFSInit.h" />
     <ClInclude Include="Include\CmGLContext.h" />

+ 2 - 2
CamelotGLRenderer/Include/CmGLFBOMultiRenderTarget.h

@@ -44,8 +44,8 @@ namespace CamelotEngine {
 
 		bool requiresTextureFlipping() const { return true; }
 	private:
-		virtual void bindSurfaceImpl(size_t attachment, RenderTexture *target);
-		virtual void unbindSurfaceImpl(size_t attachment); 
+		virtual void bindSurfaceImpl(UINT32 attachment, RenderTexture *target);
+		virtual void unbindSurfaceImpl(UINT32 attachment); 
 		GLFrameBufferObject fbo;
 	};
 

+ 6 - 6
CamelotGLRenderer/Include/CmGLFBORenderTexture.h

@@ -86,7 +86,7 @@ namespace CamelotEngine {
         
         /** Request a render buffer. If format is GL_NONE, return a zero buffer.
         */
-        GLSurfaceDesc requestRenderBuffer(GLenum format, size_t width, size_t height, UINT32 fsaa);
+        GLSurfaceDesc requestRenderBuffer(GLenum format, UINT32 width, UINT32 height, UINT32 fsaa);
         /** Request the specify render buffer in case shared somewhere. Ignore
             silently if surface.buffer is 0.
         */
@@ -113,8 +113,8 @@ namespace CamelotEngine {
             */
             struct Mode
             {
-                size_t depth;     // Depth format (0=no depth)
-                size_t stencil;   // Stencil format (0=no stencil)
+                UINT32 depth;     // Depth format (0=no depth)
+                UINT32 stencil;   // Stencil format (0=no stencil)
             };
             
             vector<Mode>::type modes;
@@ -129,12 +129,12 @@ namespace CamelotEngine {
         */
         struct RBFormat
         {
-            RBFormat(GLenum inFormat, size_t inWidth, size_t inHeight, UINT32 fsaa):
+            RBFormat(GLenum inFormat, UINT32 inWidth, UINT32 inHeight, UINT32 fsaa):
                 format(inFormat), width(inWidth), height(inHeight), samples(fsaa)
             {}
             GLenum format;
-            size_t width;
-            size_t height;
+            UINT32 width;
+            UINT32 height;
 			UINT32 samples;
             // Overloaded comparison operator for usage in map
             bool operator < (const RBFormat &other) const

+ 5 - 5
CamelotGLRenderer/Include/CmGLFrameBufferObject.h

@@ -44,10 +44,10 @@ namespace CamelotEngine {
         /** Bind a surface to a certain attachment point.
             attachment: 0..CM_MAX_MULTIPLE_RENDER_TARGETS-1
         */
-        void bindSurface(size_t attachment, const GLSurfaceDesc &target);
+        void bindSurface(UINT32 attachment, const GLSurfaceDesc &target);
         /** Unbind attachment
         */
-        void unbindSurface(size_t attachment);
+        void unbindSurface(UINT32 attachment);
         
         /** Bind FrameBufferObject
         */
@@ -63,12 +63,12 @@ namespace CamelotEngine {
 		GLuint getGLMultisampleFBOID() const { return mMultisampleFB; }
         
         /// Accessors
-        size_t getWidth();
-        size_t getHeight();
+        UINT32 getWidth();
+        UINT32 getHeight();
         PixelFormat getFormat();
         
         GLFBOManager *getManager() { return mManager; }
-		const GLSurfaceDesc &getSurface(size_t attachment) { return mColour[attachment]; }
+		const GLSurfaceDesc &getSurface(UINT32 attachment) { return mColour[attachment]; }
     private:
         GLFBOManager *mManager;
 		GLsizei mNumSamples;

+ 2 - 2
CamelotGLRenderer/Include/CmGLPBRenderTexture.h

@@ -75,7 +75,7 @@ namespace CamelotEngine {
         
         /** Create PBuffer for a certain pixel format and size
         */
-        void requestPBuffer(PixelComponentType ctype, size_t width, size_t height);
+        void requestPBuffer(PixelComponentType ctype, UINT32 width, UINT32 height);
         
         /** Release PBuffer for a certain pixel format
         */
@@ -83,7 +83,7 @@ namespace CamelotEngine {
         
         /** Get GL rendering context for a certain component type and size.
         */
-        GLContext *getContextFor(PixelComponentType ctype, size_t width, size_t height);
+        GLContext *getContextFor(PixelComponentType ctype, UINT32 width, UINT32 height);
     protected:
         /** GLSupport reference, used to create PBuffers */
         GLSupport *mSupport;

+ 4 - 4
CamelotGLRenderer/Include/CmGLPBuffer.h

@@ -38,7 +38,7 @@ namespace CamelotEngine {
     class CM_RSGL_EXPORT GLPBuffer
     {
     public:
-        GLPBuffer(PixelComponentType format, size_t width, size_t height);
+        GLPBuffer(PixelComponentType format, UINT32 width, UINT32 height);
         virtual ~GLPBuffer();
         
         /** Get the GL context that needs to be active to render to this PBuffer.
@@ -46,15 +46,15 @@ namespace CamelotEngine {
         virtual GLContext *getContext() = 0;
         
         PixelComponentType getFormat() { return mFormat; }
-        size_t getWidth() { return mWidth; }
-        size_t getHeight() { return mHeight; }
+        UINT32 getWidth() { return mWidth; }
+        UINT32 getHeight() { return mHeight; }
         
         /** Get PBuffer component format for an OGRE pixel format.
          */
         static PixelComponentType getPixelComponentType(PixelFormat fmt);
     protected:
         PixelComponentType mFormat;
-        size_t mWidth, mHeight;
+        UINT32 mWidth, mHeight;
     };
     
 }

+ 2 - 2
CamelotGLRenderer/Include/CmGLPixelFormat.h

@@ -88,12 +88,12 @@ namespace CamelotEngine {
 				For compressed formats, constraints apply on minimum size and alignment
 				so this might differ.
 		*/
-		static size_t getMaxMipmaps(size_t width, size_t height, size_t depth, PixelFormat format);
+		static UINT32 getMaxMipmaps(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format);
         
         /** Returns next power-of-two size if required by render system, in case
             RSC_NON_POWER_OF_2_TEXTURES is supported it returns value as-is.
         */
-        static size_t optionalPO2(size_t value);
+        static UINT32 optionalPO2(UINT32 value);
 	};
 };
 

+ 10 - 10
CamelotGLRenderer/Include/CmGLRenderSystem.h

@@ -57,7 +57,7 @@ namespace CamelotEngine {
         FilterOptions mMipFilter;
 
         /// What texture coord set each texture unit is using
-        size_t mTextureCoordIndex[CM_MAX_TEXTURE_LAYERS];
+        UINT32 mTextureCoordIndex[CM_MAX_TEXTURE_LAYERS];
 
         /// Holds texture type settings for every stage
         GLenum mTextureTypes[CM_MAX_TEXTURE_LAYERS];
@@ -95,7 +95,7 @@ namespace CamelotEngine {
         GLint convertStencilOp(StencilOperation op, bool invert = false) const;
 
 		/// Internal method for anisotropy validation
-		GLfloat _getCurrentAnisotropy(size_t unit);
+		GLfloat _getCurrentAnisotropy(UINT16 unit);
 		
         /// GL support class, used for creating windows etc.
         GLSupport* mGLSupport;
@@ -129,7 +129,7 @@ namespace CamelotEngine {
 
 	protected:
 		void setClipPlanesImpl(const PlaneList& clipPlanes);
-		bool activateGLTextureUnit(size_t unit);
+		bool activateGLTextureUnit(UINT16 unit);
 
 		/// @copydoc RenderSystem::createMultiRenderTarget
 		virtual MultiRenderTarget * createMultiRenderTarget(const String & name); 
@@ -222,19 +222,19 @@ namespace CamelotEngine {
 		/** See
           RenderSystem
          */
-        void setTexture_internal(size_t unit, bool enabled, const TexturePtr &tex);
+        void setTexture_internal(UINT16 unit, bool enabled, const TexturePtr &tex);
         /** See
           RenderSystem
          */
-        void setTextureAddressingMode_internal(size_t stage, const SamplerState::UVWAddressingMode& uvw);
+        void setTextureAddressingMode_internal(UINT16 stage, const SamplerState::UVWAddressingMode& uvw);
         /** See
           RenderSystem
          */
-        void setTextureBorderColor_internal(size_t stage, const Color& colour);
+        void setTextureBorderColor_internal(UINT16 stage, const Color& colour);
 		/** See
 		  RenderSystem
 		 */
-		void setTextureMipmapBias_internal(size_t unit, float bias);
+		void setTextureMipmapBias_internal(UINT16 unit, float bias);
         /** See
           RenderSystem
          */
@@ -320,11 +320,11 @@ namespace CamelotEngine {
         /** See
           RenderSystem
          */
-        void setTextureFiltering_internal(size_t unit, FilterType ftype, FilterOptions filter);
+        void setTextureFiltering_internal(UINT16 unit, FilterType ftype, FilterOptions filter);
         /** See
           RenderSystem
          */
-		void setTextureAnisotropy_internal(size_t unit, unsigned int maxAnisotropy);
+		void setTextureAnisotropy_internal(UINT16 unit, unsigned int maxAnisotropy);
         /** See
           RenderSystem
          */
@@ -341,7 +341,7 @@ namespace CamelotEngine {
         /** See
           RenderSystem
          */
-        void setScissorTest_internal(bool enabled, size_t left = 0, size_t top = 0, size_t right = 800, size_t bottom = 600) ;
+        void setScissorTest_internal(bool enabled, UINT32 left = 0, UINT32 top = 0, UINT32 right = 800, UINT32 bottom = 600) ;
         void clearFrameBuffer_internal(unsigned int buffers, 
             const Color& colour = Color::Black, 
             float depth = 1.0f, unsigned short stencil = 0);

+ 1 - 1
CamelotGLRenderer/Include/CmGLRenderTexture.h

@@ -39,7 +39,7 @@ namespace CamelotEngine {
     {
     public:
         GLHardwarePixelBuffer *buffer;
-        size_t zoffset;
+        UINT32 zoffset;
 		UINT32 numSamples;
 
 		GLSurfaceDesc() :buffer(0), zoffset(0), numSamples(0) {}

+ 1 - 1
CamelotGLRenderer/Include/CmWin32GLSupport.h

@@ -56,7 +56,7 @@ namespace CamelotEngine
 		bool selectPixelFormat(HDC hdc, int colourDepth, int multisample, bool hwGamma);
 
 		virtual bool supportsPBuffers();
-		virtual GLPBuffer *createPBuffer(PixelComponentType format, size_t width, size_t height);
+		virtual GLPBuffer *createPBuffer(PixelComponentType format, UINT32 width, UINT32 height);
 		virtual unsigned int getDisplayMonitorCount() const;
 	private:
 		// Allowed video modes

+ 1 - 1
CamelotGLRenderer/Include/CmWin32RenderTexture.h

@@ -37,7 +37,7 @@ namespace CamelotEngine {
     class CM_RSGL_EXPORT Win32PBuffer : public GLPBuffer
     {
 	public:
-		Win32PBuffer(PixelComponentType format, size_t width, size_t height);
+		Win32PBuffer(PixelComponentType format, UINT32 width, UINT32 height);
 		~Win32PBuffer();
 	    
 		virtual GLContext *getContext() { return mContext; }

+ 2 - 2
CamelotGLRenderer/Source/CmGLFBOMultiRenderTarget.cpp

@@ -42,7 +42,7 @@ namespace CamelotEngine {
 	}
 
 
-	void GLFBOMultiRenderTarget::bindSurfaceImpl(size_t attachment, RenderTexture *target)
+	void GLFBOMultiRenderTarget::bindSurfaceImpl(UINT32 attachment, RenderTexture *target)
 
 	{
 
@@ -68,7 +68,7 @@ namespace CamelotEngine {
 
 
 
-	void GLFBOMultiRenderTarget::unbindSurfaceImpl(size_t attachment)
+	void GLFBOMultiRenderTarget::unbindSurfaceImpl(UINT32 attachment)
 	{
 		fbo.unbindSurface(attachment);
 

+ 7 - 7
CamelotGLRenderer/Source/CmGLFBORenderTexture.cpp

@@ -79,7 +79,7 @@ static const GLenum stencilFormats[] =
     GL_STENCIL_INDEX8_EXT,
     GL_STENCIL_INDEX16_EXT
 };
-static const size_t stencilBits[] =
+static const UINT32 stencilBits[] =
 {
     0, 1, 4, 8, 16
 };
@@ -93,7 +93,7 @@ static const GLenum depthFormats[] =
     GL_DEPTH_COMPONENT32,
     GL_DEPTH24_STENCIL8_EXT // packed depth / stencil
 };
-static const size_t depthBits[] =
+static const UINT32 depthBits[] =
 {
     0,16,24,32,24
 };
@@ -290,13 +290,13 @@ static const size_t depthBits[] =
 					<< " depth/stencil support: ";
 
                 // For each depth/stencil formats
-                for (size_t depth = 0; depth < DEPTHFORMAT_COUNT; ++depth)
+                for (UINT32 depth = 0; depth < DEPTHFORMAT_COUNT; ++depth)
                 {
                     if (depthFormats[depth] != GL_DEPTH24_STENCIL8_EXT)
                     {
                         // General depth/stencil combination
 
-                        for (size_t stencil = 0; stencil < STENCILFORMAT_COUNT; ++stencil)
+                        for (UINT32 stencil = 0; stencil < STENCILFORMAT_COUNT; ++stencil)
                         {
                             //StringUtil::StrStreamType l;
                             //l << "Trying " << PixelUtil::getFormatName((PixelFormat)x) 
@@ -374,7 +374,7 @@ static const size_t depthBits[] =
         /// Decide what stencil and depth formats to use
         /// [best supported for internal format]
         size_t bestmode=0;
-        int bestscore=-1;
+        UINT32 bestscore=0;
         for(size_t mode=0; mode<props.modes.size(); mode++)
         {
 #if 0
@@ -386,7 +386,7 @@ static const size_t depthBits[] =
                 break;
             }
 #endif
-            int desirability = 0;
+            UINT32 desirability = 0;
             /// Find most desirable mode
             /// desirability == 0            if no depth, no stencil
             /// desirability == 1000...2000  if no depth, stencil
@@ -436,7 +436,7 @@ static const size_t depthBits[] =
             glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
     }
     
-    GLSurfaceDesc GLFBOManager::requestRenderBuffer(GLenum format, size_t width, size_t height, UINT32 fsaa)
+    GLSurfaceDesc GLFBOManager::requestRenderBuffer(GLenum format, UINT32 width, UINT32 height, UINT32 fsaa)
     {
         GLSurfaceDesc retval;
         retval.buffer = 0; // Return 0 buffer if GL_NONE is requested

+ 11 - 11
CamelotGLRenderer/Source/CmGLFrameBufferObject.cpp

@@ -66,7 +66,7 @@ namespace CamelotEngine {
         /// Initialise state
         mDepth.buffer=0;
         mStencil.buffer=0;
-        for(size_t x=0; x<CM_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+        for(UINT32 x=0; x<CM_MAX_MULTIPLE_RENDER_TARGETS; ++x)
         {
             mColour[x].buffer=0;
         }
@@ -82,7 +82,7 @@ namespace CamelotEngine {
 			glDeleteFramebuffersEXT(1, &mMultisampleFB);
 
     }
-    void GLFrameBufferObject::bindSurface(size_t attachment, const GLSurfaceDesc &target)
+    void GLFrameBufferObject::bindSurface(UINT32 attachment, const GLSurfaceDesc &target)
     {
         assert(attachment < CM_MAX_MULTIPLE_RENDER_TARGETS);
         mColour[attachment] = target;
@@ -90,7 +90,7 @@ namespace CamelotEngine {
 		if(mColour[0].buffer)
 			initialise();
     }
-    void GLFrameBufferObject::unbindSurface(size_t attachment)
+    void GLFrameBufferObject::unbindSurface(UINT32 attachment)
     {
         assert(attachment < CM_MAX_MULTIPLE_RENDER_TARGETS);
         mColour[attachment].buffer = 0;
@@ -119,8 +119,8 @@ namespace CamelotEngine {
 		// mMultisampleFB is bound during rendering and is the one with a depth/stencil
 
         /// Store basic stats
-        size_t width = mColour[0].buffer->getWidth();
-        size_t height = mColour[0].buffer->getHeight();
+        UINT32 width = mColour[0].buffer->getWidth();
+        UINT32 height = mColour[0].buffer->getHeight();
         GLuint format = mColour[0].buffer->getGLFormat();
         PixelFormat ogreFormat = mColour[0].buffer->getFormat();
         UINT16 maxSupportedMRTs = CamelotEngine::RenderSystemManager::getActive()->getCapabilities_internal()->getNumMultiRenderTargets();
@@ -129,7 +129,7 @@ namespace CamelotEngine {
 		glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, mFB);
 
         /// Bind all attachment points to frame buffer
-        for(size_t x=0; x<maxSupportedMRTs; ++x)
+        for(UINT16 x=0; x<maxSupportedMRTs; ++x)
         {
             if(mColour[x].buffer)
             {
@@ -220,7 +220,7 @@ namespace CamelotEngine {
 		/// Do glDrawBuffer calls
 		GLenum bufs[CM_MAX_MULTIPLE_RENDER_TARGETS];
 		GLsizei n=0;
-		for(size_t x=0; x<CM_MAX_MULTIPLE_RENDER_TARGETS; ++x)
+		for(UINT32 x=0; x<CM_MAX_MULTIPLE_RENDER_TARGETS; ++x)
 		{
 			// Fill attached colour buffers
 			if(mColour[x].buffer)
@@ -290,8 +290,8 @@ namespace CamelotEngine {
 		if (mMultisampleFB)
 		{
 			// blit from multisample buffer to final buffer, triggers resolve
-			size_t width = mColour[0].buffer->getWidth();
-			size_t height = mColour[0].buffer->getHeight();
+			UINT32 width = mColour[0].buffer->getWidth();
+			UINT32 height = mColour[0].buffer->getHeight();
 			glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, mMultisampleFB);
 			glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, mFB);
 			glBlitFramebufferEXT(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_NEAREST);
@@ -299,12 +299,12 @@ namespace CamelotEngine {
 		}
 	}
 
-    size_t GLFrameBufferObject::getWidth()
+    UINT32 GLFrameBufferObject::getWidth()
     {
         assert(mColour[0].buffer);
         return mColour[0].buffer->getWidth();
     }
-    size_t GLFrameBufferObject::getHeight()
+    UINT32 GLFrameBufferObject::getHeight()
     {
         assert(mColour[0].buffer);
         return mColour[0].buffer->getHeight();

+ 2 - 2
CamelotGLRenderer/Source/CmGLGpuProgram.cpp

@@ -176,10 +176,10 @@ void GLArbGpuProgram::bindProgramParameters(GpuProgramParametersSharedPtr params
 	{
 		if (i->second.variability & mask)
 		{
-			size_t logicalIndex = i->first;
+			UINT32 logicalIndex = i->first;
 			const float* pFloat = params->getFloatPointer(i->second.physicalIndex);
 			// Iterate over the params, set in 4-float chunks (low-level)
-			for (size_t j = 0; j < i->second.currentSize; j+=4)
+			for (UINT32 j = 0; j < i->second.currentSize; j+=4)
 			{
 				glProgramLocalParameter4fvARB(type, logicalIndex, pFloat);
 				pFloat += 4;

+ 3 - 3
CamelotGLRenderer/Source/CmGLPBRenderTexture.cpp

@@ -32,7 +32,7 @@ THE SOFTWARE.
 
 namespace CamelotEngine {
 //-----------------------------------------------------------------------------  
-    GLPBuffer::GLPBuffer(PixelComponentType format, size_t width, size_t height):
+    GLPBuffer::GLPBuffer(PixelComponentType format, UINT32 width, UINT32 height):
         mFormat(format),
         mWidth(width),
         mHeight(height)
@@ -115,7 +115,7 @@ namespace CamelotEngine {
             static_cast<GLTextureBuffer*>(surface.buffer)->copyFromFramebuffer(surface.zoffset);
     }
     
-    void GLPBRTTManager::requestPBuffer(PixelComponentType ctype, size_t width, size_t height)
+    void GLPBRTTManager::requestPBuffer(PixelComponentType ctype, UINT32 width, UINT32 height)
     {
         //Check size
         if(mPBuffers[ctype].pb)
@@ -146,7 +146,7 @@ namespace CamelotEngine {
         }
     }
     
-    GLContext *GLPBRTTManager::getContextFor(PixelComponentType ctype, size_t width, size_t height)
+    GLContext *GLPBRTTManager::getContextFor(PixelComponentType ctype, UINT32 width, UINT32 height)
     {
         // Faster to return main context if the RTT is smaller than the window size
         // and ctype is PCT_BYTE. This must be checked every time because the window might have been resized

+ 3 - 3
CamelotGLRenderer/Source/CmGLPixelFormat.cpp

@@ -348,9 +348,9 @@ namespace CamelotEngine  {
 	}
 	//----------------------------------------------------------------------------- 
 
-	size_t GLPixelUtil::getMaxMipmaps(size_t width, size_t height, size_t depth, PixelFormat format)
+	UINT32 GLPixelUtil::getMaxMipmaps(UINT32 width, UINT32 height, UINT32 depth, PixelFormat format)
 	{
-		size_t count = 0;
+		UINT32 count = 0;
         if((width > 0) && (height > 0))
         {
             do {
@@ -371,7 +371,7 @@ namespace CamelotEngine  {
 		return count;
 	}
     //-----------------------------------------------------------------------------    
-    size_t GLPixelUtil::optionalPO2(size_t value)
+    UINT32 GLPixelUtil::optionalPO2(UINT32 value)
     {
         const RenderSystemCapabilities *caps = CamelotEngine::RenderSystemManager::getActive()->getCapabilities_internal();
         if(caps->hasCapability(RSC_NON_POWER_OF_2_TEXTURES))

+ 11 - 11
CamelotGLRenderer/Source/CmGLRenderSystem.cpp

@@ -444,7 +444,7 @@ namespace CamelotEngine {
 		}
 	}
 	//-----------------------------------------------------------------------------
-	void GLRenderSystem::setTexture_internal(size_t stage, bool enabled, const TexturePtr &texPtr)
+	void GLRenderSystem::setTexture_internal(UINT16 stage, bool enabled, const TexturePtr &texPtr)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -503,7 +503,7 @@ namespace CamelotEngine {
 		activateGLTextureUnit(0);
 	}
 	//-----------------------------------------------------------------------------
-	void GLRenderSystem::setTextureAddressingMode_internal(size_t stage, const SamplerState::UVWAddressingMode& uvw)
+	void GLRenderSystem::setTextureAddressingMode_internal(UINT16 stage, const SamplerState::UVWAddressingMode& uvw)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -519,7 +519,7 @@ namespace CamelotEngine {
 		activateGLTextureUnit(0);
 	}
 	//-----------------------------------------------------------------------------
-	void GLRenderSystem::setTextureBorderColor_internal(size_t stage, const Color& colour)
+	void GLRenderSystem::setTextureBorderColor_internal(UINT16 stage, const Color& colour)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -531,7 +531,7 @@ namespace CamelotEngine {
 		}
 	}
 	//-----------------------------------------------------------------------------
-	void GLRenderSystem::setTextureMipmapBias_internal(size_t stage, float bias)
+	void GLRenderSystem::setTextureMipmapBias_internal(UINT16 stage, float bias)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -1007,7 +1007,7 @@ namespace CamelotEngine {
 		}
 	}
 	//---------------------------------------------------------------------
-	void GLRenderSystem::setTextureFiltering_internal(size_t unit, 
+	void GLRenderSystem::setTextureFiltering_internal(UINT16 unit, 
 		FilterType ftype, FilterOptions fo)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
@@ -1056,7 +1056,7 @@ namespace CamelotEngine {
 		activateGLTextureUnit(0);
 	}
 	//---------------------------------------------------------------------
-	void GLRenderSystem::setTextureAnisotropy_internal(size_t unit, unsigned int maxAnisotropy)
+	void GLRenderSystem::setTextureAnisotropy_internal(UINT16 unit, unsigned int maxAnisotropy)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -1338,15 +1338,15 @@ namespace CamelotEngine {
 
 	}
 	//---------------------------------------------------------------------
-	void GLRenderSystem::setScissorTest_internal(bool enabled, size_t left, 
-		size_t top, size_t right, size_t bottom)
+	void GLRenderSystem::setScissorTest_internal(bool enabled, UINT32 left, 
+		UINT32 top, UINT32 right, UINT32 bottom)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
 		// If request texture flipping, use "upper-left", otherwise use "lower-left"
 		bool flipping = mActiveRenderTarget->requiresTextureFlipping();
 		//  GL measures from the bottom, not the top
-		size_t targetHeight = mActiveRenderTarget->getHeight();
+		UINT32 targetHeight = mActiveRenderTarget->getHeight();
 		// Calculate the "lower-left" corner of the viewport
         GLsizei x = 0, y = 0, w = 0, h = 0;
 
@@ -1613,7 +1613,7 @@ namespace CamelotEngine {
 		}
 	}
 	//---------------------------------------------------------------------
-	bool GLRenderSystem::activateGLTextureUnit(size_t unit)
+	bool GLRenderSystem::activateGLTextureUnit(UINT16 unit)
 	{
 		if (mActiveTextureUnit != unit)
 		{
@@ -1644,7 +1644,7 @@ namespace CamelotEngine {
 		mGLSupport->addConfig();
 	}
 	//---------------------------------------------------------------------
-	GLfloat GLRenderSystem::_getCurrentAnisotropy(size_t unit)
+	GLfloat GLRenderSystem::_getCurrentAnisotropy(UINT16 unit)
 	{
 		GLfloat curAniso = 0;
 		glGetTexParameterfv(mTextureTypes[unit], 

+ 4 - 4
CamelotGLRenderer/Source/CmGLTextureManager.cpp

@@ -54,13 +54,13 @@ namespace CamelotEngine {
 	void GLTextureManager::createWarningTexture()
 	{
 		// Generate warning texture
-		size_t width = 8;
-		size_t height = 8;
+		UINT32 width = 8;
+		UINT32 height = 8;
 		UINT32 *data = new UINT32[width*height];		// 0xXXRRGGBB
 		// Yellow/black stripes
-		for(size_t y=0; y<height; ++y)
+		for(UINT32 y=0; y<height; ++y)
 		{
-			for(size_t x=0; x<width; ++x)
+			for(UINT32 x=0; x<width; ++x)
 			{
 				data[y*width+x] = (((x+y)%8)<4)?0x000000:0xFFFF00;
 			}

+ 1 - 1
CamelotGLRenderer/Source/CmWin32GLSupport.cpp

@@ -631,7 +631,7 @@ namespace CamelotEngine {
 	{
 		return WGLEW_GET_FUN(__WGLEW_ARB_pbuffer) != GL_FALSE;
 	}
-    GLPBuffer *Win32GLSupport::createPBuffer(PixelComponentType format, size_t width, size_t height)
+    GLPBuffer *Win32GLSupport::createPBuffer(PixelComponentType format, UINT32 width, UINT32 height)
 	{
 		return new Win32PBuffer(format, width, height);
 	}

+ 1 - 1
CamelotGLRenderer/Source/CmWin32RenderTexture.cpp

@@ -34,7 +34,7 @@ THE SOFTWARE.
 
 namespace CamelotEngine {
 
-	 Win32PBuffer::Win32PBuffer(PixelComponentType format, size_t width, size_t height):
+	 Win32PBuffer::Win32PBuffer(PixelComponentType format, UINT32 width, UINT32 height):
 		GLPBuffer(format, width, height),
         mContext(0)
 	{

+ 3 - 3
CamelotGLRenderer/Source/GLSL/src/CmGLSLPreprocessor.cpp

@@ -175,7 +175,7 @@ int CPreprocessor::Token::CountNL ()
         return 0;
 
     const char *s = String;
-    int l = Length;
+    size_t l = Length;
     int c = 0;
     while (l > 0)
     {
@@ -760,7 +760,7 @@ CPreprocessor::Token CPreprocessor::GetArgument (Token &oArg, bool iExpand)
             return Token (Token::TK_ERROR);
         }
 
-    UINT32 len = oArg.Length;
+    size_t len = oArg.Length;
     while (true)
     {
         Token t = GetToken (iExpand);
@@ -1047,7 +1047,7 @@ CPreprocessor::Token CPreprocessor::HandleDirective (Token &iToken, int iLine)
 {
     // Analyze preprocessor directive
     const char *directive = iToken.String + 1;
-    int dirlen = iToken.Length - 1;
+    size_t dirlen = iToken.Length - 1;
     while (dirlen && isspace (*directive))
         dirlen--, directive++;
 

+ 4 - 4
CamelotGLRenderer/Source/atifs/include/Compiler2Pass.h

@@ -102,7 +102,7 @@ protected:
 	  UINT32 mNTTRuleID;			// Non-Terminal Token Rule ID that generated Token
 	  UINT32 mID;					// Token ID
 	  int mLine;				// line number in source code where Token was found
-	  int mPos;					// Character position in source where Token was found
+	  size_t mPos;					// Character position in source where Token was found
 
 	};
 
@@ -181,7 +181,7 @@ protected:
 		true if characters form a valid float representation
 		false if a number value could not be extracted
 	*/
-	bool isFloatValue(float & fvalue, int & charsize);
+	bool isFloatValue(float & fvalue, size_t & charsize);
 
 	/** check to see if the text is in the symbol text library
 	@param symbol points to begining of text where a symbol token might exist
@@ -190,7 +190,7 @@ protected:
 		true if a matching token could be found in the token type library
 		false if could not be tokenized
 	*/
-	bool isSymbol(const char* symbol, int & symbolsize);
+	bool isSymbol(const char* symbol, size_t & symbolsize);
 
 
 	/// position to the next possible valid sysmbol
@@ -246,7 +246,7 @@ protected:
 public:
 	// ** these probably should not be public
 	int mCurrentLine;
-	int mCharPos;
+	size_t mCharPos;
 
 
 	/// constructor

+ 2 - 2
CamelotGLRenderer/Source/atifs/src/ATI_FS_GLGpuProgram.cpp

@@ -72,10 +72,10 @@ void ATI_FS_GLGpuProgram::bindProgramParameters(GpuProgramParametersSharedPtr pa
 	{
 		if (i->second.variability & mask)
 		{
-			size_t logicalIndex = i->first;
+			UINT32 logicalIndex = i->first;
 			const float* pFloat = params->getFloatPointer(i->second.physicalIndex);
 			// Iterate over the params, set in 4-float chunks (low-level)
-			for (size_t j = 0; j < i->second.currentSize; j+=4)
+			for (UINT32 j = 0; j < i->second.currentSize; j+=4)
 			{
 				glSetFragmentShaderConstantATI(GL_CON_0_ATI + logicalIndex, pFloat);
 				pFloat += 4;

+ 7 - 7
CamelotGLRenderer/Source/atifs/src/Compiler2Pass.cpp

@@ -101,7 +101,7 @@ bool Compiler2Pass::doPass1()
 	mCharPos = 0;
 	// reset position in Constants container
 	mConstants.clear();
-	mEndOfSource = strlen(mSource);
+	mEndOfSource = (int)strlen(mSource);
 
 	// start with a clean slate
 	mTokenInstructions.clear();
@@ -124,10 +124,10 @@ bool Compiler2Pass::processRulePath( UINT32 rulepathIDX)
 
 	// record position of last token in container
 	// to be used as the rollback position if a valid token is not found
-	UINT32 TokenContainerOldSize = mTokenInstructions.size();
-	int OldCharPos = mCharPos;
+	UINT32 TokenContainerOldSize = (UINT32)mTokenInstructions.size();
+	size_t OldCharPos = mCharPos;
 	int OldLinePos = mCurrentLine;
-	UINT32 OldConstantsSize = mConstants.size();
+	UINT32 OldConstantsSize = (UINT32)mConstants.size();
 
 	// keep track of what non-terminal token activated the rule
 	UINT32 ActiveNTTRule = mRootRulePath[rulepathIDX].mTokenID;
@@ -215,7 +215,7 @@ bool Compiler2Pass::processRulePath( UINT32 rulepathIDX)
 
 bool Compiler2Pass::ValidateToken(const UINT32 rulepathIDX, const UINT32 activeRuleID)
 {
-	int tokenlength = 0;
+	size_t tokenlength = 0;
 	// assume the test is going to fail
 	bool Passed = false;
 	UINT32 TokenID = mRootRulePath[rulepathIDX].mTokenID;
@@ -279,7 +279,7 @@ const char* Compiler2Pass::getTypeDefText(const UINT32 sid)
 }
 
 
-bool Compiler2Pass::isFloatValue(float& fvalue, int& charsize)
+bool Compiler2Pass::isFloatValue(float& fvalue, size_t& charsize)
 {
 	// check to see if it is a numeric float value
 	bool valuefound = false;
@@ -301,7 +301,7 @@ bool Compiler2Pass::isFloatValue(float& fvalue, int& charsize)
 }
 
 
-bool Compiler2Pass::isSymbol(const char* symbol, int& symbolsize)
+bool Compiler2Pass::isSymbol(const char* symbol, size_t& symbolsize)
 {
 	// compare text at source+charpos with the symbol : limit testing to symbolsize
 	bool symbolfound = false;

+ 2 - 2
CamelotGLRenderer/Source/atifs/src/ps_1_4.cpp

@@ -1836,7 +1836,7 @@ void PS_1_4::test()
   char passed[] = "PASSED\n";
   char failed[] = "***** FAILED *****\n";
 
-  int resultID = 0;
+  size_t resultID = 0;
 
   // loop variable used in for loops
   int i;
@@ -1886,7 +1886,7 @@ void PS_1_4::test()
 // **************************************************************
   fprintf(fp, "\nTesting: isFloatValue\n");
   float fvalue = 0;
-  int charsize = 0;
+  size_t charsize = 0;
   char teststrfloat1[] = "1 test";
   mCharPos = 0;
   int testsize = ARRAYSIZE(testfloatresults);

+ 1 - 1
CamelotRenderer.sln

@@ -127,7 +127,7 @@ Global
 		{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}.Debug|Mixed Platforms.Build.0 = Debug|Win32
 		{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}.Debug|Win32.ActiveCfg = Debug|Win32
 		{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}.Debug|Win32.Build.0 = Debug|Win32
-		{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}.Debug|x64.ActiveCfg = Debug|Win32
+		{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}.Debug|x64.ActiveCfg = Debug|x64
 		{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}.Release|Any CPU.ActiveCfg = Release|Win32
 		{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}.Release|Mixed Platforms.ActiveCfg = Release|Win32
 		{F58FF869-2EA6-4FFF-AB84-328C531BA9D9}.Release|Mixed Platforms.Build.0 = Release|Win32

+ 27 - 27
CamelotRenderer/Include/CmRenderSystem.h

@@ -400,14 +400,14 @@ namespace CamelotEngine
 		only sets those settings which are different from the current settings for this
 		unit, thus minimising render state changes.
 		*/
-		void setTextureUnitSettings(size_t texUnit, const TexturePtr& texture, const SamplerState& samplerState);
-		virtual void setTextureUnitSettings_internal(size_t texUnit, const TexturePtr& texture, const SamplerState& samplerState);
+		void setTextureUnitSettings(UINT16 texUnit, const TexturePtr& texture, const SamplerState& samplerState);
+		virtual void setTextureUnitSettings_internal(UINT16 texUnit, const TexturePtr& texture, const SamplerState& samplerState);
 		/** Turns off a texture unit. */
-		void disableTextureUnit(size_t texUnit);
-		virtual void disableTextureUnit_internal(size_t texUnit);
+		void disableTextureUnit(UINT16 texUnit);
+		virtual void disableTextureUnit_internal(UINT16 texUnit);
 		/** Disables all texture units from the given unit upwards */
-		void disableTextureUnitsFrom(size_t texUnit);
-		virtual void disableTextureUnitsFrom_internal(size_t texUnit);
+		void disableTextureUnitsFrom(UINT16 texUnit);
+		virtual void disableTextureUnitsFrom_internal(UINT16 texUnit);
 
 		/** Sets the size of points and how they are attenuated with distance.
 		@remarks
@@ -437,9 +437,9 @@ namespace CamelotEngine
 		@param enabled Boolean to turn the unit on/off
 		@param texPtr Pointer to the texture to use.
 		*/
-		void setTexture(size_t unit, bool enabled, 
+		void setTexture(UINT16 unit, bool enabled, 
 			const TexturePtr &texPtr);
-		virtual void setTexture_internal(size_t unit, bool enabled, 
+		virtual void setTexture_internal(UINT16 unit, bool enabled, 
 			const TexturePtr &texPtr) = 0;
 
 		/** Binds a texture to a vertex sampler.
@@ -451,8 +451,8 @@ namespace CamelotEngine
 		fragment units; calling this method will throw an exception.
 		@see RenderSystemCapabilites::getVertexTextureUnitsShared
 		*/
-		void setVertexTexture(size_t unit, const TexturePtr& tex);
-		virtual void setVertexTexture_internal(size_t unit, const TexturePtr& tex);
+		void setVertexTexture(UINT16 unit, const TexturePtr& tex);
+		virtual void setVertexTexture_internal(UINT16 unit, const TexturePtr& tex);
 
 		/** Sets the filtering options for a given texture unit.
 		@param unit The texture unit to set the filtering options for
@@ -460,9 +460,9 @@ namespace CamelotEngine
 		@param magFilter The filter used when a texture is magnified
 		@param mipFilter The filter used between mipmap levels, FO_NONE disables mipmapping
 		*/
-		void setTextureFiltering(size_t unit, FilterOptions minFilter,
+		void setTextureFiltering(UINT16 unit, FilterOptions minFilter,
 			FilterOptions magFilter, FilterOptions mipFilter);
-		virtual void setTextureFiltering_internal(size_t unit, FilterOptions minFilter,
+		virtual void setTextureFiltering_internal(UINT16 unit, FilterOptions minFilter,
 			FilterOptions magFilter, FilterOptions mipFilter);
 
 		/** Sets a single filter for a given texture unit.
@@ -470,20 +470,20 @@ namespace CamelotEngine
 		@param ftype The filter type
 		@param filter The filter to be used
 		*/
-		void setTextureFiltering(size_t unit, FilterType ftype, FilterOptions filter);
-		virtual void setTextureFiltering_internal(size_t unit, FilterType ftype, FilterOptions filter) = 0;
+		void setTextureFiltering(UINT16 unit, FilterType ftype, FilterOptions filter);
+		virtual void setTextureFiltering_internal(UINT16 unit, FilterType ftype, FilterOptions filter) = 0;
 
 		/** Sets the maximal anisotropy for the specified texture unit.*/
-		void setTextureAnisotropy(size_t unit, unsigned int maxAnisotropy);
-		virtual void setTextureAnisotropy_internal(size_t unit, unsigned int maxAnisotropy) = 0;
+		void setTextureAnisotropy(UINT16 unit, unsigned int maxAnisotropy);
+		virtual void setTextureAnisotropy_internal(UINT16 unit, unsigned int maxAnisotropy) = 0;
 
 		/** Sets the texture addressing mode for a texture unit.*/
-		void setTextureAddressingMode(size_t unit, const SamplerState::UVWAddressingMode& uvw);
-		virtual void setTextureAddressingMode_internal(size_t unit, const SamplerState::UVWAddressingMode& uvw) = 0;
+		void setTextureAddressingMode(UINT16 unit, const SamplerState::UVWAddressingMode& uvw);
+		virtual void setTextureAddressingMode_internal(UINT16 unit, const SamplerState::UVWAddressingMode& uvw) = 0;
 
 		/** Sets the texture border color for a texture unit.*/
-		void setTextureBorderColor(size_t unit, const Color& color);
-		virtual void setTextureBorderColor_internal(size_t unit, const Color& color) = 0;
+		void setTextureBorderColor(UINT16 unit, const Color& color);
+		virtual void setTextureBorderColor_internal(UINT16 unit, const Color& color) = 0;
 
 		/** Sets the mipmap bias value for a given texture unit.
 		@remarks
@@ -493,8 +493,8 @@ namespace CamelotEngine
 		of levels, so +1 forces the mipmaps to one smaller level.
 		@note Only does something if render system has capability RSC_MIPMAP_LOD_BIAS.
 		*/
-		void setTextureMipmapBias(size_t unit, float bias);
-		virtual void setTextureMipmapBias_internal(size_t unit, float bias) = 0;
+		void setTextureMipmapBias(UINT16 unit, float bias);
+		virtual void setTextureMipmapBias_internal(UINT16 unit, float bias) = 0;
 
 		/** Sets the global blending factors for combining subsequent renders with the existing frame contents.
 		The result of the blending operation is:</p>
@@ -827,10 +827,10 @@ namespace CamelotEngine
 		@param left, top, right, bottom The location of the corners of the rectangle, expressed in
 		<i>pixels</i>.
 		*/
-		void setScissorTest(bool enabled, size_t left = 0, size_t top = 0, 
-			size_t right = 800, size_t bottom = 600);
-		virtual void setScissorTest_internal(bool enabled, size_t left = 0, size_t top = 0, 
-			size_t right = 800, size_t bottom = 600) = 0;
+		void setScissorTest(bool enabled, UINT32 left = 0, UINT32 top = 0, 
+			UINT32 right = 800, UINT32 bottom = 600);
+		virtual void setScissorTest_internal(bool enabled, UINT32 left = 0, UINT32 top = 0, 
+			UINT32 right = 800, UINT32 bottom = 600) = 0;
 
 		/** Clears one or more frame buffers on the active render target. 
 		@param buffers Combination of one or more elements of FrameBufferType
@@ -937,7 +937,7 @@ namespace CamelotEngine
 		bool mInvertVertexWinding;
 
 		/// Texture units from this upwards are disabled
-		size_t mDisabledTexUnitsFrom;
+		UINT16 mDisabledTexUnitsFrom;
 
 		bool mVertexProgramBound;
 		bool mGeometryProgramBound;

+ 9 - 9
CamelotRenderer/Include/CmRenderTexture.h

@@ -48,7 +48,7 @@ namespace CamelotEngine
     class CM_EXPORT RenderTexture: public RenderTarget
     {
     public:
-        RenderTexture(HardwarePixelBuffer *buffer, size_t zoffset);
+        RenderTexture(HardwarePixelBuffer *buffer, UINT32 zoffset);
         virtual ~RenderTexture();
 
 		virtual void copyContentsToMemory(const PixelData &dst, FrameBuffer buffer);
@@ -56,7 +56,7 @@ namespace CamelotEngine
 
 	protected:
 		HardwarePixelBuffer *mBuffer;
-		size_t mZOffset;
+		UINT32 mZOffset;
     };
 
 	/** This class represents a render target that renders to multiple RenderTextures
@@ -80,9 +80,9 @@ namespace CamelotEngine
 			- Not all bound surfaces have the same internal format 
 		*/
 
-		virtual void bindSurface(size_t attachment, RenderTexture *target)
+		virtual void bindSurface(UINT32 attachment, RenderTexture *target)
 		{
-			for (size_t i = mBoundSurfaces.size(); i <= attachment; ++i)
+			for (UINT32 i = (UINT32)mBoundSurfaces.size(); i <= attachment; ++i)
 			{
 				mBoundSurfaces.push_back(0);
 			}
@@ -96,9 +96,9 @@ namespace CamelotEngine
 		/** Unbind attachment.
 		*/
 
-		virtual void unbindSurface(size_t attachment)
+		virtual void unbindSurface(UINT32 attachment)
 		{
-			if (attachment < mBoundSurfaces.size())
+			if (attachment < (UINT32)mBoundSurfaces.size())
 				mBoundSurfaces[attachment] = 0;
 			unbindSurfaceImpl(attachment);
 		}
@@ -116,7 +116,7 @@ namespace CamelotEngine
 		const BoundSufaceList& getBoundSurfaceList() const { return mBoundSurfaces; }
 
 		/** Get a pointer to a bound surface */
-		RenderTexture* getBoundSurface(size_t index)
+		RenderTexture* getBoundSurface(UINT32 index)
 		{
 			assert (index < mBoundSurfaces.size());
 			return mBoundSurfaces[index];
@@ -127,9 +127,9 @@ namespace CamelotEngine
 		BoundSufaceList mBoundSurfaces;
 
 		/// implementation of bindSurface, must be provided
-		virtual void bindSurfaceImpl(size_t attachment, RenderTexture *target) = 0;
+		virtual void bindSurfaceImpl(UINT32 attachment, RenderTexture *target) = 0;
 		/// implementation of unbindSurface, must be provided
-		virtual void unbindSurfaceImpl(size_t attachment) = 0;
+		virtual void unbindSurfaceImpl(UINT32 attachment) = 0;
 
 
 	};

+ 18 - 18
CamelotRenderer/Source/CmRenderSystem.cpp

@@ -253,7 +253,7 @@ namespace CamelotEngine {
         return mActiveViewport;
     }
     //-----------------------------------------------------------------------
-    void RenderSystem::setTextureUnitSettings(size_t texUnit, const TexturePtr& tex, const SamplerState& samplerState)
+    void RenderSystem::setTextureUnitSettings(UINT16 texUnit, const TexturePtr& tex, const SamplerState& samplerState)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -261,7 +261,7 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::setTextureUnitSettings_internal, this, texUnit, tex, samplerState));
 	}
 	//-----------------------------------------------------------------------
-    void RenderSystem::setTextureUnitSettings_internal(size_t texUnit, const TexturePtr& tex, const SamplerState& tl)
+    void RenderSystem::setTextureUnitSettings_internal(UINT16 texUnit, const TexturePtr& tex, const SamplerState& tl)
     {
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -311,7 +311,7 @@ namespace CamelotEngine {
         setTextureAddressingMode_internal(texUnit, uvw);
     }
 	//-----------------------------------------------------------------------
-	void RenderSystem::setTexture(size_t unit, bool enabled, const TexturePtr &texPtr)
+	void RenderSystem::setTexture(UINT16 unit, bool enabled, const TexturePtr &texPtr)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -319,7 +319,7 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::setTexture_internal, this, unit, enabled, texPtr));
 	}
 	//-----------------------------------------------------------------------
-	void RenderSystem::setVertexTexture(size_t unit, const TexturePtr& tex)
+	void RenderSystem::setVertexTexture(UINT16 unit, const TexturePtr& tex)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -327,7 +327,7 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::setVertexTexture_internal, this, unit, tex));
 	}
 	//-----------------------------------------------------------------------
-	void RenderSystem::setVertexTexture_internal(size_t unit, const TexturePtr& tex)
+	void RenderSystem::setVertexTexture_internal(UINT16 unit, const TexturePtr& tex)
 	{
 		THROW_IF_NOT_RENDER_THREAD;
 
@@ -337,7 +337,7 @@ namespace CamelotEngine {
 			"the vertex and fragment units.");
 	}
 	//-----------------------------------------------------------------------
-	void RenderSystem::disableTextureUnit(size_t texUnit)
+	void RenderSystem::disableTextureUnit(UINT16 texUnit)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -345,14 +345,14 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::disableTextureUnit_internal, this, texUnit));
 	}
     //-----------------------------------------------------------------------
-    void RenderSystem::disableTextureUnit_internal(size_t texUnit)
+    void RenderSystem::disableTextureUnit_internal(UINT16 texUnit)
     {
 		THROW_IF_NOT_RENDER_THREAD;
 
         setTexture_internal(texUnit, false, sNullTexPtr);
     }
 	//---------------------------------------------------------------------
-	void RenderSystem::disableTextureUnitsFrom(size_t texUnit)
+	void RenderSystem::disableTextureUnitsFrom(UINT16 texUnit)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -360,21 +360,21 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::disableTextureUnitsFrom_internal, this, texUnit));
 	}
     //---------------------------------------------------------------------
-    void RenderSystem::disableTextureUnitsFrom_internal(size_t texUnit)
+    void RenderSystem::disableTextureUnitsFrom_internal(UINT16 texUnit)
     {
 		THROW_IF_NOT_RENDER_THREAD;
 
-        size_t disableTo = CM_MAX_TEXTURE_LAYERS;
+        UINT16 disableTo = CM_MAX_TEXTURE_LAYERS;
         if (disableTo > mDisabledTexUnitsFrom)
             disableTo = mDisabledTexUnitsFrom;
         mDisabledTexUnitsFrom = texUnit;
-        for (size_t i = texUnit; i < disableTo; ++i)
+        for (UINT16 i = texUnit; i < disableTo; ++i)
         {
             disableTextureUnit_internal(i);
         }
     }
 	//-----------------------------------------------------------------------
-	void RenderSystem::setTextureFiltering(size_t unit, FilterOptions minFilter,
+	void RenderSystem::setTextureFiltering(UINT16 unit, FilterOptions minFilter,
 		FilterOptions magFilter, FilterOptions mipFilter)
 	{
 		THROW_IF_INVALID_CONTEXT;
@@ -383,7 +383,7 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::setTextureFiltering_internal, this, unit, minFilter, magFilter, mipFilter));
 	}
     //-----------------------------------------------------------------------
-    void RenderSystem::setTextureFiltering_internal(size_t unit, FilterOptions minFilter,
+    void RenderSystem::setTextureFiltering_internal(UINT16 unit, FilterOptions minFilter,
             FilterOptions magFilter, FilterOptions mipFilter)
     {
 		THROW_IF_NOT_RENDER_THREAD;
@@ -393,7 +393,7 @@ namespace CamelotEngine {
         setTextureFiltering_internal(unit, FT_MIP, mipFilter);
     }
 	//-----------------------------------------------------------------------
-	void RenderSystem::setTextureAnisotropy(size_t unit, unsigned int maxAnisotropy)
+	void RenderSystem::setTextureAnisotropy(UINT16 unit, unsigned int maxAnisotropy)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -401,7 +401,7 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::setTextureAnisotropy_internal, this, unit, maxAnisotropy));
 	}
 	//-----------------------------------------------------------------------
-	void RenderSystem::setTextureAddressingMode(size_t unit, const SamplerState::UVWAddressingMode& uvw)
+	void RenderSystem::setTextureAddressingMode(UINT16 unit, const SamplerState::UVWAddressingMode& uvw)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -409,7 +409,7 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::setTextureAddressingMode_internal, this, unit, uvw));
 	}
 	//-----------------------------------------------------------------------
-	void RenderSystem::setTextureBorderColor(size_t unit, const Color& color)
+	void RenderSystem::setTextureBorderColor(UINT16 unit, const Color& color)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -417,7 +417,7 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::setTextureBorderColor_internal, this, unit, color));
 	}
 	//-----------------------------------------------------------------------
-	void RenderSystem::setTextureMipmapBias(size_t unit, float bias)
+	void RenderSystem::setTextureMipmapBias(UINT16 unit, float bias)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);
@@ -459,7 +459,7 @@ namespace CamelotEngine {
 		mActiveContext->queueCommand(boost::bind(&RenderSystem::setAlphaRejectSettings_internal, this, func, value, alphaToCoverage));
 	}
 	//-----------------------------------------------------------------------
-	void RenderSystem::setScissorTest(bool enabled, size_t left, size_t top, size_t right, size_t bottom)
+	void RenderSystem::setScissorTest(bool enabled, UINT32 left, UINT32 top, UINT32 right, UINT32 bottom)
 	{
 		THROW_IF_INVALID_CONTEXT;
 		CM_LOCK_MUTEX(mActiveContextMutex);

+ 1 - 1
CamelotRenderer/Source/CmRenderTexture.cpp

@@ -34,7 +34,7 @@ namespace CamelotEngine
 {
 
     //-----------------------------------------------------------------------------
-	RenderTexture::RenderTexture(HardwarePixelBuffer *buffer, size_t zoffset):
+	RenderTexture::RenderTexture(HardwarePixelBuffer *buffer, UINT32 zoffset):
 		mBuffer(buffer), mZOffset(zoffset)
     {
         mPriority = OGRE_REND_TO_TEX_RT_GROUP;

+ 1 - 0
CamelotRenderer/TODO.txt

@@ -58,6 +58,7 @@ HIGH PRIORITY TODO:
  - HLSL & Cg don't handle include files yet
 
 Mid priority TODO:
+ - Compiler2Pass in GL renderer doesn't seem to be 64bit ready. I hacked it together but it will likely cause problems.
  - Resource handle should store a unique integer ID, which just points to a table of GUIDs. Keeping GUID string everywhere in not efficient.
  - Add a field that tracks % of resource deserialization in BinarySerializer
  - GpuProgram default parameters might not be needed. The parameters change with each use of the gpu program anyway

+ 1 - 1
CamelotUtility/Include/CmPixelUtil.h

@@ -145,7 +145,7 @@ namespace CamelotEngine {
         /** Returns the component count for a certain pixel format. Returns 3(no alpha) or 
             4 (has alpha) in case there is no clear component type like with compressed formats.
          */
-        static size_t getComponentCount(PixelFormat fmt);
+        static UINT32 getComponentCount(PixelFormat fmt);
 
         /** Gets the format from given name.
             @param  name            The string of format name

+ 1 - 1
CamelotUtility/Source/CmPixelUtil.cpp

@@ -1136,7 +1136,7 @@ namespace CamelotEngine {
         return des.componentType;
     }
     //-----------------------------------------------------------------------
-    size_t PixelUtil::getComponentCount(PixelFormat fmt)
+    UINT32 PixelUtil::getComponentCount(PixelFormat fmt)
     {
         const PixelFormatDescription &des = getDescriptionFor(fmt);
         return des.componentCount;