_update sdl

This commit is contained in:
2024-12-01 20:51:37 +02:00
parent 846f44b882
commit 7cbe44c4e5
3 changed files with 5 additions and 5 deletions

View File

@@ -389,7 +389,7 @@ public:
SDL_GetGlobalMouseState(&oldPosition.X, &oldPosition.Y);
Mouse::SetRelativeMode(relativeMode, window);
if (SDL_SetWindowRelativeMouseMode(static_cast<SDLWindow*>(window)->_window, relativeMode) != 0)
if (!SDL_SetWindowRelativeMouseMode(static_cast<SDLWindow*>(window)->_window, relativeMode))
LOG(Error, "Failed to set mouse relative mode: {0}", String(SDL_GetError()));
if (!relativeMode)

View File

@@ -442,7 +442,7 @@ DialogResult MessageBox::Show(Window* parent, const StringView& text, const Stri
data.buttons = dataButtons;
int result = -1;
if (SDL_ShowMessageBox(&data, &result) != 0)
if (!SDL_ShowMessageBox(&data, &result))
{
#if PLATFORM_LINUX
// Fallback to native messagebox implementation in case some system fonts are missing

View File

@@ -760,7 +760,7 @@ void SDLWindow::Show()
if (_isTrackingMouse)
{
if (SDL_CaptureMouse(true) != 0)
if (!SDL_CaptureMouse(true))
{
if (!SDLPlatform::UsesWayland()) // Suppress "That operation is not supported" errors
LOG(Warning, "SDL_CaptureMouse: {0}", String(SDL_GetError()));
@@ -1232,7 +1232,7 @@ void SDLWindow::StartTrackingMouse(bool useMouseScreenOffset)
if (_visible)
{
if (SDL_CaptureMouse(true) != 0)
if (!SDL_CaptureMouse(true))
{
if (!SDLPlatform::UsesWayland()) // Suppress "That operation is not supported" errors
LOG(Warning, "SDL_CaptureMouse: {0}", String(SDL_GetError()));
@@ -1253,7 +1253,7 @@ void SDLWindow::EndTrackingMouse()
_isHorizontalFlippingMouse = false;
_isVerticalFlippingMouse = false;
if (SDL_CaptureMouse(false) != 0)
if (!SDL_CaptureMouse(false))
{
if (!SDLPlatform::UsesWayland()) // Suppress "That operation is not supported" errors
LOG(Warning, "SDL_CaptureMouse: {0}", String(SDL_GetError()));