Ver Fonte

Re-enable basic texturing support in GLRenderer

Daniele Bartolini há 13 anos atrás
pai
commit
42cefd6df7
3 ficheiros alterados com 23 adições e 23 exclusões
  1. 8 8
      src/renderers/Renderer.h
  2. 14 14
      src/renderers/gl/GLRenderer.cpp
  3. 1 1
      src/renderers/gl/GLRenderer.h

+ 8 - 8
src/renderers/Renderer.h

@@ -145,14 +145,14 @@ public:
 	*/
 	*/
 	virtual void _SetAmbientLight(const Color4& color) = 0;
 	virtual void _SetAmbientLight(const Color4& color) = 0;
 
 
-//	/**
-//		Set whether the given texture unit is enabled.
-//	@param unit
-//		The texture unit
-//	@param texturing
-//		Whether texturing is enabled or not
-//	*/
-//	virtual void _SetTexturing(uint32_t unit, bool texturing) = 0;
+	/**
+		Set whether the given texture unit is enabled.
+	@param unit
+		The texture unit
+	@param texturing
+		Whether texturing is enabled or not
+	*/
+	virtual void _SetTexturing(uint32_t unit, bool texturing) = 0;
 
 
 //	/**
 //	/**
 //		Sets a texture for the given texture unit.
 //		Sets a texture for the given texture unit.

+ 14 - 14
src/renderers/gl/GLRenderer.cpp

@@ -237,21 +237,21 @@ void GLRenderer::_SetLighting(bool lighting)
 	}
 	}
 }
 }
 
 
-////-----------------------------------------------------------------------------
-//void GLRenderer::_SetTexturing(uint32_t unit, bool texturing)
-//{
-//	if (!ActivateTextureUnit(unit))
-//		return;
+//-----------------------------------------------------------------------------
+void GLRenderer::_SetTexturing(uint32_t unit, bool texturing)
+{
+	if (!ActivateTextureUnit(unit))
+		return;
 
 
-//	if (texturing)
-//	{
-//		glEnable(mTextureUnitTarget[unit]);
-//	}
-//	else
-//	{
-//		glDisable(mTextureUnitTarget[unit]);
-//	}
-//}
+	if (texturing)
+	{
+		glEnable(mTextureUnitTarget[unit]);
+	}
+	else
+	{
+		glDisable(mTextureUnitTarget[unit]);
+	}
+}
 
 
 ////-----------------------------------------------------------------------------
 ////-----------------------------------------------------------------------------
 //void GLRenderer::_SetTexture(uint32_t unit, Texture* texture)
 //void GLRenderer::_SetTexture(uint32_t unit, Texture* texture)

+ 1 - 1
src/renderers/gl/GLRenderer.h

@@ -58,7 +58,7 @@ public:
 	void				_SetLighting(bool lighting);
 	void				_SetLighting(bool lighting);
 	void				_SetAmbientLight(const Color4& color);
 	void				_SetAmbientLight(const Color4& color);
 
 
-//	void				_SetTexturing(uint32_t unit, bool texturing);
+	void				_SetTexturing(uint32_t unit, bool texturing);
 //	void				_SetTexture(uint32_t unit, Texture* texture);
 //	void				_SetTexture(uint32_t unit, Texture* texture);
 //	void				_SetTextureMode(uint32_t unit, TextureMode mode, const Color4& blendColor);
 //	void				_SetTextureMode(uint32_t unit, TextureMode mode, const Color4& blendColor);
 //	void				_SetTextureWrap(uint32_t unit, TextureWrap wrap);
 //	void				_SetTextureWrap(uint32_t unit, TextureWrap wrap);