Allow generating texture mip maps.

This commit is contained in:
Bartosz Taudul 2023-04-27 21:58:48 +02:00
parent d131f22354
commit 42aeece7fd
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 8 additions and 0 deletions

View File

@ -174,4 +174,11 @@ void UpdateTextureRGBA( void* _tex, void* data, int w, int h )
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data ); glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data );
} }
void MakeMipMaps( void* _tex )
{
auto tex = (GLuint)(intptr_t)_tex;
glBindTexture( GL_TEXTURE_2D, tex );
glGenerateMipmap( GL_TEXTURE_2D );
}
} }

View File

@ -11,6 +11,7 @@ void* MakeTexture( bool zigzag = false );
void FreeTexture( void* tex, void(*runOnMainThread)(const std::function<void()>&, bool) ); void FreeTexture( void* tex, void(*runOnMainThread)(const std::function<void()>&, bool) );
void UpdateTexture( void* tex, const char* data, int w, int h ); void UpdateTexture( void* tex, const char* data, int w, int h );
void UpdateTextureRGBA( void* tex, void* data, int w, int h ); void UpdateTextureRGBA( void* tex, void* data, int w, int h );
void MakeMipMaps( void* tex );
} }