• Stars
    star
    230
  • Rank 168,225 (Top 4 %)
  • Language
    C++
  • Created about 6 years ago
  • Updated 12 months ago

Reviews

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

Repository Details

A Software Renderer for Dear ImGui

Dear ImGui software renderer

This is a software renderer for Dear ImGui. I built it not out of a specific need, but because it was fun. The goal was to get something accurate and decently fast in not too many lines of code. It renders a complex GUI in 1-10 milliseconds on a modern laptop.

What it is:

As the name implies, this is a software renderer for ImGui. It does not handle any windows or input. In the supplied example I use SDL2 for that.

How to use it

Just copy imgui_sw.hpp and imgui_sw.cpp. There are no other dependencies beside Dear ImGui. Requires C++11.

How to test it

git clone https://github.com/emilk/imgui_software_renderer.git
cd imgui_software_renderer
git submodule update --init --recursive
./build_and_run.sh

For the example to work you will need to have SDL2 on your system.

Example:

This renders in 7 ms on my MacBook Pro:

Software rendered

Alternatives

There is another software rasterizer for ImGui (which I did not know about when I wrote mine) at https://github.com/sronsse/imgui/tree/sw_rasterizer_example/examples/sdl_sw_example. I have not compared the two (yet).

Future work:

  • We do not yet support painting with any other texture than the default font texture.
  • Optimize rendering of gradient rectangles (common for color pickers)
  • Compare my software renderer to the one by @sronsse

License:

This software is dual-licensed to the public domain and under the following license: you are granted a perpetual, irrevocable license to copy, modify, publish, and distribute this file as you see fit.

More Repositories

1

egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
Rust
19,517
star
2

loguru

A lightweight C++ logging library
C++
1,712
star
3

eframe_template

The easy way to make a Rust app with a GUI
Rust
649
star
4

emilib

Loose collection of misc C++ libs
C++
339
star
5

wfc

A C++ port of Wave Function Collapse Tiling
C
304
star
6

ehttp

Minimal Rust HTTP client for both native and WASM
Rust
250
star
7

drop-merge-sort

A novel adaptive sorting algorithm
Rust
164
star
8

Configuru

Experimental config library for C++
C++
137
star
9

ram_bench

A benchmark for random memory accesses
C++
106
star
10

Dual-Contouring

Dual Contoruing implemented in C++
C++
73
star
11

eterm

Exeprimental visual terminal for egui
Rust
69
star
12

sol

Lua + Typesafety = Sol
Lua
65
star
13

puffin_egui

Show puffin profiler flamegraph in-game using egui
44
star
14

hobogo

Rust + WASM experiment
Rust
35
star
15

pga

Experimental type-safe geometric algebra for Rust
Rust
35
star
16

bon

BON - Binary Object Notation
C++
22
star
17

field_interpolation

Field interpolation using finite elements and sparse linear least squares
C++
13
star
18

blog

My personal blog, I Like Big Bits
HTML
9
star
19

sproxel

Fork of http://code.google.com/p/sproxel/
Python
9
star
20

emath

Some 2D/3D math I tend to reuse across projects.
C++
9
star
21

egui_presentation

A presentation about egui, implemented in egui
Rust
9
star
22

userp

Rust formatting tool for clustering use statements
Rust
8
star
23

alignify

Helper script for automatic text alignment
Python
7
star
24

snake_case

A Rust crate for working with snake_case strings
Rust
6
star
25

econtext

Rust crate for fast and simple error context on panics
Rust
5
star
26

egui-pure-glow

Quick test of egui dependencies
Rust
4
star
27

luastrip

Strips Lua files of specific statements. The outputted Lua files are identically formatted to the input, including line numbers even after the skipped statements.
C++
4
star
28

urlbot

irc bot that scan for urls, then print the page title to the channel
Python
3
star
29

emilk

This specifies how my profile at https://github.com/emilk looks.
2
star
30

binandlib

A Rust crate to test if it is possible to make a crate that is both a binary and a library
Rust
1
star
31

rayon_test

Test the use of rayon on Wasm
Rust
1
star
32

webgl

WebGL toys
1
star
33

list_traversal

A benchmark for random memory access
1
star