sdlSetTextureScaleMode function

bool sdlSetTextureScaleMode(
  1. Pointer<SdlTexture> texture,
  2. int scaleMode
)

Set the scale mode used for texture scale operations.

The default texture scale mode is SDL_SCALEMODE_LINEAR.

If the scale mode is not supported, the closest supported mode is chosen.

\param texture the texture to update. \param scaleMode the SDL_ScaleMode to use for texture scaling. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_GetTextureScaleMode

extern SDL_DECLSPEC bool SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode)

Implementation

bool sdlSetTextureScaleMode(Pointer<SdlTexture> texture, int scaleMode) {
  final sdlSetTextureScaleModeLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlTexture> texture, Int32 scaleMode),
      int Function(Pointer<SdlTexture> texture,
          int scaleMode)>('SDL_SetTextureScaleMode');
  return sdlSetTextureScaleModeLookupFunction(texture, scaleMode) == 1;
}