Hi, I’m having trouble displaying custom PNG images to an ImGui window. I’m using OpenGL3 with SDL and I’m starting out with modifying the sdl/opengl3 example provided before moving to my project.
The issue I’m having is that the image is being displayed as a black box in the window I want to render it in (exactly like this issue: ImGui::Image with opengl black box instead of the image). I first tried putting the code you provided in the “How do I display an image?” FAQ section in main.cpp, but then after reading more into how OpenGL texture loading works, I ended up with this code (my changes are marked with the “CG Change” comment): http://txt.do/dn8pf
As for the image, I have a simple png that I place in the example_sdl_opengl3 directory along with stb_image.h. Here’s the png I’m using for reference: https://imgur.com/xFsKxDx (you’ll have to change the file name to make it play nice with the code).
Thank you,
Chris Gomez