Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emilk/imgui_software_renderer
A Software Renderer for Dear ImGui
https://github.com/emilk/imgui_software_renderer
Last synced: 28 days ago
JSON representation
A Software Renderer for Dear ImGui
- Host: GitHub
- URL: https://github.com/emilk/imgui_software_renderer
- Owner: emilk
- Created: 2018-04-08T17:03:58.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T06:53:47.000Z (about 2 years ago)
- Last Synced: 2024-11-07T21:12:48.508Z (about 1 month ago)
- Language: C++
- Size: 484 KB
- Stars: 267
- Watchers: 11
- Forks: 27
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AwesomeCppGameDev - imgui_software_renderer
README
# Dear ImGui software renderer
This is a software renderer for [Dear ImGui](https://github.com/ocornut/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](www.libsdl.org) 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](screenshots/imgui_sw.png)
## 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](https://github.com/sronsse/imgui/tree/sw_rasterizer_example/examples/sdl_sw_example) @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.