summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/examples/common')
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.cpp3
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_glfw.cpp77
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_p.h4
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_sdl.cpp92
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_windows.cpp8
-rw-r--r--3rdparty/bgfx/examples/common/example-glue.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp68
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.h4
-rw-r--r--3rdparty/bgfx/examples/common/imgui/makefile2
10 files changed, 114 insertions, 148 deletions
diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp
index 07621f3cd25..dc3e97488ea 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry.cpp
@@ -767,6 +767,7 @@ restart:
handle = size->m_handle;
_width = size->m_width;
_height = size->m_height;
+ BX_TRACE("Window resize event: %d: %dx%d", handle, _width, _height);
needReset = true;
}
@@ -800,6 +801,7 @@ restart:
&& needReset)
{
_reset = s_reset;
+ BX_TRACE("bgfx::reset(%d, %d, 0x%x)", _width, _height, _reset)
bgfx::reset(_width, _height, _reset);
inputSetMouseResolution(uint16_t(_width), uint16_t(_height) );
}
@@ -979,6 +981,7 @@ restart:
if (needReset)
{
_reset = s_reset;
+ BX_TRACE("bgfx::reset(%d, %d, 0x%x)", s_window[0].m_width, s_window[0].m_height, _reset)
bgfx::reset(s_window[0].m_width, s_window[0].m_height, _reset);
inputSetMouseResolution(uint16_t(s_window[0].m_width), uint16_t(s_window[0].m_height) );
}
diff --git a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
index d27745d1390..4c699f23a5e 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
@@ -15,13 +15,9 @@
#endif // GLFW_VERSION_MINOR < 2
#if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
-# include <wayland-egl.h>
-# define GLFW_EXPOSE_NATIVE_WAYLAND
-# else
-# define GLFW_EXPOSE_NATIVE_X11
-# define GLFW_EXPOSE_NATIVE_GLX
-# endif
+# define GLFW_EXPOSE_NATIVE_WAYLAND
+# define GLFW_EXPOSE_NATIVE_X11
+# define GLFW_EXPOSE_NATIVE_GLX
#elif BX_PLATFORM_OSX
# define GLFW_EXPOSE_NATIVE_COCOA
# define GLFW_EXPOSE_NATIVE_NSGL
@@ -45,22 +41,14 @@ namespace entry
static void* glfwNativeWindowHandle(GLFWwindow* _window)
{
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window);
- if(!win_impl)
+ if (glfwGetPlatform() == GLFW_PLATFORM_WAYLAND)
+ {
+ return glfwGetWaylandWindow(_window);
+ }
+ else
{
- int width, height;
- glfwGetWindowSize(_window, &width, &height);
- struct wl_surface* surface = (struct wl_surface*)glfwGetWaylandWindow(_window);
- if(!surface)
- return nullptr;
- win_impl = wl_egl_window_create(surface, width, height);
- glfwSetWindowUserPointer(_window, (void*)(uintptr_t)win_impl);
+ return (void*)(uintptr_t)glfwGetX11Window(_window);
}
- return (void*)(uintptr_t)win_impl;
-# else
- return (void*)(uintptr_t)glfwGetX11Window(_window);
-# endif
# elif BX_PLATFORM_OSX
return glfwGetCocoaWindow(_window);
# elif BX_PLATFORM_WINDOWS
@@ -68,23 +56,6 @@ namespace entry
# endif // BX_PLATFORM_
}
- static void glfwDestroyWindowImpl(GLFWwindow *_window)
- {
- if(!_window)
- return;
-# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- wl_egl_window *win_impl = (wl_egl_window*)glfwGetWindowUserPointer(_window);
- if(win_impl)
- {
- glfwSetWindowUserPointer(_window, nullptr);
- wl_egl_window_destroy(win_impl);
- }
-# endif
-# endif
- glfwDestroyWindow(_window);
- }
-
static uint8_t translateKeyModifiers(int _glfw)
{
uint8_t modifiers = 0;
@@ -525,7 +496,7 @@ namespace entry
{
GLFWwindow* window = m_window[msg->m_handle.idx];
m_eventQueue.postWindowEvent(msg->m_handle);
- glfwDestroyWindowImpl(window);
+ glfwDestroyWindow(window);
m_window[msg->m_handle.idx] = NULL;
}
}
@@ -617,7 +588,7 @@ namespace entry
m_eventQueue.postExitEvent();
m_thread.shutdown();
- glfwDestroyWindowImpl(m_window[0]);
+ glfwDestroyWindow(m_window[0]);
glfwTerminate();
return m_thread.getExitCode();
@@ -865,11 +836,14 @@ namespace entry
void* getNativeDisplayHandle()
{
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- return glfwGetWaylandDisplay();
-# else
- return glfwGetX11Display();
-# endif // ENTRY_CONFIG_USE_WAYLAND
+ if (glfwGetPlatform() == GLFW_PLATFORM_WAYLAND)
+ {
+ return glfwGetWaylandDisplay();
+ }
+ else
+ {
+ return glfwGetX11Display();
+ }
# else
return NULL;
# endif // BX_PLATFORM_*
@@ -878,11 +852,14 @@ namespace entry
bgfx::NativeWindowHandleType::Enum getNativeWindowHandleType(WindowHandle _handle)
{
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- return bgfx::NativeWindowHandleType::Wayland;
-# else
- return bgfx::NativeWindowHandleType::Default;
-# endif // ENTRY_CONFIG_USE_WAYLAND
+ if (glfwGetPlatform() == GLFW_PLATFORM_WAYLAND)
+ {
+ return bgfx::NativeWindowHandleType::Wayland;
+ }
+ else
+ {
+ return bgfx::NativeWindowHandleType::Default;
+ }
# else
return bgfx::NativeWindowHandleType::Default;
# endif // BX_PLATFORM_*
diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h
index 59307c2f040..3c01e3459c8 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_p.h
+++ b/3rdparty/bgfx/examples/common/entry/entry_p.h
@@ -25,10 +25,6 @@
# define ENTRY_CONFIG_USE_GLFW 0
#endif // ENTRY_CONFIG_USE_GLFW
-#ifndef ENTRY_CONFIG_USE_WAYLAND
-# define ENTRY_CONFIG_USE_WAYLAND 0
-#endif // ENTRY_CONFIG_USE_WAYLAND
-
#if !defined(ENTRY_CONFIG_USE_NATIVE) \
&& !ENTRY_CONFIG_USE_NOOP \
&& !ENTRY_CONFIG_USE_SDL \
diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
index 5a862c0ca05..bbcdb069257 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
@@ -8,9 +8,6 @@
#if ENTRY_CONFIG_USE_SDL
#if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
-# include <wayland-egl.h>
-# endif
#elif BX_PLATFORM_WINDOWS
# define SDL_MAIN_HANDLED
#endif
@@ -49,25 +46,14 @@ namespace entry
}
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- if (wmi.subsystem == SDL_SYSWM_WAYLAND)
- {
- wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(_window, "wl_egl_window");
- if(!win_impl)
- {
- int width, height;
- SDL_GetWindowSize(_window, &width, &height);
- struct wl_surface* surface = wmi.info.wl.surface;
- if(!surface)
- return nullptr;
- win_impl = wl_egl_window_create(surface, width, height);
- SDL_SetWindowData(_window, "wl_egl_window", win_impl);
- }
- return (void*)(uintptr_t)win_impl;
- }
- else
-# endif // ENTRY_CONFIG_USE_WAYLAND
- return (void*)wmi.info.x11.window;
+ if (wmi.subsystem == SDL_SYSWM_WAYLAND)
+ {
+ return (void*)wmi.info.wl.surface;
+ }
+ else
+ {
+ return (void*)wmi.info.x11.window;
+ }
# elif BX_PLATFORM_OSX || BX_PLATFORM_IOS
return wmi.info.cocoa.window;
# elif BX_PLATFORM_WINDOWS
@@ -77,23 +63,6 @@ namespace entry
# endif // BX_PLATFORM_
}
- static void sdlDestroyWindow(SDL_Window* _window)
- {
- if(!_window)
- return;
-# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- wl_egl_window *win_impl = (wl_egl_window*)SDL_GetWindowData(_window, "wl_egl_window");
- if(win_impl)
- {
- SDL_SetWindowData(_window, "wl_egl_window", nullptr);
- wl_egl_window_destroy(win_impl);
- }
-# endif
-# endif
- SDL_DestroyWindow(_window);
- }
-
static uint8_t translateKeyModifiers(uint16_t _sdl)
{
uint8_t modifiers = 0;
@@ -493,7 +462,7 @@ namespace entry
// Force window resolution...
WindowHandle defaultWindow = { 0 };
- setWindowSize(defaultWindow, m_width, m_height, true);
+ entry::setWindowSize(defaultWindow, m_width, m_height);
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);
@@ -671,7 +640,15 @@ namespace entry
case SDL_WINDOWEVENT_SIZE_CHANGED:
{
WindowHandle handle = findHandle(wev.windowID);
- setWindowSize(handle, wev.data1, wev.data2);
+ uint32_t width = wev.data1;
+ uint32_t height = wev.data2;
+ if (width != m_width
+ || height != m_height)
+ {
+ m_width = width;
+ m_height = height;
+ m_eventQueue.postSizeEvent(handle, m_width, m_height);
+ }
}
break;
@@ -865,7 +842,7 @@ namespace entry
if (isValid(handle) )
{
m_eventQueue.postWindowEvent(handle);
- sdlDestroyWindow(m_window[handle.idx]);
+ SDL_DestroyWindow(m_window[handle.idx]);
m_window[handle.idx] = NULL;
}
}
@@ -916,7 +893,7 @@ namespace entry
Msg* msg = (Msg*)uev.data2;
if (isValid(handle) )
{
- setWindowSize(handle, msg->m_width, msg->m_height);
+ SDL_SetWindowSize(m_window[handle.idx], msg->m_width, msg->m_height);
}
delete msg;
}
@@ -959,7 +936,7 @@ namespace entry
while (bgfx::RenderFrame::NoContext != bgfx::renderFrame() ) {};
m_thread.shutdown();
- sdlDestroyWindow(m_window[0]);
+ SDL_DestroyWindow(m_window[0]);
SDL_Quit();
return m_thread.getExitCode();
@@ -988,20 +965,6 @@ namespace entry
return invalid;
}
- void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height, bool _force = false)
- {
- if (_width != m_width
- || _height != m_height
- || _force)
- {
- m_width = _width;
- m_height = _height;
-
- SDL_SetWindowSize(m_window[_handle.idx], m_width, m_height);
- m_eventQueue.postSizeEvent(_handle, m_width, m_height);
- }
- }
-
GamepadHandle findGamepad(SDL_JoystickID _jid)
{
for (uint32_t ii = 0, num = m_gamepadAlloc.getNumHandles(); ii < num; ++ii)
@@ -1102,6 +1065,7 @@ namespace entry
void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height)
{
+ // Function to set the window size programmatically from the examples/tools.
Msg* msg = new Msg;
msg->m_width = _width;
msg->m_height = _height;
@@ -1149,12 +1113,10 @@ namespace entry
return NULL;
}
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- if (wmi.subsystem == SDL_SYSWM_WAYLAND)
- return wmi.info.wl.display;
- else
-# endif // ENTRY_CONFIG_USE_WAYLAND
- return wmi.info.x11.display;
+ if (wmi.subsystem == SDL_SYSWM_WAYLAND)
+ return wmi.info.wl.display;
+ else
+ return wmi.info.x11.display;
# else
return NULL;
# endif // BX_PLATFORM_*
@@ -1169,11 +1131,9 @@ namespace entry
return bgfx::NativeWindowHandleType::Default;
}
# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
if (wmi.subsystem == SDL_SYSWM_WAYLAND)
return bgfx::NativeWindowHandleType::Wayland;
else
-# endif // ENTRY_CONFIG_USE_WAYLAND
return bgfx::NativeWindowHandleType::Default;
# else
return bgfx::NativeWindowHandleType::Default;
diff --git a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
index 754039a6db7..e731977737e 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
@@ -851,14 +851,18 @@ namespace entry
if (utf16[0] >= 0xD800 && utf16[0] <= 0xDBFF) {
m_surrogate = utf16[0];
- } else {
+ }
+ else
+ {
int utf16_len;
if (utf16[0] >= 0xDC00 && utf16[0] <= 0xDFFF) {
utf16[1] = utf16[0];
utf16[0] = m_surrogate;
m_surrogate = 0;
utf16_len = 2;
- } else {
+ }
+ else
+ {
utf16_len = 1;
}
diff --git a/3rdparty/bgfx/examples/common/example-glue.cpp b/3rdparty/bgfx/examples/common/example-glue.cpp
index 74ff3719f18..3c51db6ee0f 100644
--- a/3rdparty/bgfx/examples/common/example-glue.cpp
+++ b/3rdparty/bgfx/examples/common/example-glue.cpp
@@ -290,6 +290,8 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
}
}
}
+#else
+ ImGui::Text("Renderer: %s", bgfx::getRendererName(bgfx::getRendererType()));
#endif // 0
const bgfx::Stats* stats = bgfx::getStats();
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc b/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc
index f07729cb94c..0b9c9828b2c 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc
+++ b/3rdparty/bgfx/examples/common/imgui/fs_ocornut_imgui.sc
@@ -7,5 +7,5 @@ SAMPLER2D(s_tex, 0);
void main()
{
vec4 texel = texture2D(s_tex, v_texcoord0);
- gl_FragColor = texel * v_color0;
+ gl_FragColor = texel * v_color0;
}
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index 951c118ed76..d553d9d43e1 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -14,12 +14,14 @@
#include "imgui.h"
#include "../bgfx_utils.h"
-//#define USE_ENTRY 1
-
#ifndef USE_ENTRY
# define USE_ENTRY 0
#endif // USE_ENTRY
+#ifndef USE_LOCAL_STB
+# define USE_LOCAL_STB 1
+#endif // USE_LOCAL_STB
+
#if USE_ENTRY
# include "../entry/entry.h"
# include "../entry/input.h"
@@ -66,10 +68,13 @@ struct OcornutImguiContext
void render(ImDrawData* _drawData)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
- int fb_width = (int)(_drawData->DisplaySize.x * _drawData->FramebufferScale.x);
- int fb_height = (int)(_drawData->DisplaySize.y * _drawData->FramebufferScale.y);
- if (fb_width <= 0 || fb_height <= 0)
+ int32_t dispWidth = int32_t(_drawData->DisplaySize.x * _drawData->FramebufferScale.x);
+ int32_t dispHeight = int32_t(_drawData->DisplaySize.y * _drawData->FramebufferScale.y);
+ if (dispWidth <= 0
+ || dispHeight <= 0)
+ {
return;
+ }
bgfx::setViewName(m_viewId, "ImGui");
bgfx::setViewMode(m_viewId, bgfx::ViewMode::Sequential);
@@ -134,14 +139,16 @@ struct OcornutImguiContext
bgfx::TextureHandle th = m_texture;
bgfx::ProgramHandle program = m_program;
- if (NULL != cmd->TextureId)
+ if (ImU64(0) != cmd->TextureId)
{
union { ImTextureID ptr; struct { bgfx::TextureHandle handle; uint8_t flags; uint8_t mip; } s; } texture = { cmd->TextureId };
+
state |= 0 != (IMGUI_FLAGS_ALPHA_BLEND & texture.s.flags)
? BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
: BGFX_STATE_NONE
;
th = texture.s.handle;
+
if (0 != texture.s.mip)
{
const float lodEnabled[4] = { float(texture.s.mip), 1.0f, 0.0f, 0.0f };
@@ -161,8 +168,8 @@ struct OcornutImguiContext
clipRect.z = (cmd->ClipRect.z - clipPos.x) * clipScale.x;
clipRect.w = (cmd->ClipRect.w - clipPos.y) * clipScale.y;
- if (clipRect.x < fb_width
- && clipRect.y < fb_height
+ if (clipRect.x < dispWidth
+ && clipRect.y < dispHeight
&& clipRect.z >= 0.0f
&& clipRect.w >= 0.0f)
{
@@ -188,6 +195,8 @@ struct OcornutImguiContext
void create(float _fontSize, bx::AllocatorI* _allocator)
{
+ IMGUI_CHECKVERSION();
+
m_allocator = _allocator;
if (NULL == _allocator)
@@ -462,12 +471,13 @@ struct OcornutImguiContext
m_lastScroll = _scroll;
#if USE_ENTRY
- uint8_t modifiers = inputGetModifiersState();
- io.AddKeyEvent(ImGuiKey_ModShift, 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) ) );
- io.AddKeyEvent(ImGuiKey_ModCtrl, 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) ) );
- io.AddKeyEvent(ImGuiKey_ModAlt, 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) ) );
- io.AddKeyEvent(ImGuiKey_ModSuper, 0 != (modifiers & (entry::Modifier::LeftMeta | entry::Modifier::RightMeta ) ) );
- for (int32_t ii = 0; ii < (int32_t)entry::Key::Count; ++ii)
+ const uint8_t modifiers = inputGetModifiersState();
+ io.AddKeyEvent(ImGuiMod_Shift, 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) ) );
+ io.AddKeyEvent(ImGuiMod_Ctrl, 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) ) );
+ io.AddKeyEvent(ImGuiMod_Alt, 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) ) );
+ io.AddKeyEvent(ImGuiMod_Super, 0 != (modifiers & (entry::Modifier::LeftMeta | entry::Modifier::RightMeta ) ) );
+
+ for (int32_t ii = 0; ii < int32_t(entry::Key::Count); ++ii)
{
io.AddKeyEvent(m_keyMap[ii], inputGetKeyState(entry::Key::Enum(ii) ) );
io.SetKeyEventNativeData(m_keyMap[ii], 0, 0, ii);
@@ -559,15 +569,29 @@ namespace ImGui
} // namespace ImGui
+#if USE_LOCAL_STB
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4505); // error C4505: '' : unreferenced local function has been removed
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wunused-function"); // warning: 'int rect_width_compare(const void*, const void*)' defined but not used
-BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunknown-pragmas")
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wtype-limits"); // warning: comparison is always true due to limited range of data type
-#define STBTT_malloc(_size, _userData) memAlloc(_size, _userData)
-#define STBTT_free(_ptr, _userData) memFree(_ptr, _userData)
-#define STB_RECT_PACK_IMPLEMENTATION
-#include <stb/stb_rect_pack.h>
-#define STB_TRUETYPE_IMPLEMENTATION
-#include <stb/stb_truetype.h>
-BX_PRAGMA_DIAGNOSTIC_POP();
+
+# define STBTT_ifloor(_a) int32_t(bx::floor(_a) )
+# define STBTT_iceil(_a) int32_t(bx::ceil(_a) )
+# define STBTT_sqrt(_a) bx::sqrt(_a)
+# define STBTT_pow(_a, _b) bx::pow(_a, _b)
+# define STBTT_fmod(_a, _b) bx::mod(_a, _b)
+# define STBTT_cos(_a) bx::cos(_a)
+# define STBTT_acos(_a) bx::acos(_a)
+# define STBTT_fabs(_a) bx::abs(_a)
+# define STBTT_strlen(_str) bx::strLen(_str)
+
+# define STBTT_memcpy(_dst, _src, _numBytes) bx::memCopy(_dst, _src, _numBytes)
+# define STBTT_memset(_dst, _ch, _numBytes) bx::memSet(_dst, _ch, _numBytes)
+# define STBTT_malloc(_size, _userData) memAlloc(_size, _userData)
+# define STBTT_free(_ptr, _userData) memFree(_ptr, _userData)
+
+# define STB_RECT_PACK_IMPLEMENTATION
+# include <stb/stb_rect_pack.h>
+# define STB_TRUETYPE_IMPLEMENTATION
+# include <stb/stb_truetype.h>
+#endif // USE_LOCAL_STB
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h
index 98072777530..81e9ec49854 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2025 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -62,7 +62,7 @@ namespace ImGui
, const ImVec4& _borderCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
)
{
- Image(toId(_handle, _flags, _mip), _size, _uv0, _uv1, _tintCol, _borderCol);
+ ImageWithBg(toId(_handle, _flags, _mip), _size, _uv0, _uv1, _tintCol, _borderCol);
}
// Helper function for passing bgfx::TextureHandle to ImGui::Image.
diff --git a/3rdparty/bgfx/examples/common/imgui/makefile b/3rdparty/bgfx/examples/common/imgui/makefile
index 1979d957d9e..7b26cb84a85 100644
--- a/3rdparty/bgfx/examples/common/imgui/makefile
+++ b/3rdparty/bgfx/examples/common/imgui/makefile
@@ -1,5 +1,5 @@
#
-# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# Copyright 2011-2025 Branimir Karadzic. All rights reserved.
# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#