getOutputSize method

Point<double> getOutputSize()

Get the output size in pixels of a rendering context.

This returns the true output size in pixels, ignoring any render targets or logical size and presentation.

For the output size of the current rendering target, with logical size adjustments, use SDL_GetCurrentRenderOutputSize() instead.

\param renderer the rendering context. \param w a pointer filled in with the width in pixels. \param h a pointer filled in with the height in pixels. \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.2.0.

\sa SDL_GetCurrentRenderOutputSize

extern SDL_DECLSPEC bool SDLCALL SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h)

{@category render}

Implementation

math.Point<double> getOutputSize() {
  final wPointer = calloc<Int32>();
  final hPointer = calloc<Int32>();
  sdlGetRenderOutputSize(this, wPointer, hPointer);
  final result = math.Point<double>(
    wPointer.value.toDouble(),
    hPointer.value.toDouble(),
  );
  calloc
    ..free(wPointer)
    ..free(hPointer);
  return result;
}