cpp-sdl2
C++ header-only SDL2 wrapper
sdl::Mouse::Cursor Class Reference

Cursor object. More...

#include <mouse.hpp>

Public Member Functions

 Cursor (SDL_SystemCursor id)
 Construct a system cursor. More...
 
 Cursor (const uint8_t *data, const uint8_t *mask, Vec2i const &size, Vec2i const &hot)
 Construct a cursor from MSB bitmap data. More...
 
 Cursor (Surface const &surface, Vec2i const &hot)
 Create cursor from a SDL_Surface. More...
 
 ~Cursor ()
 Free the cursor. More...
 
Cursoroperator= (Cursor &&other) noexcept
 
 Cursor (Cursor &&other) noexcept
 
void set () const
 Set this cursor as the current cursor. More...
 

Static Public Member Functions

static void show ()
 Set the cursor as visible. More...
 
static void hide ()
 Set the cursor as invisible. More...
 
static bool visible ()
 Return true or false if the cursor is curently visible or not. More...
 

Private Attributes

SDL_Cursor * cursor_ = nullptr
 SDL pointer. More...
 

Detailed Description

Cursor object.

Definition at line 37 of file mouse.hpp.

Constructor & Destructor Documentation

◆ Cursor() [1/4]

sdl::Mouse::Cursor::Cursor ( SDL_SystemCursor  id)
inline

Construct a system cursor.

Definition at line 44 of file mouse.hpp.

◆ Cursor() [2/4]

sdl::Mouse::Cursor::Cursor ( const uint8_t *  data,
const uint8_t *  mask,
Vec2i const &  size,
Vec2i const &  hot 
)
inline

Construct a cursor from MSB bitmap data.

Definition at line 53 of file mouse.hpp.

◆ Cursor() [3/4]

sdl::Mouse::Cursor::Cursor ( Surface const &  surface,
Vec2i const &  hot 
)
inline

Create cursor from a SDL_Surface.

Definition at line 63 of file mouse.hpp.

◆ ~Cursor()

sdl::Mouse::Cursor::~Cursor ( )
inline

Free the cursor.

Definition at line 73 of file mouse.hpp.

◆ Cursor() [4/4]

sdl::Mouse::Cursor::Cursor ( Cursor &&  other)
inlinenoexcept

Definition at line 88 of file mouse.hpp.

Member Function Documentation

◆ hide()

static void sdl::Mouse::Cursor::hide ( )
inlinestatic

Set the cursor as invisible.

Definition at line 108 of file mouse.hpp.

◆ operator=()

Cursor& sdl::Mouse::Cursor::operator= ( Cursor &&  other)
inlinenoexcept

Definition at line 78 of file mouse.hpp.

References cursor_.

◆ set()

void sdl::Mouse::Cursor::set ( ) const
inline

Set this cursor as the current cursor.

Definition at line 91 of file mouse.hpp.

◆ show()

static void sdl::Mouse::Cursor::show ( )
inlinestatic

Set the cursor as visible.

Definition at line 97 of file mouse.hpp.

◆ visible()

static bool sdl::Mouse::Cursor::visible ( )
inlinestatic

Return true or false if the cursor is curently visible or not.

Definition at line 119 of file mouse.hpp.

Member Data Documentation

◆ cursor_

SDL_Cursor* sdl::Mouse::Cursor::cursor_ = nullptr
private

SDL pointer.

Definition at line 40 of file mouse.hpp.

Referenced by operator=().


The documentation for this class was generated from the following file: