Updated ImGui.

This commit is contained in:
Branimir Karadžić 2016-05-30 10:56:21 -07:00
parent fdc37ad7cb
commit 70a75edc08
5 changed files with 307 additions and 299 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
// dear imgui, v1.49 WIP // dear imgui, v1.50 WIP
// (headers) // (headers)
// See imgui.cpp file for documentation. // See imgui.cpp file for documentation.
@ -16,7 +16,7 @@
#include <stddef.h> // ptrdiff_t, NULL #include <stddef.h> // ptrdiff_t, NULL
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp #include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
#define IMGUI_VERSION "1.49 WIP" #define IMGUI_VERSION "1.50 WIP"
// Define attributes of all API symbols declarations, e.g. for DLL under Windows. // Define attributes of all API symbols declarations, e.g. for DLL under Windows.
#ifndef IMGUI_API #ifndef IMGUI_API
@ -36,6 +36,11 @@
#define IM_PRINTFARGS(FMT) #define IM_PRINTFARGS(FMT)
#endif #endif
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
#endif
// Forward declarations // Forward declarations
struct ImDrawChannel; // Temporary storage for outputting drawing commands out of order, used by ImDrawList::ChannelsSplit() struct ImDrawChannel; // Temporary storage for outputting drawing commands out of order, used by ImDrawList::ChannelsSplit()
struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call) struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call)
@ -329,7 +334,7 @@ namespace ImGui
IMGUI_API void TreeAdvanceToLabelPos(); // advance cursor x position by GetTreeNodeToLabelSpacing() IMGUI_API void TreeAdvanceToLabelPos(); // advance cursor x position by GetTreeNodeToLabelSpacing()
IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceeding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceeding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode
IMGUI_API void SetNextTreeNodeOpen(bool is_open, ImGuiSetCond cond = 0); // set next TreeNode/CollapsingHeader open state. IMGUI_API void SetNextTreeNodeOpen(bool is_open, ImGuiSetCond cond = 0); // set next TreeNode/CollapsingHeader open state.
IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. user doesn't have to call TreePop(). IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().
IMGUI_API bool CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags = 0); // when 'p_open' isn't NULL, display an additional small close button on upper right of the header IMGUI_API bool CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags = 0); // when 'p_open' isn't NULL, display an additional small close button on upper right of the header
// Widgets: Selectable / Lists // Widgets: Selectable / Lists
@ -1388,6 +1393,10 @@ struct ImFont
IMGUI_API void AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built. IMGUI_API void AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.
}; };
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
//---- Include imgui_user.h at the end of imgui.h //---- Include imgui_user.h at the end of imgui.h
//---- So you can include code that extends ImGui using any of the types declared above. //---- So you can include code that extends ImGui using any of the types declared above.
//---- (also convenient for user to only explicitly include vanilla imgui.h) //---- (also convenient for user to only explicitly include vanilla imgui.h)

View File

@ -1,4 +1,4 @@
// dear imgui, v1.49 WIP // dear imgui, v1.50 WIP
// (demo code) // (demo code)
// Don't remove this file from your project! It is useful reference code that you can execute. // Don't remove this file from your project! It is useful reference code that you can execute.

View File

@ -1,4 +1,4 @@
// dear imgui, v1.49 WIP // dear imgui, v1.50 WIP
// (drawing and font code) // (drawing and font code)
// Contains implementation for // Contains implementation for

View File

@ -1,4 +1,4 @@
// dear imgui, v1.49 WIP // dear imgui, v1.50 WIP
// (internals) // (internals)
// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
@ -19,6 +19,13 @@
#pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport) #pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport)
#endif #endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h
#pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h
#pragma clang diagnostic ignored "-Wold-style-cast"
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Forward Declarations // Forward Declarations
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -47,12 +54,6 @@ typedef int ImGuiSliderFlags; // enum ImGuiSliderFlags_
namespace ImGuiStb namespace ImGuiStb
{ {
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#endif
#undef STB_TEXTEDIT_STRING #undef STB_TEXTEDIT_STRING
#undef STB_TEXTEDIT_CHARTYPE #undef STB_TEXTEDIT_CHARTYPE
#define STB_TEXTEDIT_STRING ImGuiTextEditState #define STB_TEXTEDIT_STRING ImGuiTextEditState
@ -60,10 +61,6 @@ namespace ImGuiStb
#define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f #define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f
#include "stb_textedit.h" #include "stb_textedit.h"
#ifdef __clang__
#pragma clang diagnostic pop
#endif
} // namespace ImGuiStb } // namespace ImGuiStb
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -746,7 +743,11 @@ namespace ImGui
IMGUI_API int ParseFormatPrecision(const char* fmt, int default_value); IMGUI_API int ParseFormatPrecision(const char* fmt, int default_value);
IMGUI_API float RoundScalar(float value, int decimal_precision); IMGUI_API float RoundScalar(float value, int decimal_precision);
} // namespace ImGuiP } // namespace ImGui
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning (pop) #pragma warning (pop)