Problem with ImGui textures

Hello! I’m back to this forum because I have a new problem) I consider to use Dear ImGui as a GUI system in my project, but there is a (IMHO) complex problem with its integration to Panda3D. I want to create a button with custom texture, but it needs a low-level data from OpenGL (GLuint texture ID or something like it – Image Loading and Displaying Examples · ocornut/imgui Wiki · GitHub). Can I access to this data without modifying Panda3D sources? Maybe it is better to use PGUI (but I’d like to use Dear ImGui because PGUI doesn’t have enough documentation)?

EDIT: I have got an ID of texture with my_texture->prepare_now(0, window->get_graphics_window()->get_gsg()->get_prepared_objects(), window->get_graphics_window()->get_gsg())->get_native_id(), but it when I try to use it in ImGui, my program crashes without any message. What do I wrong?

I found a solution in panda3d_imgui! I just needed to use p() of my PT(Texture).
EDIT: Now there is another problem. My texture is displayed incorrectly: black isn’t displayed, white is shown instead of another colors. Does someone know how to fix it? If a system-specific information is needed: I use OpenGl and GNU/Linux.

Have you perhaps looked at the following project?

I don’t know its status–whether it’s still current, or still supported, or how mature it is–but it may be worth looking at!

Yes, I currently use this helper. It is useful, but textures are broken :frowning:

1 Like

I found a solution! It was a problem with shaders. I will fix it.

1 Like