From eaa63d0b6928b55c07011c2d5a0849f693377892 Mon Sep 17 00:00:00 2001 From: Benlitz Date: Fri, 21 Jun 2013 16:27:50 +0000 Subject: [PATCH] Added mipmap generation function for textures (i lied, it was easy with d3d9 <3) --- src/gpu/texture.cpp | 10 ++++++++++ src/lol/gpu/texture.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/gpu/texture.cpp b/src/gpu/texture.cpp index 12a72914..404a9a1c 100644 --- a/src/gpu/texture.cpp +++ b/src/gpu/texture.cpp @@ -291,6 +291,16 @@ void Texture::SetMinFiltering(TextureMinFilter filter) #endif } +void Texture::GenerateMipmaps() +{ +#if defined _XBOX || defined USE_D3D9 + m_data->m_texture->GenerateMipSubLevels(); +#else + glBindTexture(GL_TEXTURE_2D, m_data->m_texture); + glGenerateMipmap(GL_TEXTURE_2D); +#endif +} + Texture::~Texture() { #if defined USE_D3D9 || defined _XBOX diff --git a/src/lol/gpu/texture.h b/src/lol/gpu/texture.h index 1ad13e3b..d2a4f013 100644 --- a/src/lol/gpu/texture.h +++ b/src/lol/gpu/texture.h @@ -100,6 +100,7 @@ public: void SetMagFiltering(TextureMagFilter filter); void SetMinFiltering(TextureMinFilter filter); + void GenerateMipmaps(); ShaderTexture GetTexture() const;