From e312363007cefa6140ca884515d2e0c6442dcb47 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 28 Aug 2018 21:59:14 +0200 Subject: [PATCH] Refactor: Added empty imgui_widgets.cpp + updated project files / makefiles etc. accordingly (#2036) --- README.md | 1 + .../example_allegro5/example_allegro5.vcxproj | 1 + .../example_allegro5.vcxproj.filters | 3 +++ .../example_freeglut_opengl2.vcxproj | 1 + .../example_freeglut_opengl2.vcxproj.filters | 3 +++ examples/example_glfw_opengl2/Makefile | 2 +- .../example_glfw_opengl2.vcxproj | 1 + .../example_glfw_opengl2.vcxproj.filters | 3 +++ examples/example_glfw_opengl3/Makefile | 2 +- .../example_glfw_opengl3.vcxproj | 1 + .../example_glfw_opengl3.vcxproj.filters | 3 +++ .../example_marmalade/marmalade_example.mkb | 1 + examples/example_sdl_opengl2/Makefile | 2 +- .../example_sdl_opengl2.vcxproj | 3 ++- .../example_sdl_opengl2.vcxproj.filters | 3 +++ examples/example_sdl_opengl3/Makefile | 2 +- .../example_sdl_opengl3.vcxproj | 1 + .../example_sdl_opengl3.vcxproj.filters | 3 +++ .../example_sdl_vulkan.vcxproj | 1 + .../example_sdl_vulkan.vcxproj.filters | 3 +++ .../example_win32_directx10.vcxproj | 1 + .../example_win32_directx10.vcxproj.filters | 3 +++ .../example_win32_directx11.vcxproj | 1 + .../example_win32_directx11.vcxproj.filters | 3 +++ .../example_win32_directx12.vcxproj | 1 + .../example_win32_directx12.vcxproj.filters | 3 +++ .../example_win32_directx9.vcxproj | 1 + .../example_win32_directx9.vcxproj.filters | 3 +++ imgui_widgets.cpp | 25 +++++++++++++++++++ 29 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 imgui_widgets.cpp diff --git a/README.md b/README.md index e2624d06..6d724a0b 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ Dear ImGui is self-contained within a few files that you can easily copy and com - imgui.h - imgui_demo.cpp - imgui_draw.cpp +- imgui_widgets.cpp - imgui_internal.h - imconfig.h (empty by default, user-editable) - stb_rect_pack.h diff --git a/examples/example_allegro5/example_allegro5.vcxproj b/examples/example_allegro5/example_allegro5.vcxproj index ec96f621..b0792697 100644 --- a/examples/example_allegro5/example_allegro5.vcxproj +++ b/examples/example_allegro5/example_allegro5.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/example_allegro5/example_allegro5.vcxproj.filters b/examples/example_allegro5/example_allegro5.vcxproj.filters index 09dbc5eb..8019ebfd 100644 --- a/examples/example_allegro5/example_allegro5.vcxproj.filters +++ b/examples/example_allegro5/example_allegro5.vcxproj.filters @@ -28,6 +28,9 @@ sources + + imgui + diff --git a/examples/example_freeglut_opengl2/example_freeglut_opengl2.vcxproj b/examples/example_freeglut_opengl2/example_freeglut_opengl2.vcxproj index 0c60ba36..e3bd4176 100644 --- a/examples/example_freeglut_opengl2/example_freeglut_opengl2.vcxproj +++ b/examples/example_freeglut_opengl2/example_freeglut_opengl2.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/example_freeglut_opengl2/example_freeglut_opengl2.vcxproj.filters b/examples/example_freeglut_opengl2/example_freeglut_opengl2.vcxproj.filters index b4591945..eb6d8526 100644 --- a/examples/example_freeglut_opengl2/example_freeglut_opengl2.vcxproj.filters +++ b/examples/example_freeglut_opengl2/example_freeglut_opengl2.vcxproj.filters @@ -28,6 +28,9 @@ sources + + imgui + diff --git a/examples/example_glfw_opengl2/Makefile b/examples/example_glfw_opengl2/Makefile index 7ec7eeee..482b0e5d 100644 --- a/examples/example_glfw_opengl2/Makefile +++ b/examples/example_glfw_opengl2/Makefile @@ -17,7 +17,7 @@ EXE = example_glfw_opengl2 SOURCES = main.cpp SOURCES += ../imgui_impl_glfw.cpp ../imgui_impl_opengl2.cpp -SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp +SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) UNAME_S := $(shell uname -s) diff --git a/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj b/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj index acec434b..73c7ba9d 100644 --- a/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj +++ b/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj.filters b/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj.filters index acf77fa4..b7a37e68 100644 --- a/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj.filters +++ b/examples/example_glfw_opengl2/example_glfw_opengl2.vcxproj.filters @@ -28,6 +28,9 @@ sources + + imgui + diff --git a/examples/example_glfw_opengl3/Makefile b/examples/example_glfw_opengl3/Makefile index d36b78d8..a9c7007f 100644 --- a/examples/example_glfw_opengl3/Makefile +++ b/examples/example_glfw_opengl3/Makefile @@ -17,7 +17,7 @@ EXE = example_glfw_opengl3 SOURCES = main.cpp SOURCES += ../imgui_impl_glfw.cpp ../imgui_impl_opengl3.cpp -SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp +SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) UNAME_S := $(shell uname -s) diff --git a/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj b/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj index 07f28e30..172a34d8 100644 --- a/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj +++ b/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj.filters b/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj.filters index bffa9373..efb570ce 100644 --- a/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj.filters +++ b/examples/example_glfw_opengl3/example_glfw_opengl3.vcxproj.filters @@ -34,6 +34,9 @@ sources + + imgui + diff --git a/examples/example_marmalade/marmalade_example.mkb b/examples/example_marmalade/marmalade_example.mkb index f605078e..34315b9a 100644 --- a/examples/example_marmalade/marmalade_example.mkb +++ b/examples/example_marmalade/marmalade_example.mkb @@ -33,6 +33,7 @@ files ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp + ../../imgui_widgets.cpp ../../imconfig.h ../../imgui.h ../../imgui_internal.h diff --git a/examples/example_sdl_opengl2/Makefile b/examples/example_sdl_opengl2/Makefile index 1872d7cb..4a948aa4 100644 --- a/examples/example_sdl_opengl2/Makefile +++ b/examples/example_sdl_opengl2/Makefile @@ -16,7 +16,7 @@ EXE = example_sdl_opengl2 SOURCES = main.cpp ../imgui_impl_sdl.cpp ../imgui_impl_opengl2.cpp -SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp +SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) UNAME_S := $(shell uname -s) diff --git a/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj b/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj index bdec85b3..fa6b8d3a 100644 --- a/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj +++ b/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj @@ -19,7 +19,7 @@ - {2AE17FDE-F7F3-4CAC-ADAB-0710EDA4F741} + {94E991D0-790A-4DAF-B442-AAADE3233C75} example_sdl_opengl2 @@ -153,6 +153,7 @@ + diff --git a/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj.filters b/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj.filters index 602fa0b0..e0c1bf2e 100644 --- a/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj.filters +++ b/examples/example_sdl_opengl2/example_sdl_opengl2.vcxproj.filters @@ -28,6 +28,9 @@ sources + + imgui + diff --git a/examples/example_sdl_opengl3/Makefile b/examples/example_sdl_opengl3/Makefile index 765c4460..69874119 100644 --- a/examples/example_sdl_opengl3/Makefile +++ b/examples/example_sdl_opengl3/Makefile @@ -17,7 +17,7 @@ EXE = example_sdl_opengl3 SOURCES = main.cpp SOURCES += ../imgui_impl_sdl.cpp ../imgui_impl_opengl3.cpp -SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp +SOURCES += ../../imgui.cpp ../../imgui_demo.cpp ../../imgui_draw.cpp ../../imgui_widgets.cpp OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) UNAME_S := $(shell uname -s) diff --git a/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj b/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj index b194e620..9fda1897 100644 --- a/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj +++ b/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj.filters b/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj.filters index 87ae4313..fbef18ac 100644 --- a/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj.filters +++ b/examples/example_sdl_opengl3/example_sdl_opengl3.vcxproj.filters @@ -34,6 +34,9 @@ sources + + imgui + diff --git a/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj b/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj index 3d2a424a..622dc093 100644 --- a/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj +++ b/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj.filters b/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj.filters index 4f7c7928..6f082524 100644 --- a/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj.filters +++ b/examples/example_sdl_vulkan/example_sdl_vulkan.vcxproj.filters @@ -28,6 +28,9 @@ sources + + imgui + diff --git a/examples/example_win32_directx10/example_win32_directx10.vcxproj b/examples/example_win32_directx10/example_win32_directx10.vcxproj index df5a026a..5e2973b9 100644 --- a/examples/example_win32_directx10/example_win32_directx10.vcxproj +++ b/examples/example_win32_directx10/example_win32_directx10.vcxproj @@ -150,6 +150,7 @@ + diff --git a/examples/example_win32_directx10/example_win32_directx10.vcxproj.filters b/examples/example_win32_directx10/example_win32_directx10.vcxproj.filters index c3422a58..97620028 100644 --- a/examples/example_win32_directx10/example_win32_directx10.vcxproj.filters +++ b/examples/example_win32_directx10/example_win32_directx10.vcxproj.filters @@ -44,6 +44,9 @@ sources + + imgui + diff --git a/examples/example_win32_directx11/example_win32_directx11.vcxproj b/examples/example_win32_directx11/example_win32_directx11.vcxproj index 9aa09865..166602a3 100644 --- a/examples/example_win32_directx11/example_win32_directx11.vcxproj +++ b/examples/example_win32_directx11/example_win32_directx11.vcxproj @@ -150,6 +150,7 @@ + diff --git a/examples/example_win32_directx11/example_win32_directx11.vcxproj.filters b/examples/example_win32_directx11/example_win32_directx11.vcxproj.filters index ab1e3fba..1df6a0c4 100644 --- a/examples/example_win32_directx11/example_win32_directx11.vcxproj.filters +++ b/examples/example_win32_directx11/example_win32_directx11.vcxproj.filters @@ -44,6 +44,9 @@ sources + + imgui + diff --git a/examples/example_win32_directx12/example_win32_directx12.vcxproj b/examples/example_win32_directx12/example_win32_directx12.vcxproj index c82f0007..38c83351 100644 --- a/examples/example_win32_directx12/example_win32_directx12.vcxproj +++ b/examples/example_win32_directx12/example_win32_directx12.vcxproj @@ -153,6 +153,7 @@ + diff --git a/examples/example_win32_directx12/example_win32_directx12.vcxproj.filters b/examples/example_win32_directx12/example_win32_directx12.vcxproj.filters index 43fdebab..28a25572 100644 --- a/examples/example_win32_directx12/example_win32_directx12.vcxproj.filters +++ b/examples/example_win32_directx12/example_win32_directx12.vcxproj.filters @@ -44,6 +44,9 @@ sources + + imgui + diff --git a/examples/example_win32_directx9/example_win32_directx9.vcxproj b/examples/example_win32_directx9/example_win32_directx9.vcxproj index ebc8a921..08f21c87 100644 --- a/examples/example_win32_directx9/example_win32_directx9.vcxproj +++ b/examples/example_win32_directx9/example_win32_directx9.vcxproj @@ -143,6 +143,7 @@ + diff --git a/examples/example_win32_directx9/example_win32_directx9.vcxproj.filters b/examples/example_win32_directx9/example_win32_directx9.vcxproj.filters index 2ac28d18..914cd260 100644 --- a/examples/example_win32_directx9/example_win32_directx9.vcxproj.filters +++ b/examples/example_win32_directx9/example_win32_directx9.vcxproj.filters @@ -28,6 +28,9 @@ sources + + imgui + diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp new file mode 100644 index 00000000..09283437 --- /dev/null +++ b/imgui_widgets.cpp @@ -0,0 +1,25 @@ +// dear imgui, v1.64 WIP +// (widgets code) + +#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include "imgui.h" +#ifndef IMGUI_DEFINE_MATH_OPERATORS +#define IMGUI_DEFINE_MATH_OPERATORS +#endif +#include "imgui_internal.h" + +//------------------------------------------------------------------------- +// Forward Declarations +//------------------------------------------------------------------------- + +//------------------------------------------------------------------------- +// Shared Utilities +//------------------------------------------------------------------------- + +//------------------------------------------------------------------------- +// Widgets +//------------------------------------------------------------------------- +