Hello,
I try to draw an FBO in a ImGui window.
Im’ using OF 10.1, ofxImGui with ImGui 1.65 or 1.72b
Follow is the code.
for Setup
gui.setup();
// load image
fn << "./gradients/Vice City.jpg";
imgId = gui.loadImage(fn.str());
fbo.allocate(400, 400);
for Draw
fbo.begin();
ofClear(255);
ofSetColor(255, 0, 0);
ofCircle(200, 200, 60);
fbo.end();
fbo.draw(0, 0);
DrawUI();
for DrawUI
gui.begin();
ImGui::Begin("Image");
ImGui::Image(GetImTextureID(imgId), ImVec2(400, 400));
ImGui::End();
ImGui::Begin("Fbo");
ImGui::Image(GetImTextureID(fbo.getTexture()), ImVec2(400, 400));
ImGui::End();
ImGui::Begin("Button FBO");
ImGui::ImageButton(GetImTextureID(imgId), ImVec2(200, 50));
ImGui::ImageButton(GetImTextureID(fbo.getTexture()), ImVec2(200, 50));
ImGui::End();
gui.end();
The Fbo draw correctly in the background (the red circle), but not in ImGui window or button.
Instead it shows the font map ?
See the screen capture.
I’m rather new to OF and OpenGL, I used to work in Unity.
Any idea on what I’m doing wrong ?
Tank’s,
Constant