svn merge -r39792:39829 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / gameengine / Rasterizer / RAS_OpenGLRasterizer / RAS_OpenGLRasterizer.cpp
index 55f36dcd772484e3020112c96096e2e5c2e00f90..98459bf53af9b2ec99d9a66b1e1c3fb330ffc8c7 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();
+}