• Stars
    star
    373
  • Rank 110,567 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dear ImGui over WebSockets

Actions Status

imgui-ws

Dear ImGui over WebSockets

This is a small library that allows to stream a Dear ImGui scene to multiple WebSocket clients at once. This is achieved by sending Dear ImGui's DrawData structure which is then rendered in the browser using WebGL. To reduce the amount of network traffic, we send only the diffs between sequential frames (for more info - see #1).

Live examples

These are sample applications using imgui-ws, running on a Linode 2GB instance:

Example URL Description
demo-null http://imgui-ws.ggerganov.com:5001/ Dear ImGui's demo app
basic-null http://imgui-ws.ggerganov.com:5002/ Basic read-only data visualization
textures-null http://imgui-ws.ggerganov.com:5003/ Textures example

Note that these examples are "headless". This means that no graphics backend (like OpenGL, SDL, Vulkan, etc) is needed on the server, because it does not render anything. The application just generates the Dear ImGui draw data and sends it to any connected WebSocket clients where the actual rendering occurs. This has the advantage of being able to run applications with Dear ImGui interface on almost any kind of hardware, even one without a monitor or a graphics card. For example, the applications can run on a Raspberry Pi, or on a cloud VM as in the examples above.

Tools

There are a few tools that help with the development and the optimization of the ImDrawData compression. To build the SDL-based tools, use cmake -DIMGUI_WS_SUPPORT_SDL2=ON.

  • record-sdl2

    Record the ImDrawData for all rendered frames in a Dear ImGui session

    ./bin/record-sdl2 session.imdd
    
  • replay-sdl2

    Replay a session recorded with the record-sdl2 tool

    ./bin/replay-sdl2 session.imdd
    
  • compressor-benchmark

    Run the available ImDrawData compression algorithms on various pre-recorded Dear ImGui sessions. Reports compression ratio, average required bandwidth and cpu utilization:

    ./bin/compressor-benchmark session0.imdd [session1.imdd] [session2.imdd] [...]
    

Building & running

# build
git clone https://github.com/ggerganov/imgui-ws --recursive
cd imgui-ws && mkdir build && cd build
cmake ..
make

# running
./bin/demo-null 5000

Open some browsers and point them to http://localhost:5000/

Dependencies

Screenshot

imgui-ws

Credits

More Repositories

1

llama.cpp

LLM inference in C/C++
C++
57,294
star
2

whisper.cpp

Port of OpenAI's Whisper model in C/C++
C
31,104
star
3

ggml

Tensor library for machine learning
C
9,644
star
4

kbd-audio

🎤⌨️ Acoustic keyboard eavesdropping
C++
7,569
star
5

imtui

ImTui: Immediate Mode Text-based User Interface C++ Library
C++
2,421
star
6

wave-share

Serverless, peer-to-peer, local file sharing through sound
C++
1,955
star
7

ggwave

Tiny data-over-sound library
C++
1,496
star
8

dot-to-ascii

Graphviz to ASCII converter using Graph::Easy
HTML
371
star
9

hnterm

📃 Hacker News in the terminal
C++
144
star
10

ggmorse

Morse code decoding library
C++
136
star
11

whisper.spm

whisper.cpp package for the Swift Package Manager
C
120
star
12

tweet2doom

Tweet to play Doom
Shell
83
star
13

wave-gui

Yet another data-over-sound tool
C++
70
star
14

wtf-tui

Text-based UI tool for configuring the WTF terminal dashboard
C++
66
star
15

incppect

Inspect C++ memory in the browser
C++
63
star
16

ggweb

Template for C++ GUI apps that can run in the browser
C
54
star
17

ggterm

Terminal configuration for C++ development with Vim
Vim Script
34
star
18

diff-challenge

Is this even possible?
Shell
27
star
19

wordle-bg

🇧🇬 Wordle clone in Bulgarian
C++
27
star
20

hnreplies

Scrape Hacker News replies
C++
22
star
21

intervals

Downsampling array of intervals
C++
21
star
22

wave-em

Data over sound in the browser
C++
20
star
23

typing-battles

A multiplayer typing game (server: C++/WebSockets, client: JS)
C++
18
star
24

morse-meme

Meme generator in Bash
Shell
16
star
25

tweet2doom-data

@tweet2doom data and tools
JavaScript
16
star
26

ggwave-java

Minimal Java app for Android using ggwave
Java
14
star
27

ggwave-arduino

Mirror of ggwave used in the Arduino Library Manager
C++
14
star
28

imgui-em

Emscripten port of Dear ImGui (not maintained)
C++
14
star
29

ggwave-objc

Minimal Objective-C app for iOS using ggwave
Objective-C
10
star
30

ggwords

Generate language n-gram statistics
C++
10
star
31

ggerganov.github.io

JavaScript
10
star
32

imtui-template

Template repo for simple ImTui apps
C++
9
star
33

ggwave-spm

ggwave package for the Swift Package Manager
C++
8
star
34

asteroid-generator

The demo generates and renders asteroids floating in space. The shape and the texture of the generated asteroids are procedurally generated. The space background is procedurally generated as well.
C++
7
star
35

ggint

Poor man's big integer arithmetic operations
C++
6
star
36

ggsock

Non-blocking sockets wrapper
C++
5
star
37

hnguessr

Guess the Hacker News titles
C++
5
star
38

ggimg

Poor man's 2d and 3d image operations
C++
4
star
39

load-em

Load a local file in C++ Emscripten program
HTML
4
star
40

the-story

Collaborative storytelling experiment
HTML
4
star
41

tweet2btc

BTC price predictions via Twitter Polls
Shell
3
star
42

site-wave-share

A dedicated page for the wave-share tool:
JavaScript
3
star
43

ocl-lights

Pixel perfect 2D shadows on the GPU
C++
3
star
44

font-rasterizer

Simple TTF rasterizer
C
3
star
45

toto-check

See how many times you could have won the lottery
HTML
3
star
46

puzzle-solver

C++
2
star
47

OSSRH-94491

Jira
1
star
48

homebrew-ggerganov

My Homebrew tap for projects that are not notable enough
Ruby
1
star