瀏覽代碼

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

legacy
Benlitz benlitz 11 年之前
父節點
當前提交
eaa63d0b69
共有 2 個檔案被更改,包括 11 行新增0 行删除
  1. +10
    -0
      src/gpu/texture.cpp
  2. +1
    -0
      src/lol/gpu/texture.h

+ 10
- 0
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


+ 1
- 0
src/lol/gpu/texture.h 查看文件

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

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

ShaderTexture GetTexture() const;



Loading…
取消
儲存