All Projects → Tyyppi77 → Imgui_sdl

Tyyppi77 / Imgui_sdl

Licence: mit
ImGuiSDL: SDL2 based renderer for Dear ImGui

Projects that are alternatives of or similar to Imgui sdl

Imgui
Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
Stars: ✭ 33,574 (+24955.22%)
Mutual labels:  gamedev, tools, gui, imgui
Iconfontcppheaders
C, C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Kenney game icons and Fontaudio
Stars: ✭ 509 (+279.85%)
Mutual labels:  gamedev, gui, imgui
Gwork
Skinnable GUI with useful widget collection. Fork of GWEN.
Stars: ✭ 179 (+33.58%)
Mutual labels:  gamedev, sdl2, gui
Cimgui
c-api for imgui (https://github.com/ocornut/imgui) Look at: https://github.com/cimgui for other widgets
Stars: ✭ 707 (+427.61%)
Mutual labels:  gamedev, gui, imgui
Imgui
Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui)
Stars: ✭ 394 (+194.03%)
Mutual labels:  gamedev, gui, imgui
Dearpygui
Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
Stars: ✭ 6,631 (+4848.51%)
Mutual labels:  tools, gui, imgui
Imgui markdown
Markdown for Dear ImGui
Stars: ✭ 594 (+343.28%)
Mutual labels:  gamedev, gui, imgui
Imgui
Immediate Mode GUI for C#
Stars: ✭ 133 (-0.75%)
Mutual labels:  gui, imgui
Wtk
📺 A cross-platform immediate mode user-interface library. Public domain.
Stars: ✭ 30 (-77.61%)
Mutual labels:  gui, imgui
Simpleton Engine
What a stupid name for a library
Stars: ✭ 42 (-68.66%)
Mutual labels:  gamedev, sdl2
Flycube
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (-41.79%)
Mutual labels:  gamedev, renderer
Asap app imgui
Starter project for portable app with optional GUI (GLFW/ImGui) and a rich builtin debug UI. Includes docked windows, log viewer, settings editor, configuration load/save, etc...
Stars: ✭ 70 (-47.76%)
Mutual labels:  gui, imgui
Imgui Rs
Rust bindings for Dear ImGui
Stars: ✭ 1,258 (+838.81%)
Mutual labels:  gui, imgui
Giu
Cross platform rapid GUI framework for golang based on Dear ImGui.
Stars: ✭ 862 (+543.28%)
Mutual labels:  gui, imgui
Raygui
A simple and easy-to-use immediate-mode gui library
Stars: ✭ 785 (+485.82%)
Mutual labels:  tools, imgui
Rendy
State of the art "build your own engine" kit powered by gfx-hal
Stars: ✭ 750 (+459.7%)
Mutual labels:  gamedev, renderer
Swiftgui
SwiftGUI is an API inspired by SwiftUI DSL, using Dear ImGui as renderer and running on macOS 10.13+ and iOS 11+
Stars: ✭ 74 (-44.78%)
Mutual labels:  gui, imgui
16counters
GUI for those who don't do GUI
Stars: ✭ 114 (-14.93%)
Mutual labels:  debugging-tool, gui
Horus ui
HorusUI Immediate Mode Graphical User Interface
Stars: ✭ 106 (-20.9%)
Mutual labels:  gui, imgui
Implot
Immediate Mode Plotting
Stars: ✭ 2,014 (+1402.99%)
Mutual labels:  gui, imgui

imgui_sdl

ImGuiSDL is a lightweight SDL2 based renderer for Dear ImGui. Dear ImGui is designed to be easily rendered using modern 3D renderers like OpenGL or DirectX, but while SDL2's renderer does use hardware acceleration (the beforementioned APIs) behind the scenes, it does not provide an interface to pass generic vertex data to OpenGL. ImGuiSDL implements the rendering using a combination of a software based triangle rasterizer and a simple textured/filled rectangle drawer from SDL2. To improve the performance, the slower triangle blits are cached into render textures.

ImGuiSDL consists of two files that you can simply add to your project to use ImGuiSDL:

  • imgui_sdl.h
  • imgui_sdl.cpp

Usage

There is a full usage example provided in example.cpp, and the public API is exposed and documented in imgui_sdl.h.

Here's how you initialize ImGuiSDL:

// Create your SDL renderer or use an existing one.
SDL_Renderer* renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
// Initialize ImGuiSDL by calling Initialize with your SDL_Renderer, and with window size. This will also take care of setting up the ImGui viewport.
ImGuiSDL::Initialize(renderer, 800, 600);

Then to render ImGui, call ImGuiSDL::Render after calling ImGui::Render. You probably want to do this after all other rendering that happens in your project:

ImGuiSDL::Render(ImGui::GetDrawData());

To cleanup at exit, you can call ImGuiSDL::Deinitialize, but that doesn't do anything critical, so if you don't care about cleaning up memory at application exit, you don't need to call this.

Render Result

Render Result

As you can see the results are not perfect, but this display is definitely good enough to be used as a debug UI which is the main use case for Dear ImGui anyways. The rendering is also done in a little bit simpler style than what Dear ImGui uses by default, mainly to increase the amount of rendering that can be done using rectangles.

Requirements

The implementation doesn't rely on any non-standard SDL functionality, imgui_sdl.cpp simply includes SDL.h and imgui.h. You can easily change these two includes to point to the correct locations if you use some sort of other include file scheme.

Notes

Do note that this is just a renderer for SDL2. For input handling, you shoud use the great SDL2 implementation provided in the Dear ImGui repository, or you could of course roll your own event provider.

Links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].