瀏覽代碼

Removing unused render system methods #4

Marko Pintera 13 年之前
父節點
當前提交
0469d62c92

+ 0 - 8
CamelotD3D9Renderer/Include/CmD3D9RenderSystem.h

@@ -216,17 +216,11 @@ namespace CamelotEngine
             bool twoSidedOperation = false);
             bool twoSidedOperation = false);
 
 
 		// Low-level overridden members, mainly for internal use
 		// Low-level overridden members, mainly for internal use
-		void _setWorldMatrix( const Matrix4 &m );
-		void _setViewMatrix( const Matrix4 &m );
-		void _setProjectionMatrix( const Matrix4 &m );
-		void _setSurfaceParams( const Color &ambient, const Color &diffuse, const Color &specular, const Color &emissive, float shininess, TrackVertexColourType tracking );
-		void _setPointSpritesEnabled(bool enabled);
 		void _setPointParameters(float size, bool attenuationEnabled, 
 		void _setPointParameters(float size, bool attenuationEnabled, 
 			float constant, float linear, float quadratic, float minSize, float maxSize);
 			float constant, float linear, float quadratic, float minSize, float maxSize);
 		void _setTexture(size_t unit, bool enabled, const TexturePtr &texPtr);
 		void _setTexture(size_t unit, bool enabled, const TexturePtr &texPtr);
 		void _setVertexTexture(size_t unit, const TexturePtr& tex);
 		void _setVertexTexture(size_t unit, const TexturePtr& tex);
 		void _disableTextureUnit(size_t texUnit);
 		void _disableTextureUnit(size_t texUnit);
-		void _setTextureCoordSet( size_t unit, size_t index );
         void _setTextureAddressingMode(size_t stage, const SamplerState::UVWAddressingMode& uvw);
         void _setTextureAddressingMode(size_t stage, const SamplerState::UVWAddressingMode& uvw);
         void _setTextureBorderColour(size_t stage, const Color& colour);
         void _setTextureBorderColour(size_t stage, const Color& colour);
 		void _setTextureMipmapBias(size_t unit, float bias);
 		void _setTextureMipmapBias(size_t unit, float bias);
@@ -243,7 +237,6 @@ namespace CamelotEngine
 		void _setDepthBufferWriteEnabled(bool enabled = true);
 		void _setDepthBufferWriteEnabled(bool enabled = true);
 		void _setDepthBufferFunction( CompareFunction func = CMPF_LESS_EQUAL );
 		void _setDepthBufferFunction( CompareFunction func = CMPF_LESS_EQUAL );
 		void _setDepthBias(float constantBias, float slopeScaleBias);
 		void _setDepthBias(float constantBias, float slopeScaleBias);
-		void _setFog( FogMode mode = FOG_NONE, const Color& colour = Color::White, float expDensity = 1.0, float linearStart = 0.0, float linearEnd = 1.0 );
 		void _convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, bool forGpuProgram = false);
 		void _convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, bool forGpuProgram = false);
 		void _setPolygonMode(PolygonMode level);
 		void _setPolygonMode(PolygonMode level);
         void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter);
         void _setTextureUnitFiltering(size_t unit, FilterType ftype, FilterOptions filter);
@@ -271,7 +264,6 @@ namespace CamelotEngine
             float depth = 1.0f, unsigned short stencil = 0);
             float depth = 1.0f, unsigned short stencil = 0);
 		void setClipPlane (UINT16 index, float A, float B, float C, float D);
 		void setClipPlane (UINT16 index, float A, float B, float C, float D);
 		void enableClipPlane (UINT16 index, bool enable);
 		void enableClipPlane (UINT16 index, bool enable);
-        HardwareOcclusionQuery* createHardwareOcclusionQuery();
         float getHorizontalTexelOffset();
         float getHorizontalTexelOffset();
         float getVerticalTexelOffset();
         float getVerticalTexelOffset();
         float getMinimumDepthInputValue();
         float getMinimumDepthInputValue();

+ 0 - 160
CamelotD3D9Renderer/Source/CmD3D9RenderSystem.cpp

@@ -1466,92 +1466,6 @@ namespace CamelotEngine
 		}
 		}
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_setViewMatrix( const Matrix4 &m )
-	{
-		// save latest view matrix
-		mViewMatrix = m;
-		mViewMatrix[2][0] = -mViewMatrix[2][0];
-		mViewMatrix[2][1] = -mViewMatrix[2][1];
-		mViewMatrix[2][2] = -mViewMatrix[2][2];
-		mViewMatrix[2][3] = -mViewMatrix[2][3];
-
-		mDxViewMat = D3D9Mappings::makeD3DXMatrix( mViewMatrix );
-
-		HRESULT hr;
-		if( FAILED( hr = getActiveD3D9Device()->SetTransform( D3DTS_VIEW, &mDxViewMat ) ) )
-			CM_EXCEPT(RenderingAPIException, "Cannot set D3D9 view matrix");
-
-		// also mark clip planes dirty
-		if (!mClipPlanes.empty())
-			mClipPlanesDirty = true;
-	}
-	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_setProjectionMatrix( const Matrix4 &m )
-	{
-		// save latest matrix
-		mDxProjMat = D3D9Mappings::makeD3DXMatrix( m );
-
-		if( mActiveRenderTarget->requiresTextureFlipping() )
-		{
-			// Invert transformed y
-			mDxProjMat._12 = - mDxProjMat._12;
-			mDxProjMat._22 = - mDxProjMat._22;
-			mDxProjMat._32 = - mDxProjMat._32;
-			mDxProjMat._42 = - mDxProjMat._42;
-		}
-
-		HRESULT hr;
-		if( FAILED( hr = getActiveD3D9Device()->SetTransform( D3DTS_PROJECTION, &mDxProjMat ) ) )
-			CM_EXCEPT(RenderingAPIException, "Cannot set D3D9 projection matrix");
-
-		// also mark clip planes dirty
-		if (!mClipPlanes.empty())
-			mClipPlanesDirty = true;
-
-	}
-	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_setWorldMatrix( const Matrix4 &m )
-	{
-		// save latest matrix
-		mDxWorldMat = D3D9Mappings::makeD3DXMatrix( m );
-
-		HRESULT hr;
-		if( FAILED( hr = getActiveD3D9Device()->SetTransform( D3DTS_WORLD, &mDxWorldMat ) ) )
-			CM_EXCEPT(RenderingAPIException, "Cannot set D3D9 world matrix");
-	}
-	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_setSurfaceParams( const Color &ambient, const Color &diffuse,
-		const Color &specular, const Color &emissive, float shininess,
-		TrackVertexColourType tracking )
-	{
-
-		D3DMATERIAL9 material;
-		material.Diffuse = D3DXCOLOR( diffuse.r, diffuse.g, diffuse.b, diffuse.a );
-		material.Ambient = D3DXCOLOR( ambient.r, ambient.g, ambient.b, ambient.a );
-		material.Specular = D3DXCOLOR( specular.r, specular.g, specular.b, specular.a );
-		material.Emissive = D3DXCOLOR( emissive.r, emissive.g, emissive.b, emissive.a );
-		material.Power = shininess;
-
-		HRESULT hr = getActiveD3D9Device()->SetMaterial( &material );
-		if( FAILED( hr ) )
-			CM_EXCEPT(RenderingAPIException, "Error setting D3D material");
-
-
-		if(tracking != TVC_NONE) 
-		{
-			__SetRenderState(D3DRS_COLORVERTEX, TRUE);
-			__SetRenderState(D3DRS_AMBIENTMATERIALSOURCE, (tracking&TVC_AMBIENT)?D3DMCS_COLOR1:D3DMCS_MATERIAL);
-			__SetRenderState(D3DRS_DIFFUSEMATERIALSOURCE, (tracking&TVC_DIFFUSE)?D3DMCS_COLOR1:D3DMCS_MATERIAL);
-			__SetRenderState(D3DRS_SPECULARMATERIALSOURCE, (tracking&TVC_SPECULAR)?D3DMCS_COLOR1:D3DMCS_MATERIAL);
-			__SetRenderState(D3DRS_EMISSIVEMATERIALSOURCE, (tracking&TVC_EMISSIVE)?D3DMCS_COLOR1:D3DMCS_MATERIAL);
-		} 
-		else 
-		{
-			__SetRenderState(D3DRS_COLORVERTEX, FALSE);               
-		}
-
-	}
-	//---------------------------------------------------------------------
 	void D3D9RenderSystem::_setPointParameters(float size, 
 	void D3D9RenderSystem::_setPointParameters(float size, 
 		bool attenuationEnabled, float constant, float linear, float quadratic,
 		bool attenuationEnabled, float constant, float linear, float quadratic,
 		float minSize, float maxSize)
 		float minSize, float maxSize)
@@ -1576,18 +1490,6 @@ namespace CamelotEngine
 		__SetFloatRenderState(D3DRS_POINTSIZE_MAX, maxSize);
 		__SetFloatRenderState(D3DRS_POINTSIZE_MAX, maxSize);
 
 
 
 
-	}
-	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_setPointSpritesEnabled(bool enabled)
-	{
-		if (enabled)
-		{
-			__SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE);
-		}
-		else
-		{
-			__SetRenderState(D3DRS_POINTSPRITEENABLE, FALSE);
-		}
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
 	void D3D9RenderSystem::_setTexture( size_t stage, bool enabled, const TexturePtr& tex )
 	void D3D9RenderSystem::_setTexture( size_t stage, bool enabled, const TexturePtr& tex )
@@ -1697,21 +1599,6 @@ namespace CamelotEngine
 		_setVertexTexture(texUnit, nullPtr);
 		_setVertexTexture(texUnit, nullPtr);
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_setTextureCoordSet( size_t stage, size_t index )
-	{
-		// if vertex shader is being used, stage and index must match
-		if (mVertexProgramBound)
-			index = stage;
-
-		HRESULT hr;
-		// Record settings
-		mTexStageDesc[stage].coordIndex = index;
-
-		hr = __SetTextureStageState( static_cast<DWORD>(stage), D3DTSS_TEXCOORDINDEX, D3D9Mappings::get(mTexStageDesc[stage].autoTexCoordType, mDeviceManager->getActiveDevice()->getD3D9DeviceCaps()) | index );
-		if( FAILED( hr ) )
-			CM_EXCEPT(RenderingAPIException, "Unable to set texture coord. set index");
-	}
-	//---------------------------------------------------------------------
 	void D3D9RenderSystem::_setTextureMipmapBias(size_t unit, float bias)
 	void D3D9RenderSystem::_setTextureMipmapBias(size_t unit, float bias)
 	{
 	{
 		if (mCurrentCapabilities->hasCapability(RSC_MIPMAP_LOD_BIAS))
 		if (mCurrentCapabilities->hasCapability(RSC_MIPMAP_LOD_BIAS))
@@ -1955,46 +1842,6 @@ namespace CamelotEngine
 			CM_EXCEPT(RenderingAPIException, "Error setting colour write enable flags");
 			CM_EXCEPT(RenderingAPIException, "Error setting colour write enable flags");
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_setFog( FogMode mode, const Color& colour, float densitiy, float start, float end )
-	{
-		HRESULT hr;
-
-		D3DRENDERSTATETYPE fogType, fogTypeNot;
-
-		if (mDeviceManager->getActiveDevice()->getD3D9DeviceCaps().RasterCaps & D3DPRASTERCAPS_FOGTABLE)
-		{
-			fogType = D3DRS_FOGTABLEMODE;
-			fogTypeNot = D3DRS_FOGVERTEXMODE;
-		}
-		else
-		{
-			fogType = D3DRS_FOGVERTEXMODE;
-			fogTypeNot = D3DRS_FOGTABLEMODE;
-		}
-
-		if( mode == FOG_NONE)
-		{
-			// just disable
-			hr = __SetRenderState(fogType, D3DFOG_NONE );
-			hr = __SetRenderState(D3DRS_FOGENABLE, FALSE);
-		}
-		else
-		{
-			// Allow fog
-			hr = __SetRenderState( D3DRS_FOGENABLE, TRUE );
-			hr = __SetRenderState( fogTypeNot, D3DFOG_NONE );
-			hr = __SetRenderState( fogType, D3D9Mappings::get(mode) );
-
-			hr = __SetRenderState( D3DRS_FOGCOLOR, colour.getAsARGB() );
-			hr = __SetFloatRenderState( D3DRS_FOGSTART, start );
-			hr = __SetFloatRenderState( D3DRS_FOGEND, end );
-			hr = __SetFloatRenderState( D3DRS_FOGDENSITY, densitiy );
-		}
-
-		if( FAILED( hr ) )
-			CM_EXCEPT(RenderingAPIException, "Error setting render state");
-	}
-	//---------------------------------------------------------------------
 	void D3D9RenderSystem::_setPolygonMode(PolygonMode level)
 	void D3D9RenderSystem::_setPolygonMode(PolygonMode level)
 	{
 	{
 		HRESULT hr = __SetRenderState(D3DRS_FILLMODE, D3D9Mappings::get(level));
 		HRESULT hr = __SetRenderState(D3DRS_FILLMODE, D3D9Mappings::get(level));
@@ -2797,13 +2644,6 @@ namespace CamelotEngine
 			(prev | (1 << index)) : (prev & ~(1 << index)));
 			(prev | (1 << index)) : (prev & ~(1 << index)));
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	HardwareOcclusionQuery* D3D9RenderSystem::createHardwareOcclusionQuery()
-	{
-		D3D9HardwareOcclusionQuery* ret = new D3D9HardwareOcclusionQuery(); 
-		mHwOcclusionQueries.push_back(ret);
-		return ret;
-	}
-	//---------------------------------------------------------------------
 	float D3D9RenderSystem::getHorizontalTexelOffset()
 	float D3D9RenderSystem::getHorizontalTexelOffset()
 	{
 	{
 		// D3D considers the origin to be in the center of a pixel
 		// D3D considers the origin to be in the center of a pixel

+ 0 - 36
CamelotGLRenderer/Include/CmGLRenderSystem.h

@@ -197,46 +197,15 @@ namespace CamelotEngine {
         // -----------------------------
         // -----------------------------
         // Low-level overridden members
         // Low-level overridden members
         // -----------------------------
         // -----------------------------
-        /** See
-          RenderSystem
-         */
-		bool areFixedFunctionLightsInViewSpace() const { return true; }
-        /** See
-          RenderSystem
-         */
-        void _setWorldMatrix(const Matrix4 &m);
-        /** See
-          RenderSystem
-         */
-        void _setViewMatrix(const Matrix4 &m);
-        /** See
-          RenderSystem
-         */
-        void _setProjectionMatrix(const Matrix4 &m);
-        /** See
-          RenderSystem
-         */
-        void _setSurfaceParams(const Color &ambient,
-            const Color &diffuse, const Color &specular,
-            const Color &emissive, float shininess,
-            TrackVertexColourType tracking);
         /** See
         /** See
           RenderSystem
           RenderSystem
          */
          */
 		void _setPointParameters(float size, bool attenuationEnabled, 
 		void _setPointParameters(float size, bool attenuationEnabled, 
 			float constant, float linear, float quadratic, float minSize, float maxSize);
 			float constant, float linear, float quadratic, float minSize, float maxSize);
-        /** See
-          RenderSystem
-         */
-		void _setPointSpritesEnabled(bool enabled);
 		/** See
 		/** See
           RenderSystem
           RenderSystem
          */
          */
         void _setTexture(size_t unit, bool enabled, const TexturePtr &tex);
         void _setTexture(size_t unit, bool enabled, const TexturePtr &tex);
-        /** See
-          RenderSystem
-         */
-        void _setTextureCoordSet(size_t stage, size_t index);
         /** See
         /** See
           RenderSystem
           RenderSystem
          */
          */
@@ -309,10 +278,6 @@ namespace CamelotEngine {
           RenderSystem
           RenderSystem
          */
          */
         void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha);
         void _setColourBufferWriteEnabled(bool red, bool green, bool blue, bool alpha);
-		/** See
-          RenderSystem
-         */
-        void _setFog(FogMode mode, const Color& colour, float density, float start, float end);
         /** See
         /** See
           RenderSystem
           RenderSystem
          */
          */
@@ -383,7 +348,6 @@ namespace CamelotEngine {
         void clearFrameBuffer(unsigned int buffers, 
         void clearFrameBuffer(unsigned int buffers, 
             const Color& colour = Color::Black, 
             const Color& colour = Color::Black, 
             float depth = 1.0f, unsigned short stencil = 0);
             float depth = 1.0f, unsigned short stencil = 0);
-        HardwareOcclusionQuery* createHardwareOcclusionQuery(void);
         float getHorizontalTexelOffset(void);
         float getHorizontalTexelOffset(void);
         float getVerticalTexelOffset(void);
         float getVerticalTexelOffset(void);
         float getMinimumDepthInputValue(void);
         float getMinimumDepthInputValue(void);

+ 0 - 184
CamelotGLRenderer/Source/CmGLRenderSystem.cpp

@@ -1060,120 +1060,6 @@ namespace CamelotEngine {
 		}
 		}
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
-	void GLRenderSystem::_setWorldMatrix( const Matrix4 &m )
-	{
-		GLfloat mat[16];
-		mWorldMatrix = m;
-		makeGLMatrix( mat, mViewMatrix * mWorldMatrix );
-		glMatrixMode(GL_MODELVIEW);
-		glLoadMatrixf(mat);
-	}
-
-	//-----------------------------------------------------------------------------
-	void GLRenderSystem::_setViewMatrix( const Matrix4 &m )
-	{
-		mViewMatrix = m;
-
-		GLfloat mat[16];
-		makeGLMatrix( mat, mViewMatrix * mWorldMatrix );
-		glMatrixMode(GL_MODELVIEW);
-		glLoadMatrixf(mat);
-
-		// also mark clip planes dirty
-		if (!mClipPlanes.empty())
-			mClipPlanesDirty = true;
-	}
-	//-----------------------------------------------------------------------------
-	void GLRenderSystem::_setProjectionMatrix(const Matrix4 &m)
-	{
-		GLfloat mat[16];
-		makeGLMatrix(mat, m);
-		if (mActiveRenderTarget->requiresTextureFlipping())
-		{
-			// Invert transformed y
-			mat[1] = -mat[1];
-			mat[5] = -mat[5];
-			mat[9] = -mat[9];
-			mat[13] = -mat[13];
-		}
-		glMatrixMode(GL_PROJECTION);
-		glLoadMatrixf(mat);
-		glMatrixMode(GL_MODELVIEW);
-
-		// also mark clip planes dirty
-		if (!mClipPlanes.empty())
-			mClipPlanesDirty = true;
-	}
-	//-----------------------------------------------------------------------------
-	void GLRenderSystem::_setSurfaceParams(const Color &ambient,
-		const Color &diffuse, const Color &specular,
-		const Color &emissive, float shininess,
-		TrackVertexColourType tracking)
-	{
-
-		// Track vertex colour
-		if(tracking != TVC_NONE) 
-		{
-			GLenum gt = GL_DIFFUSE;
-			// There are actually 15 different combinations for tracking, of which
-			// GL only supports the most used 5. This means that we have to do some
-			// magic to find the best match. NOTE: 
-			//  GL_AMBIENT_AND_DIFFUSE != GL_AMBIENT | GL__DIFFUSE
-			if(tracking & TVC_AMBIENT) 
-			{
-				if(tracking & TVC_DIFFUSE)
-				{
-					gt = GL_AMBIENT_AND_DIFFUSE;
-				} 
-				else 
-				{
-					gt = GL_AMBIENT;
-				}
-			}
-			else if(tracking & TVC_DIFFUSE) 
-			{
-				gt = GL_DIFFUSE;
-			}
-			else if(tracking & TVC_SPECULAR) 
-			{
-				gt = GL_SPECULAR;              
-			}
-			else if(tracking & TVC_EMISSIVE) 
-			{
-				gt = GL_EMISSION;
-			}
-			glColorMaterial(GL_FRONT_AND_BACK, gt);
-
-			glEnable(GL_COLOR_MATERIAL);
-		} 
-		else 
-		{
-			glDisable(GL_COLOR_MATERIAL);          
-		}
-
-		// XXX Cache previous values?
-		// XXX Front or Front and Back?
-
-		GLfloat f4val[4] = {diffuse.r, diffuse.g, diffuse.b, diffuse.a};
-		glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, f4val);
-		f4val[0] = ambient.r;
-		f4val[1] = ambient.g;
-		f4val[2] = ambient.b;
-		f4val[3] = ambient.a;
-		glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, f4val);
-		f4val[0] = specular.r;
-		f4val[1] = specular.g;
-		f4val[2] = specular.b;
-		f4val[3] = specular.a;
-		glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, f4val);
-		f4val[0] = emissive.r;
-		f4val[1] = emissive.g;
-		f4val[2] = emissive.b;
-		f4val[3] = emissive.a;
-		glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, f4val);
-		glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, shininess);
-	}
-	//-----------------------------------------------------------------------------
 	void GLRenderSystem::_setPointParameters(float size, 
 	void GLRenderSystem::_setPointParameters(float size, 
 		bool attenuationEnabled, float constant, float linear, float quadratic,
 		bool attenuationEnabled, float constant, float linear, float quadratic,
 		float minSize, float maxSize)
 		float minSize, float maxSize)
@@ -1242,32 +1128,6 @@ namespace CamelotEngine {
 		
 		
 		
 		
 		
 		
-	}
-	//---------------------------------------------------------------------
-	void GLRenderSystem::_setPointSpritesEnabled(bool enabled)
-	{
-		if (!getCapabilities()->hasCapability(RSC_POINT_SPRITES))
-			return;
-
-		if (enabled)
-		{
-			glEnable(GL_POINT_SPRITE);
-		}
-		else
-		{
-			glDisable(GL_POINT_SPRITE);
-		}
-
-		// Set sprite texture coord generation
-		// Don't offer this as an option since D3D links it to sprite enabled
-		for (UINT16 i = 0; i < mFixedFunctionTextureUnits; ++i)
-		{
-			activateGLTextureUnit(i);
-			glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, 
-				enabled ? GL_TRUE : GL_FALSE);
-		}
-		activateGLTextureUnit(0);
-
 	}
 	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
 	void GLRenderSystem::_setTexture(size_t stage, bool enabled, const TexturePtr &texPtr)
 	void GLRenderSystem::_setTexture(size_t stage, bool enabled, const TexturePtr &texPtr)
@@ -1326,12 +1186,6 @@ namespace CamelotEngine {
 
 
 		activateGLTextureUnit(0);
 		activateGLTextureUnit(0);
 	}
 	}
-
-	//-----------------------------------------------------------------------------
-	void GLRenderSystem::_setTextureCoordSet(size_t stage, size_t index)
-	{
-		mTextureCoordIndex[stage] = index;
-	}
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
 	GLint GLRenderSystem::getTextureAddressingMode(
 	GLint GLRenderSystem::getTextureAddressingMode(
 		SamplerState::TextureAddressingMode tam) const
 		SamplerState::TextureAddressingMode tam) const
@@ -1735,37 +1589,6 @@ namespace CamelotEngine {
         const GLubyte *errString = gluErrorString (errCode);
         const GLubyte *errString = gluErrorString (errCode);
 		return (errString != 0) ? String((const char*) errString) : StringUtil::BLANK;
 		return (errString != 0) ? String((const char*) errString) : StringUtil::BLANK;
     }
     }
-    //-----------------------------------------------------------------------------
-    void GLRenderSystem::_setFog(FogMode mode, const Color& colour, float density, float start, float end)
-    {
-
-        GLint fogMode;
-        switch (mode)
-        {
-        case FOG_EXP:
-            fogMode = GL_EXP;
-            break;
-        case FOG_EXP2:
-            fogMode = GL_EXP2;
-            break;
-        case FOG_LINEAR:
-            fogMode = GL_LINEAR;
-            break;
-        default:
-            // Give up on it
-            glDisable(GL_FOG);
-            return;
-        }
-
-        glEnable(GL_FOG);
-        glFogi(GL_FOG_MODE, fogMode);
-        GLfloat fogColor[4] = {colour.r, colour.g, colour.b, colour.a};
-        glFogfv(GL_FOG_COLOR, fogColor);
-        glFogf(GL_FOG_DENSITY, density);
-        glFogf(GL_FOG_START, start);
-        glFogf(GL_FOG_END, end);
-        // XXX Hint here?
-    }
 
 
 	VertexElementType GLRenderSystem::getColourVertexElementType(void) const
 	VertexElementType GLRenderSystem::getColourVertexElementType(void) const
 	{
 	{
@@ -2601,13 +2424,6 @@ namespace CamelotEngine {
 		}
 		}
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	HardwareOcclusionQuery* GLRenderSystem::createHardwareOcclusionQuery(void)
-	{
-		GLHardwareOcclusionQuery* ret = new GLHardwareOcclusionQuery(); 
-		mHwOcclusionQueries.push_back(ret);
-		return ret;
-	}
-	//---------------------------------------------------------------------
 	float GLRenderSystem::getHorizontalTexelOffset(void)
 	float GLRenderSystem::getHorizontalTexelOffset(void)
 	{
 	{
 		// No offset in GL
 		// No offset in GL

+ 0 - 93
CamelotRenderer/Include/CmRenderSystem.h

@@ -153,14 +153,6 @@ namespace CamelotEngine
 		*/
 		*/
 		virtual void setConfigOption(const String &name, const String &value) = 0;
 		virtual void setConfigOption(const String &name, const String &value) = 0;
 
 
-		/** Create an object for performing hardware occlusion queries. 
-		*/
-		virtual HardwareOcclusionQuery* createHardwareOcclusionQuery(void) = 0;
-
-		/** Destroy a hardware occlusion query object. 
-		*/
-		virtual void destroyHardwareOcclusionQuery(HardwareOcclusionQuery *hq);
-
 		/** Validates the options set for the rendering system, returning a message if there are problems.
 		/** Validates the options set for the rendering system, returning a message if there are problems.
 		@note
 		@note
 		If the returned string is empty, there are no problems.
 		If the returned string is empty, there are no problems.
@@ -496,17 +488,6 @@ namespace CamelotEngine
 		// They can be called by library user if required
 		// They can be called by library user if required
 		// ------------------------------------------------------------------------
 		// ------------------------------------------------------------------------
 
 
-		/** Are fixed-function lights provided in view space? Affects optimisation. 
-		*/
-		virtual bool areFixedFunctionLightsInViewSpace() const { return false; }
-		/** Sets the world transform matrix. */
-		virtual void _setWorldMatrix(const Matrix4 &m) = 0;
-		/** Sets multiple world matrices (vertex blending). */
-		virtual void _setWorldMatrices(const Matrix4* m, unsigned short count);
-		/** Sets the view transform matrix */
-		virtual void _setViewMatrix(const Matrix4 &m) = 0;
-		/** Sets the projection transform matrix */
-		virtual void _setProjectionMatrix(const Matrix4 &m) = 0;
 		/** Utility function for setting all the properties of a texture unit at once.
 		/** Utility function for setting all the properties of a texture unit at once.
 		This method is also worth using over the individual texture unit settings because it
 		This method is also worth using over the individual texture unit settings because it
 		only sets those settings which are different from the current settings for this
 		only sets those settings which are different from the current settings for this
@@ -517,50 +498,6 @@ namespace CamelotEngine
 		virtual void _disableTextureUnit(size_t texUnit);
 		virtual void _disableTextureUnit(size_t texUnit);
 		/** Disables all texture units from the given unit upwards */
 		/** Disables all texture units from the given unit upwards */
 		virtual void _disableTextureUnitsFrom(size_t texUnit);
 		virtual void _disableTextureUnitsFrom(size_t texUnit);
-		/** Sets the surface properties to be used for future rendering.
-
-		This method sets the the properties of the surfaces of objects
-		to be rendered after it. In this context these surface properties
-		are the amount of each type of light the object reflects (determining
-		it's colour under different types of light), whether it emits light
-		itself, and how shiny it is. Textures are not dealt with here,
-		see the _setTetxure method for details.
-		This method is used by _setMaterial so does not need to be called
-		direct if that method is being used.
-
-		@param ambient The amount of ambient (sourceless and directionless)
-		light an object reflects. Affected by the colour/amount of ambient light in the scene.
-		@param diffuse The amount of light from directed sources that is
-		reflected (affected by colour/amount of point, directed and spot light sources)
-		@param specular The amount of specular light reflected. This is also
-		affected by directed light sources but represents the colour at the
-		highlights of the object.
-		@param emissive The colour of light emitted from the object. Note that
-		this will make an object seem brighter and not dependent on lights in
-		the scene, but it will not act as a light, so will not illuminate other
-		objects. Use a light attached to the same SceneNode as the object for this purpose.
-		@param shininess A value which only has an effect on specular highlights (so
-		specular must be non-black). The higher this value, the smaller and crisper the
-		specular highlights will be, imitating a more highly polished surface.
-		This value is not constrained to 0.0-1.0, in fact it is likely to
-		be more (10.0 gives a modest sheen to an object).
-		@param tracking A bit field that describes which of the ambient, diffuse, specular
-		and emissive colours follow the vertex colour of the primitive. When a bit in this field is set
-		its ColourValue is ignored. This is a combination of TVC_AMBIENT, TVC_DIFFUSE, TVC_SPECULAR(note that the shininess value is still
-		taken from shininess) and TVC_EMISSIVE. TVC_NONE means that there will be no material property
-		tracking the vertex colours.
-		*/
-		virtual void _setSurfaceParams(const Color &ambient,
-			const Color &diffuse, const Color &specular,
-			const Color &emissive, float shininess,
-			TrackVertexColourType tracking = TVC_NONE) = 0;
-
-		/** Sets whether or not rendering points using OT_POINT_LIST will 
-		render point sprites (textured quads) or plain points.
-		@param enabled True enables point sprites, false returns to normal
-		point rendering.
-		*/	
-		virtual void _setPointSpritesEnabled(bool enabled) = 0;
 
 
 		/** Sets the size of points and how they are attenuated with distance.
 		/** Sets the size of points and how they are attenuated with distance.
 		@remarks
 		@remarks
@@ -602,17 +539,6 @@ namespace CamelotEngine
 		*/
 		*/
 		virtual void _setVertexTexture(size_t unit, const TexturePtr& tex);
 		virtual void _setVertexTexture(size_t unit, const TexturePtr& tex);
 
 
-		/**
-		Sets the texture coordinate set to use for a texture unit.
-
-		Meant for use internally - not generally used directly by apps - the Material and TextureUnitState
-		classes let you manage textures far more easily.
-
-		@param unit Texture unit as above
-		@param index The index of the texture coordinate set to use.
-		*/
-		virtual void _setTextureCoordSet(size_t unit, size_t index) = 0;
-
 		/** Sets the filtering options for a given texture unit.
 		/** Sets the filtering options for a given texture unit.
 		@param unit The texture unit to set the filtering options for
 		@param unit The texture unit to set the filtering options for
 		@param minFilter The filter used when a texture is reduced in size
 		@param minFilter The filter used when a texture is reduced in size
@@ -783,19 +709,6 @@ namespace CamelotEngine
 
 
 		*/
 		*/
 		virtual void _setDepthBias(float constantBias, float slopeScaleBias = 0.0f) = 0;
 		virtual void _setDepthBias(float constantBias, float slopeScaleBias = 0.0f) = 0;
-		/** Sets the fogging mode for future geometry.
-		@param mode Set up the mode of fog as described in the FogMode enum, or set to FOG_NONE to turn off.
-		@param colour The colour of the fog. Either set this to the same as your viewport background colour,
-		or to blend in with a skydome or skybox.
-		@param expDensity The density of the fog in FOG_EXP or FOG_EXP2 mode, as a value between 0 and 1. The default is 1. i.e. completely opaque, lower values can mean
-		that fog never completely obscures the scene.
-		@param linearStart Distance at which linear fog starts to encroach. The distance must be passed
-		as a parametric value between 0 and 1, with 0 being the near clipping plane, and 1 being the far clipping plane. Only applicable if mode is FOG_LINEAR.
-		@param linearEnd Distance at which linear fog becomes completely opaque.The distance must be passed
-		as a parametric value between 0 and 1, with 0 being the near clipping plane, and 1 being the far clipping plane. Only applicable if mode is FOG_LINEAR.
-		*/
-		virtual void _setFog(FogMode mode = FOG_NONE, const Color& colour = Color::White, float expDensity = 1.0, float linearStart = 0.0, float linearEnd = 1.0) = 0;
-
 
 
 		/** The RenderSystem will keep a count of tris rendered, this resets the count. */
 		/** The RenderSystem will keep a count of tris rendered, this resets the count. */
 		virtual void _beginGeometryCount(void);
 		virtual void _beginGeometryCount(void);
@@ -1093,17 +1006,11 @@ namespace CamelotEngine
 		size_t mFaceCount;
 		size_t mFaceCount;
 		size_t mVertexCount;
 		size_t mVertexCount;
 
 
-		/// Saved manual colour blends
-		Color mManualBlendColours[CM_MAX_TEXTURE_LAYERS][2];
-
 		bool mInvertVertexWinding;
 		bool mInvertVertexWinding;
 
 
 		/// Texture units from this upwards are disabled
 		/// Texture units from this upwards are disabled
 		size_t mDisabledTexUnitsFrom;
 		size_t mDisabledTexUnitsFrom;
 
 
-		typedef list<HardwareOcclusionQuery*>::type HardwareOcclusionQueryList;
-		HardwareOcclusionQueryList mHwOcclusionQueries;
-
 		bool mVertexProgramBound;
 		bool mVertexProgramBound;
 		bool mGeometryProgramBound;
 		bool mGeometryProgramBound;
 		bool mFragmentProgramBound;
 		bool mFragmentProgramBound;

+ 0 - 28
CamelotRenderer/Source/CmRenderSystem.cpp

@@ -353,14 +353,6 @@ namespace CamelotEngine {
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
     void RenderSystem::shutdown(void)
     void RenderSystem::shutdown(void)
     {
     {
-		// Remove occlusion queries
-		for (HardwareOcclusionQueryList::iterator i = mHwOcclusionQueries.begin();
-			i != mHwOcclusionQueries.end(); ++i)
-		{
-			delete *i;
-		}
-		mHwOcclusionQueries.clear();
-
         // Remove all the render targets.
         // Remove all the render targets.
 		// (destroy primary target last since others may depend on it)
 		// (destroy primary target last since others may depend on it)
 		RenderTarget* primary = 0;
 		RenderTarget* primary = 0;
@@ -404,15 +396,6 @@ namespace CamelotEngine {
 
 
 	}
 	}
     //-----------------------------------------------------------------------
     //-----------------------------------------------------------------------
-    void RenderSystem::_setWorldMatrices(const Matrix4* m, unsigned short count)
-    {
-        // Do nothing with these matrices here, it never used for now,
-		// derived class should take care with them if required.
-
-        // Set hardware matrix to nothing
-        _setWorldMatrix(Matrix4::IDENTITY);
-    }
-    //-----------------------------------------------------------------------
     void RenderSystem::_render(const RenderOperation& op)
     void RenderSystem::_render(const RenderOperation& op)
     {
     {
         // Update stats
         // Update stats
@@ -489,17 +472,6 @@ namespace CamelotEngine {
 		}
 		}
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	void RenderSystem::destroyHardwareOcclusionQuery( HardwareOcclusionQuery *hq)
-	{
-		HardwareOcclusionQueryList::iterator i =
-			std::find(mHwOcclusionQueries.begin(), mHwOcclusionQueries.end(), hq);
-		if (i != mHwOcclusionQueries.end())
-		{
-			mHwOcclusionQueries.erase(i);
-			delete hq;
-		}
-	}
-	//-----------------------------------------------------------------------
 	void RenderSystem::bindGpuProgram(GpuProgram* prg)
 	void RenderSystem::bindGpuProgram(GpuProgram* prg)
 	{
 	{
 	    switch(prg->getType())
 	    switch(prg->getType())