mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-17 02:08:27 +00:00
Added scaleMode validation to SDL_SetTextureScaleMode()
This commit is contained in:
parent
63e58e5d66
commit
6c30a0f60b
1 changed files with 5 additions and 0 deletions
|
@ -1944,6 +1944,11 @@ SDL_bool SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode)
|
|||
|
||||
CHECK_TEXTURE_MAGIC(texture, false);
|
||||
|
||||
if (scaleMode != SDL_SCALEMODE_NEAREST &&
|
||||
scaleMode != SDL_SCALEMODE_LINEAR) {
|
||||
return SDL_InvalidParamError("scaleMode");
|
||||
}
|
||||
|
||||
renderer = texture->renderer;
|
||||
texture->scaleMode = scaleMode;
|
||||
if (texture->native) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue