Skip to content

Commit b78a9b4

Browse files
committed
upgrade to imgui 1.90.4
1 parent 5857cbc commit b78a9b4

15 files changed

+2037
-1169
lines changed

third_party/imgui/include/imconfig.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
3030
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
31-
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.
31+
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.
3232

3333
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
3434
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
@@ -50,12 +50,14 @@
5050
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
5151

5252
//---- Include imgui_user.h at the end of imgui.h as a convenience
53+
// May be convenient for some users to only explicitly include vanilla imgui.h and have extra stuff included.
5354
//#define IMGUI_INCLUDE_IMGUI_USER_H
55+
//#define IMGUI_USER_H_FILENAME "my_folder/my_imgui_user.h"
5456

5557
//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
5658
//#define IMGUI_USE_BGRA_PACKED_COLOR
5759

58-
//---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
60+
//---- Use 32-bit for ImWchar (default is 16-bit) to support Unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
5961
//#define IMGUI_USE_WCHAR32
6062

6163
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version

third_party/imgui/include/imgui.h

+245-219
Large diffs are not rendered by default.

third_party/imgui/include/imgui_freetype.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ namespace ImGuiFreeType
4343
IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data = nullptr);
4444

4545
// Obsolete names (will be removed soon)
46-
// Prefer using '#define IMGUI_ENABLE_FREETYPE'
4746
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
48-
static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); }
47+
//static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); } // Prefer using '#define IMGUI_ENABLE_FREETYPE'
4948
#endif
5049
}
5150

third_party/imgui/include/imgui_impl_glfw.h

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool ins
3535
IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown();
3636
IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame();
3737

38+
// Emscripten related initialization phase methods
39+
#ifdef __EMSCRIPTEN__
40+
IMGUI_IMPL_API void ImGui_ImplGlfw_InstallEmscriptenCanvasResizeCallback(const char* canvas_selector);
41+
#endif
42+
3843
// GLFW callbacks install
3944
// - When calling Init with 'install_callbacks=true': ImGui_ImplGlfw_InstallCallbacks() is called. GLFW callbacks will be installed for you. They will chain-call user's previously installed callbacks, if any.
4045
// - When calling Init with 'install_callbacks=false': GLFW callbacks won't be installed. You will need to call individual function yourself from your own GLFW callbacks.

third_party/imgui/include/imgui_impl_opengl3_loader.h

+8-2
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ typedef khronos_intptr_t GLintptr;
260260
#define GL_ARRAY_BUFFER_BINDING 0x8894
261261
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
262262
#define GL_STREAM_DRAW 0x88E0
263+
#define GL_PIXEL_UNPACK_BUFFER 0x88EC
264+
#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
263265
typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
264266
typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
265267
typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
@@ -608,7 +610,7 @@ extern "C" {
608610

609611
#include <stdlib.h>
610612

611-
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
613+
#define GL3W_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
612614

613615
#if defined(_WIN32)
614616
#ifndef WIN32_LEAN_AND_MEAN
@@ -668,6 +670,10 @@ static int open_libgl(void)
668670
{
669671
// While most systems use libGL.so.1, NetBSD seems to use that libGL.so.3. See https://github.com/ocornut/imgui/issues/6983
670672
libgl = dlopen("libGL.so", RTLD_LAZY | RTLD_LOCAL);
673+
if (!libgl)
674+
libgl = dlopen("libGL.so.1", RTLD_LAZY | RTLD_LOCAL);
675+
if (!libgl)
676+
libgl = dlopen("libGL.so.3", RTLD_LAZY | RTLD_LOCAL);
671677
if (!libgl)
672678
return GL3W_ERROR_LIBRARY_OPEN;
673679
*(void **)(&glx_get_proc_address) = dlsym(libgl, "glXGetProcAddressARB");
@@ -800,7 +806,7 @@ GL3W_API union ImGL3WProcs imgl3wProcs;
800806
static void load_procs(GL3WGetProcAddressProc proc)
801807
{
802808
size_t i;
803-
for (i = 0; i < ARRAY_SIZE(proc_names); i++)
809+
for (i = 0; i < GL3W_ARRAY_SIZE(proc_names); i++)
804810
imgl3wProcs.ptr[i] = proc(proc_names[i]);
805811
}
806812

0 commit comments

Comments
 (0)