mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
Fix the default mipmap filter for textures.
This commit is contained in:
@@ -104,6 +104,11 @@ bool isDebugEnabled()
|
|||||||
|
|
||||||
love::Type Graphics::type("graphics", &Module::type);
|
love::Type Graphics::type("graphics", &Module::type);
|
||||||
|
|
||||||
|
Graphics::DisplayState::DisplayState()
|
||||||
|
{
|
||||||
|
defaultSamplerState.mipmapFilter = SamplerState::MIPMAP_FILTER_LINEAR;
|
||||||
|
}
|
||||||
|
|
||||||
Graphics::Graphics()
|
Graphics::Graphics()
|
||||||
: width(0)
|
: width(0)
|
||||||
, height(0)
|
, height(0)
|
||||||
|
|||||||
@@ -869,6 +869,8 @@ protected:
|
|||||||
|
|
||||||
struct DisplayState
|
struct DisplayState
|
||||||
{
|
{
|
||||||
|
DisplayState();
|
||||||
|
|
||||||
Colorf color = Colorf(1.0, 1.0, 1.0, 1.0);
|
Colorf color = Colorf(1.0, 1.0, 1.0, 1.0);
|
||||||
Colorf backgroundColor = Colorf(0.0, 0.0, 0.0, 1.0);
|
Colorf backgroundColor = Colorf(0.0, 0.0, 0.0, 1.0);
|
||||||
|
|
||||||
@@ -901,6 +903,7 @@ protected:
|
|||||||
|
|
||||||
bool wireframe = false;
|
bool wireframe = false;
|
||||||
|
|
||||||
|
// Default mipmap filter is set in the DisplayState constructor.
|
||||||
SamplerState defaultSamplerState = SamplerState();
|
SamplerState defaultSamplerState = SamplerState();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -281,6 +281,9 @@ Texture::Texture(const Settings &settings, const Slices *slices)
|
|||||||
|
|
||||||
samplerState = gfx->getDefaultSamplerState();
|
samplerState = gfx->getDefaultSamplerState();
|
||||||
|
|
||||||
|
if (getMipmapCount() == 1)
|
||||||
|
samplerState.mipmapFilter = SamplerState::MIPMAP_FILTER_NONE;
|
||||||
|
|
||||||
Quad::Viewport v = {0, 0, (double) width, (double) height};
|
Quad::Viewport v = {0, 0, (double) width, (double) height};
|
||||||
quad.set(new Quad(v, width, height), Acquire::NORETAIN);
|
quad.set(new Quad(v, width, height), Acquire::NORETAIN);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user