sdlRenderViewportSet function

bool sdlRenderViewportSet(
  1. Pointer<SdlRenderer> renderer
)

Return whether an explicit rectangle was set as the viewport.

This is useful if you're saving and restoring the viewport and want to know whether you should restore a specific rectangle or NULL. Note that the viewport is always reset when changing rendering targets.

\param renderer the rendering context. \returns true if the viewport was set to a specific rectangle, or false if it was set to NULL (the entire target).

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

\since This function is available since SDL 3.1.3.

\sa SDL_GetRenderViewport \sa SDL_SetRenderViewport

extern SDL_DECLSPEC bool SDLCALL SDL_RenderViewportSet(SDL_Renderer *renderer)

Implementation

bool sdlRenderViewportSet(Pointer<SdlRenderer> renderer) {
  final sdlRenderViewportSetLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlRenderer> renderer),
      int Function(Pointer<SdlRenderer> renderer)>('SDL_RenderViewportSet');
  return sdlRenderViewportSetLookupFunction(renderer) == 1;
}