From 277f6e7842e2a1464bde74457cce1ae21068cadd Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 24 Jan 2018 18:40:23 +0100 Subject: [PATCH 1/4] Examples: Comments --- examples/README.txt | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/examples/README.txt b/examples/README.txt index 1f00756f..cf99c5dc 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -1,10 +1,13 @@ -Those are standalone ready-to-build applications to demonstrate ImGui. +Those are standalone ready-to-build applications to demonstrate Dear ImGui. Binaries of some of those demos: http://www.miracleworld.net/imgui/binaries -Third party languages and frameworks bindings: https://github.com/ocornut/imgui/wiki/Links -(languages: C, .net, rust, D, Python, Lua..) -(frameworks: DX12, Vulkan, Cinder, OpenGLES, openFrameworks, Cocos2d-x, SFML, Flexium, NanoRT, Irrlicht..) -(extras: RemoteImGui, ImWindow, imgui_wm..) +Third party languages and frameworks bindings: + https://github.com/ocornut/imgui/wiki/Links +(languages: C, C#, ChaiScript, D, Go, Haxe, Odin, Python, Rust, Lua, Pascal) +(frameworks: DX12, OpenGLES, FreeGlut, Cinder, Cocos2d-x, SFML, GML/GameMaker Studio, Irrlicht, Ogre, + OpenSceneGraph, openFrameworks, LOVE, NanoRT, Qt3d, SFML, Unreal Engine 4, etc.) +(extras: RemoteImGui, ImWindow, imgui_wm, etc.) + TL;DR; - Newcomers, read 'PROGRAMMER GUIDE' in imgui.cpp for notes on how to setup ImGui in your codebase. @@ -19,14 +22,14 @@ TL;DR; existing rendering backends, don't feel forced to rewrite them with your own engine API, or you can do that later when you already got things to work. -ImGui is highly portable and only requires a few things to run: +Dear ImGui is highly portable and only requires a few things to run and render. - Providing mouse/keyboard inputs - Load the font atlas texture into graphics memory - Providing a render function to render indexed textured triangles - Optional: clipboard support, mouse cursor supports, Windows IME support, etc. So this is essentially what those examples are doing + the obligatory cruft for portability. -Unfortunately in 2016 it is still tedious to create and maintain portable build files using external +Unfortunately in 2018 it is still tedious to create and maintain portable build files using external libraries (the kind we're using here to create a window and render 3D triangles) without relying on third party software. For most examples here I choose to provide: - Makefiles for Linux/OSX @@ -36,14 +39,15 @@ Please let me know if they don't work with your setup! You can probably just import the imgui_impl_xxx.cpp/.h files into your own codebase or compile those directly with a command-line compiler. -ImGui has zero frame of lag for most behaviors and one frame of lag for some behaviors. -At 60 FPS your experience should be pleasant. Consider that OS mouse cursors are typically drawn through -a specific hardware accelerated route and may feel smoother than other GPU rendered contents. You may -experiment with the io.MouseDrawCursor flag to request ImGui to draw a mouse cursor itself, to visualize -the lag between a hardware cursor and a software cursor. It might be beneficial to the user experience -to switch to a software rendered cursor when an interactive drag is in progress. -Also note that some setup or GPU drivers may be causing extra lag (possibly by enforcing triple buffering), -leaving you with no option but sadness/anger (Intel GPU drivers were reported as such). +Dear ImGui has zero to one frame of lag for most behaviors, at 60 FPS your experience should be pleasant. +Consider that OS mouse cursors are typically drawn through a specific hardware accelerated route and may +feel smoother than other GPU rendered contents. You may experiment with the io.MouseDrawCursor flag to +request ImGui to draw a mouse cursor itself, to visualize the lag between a hardware cursor and a software +cursor. It might be beneficial to the user experience to switch to a software rendered cursor when an +interactive drag is in progress. +Also note that some setup or GPU drivers may be causing extra lag (possibly by enforcing triple buffering), +leaving you with little option but sadness (Intel GPU drivers were reported as such). + opengl2_example/ **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** @@ -99,4 +103,4 @@ vulkan_example/ Vulkan example. This is quite long and tedious, because: Vulkan. -TODO: Apple, SDL GL/GL3, Allegro, Marmalade, Vulkan examples do not honor the io.WantMoveMouse flag. +TODO: Apple, SDL GL2/GL3, Allegro, Marmalade, Vulkan examples do not honor the io.WantMoveMouse flag. From c2e92ab61bf4ead7f1b219debbf993f3c6247818 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 24 Jan 2018 18:40:54 +0100 Subject: [PATCH 2/4] Added imgui.natvis helper for visual studio users. Added to examples projects. --- .../directx10_example.vcxproj | 1 + .../directx10_example.vcxproj.filters | 3 ++ .../directx11_example.vcxproj | 1 + .../directx11_example.vcxproj.filters | 3 ++ .../directx9_example/directx9_example.vcxproj | 1 + .../directx9_example.vcxproj.filters | 3 ++ examples/libs/imgui.natvis | 35 +++++++++++++++++++ .../opengl2_example/opengl2_example.vcxproj | 1 + .../opengl2_example.vcxproj.filters | 3 ++ .../opengl3_example/opengl3_example.vcxproj | 1 + .../opengl3_example.vcxproj.filters | 3 ++ 11 files changed, 55 insertions(+) create mode 100644 examples/libs/imgui.natvis diff --git a/examples/directx10_example/directx10_example.vcxproj b/examples/directx10_example/directx10_example.vcxproj index 8583e1de..3a403518 100644 --- a/examples/directx10_example/directx10_example.vcxproj +++ b/examples/directx10_example/directx10_example.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/directx10_example/directx10_example.vcxproj.filters b/examples/directx10_example/directx10_example.vcxproj.filters index 15e924c4..5a358463 100644 --- a/examples/directx10_example/directx10_example.vcxproj.filters +++ b/examples/directx10_example/directx10_example.vcxproj.filters @@ -41,5 +41,8 @@ + + sources + \ No newline at end of file diff --git a/examples/directx11_example/directx11_example.vcxproj b/examples/directx11_example/directx11_example.vcxproj index 7099a7bd..347b4f00 100644 --- a/examples/directx11_example/directx11_example.vcxproj +++ b/examples/directx11_example/directx11_example.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/directx11_example/directx11_example.vcxproj.filters b/examples/directx11_example/directx11_example.vcxproj.filters index 5cd0ca41..a79484cc 100644 --- a/examples/directx11_example/directx11_example.vcxproj.filters +++ b/examples/directx11_example/directx11_example.vcxproj.filters @@ -41,5 +41,8 @@ + + sources + \ No newline at end of file diff --git a/examples/directx9_example/directx9_example.vcxproj b/examples/directx9_example/directx9_example.vcxproj index 6fe7c9ce..e63bd35b 100644 --- a/examples/directx9_example/directx9_example.vcxproj +++ b/examples/directx9_example/directx9_example.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/directx9_example/directx9_example.vcxproj.filters b/examples/directx9_example/directx9_example.vcxproj.filters index 5cf02834..b0843b39 100644 --- a/examples/directx9_example/directx9_example.vcxproj.filters +++ b/examples/directx9_example/directx9_example.vcxproj.filters @@ -42,5 +42,8 @@ + + sources + \ No newline at end of file diff --git a/examples/libs/imgui.natvis b/examples/libs/imgui.natvis new file mode 100644 index 00000000..807129ad --- /dev/null +++ b/examples/libs/imgui.natvis @@ -0,0 +1,35 @@ + + + + + + + + {{Size={Size} Capacity={Capacity}}} + + + Size + Data + + + + + + {{x={x,g} y={y,g}}} + + + + {{x={x,g} y={y,g} z={z,g} w={w,g}}} + + + + {{Min=({Min.x,g} {Min.y,g}) Max=({Max.x,g} {Max.y,g}) Size=({Max.x-Min.x,g} {Max.y-Min.y,g})}} + + Min + Max + Max.x - Min.x + Max.x - Min.x + + + + \ No newline at end of file diff --git a/examples/opengl2_example/opengl2_example.vcxproj b/examples/opengl2_example/opengl2_example.vcxproj index 237eba7d..bf1a3ed4 100644 --- a/examples/opengl2_example/opengl2_example.vcxproj +++ b/examples/opengl2_example/opengl2_example.vcxproj @@ -163,6 +163,7 @@ + diff --git a/examples/opengl2_example/opengl2_example.vcxproj.filters b/examples/opengl2_example/opengl2_example.vcxproj.filters index 3cc7ee9e..35fd6ffa 100644 --- a/examples/opengl2_example/opengl2_example.vcxproj.filters +++ b/examples/opengl2_example/opengl2_example.vcxproj.filters @@ -42,5 +42,8 @@ + + sources + \ No newline at end of file diff --git a/examples/opengl3_example/opengl3_example.vcxproj b/examples/opengl3_example/opengl3_example.vcxproj index d481c943..2a78226f 100644 --- a/examples/opengl3_example/opengl3_example.vcxproj +++ b/examples/opengl3_example/opengl3_example.vcxproj @@ -166,6 +166,7 @@ + diff --git a/examples/opengl3_example/opengl3_example.vcxproj.filters b/examples/opengl3_example/opengl3_example.vcxproj.filters index f19cd16b..c743ace3 100644 --- a/examples/opengl3_example/opengl3_example.vcxproj.filters +++ b/examples/opengl3_example/opengl3_example.vcxproj.filters @@ -54,5 +54,8 @@ + + sources + \ No newline at end of file From 6f27d6b5b892a5a762c1d0db27434ccd46f75626 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 24 Jan 2018 18:52:26 +0100 Subject: [PATCH 3/4] Natvis: Made ImGuiWindow display shorter. --- examples/libs/imgui.natvis | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/libs/imgui.natvis b/examples/libs/imgui.natvis index 807129ad..eb32708d 100644 --- a/examples/libs/imgui.natvis +++ b/examples/libs/imgui.natvis @@ -31,5 +31,10 @@ Max.x - Min.x + + + {{Name={Name,s}}} + {{Name={Name,s}} Inactive} + \ No newline at end of file From 8c57d8cc1e34c2cbf0529296cec8280876b58d9d Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 24 Jan 2018 19:10:09 +0100 Subject: [PATCH 4/4] Natvis: Fix ImRect expanded height display being broken and dumb. (#1569) --- examples/libs/imgui.natvis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/libs/imgui.natvis b/examples/libs/imgui.natvis index eb32708d..38c676c7 100644 --- a/examples/libs/imgui.natvis +++ b/examples/libs/imgui.natvis @@ -28,7 +28,7 @@ Min Max Max.x - Min.x - Max.x - Min.x + Max.y - Min.y