From: Mikko Rasa Date: Thu, 29 Dec 2016 09:41:03 +0000 (+0200) Subject: Default to mipmapped filtering if EXT_framebuffer_object is available X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=34a4efa81946066d32c1374318dcc0b74ae486a9;p=libs%2Fgl.git Default to mipmapped filtering if EXT_framebuffer_object is available Even if SGIS_generate_mipmap isn't. The latter functionality has been removed from modern OpenGL. --- diff --git a/source/resources.cpp b/source/resources.cpp index 6f5b0712..db01b30b 100644 --- a/source/resources.cpp +++ b/source/resources.cpp @@ -1,6 +1,5 @@ #include #include -#include #include "animation.h" #include "armature.h" #include "font.h" @@ -27,7 +26,7 @@ namespace GL { void init_shaderlib(DataFile::BuiltinSource &); Resources::Resources(): - default_tex_filter(SGIS_generate_mipmap ? LINEAR_MIPMAP_LINEAR : LINEAR), + default_tex_filter(Texture::can_generate_mipmap() ? LINEAR_MIPMAP_LINEAR : LINEAR), srgb_conversion(false), resource_manager(0) { diff --git a/source/texture.cpp b/source/texture.cpp index 18746e5f..185ed7fe 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -243,6 +243,11 @@ void Texture::set_wrap_r(TextureWrap w) update_parameter(WRAP_R); } +bool Texture::can_generate_mipmap() +{ + return (EXT_framebuffer_object || SGIS_generate_mipmap); +} + void Texture::set_generate_mipmap(bool gm) { if(gm && !EXT_framebuffer_object) diff --git a/source/texture.h b/source/texture.h index abccb8d8..9c43b769 100644 --- a/source/texture.h +++ b/source/texture.h @@ -163,6 +163,8 @@ public: void set_wrap_t(TextureWrap); void set_wrap_r(TextureWrap); + static bool can_generate_mipmap(); + /** Sets automatic mipmap generation. If enabled, mipmaps are generated when a texture image is uploaded. */ void set_generate_mipmap(bool);