Fix the default mipmap filter for textures.

This commit is contained in:
Alex Szpakowski
2020-10-26 18:25:40 -03:00
parent 99875d83b3
commit 7e0c7e3a67
3 changed files with 11 additions and 0 deletions
+5
View File
@@ -104,6 +104,11 @@ bool isDebugEnabled()
love::Type Graphics::type("graphics", &Module::type);
Graphics::DisplayState::DisplayState()
{
defaultSamplerState.mipmapFilter = SamplerState::MIPMAP_FILTER_LINEAR;
}
Graphics::Graphics()
: width(0)
, height(0)
+3
View File
@@ -869,6 +869,8 @@ protected:
struct DisplayState
{
DisplayState();
Colorf color = Colorf(1.0, 1.0, 1.0, 1.0);
Colorf backgroundColor = Colorf(0.0, 0.0, 0.0, 1.0);
@@ -901,6 +903,7 @@ protected:
bool wireframe = false;
// Default mipmap filter is set in the DisplayState constructor.
SamplerState defaultSamplerState = SamplerState();
};
+3
View File
@@ -281,6 +281,9 @@ Texture::Texture(const Settings &settings, const Slices *slices)
samplerState = gfx->getDefaultSamplerState();
if (getMipmapCount() == 1)
samplerState.mipmapFilter = SamplerState::MIPMAP_FILTER_NONE;
Quad::Viewport v = {0, 0, (double) width, (double) height};
quad.set(new Quad(v, width, height), Acquire::NORETAIN);