sdlGetRenderScale function

bool sdlGetRenderScale(
  1. Pointer<SdlRenderer> renderer,
  2. Pointer<Float> scaleX,
  3. Pointer<Float> scaleY
)

Get the drawing scale for the current target.

\param renderer the rendering context. \param scaleX a pointer filled in with the horizontal scaling factor. \param scaleY a pointer filled in with the vertical scaling factor. \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_SetRenderScale

extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY)

Implementation

bool sdlGetRenderScale(Pointer<SdlRenderer> renderer, Pointer<Float> scaleX,
    Pointer<Float> scaleY) {
  final sdlGetRenderScaleLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlRenderer> renderer, Pointer<Float> scaleX,
          Pointer<Float> scaleY),
      int Function(Pointer<SdlRenderer> renderer, Pointer<Float> scaleX,
          Pointer<Float> scaleY)>('SDL_GetRenderScale');
  return sdlGetRenderScaleLookupFunction(renderer, scaleX, scaleY) == 1;
}