sdlRotateSurface function surface

Pointer<SdlSurface> sdlRotateSurface(
  1. Pointer<SdlSurface> surface,
  2. double angle
)

Return a copy of a surface rotated clockwise a number of degrees.

The angle of rotation can be negative for counter-clockwise rotation.

When the rotation isn't a multiple of 90 degrees, the resulting surface is larger than the original, with the background filled in with the colorkey, if available, or RGBA 255/255/255/0 if not.

\param surface the surface to rotate. \param angle the rotation angle, in degrees. \returns a rotated copy of the surface or NULL on failure; call SDL_GetError() for more information.

\threadsafety This function can be called on different threads with different surfaces.

\since This function is available since SDL 3.4.0.

extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RotateSurface(SDL_Surface *surface, float angle)

Implementation

Pointer<SdlSurface> sdlRotateSurface(
  Pointer<SdlSurface> surface,
  double angle,
) {
  final sdlRotateSurfaceLookupFunction = _libSdl
      .lookupFunction<
        Pointer<SdlSurface> Function(Pointer<SdlSurface> surface, Float angle),
        Pointer<SdlSurface> Function(Pointer<SdlSurface> surface, double angle)
      >('SDL_RotateSurface');
  return sdlRotateSurfaceLookupFunction(surface, angle);
}