This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from simongeilfus/master
Update
- Loading branch information
Showing
56 changed files
with
2,439 additions
and
3,198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,111 @@ | ||
Cinder-ImGui | ||
=================== | ||
https://github.com/ocornut/imgui/ | ||
Immediate mode GUI Library from Omar Cornut. | ||
Non-kosher wrapper for use with the latest Cinder version (glNext). | ||
####[Immediate mode GUI Library](https://github.com/ocornut/imgui/) from [Omar Cornut](https://github.com/ocornut) wrapped for use with Cinder 0.9. | ||
|
||
#####Basic Use | ||
Call this in your setup: | ||
|
||
<sub>(ImGui is free but Omar needs your support to sustain development and maintenance. If you work for a company, please consider financial support)</sub> | ||
|
||
[![Patreon](https://cloud.githubusercontent.com/assets/8225057/5990484/70413560-a9ab-11e4-8942-1a63607c0b00.png)](http://www.patreon.com/imgui) [![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5Q73FPZ9C526U) | ||
|
||
|
||
ImGui is a bloat-free graphical user interface library for C++. It outputs vertex buffers that you can render in your 3D-pipeline enabled application. It is portable, renderer agnostic and self-contained (no external dependencies). It is based on an "immediate mode" graphical user interface paradigm which enables you to build user interfaces with ease. | ||
|
||
ImGui is designed to enable fast iteration and empower programmers to create content creation tools and visualization/debug tools (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and thus lacks certain features normally found in more high-level libraries. | ||
|
||
ImGui is particularly suited to integration in realtime 3D applications, fullscreen applications, embedded applications, games, or any applications on consoles platforms where operating system features are non-standard. | ||
|
||
#####Namespace | ||
For ease of use I added a namespace alias for ImGui, feel free to disable it by defining CINDER_IMGUI_NO_NAMESPACE_ALIAS | ||
|
||
#####Initialization | ||
This is the most basic initialization: | ||
```c++ | ||
void CinderApp::setup() | ||
{ | ||
ui::initialize(); | ||
} | ||
``` | ||
You can provide an ui::Options object to the initialize method to setup the ui the way you want: | ||
```c++ | ||
void CinderApp::setup() | ||
{ | ||
ui::initialize( ui::Options().font( ttfFontPath, 12 ).window( uiWindow ).frameRounding( 0.0f ) ); | ||
} | ||
``` | ||
Multiple fonts and special glyphs are specified the same way (see ImGui docs for more info): | ||
```c++ | ||
void CinderApp::setup() | ||
{ | ||
// set ui window and io events callbacks | ||
ImGui::setWindow( getWindow() ); | ||
ui::initialize( ui::Options() | ||
.fonts( { | ||
{ getAssetPath( "Kontrapunkt Bob Light.ttf" ), 12 }, | ||
{ getAssetPath( "Kontrapunkt Bob Bold.ttf" ), 20 }, | ||
{ getAssetPath( "FontAwesome.ttf" ), 12 } | ||
} ) | ||
.fontGlyphRanges( "FontAwesome", { 0xf000, 0xf06e, 0 } ) | ||
); | ||
} | ||
``` | ||
|
||
And then create your UI between ImGui::NewFrame and ImGui::Render: | ||
#####UI Creation | ||
By default or if you don't specify an empty windowRef, the wrapper will take care of calling ImGui::NewFrame and ImGui::Render, meaning that you don't have to worry about anything else than the actual UI. You can add UI code in any place you want, that's it. The Renderer takes care of setting the matrices and the proper shader to draw the ui through a postDraw signal. (You can disable this behavior through the initialization options). | ||
|
||
```c++ | ||
void CinderApp::draw() | ||
{ | ||
// start gui | ||
ImGui::NewFrame(); | ||
|
||
// make some nice ui here! | ||
ui::Combo( "Blending", &blendMode, blendModes, 3 ); | ||
ui::SliderInt( "Circles", &n, 0, 500 ); | ||
ui::SliderFloat( "Min Radius", &minRadius, 1, 499 ); | ||
ui::Image( mFbo->getColorTexture(), mFbo->getSize() ); | ||
} | ||
void SomeFunctionCalledSomewhereElse() | ||
{ | ||
ui::Button( "MyButton" ); | ||
} | ||
``` | ||
|
||
#####Scoped Objects | ||
For the sake of simplifying a bit more the use of this lib, there's Scoped* objects for most push/pop functions. The state will be pushed when creating the object and poped at the end of its lifespan. | ||
```c++ | ||
void SomeWindow() | ||
{ | ||
ui::ScopedWindow window( "Title" ); | ||
ui::ScopedFont font( "Font-Bold" ); | ||
|
||
// render gui | ||
ImGui::Render(); | ||
ui::Text( "Some Bold Title" ); | ||
ui::Image( mFbo->getColorTexture(), mFbo->getSize() ); | ||
} | ||
``` | ||
|
||
#####Todo | ||
* fix keyboard events handling (modifiers not working for the moment) | ||
* multi-window option | ||
|
||
|
||
ImGui Credits (from [ImGui](https://github.com/ocornut/imgui/) README) | ||
------- | ||
|
||
ImGui | ||
===== | ||
|
||
ImGui is a bloat-free graphical user interface library for C/C++. It is portable, renderer agnostic and carries minimal amount of dependencies (only 3 files are needed). It is based on an "immediate" graphical user interface paradigm which allows you to build simple user interfaces with ease. | ||
|
||
ImGui is designed to allow programmers to create "content creation" or "debug" tools (as opposed to tools for the average end-user). It favors simplicity and thus lacks certain features normally found in more high-level libraries, such as string localisation. | ||
|
||
Usage example: | ||
|
||
![screenshot of sample code alongside its output with ImGui](https://raw.githubusercontent.com/ocornut/imgui/master/web/code_sample_01.png?raw=true) | ||
Developed by [Omar Cornut](http://www.miracleworld.net) and every direct or indirect contributors to the GitHub. The early version of this library was developed with the support of [Media Molecule](http://www.mediamolecule.com) and first used internally on the game [Tearaway](http://tearaway.mediamolecule.com). | ||
|
||
ImGui outputs vertex buffers and simple command-lists that you can render in your application. Because it doesn't know or touch graphics state directly, you can call ImGui commands anywhere in your code (e.g. in the middle of a running algorithm, or in the middle of your own rendering process). Refer to the sample applications in the examples/ folder for instructions on how to integrate ImGui with your existing codebase. | ||
I first discovered imgui principles at [Q-Games](http://www.q-games.com) where Atman had dropped his own simple imgui implementation in the codebase, which I spent quite some time improving and thinking about. It turned out that Atman was exposed to the concept directly by working with Casey. When I moved to Media Molecule I rewrote a new library trying to overcome the flaws and limitations of the first one I've worked with. It became this library and since then I have spent an unreasonable amount of time iterating on it. | ||
|
||
Embeds [ProggyClean.ttf](http://upperbounds.net) font by Tristan Grimmer (MIT license). | ||
|
||
Gallery | ||
------- | ||
Embeds [stb_textedit.h, stb_truetype.h, stb_rectpack.h](https://github.com/nothings/stb/) by Sean Barrett (public domain). | ||
|
||
![screenshot 1](https://raw.githubusercontent.com/ocornut/imgui/master/web/test_window_01.png?raw=true) | ||
![screenshot 2](https://raw.githubusercontent.com/ocornut/imgui/master/web/test_window_02.png?raw=true) | ||
![screenshot 3](https://raw.githubusercontent.com/ocornut/imgui/master/web/test_window_03.png?raw=true) | ||
![screenshot 4](https://raw.githubusercontent.com/ocornut/imgui/master/web/test_window_04.png?raw=true) | ||
Inspiration, feedback, and testing for early versions: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Anton Mikhailov, Matt Willis. And everybody posting feedback, questions and patches on the GitHub. | ||
|
||
Credits | ||
------- | ||
ImGui development is financially supported on [**Patreon**](http://www.patreon.com/imgui). | ||
|
||
Developed by [Omar Cornut](http://www.miracleworld.net). The library was developed with the support of [Media Molecule](http://www.mediamolecule.com) and first used internally on the game [Tearaway](http://tearaway.mediamolecule.com). | ||
Special supporters: | ||
- Jetha Chan, Wild Sheep Studio, Pastagames, Mārtiņš Možeiko, Daniel Collin, Stefano Cristiano. | ||
|
||
Embeds [proggy_clean](http://www.proggyfonts.net/) font by Tristan Grimmer (also MIT license). | ||
And: | ||
- Michel Courtine, César Leblic, Dale Kim, Alex Evans, Rui Figueira, Paul Patrashcu, Jerome Lanquetot, Ctrl Alt Ninja, Paul Fleming, Neil Henning, Stephan Dilly, Neil Blakey-Milner, Aleksei. | ||
|
||
Inspiration, feedback, and testing: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Matt Willis. Thanks! | ||
And other supporters; thanks! | ||
|
||
License | ||
ImGui License | ||
------- | ||
|
||
ImGui is licensed under the MIT License, see LICENSE for more information. | ||
|
||
ImGui is licensed under the MIT License, see [LICENSE](https://github.com/ocornut/imgui/blob/master/LICENSE) for more information. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<cinder> | ||
<block | ||
name= "imGui" | ||
id= "sg.cinder.imgui" | ||
git= "git://github.com/simongeilfus/Cinder-ImGui.git" | ||
author= "Simon Geilfus" | ||
summary= "Wrapper around imGui." | ||
license= "mit" | ||
url= "http://github.com/simongeilfus/Cinder-ImGui" | ||
library= "http://github.com/ocornut/imgui/" | ||
> | ||
|
||
name="ImGui" | ||
id="ocornut.imgui" | ||
author="Simon Geilfus" | ||
summary="Omar Cornut's ImGui for Cinder" | ||
license="MIT License" | ||
git="https://github.com/simongeilfus/Cinder-ImGui.git" | ||
> | ||
<includePath>lib/imgui</includePath> | ||
<headerPattern>lib/imgui/imgui.h</headerPattern> | ||
<sourcePattern>lib/imgui/imgui.cpp</sourcePattern> | ||
<headerPattern>src/*.h</headerPattern> | ||
<sourcePattern>src/*.cpp</sourcePattern> | ||
<includePath>include</includePath> | ||
|
||
<header>include/CinderImGui.h</header> | ||
<header>include/imgui_user.h</header> | ||
<header>include/imgui_user.inl</header> | ||
|
||
<header>lib/imgui/imconfig.h</header> | ||
<header>lib/imgui/imgui.h</header> | ||
<header>lib/imgui/imgui_internal.h</header> | ||
|
||
<source>src/CinderImGui.cpp</source> | ||
<source>lib/imgui/imgui.cpp</source> | ||
<source>lib/imgui/imgui_draw.cpp</source> | ||
<source>lib/imgui/imgui_demo.cpp</source> | ||
|
||
</block> | ||
</cinder> |
Oops, something went wrong.