How to Render Camera View (ofCamera) in an ImGui element?

I’m creating an interface using ImGui and would like to encapsulate a camera view (e.g. ofCamera or ofEasyCamera) in a GUI window that I can drag around the screen. It seems like the best way to do this is to capture the framebuffer from the camera, pass it to the GUI engine renderer, and then let the GUI render the camera image. nem0 has done something similar in his Lumix engine here, albeit using a different graphics engine.

Any thoughts? How can I reroute the camera image to a different renderer? Or is there a better way to accomplish this type of thing?

This does something similar with ofVideoPlayer but should work the same with ofVideoGrabber

https://github.com/jvcleave/ofxImGui/blob/develop/example-experimental/src/ofApp.cpp#L59

1 Like

Just realized you may be talking about a virtual camera view but the above should work for anything that you can get into an ofFbo

Thanks, that was very useful!

Hey,
Have you figured out this requirement?
I am doing a project which is based on linux where imGUI should show a video wall of streamings.

Currently, I failed to render a normal png file in imGUI::Image(). Although I went through the imgui.cpp’s guide, and even copy all showing image code, the texture area is still no image out but black color.

Further step, I would like to program streamming wall on imGUI based on linux .

Any suggestions to me? many thanks. My email is ’ bobyuan1015@gmail.com