Updated ImGui.
This commit is contained in:
parent
ab06553742
commit
b0f9dcbed8
19
3rdparty/ocornut-imgui/imgui.cpp
vendored
19
3rdparty/ocornut-imgui/imgui.cpp
vendored
@ -725,14 +725,19 @@ static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y);
|
||||
// Context
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Default context, default font atlas.
|
||||
// Default font atlas storage .
|
||||
// New contexts always point by default to this font atlas. It can be changed by reassigning the GetIO().Fonts variable.
|
||||
static ImGuiContext GImDefaultContext;
|
||||
static ImFontAtlas GImDefaultFontAtlas;
|
||||
|
||||
// Current context pointer. Implicitely used by all ImGui functions. Always assumed to be != NULL. Change to a different context by calling ImGui::SetCurrentContext()
|
||||
// ImGui is currently not thread-safe because of this variable. If you want thread-safety to allow N threads to access N different contexts, you might work around it by (A) having two instances of the ImGui code under different namespaces or (B) change this variable to be TLS. Further development aim to make this context pointer explicit to all calls. Also read https://github.com/ocornut/imgui/issues/586
|
||||
// Default context storage + current context pointer.
|
||||
// Implicitely used by all ImGui functions. Always assumed to be != NULL. Change to a different context by calling ImGui::SetCurrentContext()
|
||||
// ImGui is currently not thread-safe because of this variable. If you want thread-safety to allow N threads to access N different contexts, you might work around it by:
|
||||
// - Having multiple instances of the ImGui code compiled inside different namespace (easiest/safest, if you have a finite number of contexts)
|
||||
// - or: Changing this variable to be TLS. You may #define GImGui in imconfig.h for further custom hackery. Future development aim to make this context pointer explicit to all calls. Also read https://github.com/ocornut/imgui/issues/586
|
||||
#ifndef GImGui
|
||||
static ImGuiContext GImDefaultContext;
|
||||
ImGuiContext* GImGui = &GImDefaultContext;
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// User facing structures
|
||||
@ -2049,7 +2054,11 @@ ImGuiContext* ImGui::GetCurrentContext()
|
||||
|
||||
void ImGui::SetCurrentContext(ImGuiContext* ctx)
|
||||
{
|
||||
#ifdef IMGUI_SET_CURRENT_CONTEXT_FUNC
|
||||
IMGUI_SET_CURRENT_CONTEXT_FUNC(ctx); // For custom thread-based hackery you may want to have control over this.
|
||||
#else
|
||||
GImGui = ctx;
|
||||
#endif
|
||||
}
|
||||
|
||||
ImGuiContext* ImGui::CreateContext(void* (*malloc_fn)(size_t), void (*free_fn)(void*))
|
||||
@ -2068,7 +2077,7 @@ void ImGui::DestroyContext(ImGuiContext* ctx)
|
||||
ctx->~ImGuiContext();
|
||||
free_fn(ctx);
|
||||
if (GImGui == ctx)
|
||||
GImGui = NULL;
|
||||
SetCurrentContext(NULL);
|
||||
}
|
||||
|
||||
ImGuiIO& ImGui::GetIO()
|
||||
|
4
3rdparty/ocornut-imgui/imgui_demo.cpp
vendored
4
3rdparty/ocornut-imgui/imgui_demo.cpp
vendored
@ -38,7 +38,9 @@
|
||||
#pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure)
|
||||
#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
|
||||
#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
|
||||
//#pragma GCC diagnostic ignored "-Wmisleading-indentation" // warning: this 'if' clause does not guard this statement
|
||||
#if (__GNUC__ >= 6)
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation" // warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on github.
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
|
||||
|
9
3rdparty/ocornut-imgui/imgui_internal.h
vendored
9
3rdparty/ocornut-imgui/imgui_internal.h
vendored
@ -67,7 +67,9 @@ namespace ImGuiStb
|
||||
// Context
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
extern IMGUI_API ImGuiContext* GImGui; // current implicit ImGui context pointer
|
||||
#ifndef GImGui
|
||||
extern IMGUI_API ImGuiContext* GImGui; // Current implicit ImGui context pointer
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Helpers
|
||||
@ -488,9 +490,11 @@ struct ImGuiContext
|
||||
SetNextWindowSizeCond = 0;
|
||||
SetNextWindowContentSizeCond = 0;
|
||||
SetNextWindowCollapsedCond = 0;
|
||||
SetNextWindowFocus = false;
|
||||
SetNextWindowSizeConstraintRect = ImRect();
|
||||
SetNextWindowSizeConstraintCallback = NULL;
|
||||
SetNextWindowSizeConstraintCallbackUserData = NULL;
|
||||
SetNextWindowSizeConstraint = false;
|
||||
SetNextWindowFocus = false;
|
||||
SetNextTreeNodeOpenVal = false;
|
||||
SetNextTreeNodeOpenCond = 0;
|
||||
|
||||
@ -597,6 +601,7 @@ struct IMGUI_API ImGuiDrawContext
|
||||
memset(StackSizesBackup, 0, sizeof(StackSizesBackup));
|
||||
|
||||
IndentX = 0.0f;
|
||||
GroupOffsetX = 0.0f;
|
||||
ColumnsOffsetX = 0.0f;
|
||||
ColumnsCurrent = 0;
|
||||
ColumnsCount = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user