Skip to content

Commit

Permalink
SDL3 reverted their recent changes to SDL_GetTextureScaleMode and SDL…
Browse files Browse the repository at this point in the history
…_GetRenderDrawBlendMode
  • Loading branch information
texus committed Jul 17, 2024
1 parent 9bc9b5e commit 3a2837f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/Backend/Renderer/SDL_Renderer/BackendRenderTargetSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ namespace tgui
return;

// Store the current blend mode, in case we need to change it
#if SDL_MAJOR_VERSION >= 3
SDL_BlendMode oldBlendMode = SDL_GetRenderDrawBlendMode(m_renderer);
#else
SDL_BlendMode oldBlendMode = SDL_BLENDMODE_BLEND;
SDL_GetRenderDrawBlendMode(m_renderer, &oldBlendMode);
#endif

// Store the current clipping settings, in case we need to change it
SDL_Rect oldClipRect;
Expand Down
4 changes: 3 additions & 1 deletion src/Backend/Renderer/SDL_Renderer/BackendTextureSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ namespace tgui
if (SDL_GetTextureSize(texture, &width, &height) == 0)
m_imageSize = {static_cast<unsigned int>(width), static_cast<unsigned int>(height)};

m_isSmooth = (SDL_GetTextureScaleMode(m_texture) != SDL_SCALEMODE_NEAREST);
SDL_ScaleMode scaleMode;
if (SDL_GetTextureScaleMode(m_texture, &scaleMode) == 0)
m_isSmooth = (scaleMode != SDL_SCALEMODE_NEAREST);
#elif ((SDL_MAJOR_VERSION == 2) && (SDL_MINOR_VERSION > 0)) \
|| ((SDL_MAJOR_VERSION == 2) && (SDL_MINOR_VERSION == 0) && (SDL_PATCHLEVEL >= 12))
int width;
Expand Down

0 comments on commit 3a2837f

Please sign in to comment.