'Dear Imgui' remote access library and application
NetImgui is a library to remotely display and control Dear ImGui menus with an associated NetImgui Server application. Designed to painlessly integrate into existing codebase with few changes required. It allows any program using Dear ImGui to receives input from a remote PC and then forwards its UI rendering to it (textures, vertices, indices, draw commands).
Initially created to assist game developers in debugging their game running on a game console or smartphone, from a PC. However, its use extends to wider applications. The only requirements are that a program is using Dear ImGui using C++ and available TCP/IP communications.
Some applications lack display and inputs access, preventing feedbacks and easy control. It could be a program running on a Raspberry Pie device, or Unreal 4 running in server mode, etc. . Using NetImgui allows the display of a user interface with full control on your PC while the logic remains on the client application itself.
While inputs might be available on a particular device (keyboard, gamepad, ...), it might still not be convenient for certain aspect. For example, your smartphone might offer text input, but a full screen window with a physical keyboard is still more comfortable. Idem for a gaming console with gamepad control or VR development.
Dear ImGui is often used to display relevant debug information during development, but UI elements can obscure the regular content. NetImgui sends the UI content to a remote window, leaving the original display clutter-free and with the freedom to use the entire screen for more elaborate content.
Here is a quick overview of the logic behind using the NetImgui Server and one (or more) program using the NetImgui Client code.
1. (NetImgui Server) Capture user's inputs with mouse/keyboard
2. (NetImgui Server) Send the Inputs to client and request a draw update
3. (NetImgui Client) Draw the Dear ImGui content normally (without need to display on client)
4. (NetImgui Client) Send the drawing results to server
5. (NetImgui Server) Receives the drawing result and display them
6. Repeat the process
The NetImgui Server application currently compiles under Windows, but few changes are required to properly have it running under other Operating Systems.
NetImgui::ConnectToApp()or
NetImgui::ConnectFromApp().
ImGui::NewFrame()with
NetImgui::NewFrame().
ImGui::Render()and
ImGui::EndFrame()with
NetImgui::EndFrame().
Start the NetImgui server application and connect your application to it
More integration details can be found on the Wiki. Multiple samples are also included, providing additional insights
Connection between NetImgui Server and a netImGui Client can be achieved in 4 different ways.
ConnectToApp()with the Server address.
ConnectFromApp()then waits for connection and :
Advanced: Different Dear ImGui content can be displayed locally and remotely at the same time. Look at SampleDualUI for more information.
NetImgui::IsConnected()and
NetImgui::IsDrawingRemote()can be used during Dear ImGui drawing, helping to make selective decisions on the content to draw based on where it will be displayed.
Related projects making use of NetImgui. - Unreal ImGui : Unreal4 Plugin adding Dear ImGui support and allowing to display ImGui content over a game or editor. The net_imgui branch of this repository contains an integration of the NetImgui library for remote access and is ready to go. - Unreal NetImgui : Unreal4 plugin also adding access to Dear ImGui and NetImgui. Unlike the previous plugin, it is a simple implementation with only remote access possible (no ImGui drawing over the game).
netImgui.cfgwith a valid port.~~
(2021/01/22) - API Changes - Removed parameter from
NetImGui::ConnectToApp() / NetImGui::::ConnectFromApp()to clone the current context. NetImgui now only uses the Dear ImGui Context that was active when requesting a connection, without internally using other contexts.
NetImgui_Api.hafter declaring the define
NETIMGUI_IMPLEMENTATION, and all needed source files will also be added for compilation.
Author can be reached for feedbacks / comments at: sammyfreg (at) gmail . com or through GitHub Issues report.
Sincere thanks to Omar Cornut for the incredible work on Dear ImGui.
Support of image formats via stb_image.h by Sean Barrett (public domain).
Support of Solutions generation via Sharpmake by Ubisoft (public domain).
Support of Posix sockets thanks to Aaron Lieberman.
Support of json save file via nlohmann json