|
@@ -18,6 +18,7 @@
|
|
|
|
|
|
// CHANGELOG
|
|
// CHANGELOG
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
|
+// 2021-06:29: *BREAKING CHANGE* Removed 'SDL_Window* window' parameter to ImGui_ImplSDL2_NewFrame() which was unnecessary.
|
|
// 2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
|
|
// 2021-06-29: Reorganized backend to pull data from a single structure to facilitate usage with multiple-contexts (all g_XXXX access changed to bd->XXXX).
|
|
// 2021-03-22: Rework global mouse pos availability check listing supported platforms explicitly, effectively fixing mouse access on Raspberry Pi. (#2837, #3950)
|
|
// 2021-03-22: Rework global mouse pos availability check listing supported platforms explicitly, effectively fixing mouse access on Raspberry Pi. (#2837, #3950)
|
|
// 2020-05-25: Misc: Report a zero display-size when window is minimized, to be consistent with other backends.
|
|
// 2020-05-25: Misc: Report a zero display-size when window is minimized, to be consistent with other backends.
|
|
@@ -377,20 +378,19 @@ static void ImGui_ImplSDL2_UpdateGamepads()
|
|
#undef MAP_ANALOG
|
|
#undef MAP_ANALOG
|
|
}
|
|
}
|
|
|
|
|
|
-void ImGui_ImplSDL2_NewFrame(SDL_Window* window)
|
|
|
|
|
|
+void ImGui_ImplSDL2_NewFrame()
|
|
{
|
|
{
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();
|
|
ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();
|
|
IM_ASSERT(bd != NULL && "Did you call ImGui_ImplSDL2_Init()?");
|
|
IM_ASSERT(bd != NULL && "Did you call ImGui_ImplSDL2_Init()?");
|
|
- IM_ASSERT(bd->Window == window); // FIXME: Should remove parameter from ImGui_ImplSDL2_NewFrame()
|
|
|
|
|
|
|
|
// Setup display size (every frame to accommodate for window resizing)
|
|
// Setup display size (every frame to accommodate for window resizing)
|
|
int w, h;
|
|
int w, h;
|
|
int display_w, display_h;
|
|
int display_w, display_h;
|
|
- SDL_GetWindowSize(window, &w, &h);
|
|
|
|
- if (SDL_GetWindowFlags(window) & SDL_WINDOW_MINIMIZED)
|
|
|
|
|
|
+ SDL_GetWindowSize(bd->Window, &w, &h);
|
|
|
|
+ if (SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_MINIMIZED)
|
|
w = h = 0;
|
|
w = h = 0;
|
|
- SDL_GL_GetDrawableSize(window, &display_w, &display_h);
|
|
|
|
|
|
+ SDL_GL_GetDrawableSize(bd->Window, &display_w, &display_h);
|
|
io.DisplaySize = ImVec2((float)w, (float)h);
|
|
io.DisplaySize = ImVec2((float)w, (float)h);
|
|
if (w > 0 && h > 0)
|
|
if (w > 0 && h > 0)
|
|
io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h);
|
|
io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h);
|