Skip to content

Commit

Permalink
Backends: SDL3: Update for API changes: SDL_bool removal. SDL_INIT_TI…
Browse files Browse the repository at this point in the history
…MER removal. (ocornut#7999)
  • Loading branch information
ocornut committed Sep 19, 2024
1 parent faca859 commit 0af2c4e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backends/imgui_impl_sdl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ static void ImGui_ImplSDL3_UpdateMouseData()
// We forward mouse input when hovered or captured (via SDL_EVENT_MOUSE_MOTION) or when focused (below)
#if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE
// SDL_CaptureMouse() let the OS know e.g. that our imgui drag outside the SDL window boundaries shouldn't e.g. trigger other operations outside
SDL_CaptureMouse((bd->MouseButtonsDown != 0) ? SDL_TRUE : SDL_FALSE);
SDL_CaptureMouse(bd->MouseButtonsDown != 0);
SDL_Window* focused_window = SDL_GetKeyboardFocus();
const bool is_app_focused = (bd->Window == focused_window);
#else
Expand Down
4 changes: 2 additions & 2 deletions backends/imgui_impl_sdlrenderer3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
SDL_Rect ClipRect;
};
BackupSDLRendererState old = {};
old.ViewportEnabled = SDL_RenderViewportSet(renderer) == SDL_TRUE;
old.ClipEnabled = SDL_RenderClipEnabled(renderer) == SDL_TRUE;
old.ViewportEnabled = SDL_RenderViewportSet(renderer);
old.ClipEnabled = SDL_RenderClipEnabled(renderer);
SDL_GetRenderViewport(renderer, &old.Viewport);
SDL_GetRenderClipRect(renderer, &old.ClipRect);

Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Breaking changes:

Other changes:

- Backends: SDL3: Update for API changes: SDL_bool removal. SDL_INIT_TIMER removal.


-----------------------------------------------------------------------
VERSION 1.91.2 (Released 2024-09-19)
Expand Down
2 changes: 1 addition & 1 deletion examples/example_sdl3_opengl3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
int main(int, char**)
{
// Setup SDL
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMEPAD))
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD))
{
printf("Error: SDL_Init(): %s\n", SDL_GetError());
return -1;
Expand Down
2 changes: 1 addition & 1 deletion examples/example_sdl3_sdlrenderer3/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
int main(int, char**)
{
// Setup SDL
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_GAMEPAD))
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMEPAD))
{
printf("Error: SDL_Init(): %s\n", SDL_GetError());
return -1;
Expand Down

0 comments on commit 0af2c4e

Please sign in to comment.