mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-05 15:03:43 +00:00
Added SDL_RectToFRect()
This commit is contained in:
parent
e3cf20e1cc
commit
cd5f0d2cce
1 changed files with 18 additions and 0 deletions
|
@ -112,6 +112,24 @@ typedef struct SDL_FRect
|
||||||
} SDL_FRect;
|
} SDL_FRect;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert an SDL_Rect to SDL_FRect
|
||||||
|
*
|
||||||
|
* \param rect a pointer to an SDL_Rect.
|
||||||
|
* \param frect a pointer filled in with the floating point representation of `rect`.
|
||||||
|
*
|
||||||
|
* \threadsafety It is safe to call this function from any thread.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 3.0.0.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect)
|
||||||
|
{
|
||||||
|
frect->x = (float)rect->x;
|
||||||
|
frect->y = (float)rect->y;
|
||||||
|
frect->w = (float)rect->w;
|
||||||
|
frect->h = (float)rect->h;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine whether a point resides inside a rectangle.
|
* Determine whether a point resides inside a rectangle.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue