Add wrappers for SDL functions and structs

This commit is contained in:
Lexi / Zoe 2025-11-23 21:50:57 +01:00
parent 4277f4c818
commit d180b8a5b4
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
18 changed files with 410 additions and 206 deletions

View file

@ -0,0 +1,42 @@
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);
}
};
}