Commit 6a635be7 authored by w4t's avatar w4t

GetImTextureID static

usage:

ofTexture texture;
ofImage image;

ImGui::Image(GetImTextureID(texture), ImGui::GetWindowSize());
ImGui::Image(GetImTextureID(image), ImGui::GetWindowSize());
parent abc7d184
Pipeline #63 canceled with stages
......@@ -753,7 +753,7 @@ void ofxImGui::AddImage(ofBaseHasTexture& hasTexture, const ofVec2f& size)
//--------------------------------------------------------------
void ofxImGui::AddImage(ofTexture& texture, const ofVec2f& size)
{
ImTextureID textureID = (ImTextureID)(uintptr_t)texture.texData.textureID;
ImTextureID textureID = GetImTextureID(texture);
ImGui::Image(textureID, size);
}
......
......@@ -112,6 +112,16 @@ namespace ofxImGui
void AddImage(ofTexture& texture, const ofVec2f& size);
}
static ImTextureID GetImTextureID(ofTexture& texture)
{
return (ImTextureID)(uintptr_t)texture.texData.textureID;
}
static ImTextureID GetImTextureID(ofBaseHasTexture& hasTexture)
{
return GetImTextureID(hasTexture.getTexture());
}
//--------------------------------------------------------------
template<typename ParameterType>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment