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 to the existing logic. It forwards the rendering information needed to draw the UI on another PC (vertices, indices, draw commands).
Initially created to assist game developers in debugging their game from a PC while running on console or cellphone. However, its use can easily be extended to other fields. For example, help with VR developement, or easily add a UI to some devices without display but TCP/IP communications available.
For programs running on hardware without easy access to a keyboard and mouse, netImgui provides the comfort of your computer's inputs while controlling it remotely.
Dear ImGui is often used to display relevant debug information during development, but its 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. The hardware running Dear ImGui might not even have a display, sending the UI content to the NetImgui server application allows to have one.
- Download the latest version of netImgui.
- Add the content of Code\Client to your codebase.
- In your codebase :
- [once] Call
NetImgui::ConnectToApp()
orNetImgui::ConnectFromApp()
. - [once] Call
NetImgui::SendDataTexture()
(uploads your font texture to netImguiServer). - [Every Redraw]
- Replace
ImGui::NewFrame()
with call toNetImgui::NewFrame()
. - Draw your ImGui menu as usual.
- Replace
ImGui::Render()
andImGui::EndFrame()
with call toNetImgui::EndFrame()
.
- Replace
- [once] Call
- Start the netImgui server application and connect your application to it
(More integration details can be found on the Wiki and multiple included Sample projects can provide insights)
-
Connection between netImgui Server and a netImGui Client can be achieved in 4 different ways.
-
Server waits for connection and :
- (A) Client calls
ConnectToApp()
with the Server address.
- (A) Client calls
-
Client calls
ConnectFromApp()
then waits for connection and :- (B) Server configure the Client's address and connect to it.
- (C) Server is launched with the Client's address in commandline.
- (D) Server receives a Client's address from another application, through Windows named pipe : \.\pipe\netImgui'.
-
Advanced: Different Dear ImGui content can be displayed locally and remotely at the same time. Look at SampleDualUI for more information.
-
NetImgui::IsConnected()
andNetImgui::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.
Tested against these Dear ImGui versions: 1.74, 1.75, 1.76, 1.76(Docking), 1.77, 1.78
Should be able to support other versions without too much difficulty. Mostly involve making sure the function ContextClone()
compiles properly against the imgui.h
file.
- Bugfix : netImgui Server application unable to start when post configured for listening can't be opened. Need to manually edit
netImgui.cfg
with a valid port. - Support of additional texture formats
- Commands to assign custom backgrounds
- Handle Linear/sRGB vertex color format
- Add logging information in netImgui server application
- Profile and optimize performances
- Add copy/paste support
- Add new Dear ImGui multi windows support (docking branch)
Networking: Add support of client accepting connection from netImgui App
(2020/08/22)
- API Changes
NetImGui::NewFrame()
/NetImGui::EndFrame()
should always be used, even when disconnectedNetImGui::NewFrame()
takes a new parameter, telling netImgui to continue using the same context or use a duplicateNetImgui::Connect()
replaced byNetImgui::ConnectToApp()
/NetImGui::ConnectFromApp()
NetImgui::IsRemoteDraw()
renamed toNetImgui::IsDrawingRemote()
NetImgui::IsDrawing()
addedNetImgui::IsConnectionPending()
addedNetImgui::GetDrawData()
addedNetImgui::GetRemoteContext()
removed- New
- Support for connection initiated from netImgui server application
- GUI and save file support for Client configurations
- Improved samples
- Optional commandline parameter to specify Client's address for connection on netImgui Server launch
- Launching a second netImgui Server forward commandline option to already running instance
- netImgui Server application accepts Client's address request from a Windows 'named pipe'
- Bugfix
- Issue of text edition not recognizing special key strokes (navigation, delete, ...)
Author can be reached for feedbacks / comments at: sammyfreg (at) gmail . com
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