GithubHelp home page GithubHelp logo

knut0815 / imgui_software_renderer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nfprojects/imgui_software_renderer

0.0 0.0 0.0 498 KB

A Software Renderer for Dear ImGui

Shell 12.69% C++ 87.31%

imgui_software_renderer's Introduction

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.

imgui_software_renderer's People

Contributors

emilk avatar m0ppers avatar mkulagowski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.