diff --git a/src/BaseEngine.cpp b/src/BaseEngine.cpp index 1bb3d56..d367a95 100644 --- a/src/BaseEngine.cpp +++ b/src/BaseEngine.cpp @@ -30,6 +30,6 @@ namespace ofxImGui glBindTexture(GL_TEXTURE_2D, last_texture); - return new_texture; + return new_texture; // And who will clean up the garbage ? Seemingly nobody... }; } diff --git a/src/BaseEngine.h b/src/BaseEngine.h index c542523..2f0fe84 100644 --- a/src/BaseEngine.h +++ b/src/BaseEngine.h @@ -25,6 +25,8 @@ namespace ofxImGui virtual bool updateFontsTexture() = 0; + // This is here to keep a compatibility layer with old codebases. + // Not recommended to use, Upload with OF and use the GL_TEXTURE_2D's textureID directly. virtual GLuint loadTextureImage2D(unsigned char * pixels, int width, int height); protected: diff --git a/src/Gui.cpp b/src/Gui.cpp index 07277dd..8e5ea94 100644 --- a/src/Gui.cpp +++ b/src/Gui.cpp @@ -5,6 +5,8 @@ +// Todo: Texture/Pixel loading functions: Stop using ofDisableArbTex and use appropriate textureSettings instead. + namespace ofxImGui { //-------------------------------------------------------------- diff --git a/src/ImHelpers.h b/src/ImHelpers.h index 1415728..050dde4 100644 --- a/src/ImHelpers.h +++ b/src/ImHelpers.h @@ -128,6 +128,10 @@ namespace ofxImGui static ImTextureID GetImTextureID(const ofTexture& texture) { + if (texture.getTextureData().textureTarget == GL_TEXTURE_RECTANGLE) + { + ofLogWarning("Warning, ImGui only supports drawing textures of type GL_TEXTURE_RECTANGLE."); + } return (ImTextureID)(uintptr_t)texture.texData.textureID; }