mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Allow creating RGBA textures.
This commit is contained in:
parent
2c31ba8016
commit
0c36bfba5d
@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 );
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user