1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-24 15:50:25 +01:00

Using ImTextureID instead of void* in ImFontAtlas, not sure why I didn't do that earlier, make things more clear

This commit is contained in:
omar 2017-06-02 11:25:36 +02:00
parent 51c200ac0d
commit 2acbd1ac2d

View File

@ -1312,7 +1312,7 @@ struct ImFontAtlas
// Pitch = Width * BytesPerPixels
IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel
IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel
void SetTexID(void* id) { TexID = id; }
void SetTexID(ImTextureID id) { TexID = id; }
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
// NB: Make sure that your string are UTF-8 and NOT in your local code page. See FAQ for details.
@ -1325,7 +1325,7 @@ struct ImFontAtlas
// Members
// (Access texture data via GetTexData*() calls which will setup a default font for you.)
void* TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It ia passed back to you during rendering.
ImTextureID TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
unsigned char* TexPixelsAlpha8; // 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
unsigned int* TexPixelsRGBA32; // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
int TexWidth; // Texture width calculated during Build().