mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Special-case creating zigzag texture.
This commit is contained in:
parent
383f1ea8f1
commit
d131f22354
@ -39,14 +39,14 @@ void InitTexture()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void* MakeTexture()
|
void* MakeTexture( bool zigzag )
|
||||||
{
|
{
|
||||||
GLuint tex;
|
GLuint tex;
|
||||||
glGenTextures( 1, &tex );
|
glGenTextures( 1, &tex );
|
||||||
glBindTexture( GL_TEXTURE_2D, tex );
|
glBindTexture( GL_TEXTURE_2D, tex );
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, zigzag ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR );
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, zigzag ? GL_REPEAT : GL_CLAMP_TO_EDGE );
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
|
||||||
return (void*)(intptr_t)tex;
|
return (void*)(intptr_t)tex;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ namespace tracy
|
|||||||
{
|
{
|
||||||
|
|
||||||
void InitTexture();
|
void InitTexture();
|
||||||
void* MakeTexture();
|
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 );
|
||||||
|
Loading…
Reference in New Issue
Block a user