42 lines
926 B
C++
42 lines
926 B
C++
module;
|
|
|
|
#include <SDL3/SDL_rect.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 for SDL_FRect using class inheritance.
|
|
*/
|
|
class FRect : public SDL_FRect
|
|
{
|
|
/**
|
|
* Wrapper for SDL_RectEmptyFloat().
|
|
* @return True if the floating point rectangle takes no space.
|
|
*/
|
|
bool is_empty() const
|
|
{
|
|
return SDL_RectEmptyFloat(this);
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Wrapper for SDL_Rect using class inheritance.
|
|
*/
|
|
class Rect : public SDL_Rect
|
|
{
|
|
/**
|
|
* Wrapper for SDL_RectEmpty().
|
|
* @return True if the rectangle takes no space.
|
|
*/
|
|
bool is_empty() const
|
|
{
|
|
return SDL_RectEmpty(this);
|
|
}
|
|
};
|
|
}
|