43 lines
953 B
Text
43 lines
953 B
Text
|
|
module;
|
||
|
|
|
||
|
|
#include <SDL3/SDL.h>
|
||
|
|
|
||
|
|
export module wrappers.sdl.rect;
|
||
|
|
|
||
|
|
export namespace sdl
|
||
|
|
{
|
||
|
|
// Wrappers around SDL_Point and SDL_FPoint (change to wrapper classes when needed)
|
||
|
|
using FPoint = SDL_FPoint;
|
||
|
|
using Point = SDL_Point;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Wrapper around SDL_FRect using class inheritance.
|
||
|
|
*/
|
||
|
|
class FRect : public SDL_FRect
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Wrapper around SDL_RectEmptyFloat().
|
||
|
|
* @return True if the floating point rectangle takes no space.
|
||
|
|
*/
|
||
|
|
constexpr bool is_empty() const
|
||
|
|
{
|
||
|
|
return SDL_RectEmptyFloat(this);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Wrapper around SDL_Rect using class inheritance.
|
||
|
|
*/
|
||
|
|
class Rect : public SDL_Rect
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Wrapper around SDL_RectEmpty().
|
||
|
|
* @return True if the rectangle takes no space.
|
||
|
|
*/
|
||
|
|
constexpr bool is_empty() const
|
||
|
|
{
|
||
|
|
return SDL_RectEmpty(this);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|