|
SDL3pp
A slim C++ wrapper for SDL3
|


Public Member Functions | |
| CursorRef (CursorRaw resource) noexcept | |
| Constructs from raw Cursor. More... | |
| constexpr | CursorRef (const Cursor &resource) noexcept |
| Constructs from Cursor. More... | |
| constexpr | CursorRef (const CursorRef &other) noexcept |
| Copy constructor. | |
| constexpr | CursorRef (CursorRef &&other) noexcept |
| Move constructor. | |
| ~CursorRef () | |
| Destructor. | |
| constexpr CursorRef & | operator= (CursorRef other) noexcept |
| Assignment operator. | |
| constexpr | operator CursorRaw () const noexcept |
| Converts to CursorRaw. | |
| constexpr | Cursor (std::nullptr_t=nullptr) noexcept |
| Default ctor. | |
| constexpr | Cursor (const CursorRaw resource) noexcept |
| Constructs from CursorRef. More... | |
| constexpr | Cursor (const Cursor &other) noexcept=default |
| Copy constructor. | |
| constexpr | Cursor (Cursor &&other) noexcept |
| Move constructor. | |
| constexpr | Cursor (const CursorRef &other)=delete |
| constexpr | Cursor (CursorRef &&other)=delete |
| Cursor (const Uint8 *data, const Uint8 *mask, const PointRaw &size, const PointRaw &hot) | |
| Create a cursor using the specified bitmap data and mask (in MSB format). More... | |
| Cursor (SurfaceRef surface, const PointRaw &hot) | |
| Create a color cursor. More... | |
| Cursor (SystemCursor id) | |
| Create a system cursor. More... | |
Public Member Functions inherited from SDL::Cursor | |
| constexpr | Cursor (std::nullptr_t=nullptr) noexcept |
| Default ctor. | |
| constexpr | Cursor (const CursorRaw resource) noexcept |
| Constructs from CursorRef. More... | |
| constexpr | Cursor (Cursor &&other) noexcept |
| Move constructor. | |
| constexpr | Cursor (const CursorRef &other)=delete |
| constexpr | Cursor (CursorRef &&other)=delete |
| Cursor (const Uint8 *data, const Uint8 *mask, const PointRaw &size, const PointRaw &hot) | |
| Create a cursor using the specified bitmap data and mask (in MSB format). More... | |
| Cursor (SurfaceRef surface, const PointRaw &hot) | |
| Create a color cursor. More... | |
| Cursor (SystemCursor id) | |
| Create a system cursor. More... | |
| ~Cursor () | |
| Destructor. | |
| constexpr Cursor & | operator= (Cursor &&other) noexcept |
| Assignment operator. | |
| constexpr CursorRaw | get () const noexcept |
| Retrieves underlying CursorRaw. | |
| constexpr CursorRaw | release () noexcept |
| Retrieves underlying CursorRaw and clear this. | |
| constexpr auto | operator<=> (const Cursor &other) const noexcept=default |
| Comparison. | |
| constexpr | operator bool () const noexcept |
| Converts to bool. | |
| void | Destroy () |
| Free a previously-created cursor. More... | |
| void | Set () |
| Set the active cursor. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from SDL::Cursor | |
| constexpr | Cursor (const Cursor &other) noexcept=default |
| Copy constructor. | |
| constexpr Cursor & | operator= (const Cursor &other) noexcept=default |
| Assignment operator. | |
This does not take ownership!
|
inlinenoexcept |
| resource | a CursorRaw. |
This does not takes ownership!
|
inlineconstexprnoexcept |
| resource | a Cursor. |
This does not takes ownership!
|
inlineexplicitconstexprnoexcept |
| resource | a CursorRaw to be wrapped. |
This assumes the ownership, call release() if you need to take back.
|
inline |
mask has to be in MSB (Most Significant Bit) format.
The cursor width (w) must be a multiple of 8 bits.
The cursor is created in black and white according to the following:
Cursors created with this function must be freed with Cursor.Destroy().
If you want to have a color cursor, or create your cursor from an Surface, you should use Cursor.Cursor(). Alternately, you can hide the cursor and draw your own as part of your game's rendering, but it will be bound to the framerate.
Also, Cursor.Cursor() is available, which provides several readily-available system cursors to pick from.
| data | the color value for each pixel of the cursor. |
| mask | the mask value for each pixel of the cursor. |
| size | the width and height of the cursor. |
| hot | the x position of the cursor hot spot, from the top-left, in the range of 0 to size.x - 1 and 0 to size.y - 1. |
| Error | on failure. |
|
inline |
If this function is passed a surface with alternate representations added with Surface.AddAlternateImage(), the surface will be interpreted as the content to be used for 100% display scale, and the alternate representations will be used for high DPI situations if SDL_HINT_MOUSE_DPI_SCALE_CURSORS is enabled. For example, if the original surface is 32x32, then on a 2x macOS display or 200% display scale on Windows, a 64x64 version of the image will be used, if available. If a matching version of the image isn't available, the closest larger size image will be downscaled to the appropriate size and be used instead, if available. Otherwise, the closest smaller image will be upscaled and be used instead.
| surface | an Surface structure representing the cursor image. |
| hot | the x, y position of the cursor hot spot. |
| Error | on failure. |
|
inline |
| id | an SystemCursor enum value. |
| Error | on failure. |