I am trying to display two images inside an ofxImGui window(on Android) My problem is, if I try to display two images using ofxImGui functions, it just displays one image correctly in the window, it just displays a blank square/rectangle instead of the second image.But instead if I draw the two fbos directly onto the screen using ofFbo.draw() function, it is able to display the two images on the screen.
My code is:
void ofApp::setup(){
gui.setup();
....
fbo1.allocate(300,300);
fbo2.allocate(300,300);
void ofApp::draw(){
fbo1.begin();
ofClear(0,0,0,0);
ofSetColor(255,255,255,255);
image1.draw(0,0); //both image1 and image2 are ofImage objects
fbo1.end();
fbo2.begin();
ofClear(0,0,0,0);
ofSetColor(255,255,255,255);
image2.draw(0,0);
fbo2.end();
//here if I write fbo1.draw(); fbo2.draw(), it is able to display the two images on the screen
//directly but they are not controlled by ofxImGui
gui.begin();
ImGui::SetNextWindowPos(ofVec2f(650, 20), ImGuiSetCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(1020, 1000), ImGuiSetCond_Once);
ImGui::Begin("Funky Window");
ImTextureID texid = (ImTextureID) (uintptr_t) (
fbo1.getTexture().getTextureData().textureID);
ImGui::Image((ImTextureID) (uintptr_t) (texid),
ImVec2(480, 480), ImVec2(0, 0), ImVec2(1, 1), ImColor(255, 255, 255, 255), ImColor(255, 255, 255, 128));
ImGui::NewLine();
ImTextureID texid2=(ImTextureID)(uintptr_t)( fbo2.getTexture().getTextureData().textureID);
ImGui::Image((ImTextureID) (uintptr_t) (texid2),
ImVec2(480,480),ImVec2(1,1),ImVec2(1,1),ImColor(255,255,255,255),ImColor(255,255,255,128));
ImGui::End();
gui.end();
I will be glad if someone helps.