Dear ImGui
=====
<center><b><i>"Give someone state and they'll have a bug one day, but teach them how to represent state in two separate locations that have to be kept in sync and they'll have bugs for a lifetime."</i></b></center> <a href="https://twitter.com/rygorous/status/1507178315886444544">-ryg</a>
----
[![Build Status](https://github.com/ocornut/imgui/workflows/build/badge.svg)](https://github.com/ocornut/imgui/actions?workflow=build) [![Static Analysis Status](https://github.com/ocornut/imgui/workflows/static-analysis/badge.svg)](https://github.com/ocornut/imgui/actions?workflow=static-analysis)
<sub>(This library is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using Dear ImGui, please consider reaching out.)</sub>
Businesses: support continued development and maintenance via invoiced technical support, maintenance, sponsoring contracts:
<br> _E-mail: contact @ dearimgui dot com_
Individuals: support continued development and maintenance [here](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WGHNC6MBFLZ2S). Also see [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors) page.
| [The Pitch](#the-pitch) - [Usage](#usage) - [How it works](#how-it-works) - [Releases & Changelogs](#releases--changelogs) - [Demo](#demo) - [Integration](#integration) |
:----------------------------------------------------------: |
| [Upcoming changes](#upcoming-changes) - [Gallery](#gallery) - [Support, FAQ](#support-frequently-asked-questions-faq) - [How to help](#how-to-help) - [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors) - [Credits](#credits) - [License](#license) |
| [Wiki](https://github.com/ocornut/imgui/wiki) - [Languages & frameworks backends/bindings](https://github.com/ocornut/imgui/wiki/Bindings) - [Software using Dear ImGui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) - [User quotes](https://github.com/ocornut/imgui/wiki/Quotes) |
### The Pitch
Dear ImGui is a **bloat-free graphical user interface library for C++**. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).
Dear ImGui is designed to **enable fast iterations** and to **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 lacks certain features normally found in more high-level libraries.
Dear ImGui is particularly suited to integration in games engine (for tooling), real-time 3D applications, fullscreen applications, embedded applications, or any applications on consoles platforms where operating system features are non-standard.
- Minimize state synchronization.
- Minimize state storage on user side.
- Minimize setup and maintenance.
- Easy to use to create code-driven and data-driven tools.
- Easy to use to create ad hoc short-lived tools and long-lived, more elaborate tools.
- Easy to hack and improve.
- Portable, minimize dependencies, run on target (consoles, phones, etc.).
- Efficient runtime and memory consumption.
- Battle-tested, used by many major actors in the game industry.
### Usage
**The core of Dear ImGui is self-contained within a few platform-agnostic files** which you can easily compile in your application/engine. They are all the files in the root folder of the repository (imgui*.cpp, imgui*.h).
**No specific build process is required**. You can add the .cpp files to your existing project.
You will need a backend to integrate Dear ImGui in your app. The backend passes mouse/keyboard/gamepad inputs and variety of settings to Dear ImGui, and is in charge of rendering the resulting vertices. **Backends for a variety of graphics api and rendering platforms** are provided in the [backends/](https://github.com/ocornut/imgui/tree/master/backends) folder, along with example applications in the [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder. See the [Integration](#integration) section of this document for details. You may also create your own backend. Anywhere where you can render textured triangles, you can render Dear ImGui.
After Dear ImGui is setup in your application, you can use it from \_anywhere\_ in your program loop:
Code:
```cpp
ImGui::Text("Hello, world %d", 123);
if (ImGui::Button("Save"))
MySaveFunction();
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
```
Result:
<br>![sample code output (dark)](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v175/capture_readme_styles_0001.png) ![sample code output (light)](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v175/capture_readme_styles_0002.png)
Code:
```cpp
// Create a window called "My First Tool", with a menu bar.
ImGui::Begin("My First Tool", &my_tool_active, ImGuiWindowFlags_MenuBar);
if (ImGui::BeginMenuBar())
{
if (ImGui::BeginMenu("File"))
{
if (ImGui::MenuItem("Open..", "Ctrl+O")) { /* Do stuff */ }
if (ImGui::MenuItem("Save", "Ctrl+S")) { /* Do stuff */ }
if (ImGui::MenuItem("Close", "Ctrl+W")) { my_tool_active = false; }
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
// Edit a color (stored as ~4 floats)
ImGui::ColorEdit4("Color", my_color);
// Plot some values
const float my_values[] = { 0.2f, 0.1f, 1.0f, 0.5f, 0.9f, 2.2f };
ImGui::PlotLines("Frame Times", my_values, IM_ARRAYSIZE(my_values));
// Display contents in a scrolling region
ImGui::TextColored(ImVec4(1,1,0,1), "Important Stuff");
ImGui::BeginChild("Scrolling");
for (int n = 0; n < 50; n++)
ImGui::Text("%04d: Some text", n);
ImGui::EndChild();
ImGui::End();
```
Result:
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v180/code_sample_04_color.gif)
Dear ImGui allows you to **create elaborate tools** as well as very short-lived ones. On the extreme side of short-livedness: using the Edit&Continue (hot code reload) feature of modern compilers you can add a few widgets to tweaks variables while your application is running, and remove the code a minute later! Dear ImGui is not just for tweaking values. You can use it to trace a running algorithm by just emitting text commands. You can use it along with your own reflection data to browse your dataset live. You can use it to expose the internals of a subsystem in your engine, to create a logger, an inspection tool, a profiler, a debugger, an entire game making editor/framework, etc.
### How it works
Check out the Wiki's [About the IMGUI paradigm](https://github.com/ocornut/imgui/wiki#about-the-imgui-paradigm) section if you want to understand the core principles behind the IMGUI paradigm. An IMGUI tries to minimize superfluous state duplication, state synchronization and state retention from the user's point of view. It is less error prone (less code and less bugs) than traditional retained-mode interfaces, and lends itself to create dynamic user interfaces.
Dear ImGui outputs vertex buffers and command lists that you can easily render in your application. The number of draw calls and state changes required to render them is fairly small. Because Dear ImGui doesn't know or touch graphics state directly, you can call its functions 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 Dear ImGui with your existing codebase.
_A common misunderstanding is to mistake immediate mode gui for immediate mode rendering, which usually implies hammering your driver/GPU with a bunch of inefficient draw calls and state changes as
没有合适的资源?快使用搜索试试~ 我知道了~
imgui-1.88, C/C++立即模式完美ui, 开发人机界面必备
共195个文件
cpp:41个
h:31个
md:16个
需积分: 17 0 下载量 87 浏览量
2022-08-12
10:04:05
上传
评论
收藏 1.41MB RAR 举报
温馨提示
imgui-1.88, C/C++立即模式完美ui, 开发人机界面必备
资源详情
资源评论
资源推荐
收起资源包目录
imgui-1.88, C/C++立即模式完美ui, 开发人机界面必备 (195个子文件)
build_win32.bat 793B
build_win64.bat 754B
build_win32.bat 701B
build_win32.bat 688B
build_win32.bat 628B
build_win32.bat 614B
build_win32.bat 613B
build_win32.bat 555B
build_win32.bat 555B
build_win32.bat 546B
build_win32.bat 546B
build_win32.bat 540B
build_win32.bat 529B
build_win32.bat 253B
uSynergy.c 18KB
imgui.cpp 648KB
imgui_widgets.cpp 404KB
imgui_demo.cpp 398KB
imgui_tables.cpp 211KB
imgui_draw.cpp 208KB
imgui_impl_vulkan.cpp 76KB
imgui_impl_opengl3.cpp 41KB
imgui_impl_win32.cpp 39KB
imgui_freetype.cpp 37KB
imgui_impl_glfw.cpp 35KB
imgui_impl_dx12.cpp 34KB
imgui_impl_wgpu.cpp 31KB
imgui_impl_sdl.cpp 29KB
imgui_impl_dx11.cpp 28KB
imgui_impl_allegro5.cpp 27KB
imgui_impl_dx10.cpp 26KB
main.cpp 24KB
main.cpp 24KB
main.cpp 19KB
imgui_impl_dx9.cpp 18KB
imgui_impl_android.cpp 15KB
imgui_impl_opengl2.cpp 15KB
main.cpp 14KB
binary_to_compressed_c.cpp 13KB
imgui_impl_glut.cpp 13KB
imgui_impl_sdlrenderer.cpp 11KB
main.cpp 10KB
main.cpp 10KB
main.cpp 10KB
main.cpp 10KB
main.cpp 10KB
main.cpp 9KB
main.cpp 8KB
main.cpp 8KB
main.cpp 8KB
main.cpp 8KB
main.cpp 8KB
main.cpp 7KB
main.cpp 7KB
imgui_stdlib.cpp 3KB
main.cpp 1KB
.editorconfig 788B
example_glfw_opengl3.vcxproj.filters 2KB
example_sdl_opengl3.vcxproj.filters 2KB
example_sdl_sdlrenderer.vcxproj.filters 2KB
example_glut_opengl2.vcxproj.filters 2KB
example_glfw_opengl2.vcxproj.filters 2KB
example_sdl_opengl2.vcxproj.filters 2KB
example_glfw_vulkan.vcxproj.filters 2KB
example_sdl_vulkan.vcxproj.filters 2KB
example_win32_directx9.vcxproj.filters 2KB
example_win32_directx10.vcxproj.filters 2KB
example_win32_directx11.vcxproj.filters 2KB
example_sdl_directx11.vcxproj.filters 2KB
example_allegro5.vcxproj.filters 2KB
example_win32_directx12.vcxproj.filters 2KB
glsl_shader.frag 249B
imgui.gdb 555B
.gitattributes 397B
.gitignore 926B
.gitignore 154B
build.gradle 738B
build.gradle 421B
settings.gradle 15B
imgui.h 291KB
imgui_internal.h 207KB
imstb_truetype.h 195KB
glfw3.h 148KB
imstb_textedit.h 54KB
imgui_impl_opengl3_loader.h 34KB
imstb_rectpack.h 20KB
uSynergy.h 16KB
glfw3native.h 13KB
imconfig.h 10KB
imgui_impl_vulkan.h 9KB
imgui_freetype.h 3KB
imgui_impl_glfw.h 3KB
imgui_impl_win32.h 3KB
imgui_impl_metal.h 3KB
imgui_impl_glut.h 3KB
imgui_impl_opengl3.h 3KB
imgui_impl_dx12.h 2KB
imgui_impl_sdl.h 2KB
imgui_impl_allegro5.h 2KB
imgui_impl_opengl2.h 2KB
共 195 条
- 1
- 2
仰望虚空
- 粉丝: 1
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0