Sfoglia il codice sorgente

Added mipmap generation function for textures (i lied, it was easy with d3d9 <3)

legacy
Benlitz benlitz 11 anni fa
parent
commit
eaa63d0b69
2 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. +10
    -0
      src/gpu/texture.cpp
  2. +1
    -0
      src/lol/gpu/texture.h

+ 10
- 0
src/gpu/texture.cpp Vedi File

@@ -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


+ 1
- 0
src/lol/gpu/texture.h Vedi File

@@ -100,6 +100,7 @@ public:

void SetMagFiltering(TextureMagFilter filter);
void SetMinFiltering(TextureMinFilter filter);
void GenerateMipmaps();

ShaderTexture GetTexture() const;



Caricamento…
Annulla
Salva