BGE: Adding mipmapping control to bge.render via bge.render.setMipmapping() and bge.render.getMipmapping().

This commit is contained in:
Mitchell Stokes
2013-04-14 00:40:24 +00:00
parent 6b37baf34c
commit d2b14ed4f0
8 changed files with 110 additions and 1 deletions

View File

@@ -1064,6 +1064,35 @@ short RAS_OpenGLRasterizer::GetAnisotropicFiltering()
return (short)GPU_get_anisotropic();
}
void RAS_OpenGLRasterizer::SetMipmapping(MipmapOption val)
{
if (val == RAS_IRasterizer::RAS_MIPMAP_LINEAR)
{
GPU_set_linear_mipmap(1);
GPU_set_mipmap(1);
}
else if (val == RAS_IRasterizer::RAS_MIPMAP_NEAREST)
{
GPU_set_linear_mipmap(0);
GPU_set_mipmap(1);
}
else
{
GPU_set_linear_mipmap(0);
GPU_set_mipmap(0);
}
}
RAS_IRasterizer::MipmapOption RAS_OpenGLRasterizer::GetMipmapping()
{
if (GPU_get_linear_mipmap())
return RAS_IRasterizer::RAS_MIPMAP_LINEAR;
else if (GPU_get_mipmap())
return RAS_IRasterizer::RAS_MIPMAP_NEAREST;
else
return RAS_IRasterizer::RAS_MIPMAP_NONE;
}
void RAS_OpenGLRasterizer::SetUsingOverrideShader(bool val)
{
m_usingoverrideshader = val;