1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 20:33:52 +00:00

Allow creating RGBA textures.

This commit is contained in:
Bartosz Taudul 2022-07-26 01:49:19 +02:00
parent 2c31ba8016
commit 0c36bfba5d
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 8 additions and 0 deletions

View File

@ -35,4 +35,11 @@ void UpdateTexture( void* _tex, const char* data, int w, int h )
glCompressedTexImage2D( GL_TEXTURE_2D, 0, COMPRESSED_RGB_S3TC_DXT1_EXT, w, h, 0, w * h / 2, data );
}
void UpdateTextureRGBA( void* _tex, void* data, int w, int h )
{
auto tex = (GLuint)(intptr_t)_tex;
glBindTexture( GL_TEXTURE_2D, tex );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data );
}
}

View File

@ -9,6 +9,7 @@ namespace tracy
void* MakeTexture();
void FreeTexture( void* tex, void(*runOnMainThread)(std::function<void()>, bool) );
void UpdateTexture( void* tex, const char* data, int w, int h );
void UpdateTextureRGBA( void* tex, void* data, int w, int h );
}