Add wrappers for SDL functions and structs
This commit is contained in:
parent
4277f4c818
commit
d180b8a5b4
18 changed files with 410 additions and 206 deletions
42
src/wrappers/sdl/rect.cppm
Normal file
42
src/wrappers/sdl/rect.cppm
Normal 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);
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue