BGE: Adding two new functions to bge.render to allow users to change the anisotropic...
[blender.git] / source / gameengine / Rasterizer / RAS_OpenGLRasterizer / RAS_OpenGLRasterizer.cpp
index 23e0a50ed6f01c538429f0ba93124690ca251c1d..50d034a5a5a8f30f7f6639fc72df41a72f67a7b0 100644 (file)
@@ -99,12 +99,16 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas)
                hinterlace_mask[i] = (i&1)*0xFFFFFFFF;
        }
        hinterlace_mask[32] = 0;
+
+       m_prevafvalue = GPU_get_anisotropic();
 }
 
 
 
 RAS_OpenGLRasterizer::~RAS_OpenGLRasterizer()
 {
+       // Restore the previous AF value
+       GPU_set_anisotropic(m_prevafvalue);
 }
 
 bool RAS_OpenGLRasterizer::Init()
@@ -1204,3 +1208,12 @@ void RAS_OpenGLRasterizer::SetFrontFace(bool ccw)
        m_last_frontface = ccw;
 }
 
+void RAS_OpenGLRasterizer::SetAnisotropicFiltering(short level)
+{
+       GPU_set_anisotropic((float)level);
+}
+
+short RAS_OpenGLRasterizer::GetAnisotropicFiltering()
+{
+       return (short)GPU_get_anisotropic();
+}