Backends: Replace direct access to TextureId with GetTexID() call in ImDrawCmd. (#3761)

This commit is contained in:
thedmd
2021-05-19 18:39:18 +02:00
committed by ocornut
parent e7e170c534
commit 3c72e5142b
14 changed files with 42 additions and 17 deletions
+1 -1
View File
@@ -370,7 +370,7 @@ ImGui::Image((void*)texture, ImVec2(texture->Width, texture->Height));
The renderer function called after ImGui::Render() will receive that same value that the user code passed:
```cpp
// Cast ImTextureID / void* stored in the draw command as our texture type
MyTexture* texture = (MyTexture*)pcmd->TextureId;
MyTexture* texture = (MyTexture*)pcmd->GetTexID();
MyEngineBindTexture2D(texture);
```
Once you understand this design you will understand that loading image files and turning them into displayable textures is not within the scope of Dear ImGui.