mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Textures: ImTextureData::Create() sets status. RegisterUserTexture() increases RefCount. Added comments about ImTextureData::GetTexRef(). (#8789)
This commit is contained in:
parent
0e6e876f23
commit
a0d3e405a3
5 changed files with 14 additions and 7 deletions
|
|
@ -2457,8 +2457,10 @@ const char* ImTextureDataGetFormatName(ImTextureFormat format)
|
|||
|
||||
void ImTextureData::Create(ImTextureFormat format, int w, int h)
|
||||
{
|
||||
IM_ASSERT(Status == ImTextureStatus_Destroyed);
|
||||
DestroyPixels();
|
||||
Format = format;
|
||||
Status = ImTextureStatus_WantCreate;
|
||||
Width = w;
|
||||
Height = h;
|
||||
BytesPerPixel = ImTextureDataGetFormatBytesPerPixel(format);
|
||||
|
|
@ -3971,7 +3973,6 @@ ImTextureData* ImFontAtlasTextureAdd(ImFontAtlas* atlas, int w, int h)
|
|||
}
|
||||
|
||||
new_tex->Create(atlas->TexDesiredFormat, w, h);
|
||||
new_tex->Status = ImTextureStatus_WantCreate;
|
||||
atlas->TexIsBuilt = false;
|
||||
|
||||
ImFontAtlasBuildSetTexture(atlas, new_tex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue