Skip to content

Commit

Permalink
Updated version to 1.60 WIP to emphasis on the addition of required c…
Browse files Browse the repository at this point in the history
…alls CreateContext/DestroyContext + merged the massive Navigation branch (#1565, #787)
  • Loading branch information
ocornut committed Feb 6, 2018
1 parent f0364aa commit 7c16d52
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
17 changes: 7 additions & 10 deletions imgui.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// dear imgui, v1.54 WIP
// dear imgui, v1.60 WIP
// (main code and documentation)

// ** EXPERIMENTAL GAMEPAD/KEYBOARD NAVIGATION BRANCH
// ** Grep for FIXME-NAV

// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
// Newcomers, read 'Programmer guide' below for notes on how to setup Dear ImGui in your codebase.
// Get latest version at https://github.com/ocornut/imgui
Expand Down Expand Up @@ -253,16 +250,16 @@
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
Also read releases logs https://github.com/ocornut/imgui/releases for more details.

- 2018/01/21 (1.XX) - reorganized context handling to be more explicit,
- 2018/02/07 (1.60) - reorganized context handling to be more explicit,
- YOU NOW NEED TO CALL ImGui::CreateContext() AT THE BEGINNING OF YOUR APP, AND CALL ImGui::DestroyContext() AT THE END.
- removed Shutdown() function, as DestroyContext() serve this purpose.
- you may pass a ImFontAtlas* pointer to CreateContext() to share a font atlas between contexts. Otherwhise CreateContext() will create its own font atlas instance.
- removed allocator parameters from CreateContext(), they are now setup with SetAllocatorFunctions(), and shared by all contexts.
- removed the default global context and font atlas instance, which were confusing for users of DLL reloading and users of multiple contexts.
- 2018/01/11 (1.54) - obsoleted IsAnyWindowHovered() in favor of IsWindowHovered(ImGuiHoveredFlags_AnyWindow). Kept redirection function (will obsolete).
- 2018/01/11 (1.54) - obsoleted IsAnyWindowFocused() in favor of IsWindowFocused(ImGuiFocusedFlags_AnyWindow). Kept redirection function (will obsolete).
- 2018/01/03 (1.54) - renamed ImGuiSizeConstraintCallback to ImGuiSizeCallback, ImGuiSizeConstraintCallbackData to ImGuiSizeCallbackData.
- 2017/12/29 (1.54) - removed CalcItemRectClosestPoint() which was weird and not really used by anyone except demo code. If you need it it's easy to replicate on your side.
- 2018/01/11 (1.60) - obsoleted IsAnyWindowHovered() in favor of IsWindowHovered(ImGuiHoveredFlags_AnyWindow). Kept redirection function (will obsolete).
- 2018/01/11 (1.60) - obsoleted IsAnyWindowFocused() in favor of IsWindowFocused(ImGuiFocusedFlags_AnyWindow). Kept redirection function (will obsolete).
- 2018/01/03 (1.60) - renamed ImGuiSizeConstraintCallback to ImGuiSizeCallback, ImGuiSizeConstraintCallbackData to ImGuiSizeCallbackData.
- 2017/12/29 (1.60) - removed CalcItemRectClosestPoint() which was weird and not really used by anyone except demo code. If you need it it's easy to replicate on your side.
- 2017/12/24 (1.53) - renamed the emblematic ShowTestWindow() function to ShowDemoWindow(). Kept redirection function (will obsolete).
- 2017/12/21 (1.53) - ImDrawList: renamed style.AntiAliasedShapes to style.AntiAliasedFill for consistency and as a way to explicitly break code that manipulate those flag at runtime. You can now manipulate ImDrawList::Flags
- 2017/12/21 (1.53) - ImDrawList: removed 'bool anti_aliased = true' final parameter of ImDrawList::AddPolyline() and ImDrawList::AddConvexPolyFilled(). Prefer manipulating ImDrawList::Flags if you need to toggle them during the frame.
Expand Down Expand Up @@ -3238,7 +3235,7 @@ void ImGui::NewFrame()
for (int n = 0; n < ImGuiKey_COUNT; n++)
IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < IM_ARRAYSIZE(g.IO.KeysDown) && "io.KeyMap[] contains an out of bound value (need to be 0..512, or -1 for unmapped key)");

// Do a simple check for required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was super recently added in 1.54 WIP)
// Do a simple check for required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was super recently added in 1.60 WIP)
if (g.IO.NavFlags & ImGuiNavFlags_EnableKeyboard)
IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation.");

Expand Down
7 changes: 3 additions & 4 deletions imgui.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.54 WIP
// dear imgui, v1.60 WIP
// (headers)

// See imgui.cpp file for documentation.
Expand All @@ -21,8 +21,7 @@
#include <stddef.h> // ptrdiff_t, NULL
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp

#define IMGUI_VERSION "1.54 WIP"
#define IMGUI_HAS_NAV // navigation branch
#define IMGUI_VERSION "1.60 WIP"

// Define attributes of all API symbols declarations, e.g. for DLL under Windows.
#ifndef IMGUI_API
Expand Down Expand Up @@ -1060,7 +1059,7 @@ struct ImGuiIO
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
namespace ImGui
{
// OBSOLETED in 1.54 (from Dec 2017)
// OBSOLETED in 1.60 (from Dec 2017)
static inline bool IsAnyWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); }
static inline bool IsAnyWindowHovered() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); }
static inline ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = 0.f) { (void)on_edge; (void)outward; IM_ASSERT(0); return pos; }
Expand Down
2 changes: 1 addition & 1 deletion imgui_demo.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.54 WIP
// dear imgui, v1.60 WIP
// (demo code)

// Message to the person tempted to delete this file when integrating ImGui into their code base:
Expand Down
2 changes: 1 addition & 1 deletion imgui_draw.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.54 WIP
// dear imgui, v1.60 WIP
// (drawing and font code)

// Contains implementation for
Expand Down
4 changes: 2 additions & 2 deletions imgui_internal.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.54 WIP
// dear imgui, v1.60 WIP
// (internals)

// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
Expand Down Expand Up @@ -1026,7 +1026,7 @@ namespace ImGui
IMGUI_API bool IsWindowNavFocusable(ImGuiWindow* window);

IMGUI_API void Initialize(ImGuiContext* context);
IMGUI_API void Shutdown(ImGuiContext* context); // Since 1.54 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
IMGUI_API void Shutdown(ImGuiContext* context); // Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().

IMGUI_API void MarkIniSettingsDirty();
IMGUI_API ImGuiSettingsHandler* FindSettingsHandler(const char* type_name);
Expand Down

0 comments on commit 7c16d52

Please sign in to comment.