Dear IMGUI + Render + Window handling, amalgamation in two files ready to use

Overview

imgui-app

Imgui-app is an amalgamation of two amazing projects Dear Imgui and Sokol libraries into two files to make it very easy to start working with imgui. It might be useful when you need to do some UI quickly for a project but do not want to care that much how to get imgui up and running (imgui compilation, backend rendering, window handling, ...).

test.png

Howto

To start using imgui-app you need to add these two files to your project:

Once you are ready to display the UI, just call imgui_app, see the example.

Finally, make sure to select the proper sokol render backend, by compiling your project with -DSOKOL_GLCORE33 or any of the available backends.

There is an optional third generated file imgui_internal.h. It is usually not required but maybe you use an advanced 3rd party widget that needs it. This version, as with imgui.h can be usued in place of the original one, it also includes all the dependencies.

Notes:

  • Try not to modify the files imgui.h, imgui_app.cpp, or imgui_internal.h they are generated from the original sources by the Makefile of this project
  • We chose to use imgui.h for the headers to make the project compatible with other exisiting imgui code.
  • imgui_app.cpp is BIG, it is the result of including in one file imgui, sokol, and all the dependencies. Try not to compile every time on your project :)
  • The amalgamation idea comes from Sqlite amalgamation
Comments
  • When trying to drag window with touch interface (WASM on mobile) get stuck in moving window state

    When trying to drag window with touch interface (WASM on mobile) get stuck in moving window state

    I compiled using emscripten (latest pre-compiled release as of today) with the example app in the main readme for imgui-app. I then hosted the resulting html/wasm/js and tested on my mobile phone.

    When I give the top of an imgui window a series of taps, it then glues to my finger and I can move it, however, all subsequent taps move the window to the new tap's location and there is no way to stop tat from happening save from restarting the application (refreshing the page).

    This does not happen on the live imgui emscripten example: https://www.dearimgui.org/webdemo/master/example_emscripten.html

    Any tips on how to fix this? I don't mind working on a fix and submitting a pull request if I can figure this out.

    opened by Xadiant 5
  • How to hide and unhide OS-level window (X11)?

    How to hide and unhide OS-level window (X11)?

    Hello,

    I want to hide and unhide the complete program window. The program is controlled through an external MIDI controller which sends the signals to hide and show. I am personally on X11 where this is called Unmap() and Map(), but other OSes need something else of course.

    sokol.h has private functions to do this: _SOKOL_PRIVATE void _sapp_x11_show_window(void) and _SOKOL_PRIVATE void _sapp_x11_hide_window(void).

    I want to avoid editing sokol.h and imgui.h. Any recommendation for a best practise how to extend imgui-app here?

    opened by diovudau 2
  • How to access the style colors outside of the main loop Frame

    How to access the style colors outside of the main loop Frame

    I want to write my own color-scheme. I imagine it is better and more efficient to change the colors directly with GetStyle().Colors[...] = ImVec4(…) I would have to access this before frame is called the first itme. But since imgui-app encapsulates the whole startup process into the single imgui_app()function I can't call GetStyle(). The error message says it needs to be called in a context, but calling CreateContext() is not the right one, correct?

    So… how do I change the colors permanently without pushing onto the temporary color stack each frame. OR maybe pushing to the stack is no problem?

    opened by diovudau 1
  • Remove pragma once from amalgamated source file

    Remove pragma once from amalgamated source file

    This prevents GCC warning #pragma once in main file which cannot be disabled (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89808).

    Note that you can disable this when using clang with -Wno-pragma-once-outside-header.

    See more: https://stackoverflow.com/questions/56563679/gcc-precompiled-header-pragma-once-in-main-file

    opened by zxey 1
  • Broken reference to sokol submodule

    Broken reference to sokol submodule

    https://github.com/pplux/sokol/tree/c07c12b1eac7fe56ca28c81bf88fb039dbdb7375

    This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

    Local commit not pushed yet?

    opened by district10 1
  • Expose event callback function in header

    Expose event callback function in header

    I needed to access the event callback function to handle clipboard operations in my app. This requires me to make sure that I still call the imgui-app event function to keep imgui working and interactive. This should allow that.

    I couldn't find that I broke anything by changing the function to no longer be static...

    opened by Xadiant 0
Releases(v1.89.1)
Owner
PpluX
PpluX
A file dialog library for Dear ImGui

ImFileDialog A simple file dialog library for Dear ImGui. This library supports favorites, actual Windows icons, image previews, zooming in, etc... DI

dfranx 398 Jan 3, 2023
dear imgui + glfw framework

ImFrame ImFrame is a lightweight framework designed to provide you with a window and graphical backend for the Dear ImGui library. Unlike more traditi

null 62 Dec 25, 2022
Markdown renderer for Dear ImGui using MD4C parser

imgui_md Markdown renderer for Dear ImGui using MD4C parser. C++11 or above imgui_md currently supports the following markdown functionality: Wrapped

Dmitry Mekhontsev 74 Dec 27, 2022
A (very) simple notification wrapper for Dear ImGui

imgui-notify Is a header-only wrapper made to create notifications with Dear ImGui. As I couldn't find any library for this I just decided to create m

Patrick 212 Jan 2, 2023
Example program for integrating Dear ImGui and GLFW into Source's App System

This is an example program for integrating Dear ImGui and GLFW into Source's app system, the same thing Source's tools use. Feel free to do with this

null 9 Apr 16, 2022
X11 + GLFW + Dear ImGUI Overlay

Dear ImGUI Overlay X11 + GLFW + Dear ImGUI Overlay made by rdbo Based on https://github.com/rdbo/glfw-overlay How to use? In main.c, there is a window

Rdbo 6 Dec 25, 2022
Minimal example of prototyping CLAP audio plugins using Dear ImGui as the user interface.

clap-imgui Minimal example of prototyping CLAP audio plugins using Dear ImGui as the user interface. This is intended as an example of presenting a UI

schwa 52 Dec 19, 2022
ImGuiFileDialog is a file selection dialog built for (and using only) Dear ImGui

ImGuiFileDialog Purpose ImGuiFileDialog is a file selection dialog built for (and using only) Dear ImGui. My primary goal was to have a custom pane wi

Aiekick 790 Jan 4, 2023
o/ ImGui Builder is a graphical framework for assembling imgui codes in your interface easily

IMGUI BUILDER The project consists a gui editor of the Imgui framework EDITOR Menu Export 1 - Export cpp file 2 - Cpp file Credits Credits for Shadowy

Code Building 405 Dec 20, 2022
Sample project to use ImGui + GLFW + OpenGL3

About just a sample project to use ImGui ( https://github.com/ocornut/imgui ) Note Windows 11 Visual Studio 2019 + cmake-gui WSL2 on Windows 11 apt in

iwatake 4 Dec 23, 2021
libspng is a C library for reading and writing PNG format files with a focus on security and ease of use.

libspng (simple png) is a C library for reading and writing Portable Network Graphics (PNG) format files with a focus on security and ease of use.

Randy 570 Dec 29, 2022
Simpler ImGui Backend Implementation for VulkanHpp.

ImGui-VulkanHpp Simpler ImGui Backend Implementation for VulkanHpp.

takiyu 27 Dec 7, 2022
A cross-platform wrapper for using SDL2 with ImGui

ImSDL2 ImSDL2 is an open source "wrapper" of imgui backends available for SDL2. It aims to provide a backend-independent yet simple interface for inte

terens 5 Feb 2, 2022
ZT is a zig-contained library that automatically compiles+links ImGui, OpenGL, and GLFW into typed packages.

ZT is a zig-contained library that automatically compiles+links ImGui, OpenGL, and GLFW into typed packages. By zig contained I mean that ZT is intend

null 90 Jan 1, 2023
ImTricks is a collection of useful functions for expanding / improving the functionality of the ImGui.

ImTricks ImTricks is a collection of useful functions for expanding / improving the functionality of the ImGui. At the moment it has in itself: Functi

Alexander Pers0na2 22 Jun 13, 2022
A ImGui Application with Multi Viewports and Docking using D3D11

ImGui-Application Informations A ImGui Application with Multi Viewports and Docking using D3D11 Build You need the DirectX SDK, here the Download link

Argon Projects 12 Nov 13, 2022
Expose the ImGui framework to clasp

Expose the ImGui framework to clasp Installing in the clasp source tree cd clasp/extensions git clone https://github.com/clasp-developers/imgui-clasp

clasp 4 Oct 11, 2021
Growtopia android modmenu with ImGui

Growtopia Android ImGUI Growtopia android modmenu with ImGUI. Features Built with ImGUI. Coming Soon None Requirements The following dependencies are

ZTz 57 Jan 4, 2023
Partial source of the ImGui interfaces used in the Rocket League version of CodeRed.

CodeRed-ImGui Raw source of the ImGui interfaces used in the Rocket League version of CodeRed. About This repo is just part of the ImGui source used i

CodeRed 13 Jan 7, 2023