getAspectRatio method

({double maxAspect, double minAspect})? getAspectRatio()

Get the aspect ratio of a window's client area.

\param window the window to query the width and height from. \param min_aspect a pointer filled in with the minimum aspect ratio of the window, may be NULL. \param max_aspect a pointer filled in with the maximum aspect ratio of the window, may be NULL. \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_SetWindowAspectRatio

extern SDL_DECLSPEC bool SDLCALL SDL_GetWindowAspectRatio(SDL_Window *window, float *min_aspect, float *max_aspect)

See also:

Implementation

({double minAspect, double maxAspect})? getAspectRatio() =>
    sdlxGetWindowAspectRatio(this);