Closed MubinMuhammad closed 1 week ago
Well have you checked what’s your value of m_id ? It is valid ? Use a debugger and confirm all the values and state from both functions.
There’s no need to call glBindTexture() while submitting imgui calls.
How do I check the validity of m_id
? The Image init function is:
bool app::Image::init(const char *path) {
img_init(&m_pix_map);
img_load(&m_pix_map, path);
if (m_pix_map.fmt == NUM_IMG_FMT) {
return false;
}
m_name = path;
m_id = engine::textureInit(m_pix_map);
return true;
}
Here, if the image is invalid the function returns false. But as it doesn't return false, that means the image is valid. And yet, it shows the texture atlas.
Also, the provided image shows pointer: 2
does it confirm validity?
Thanks.
The actual issue was on my part, and doesn't relate with this. Closing.
Version/Branch of Dear ImGui:
Version 1.91.5, Branch: master
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
archlinux 6.6.56-1-lts
+g++ 14.2.1
Full config/build information:
Used a python script to build the project.
Details:
Before the details, I did read Image Loading and Displaying Examples from ImGui Wiki. As I'm using OpenGL, the general steps are:
glTexParameteri
.For this, I created this function:
The next step is to just use
ImGui::Image()
to render the image to a window. Here is the function I wrote for this:After all of this I don't get the Image I select. Instead, I get a Font Texture Atlas. This happens no matter which image I choose.
Screenshots/Video:
No matter which Image I choose, I always find this texture atlas:
Minimal, Complete and Verifiable Example code:
Example code is given in the details.