SDL Utility
Cursor.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Vector2.hpp"
4 #include "Util.hpp"
5 
6 struct SDL_Cursor;
7 struct SDL_Surface;
8 
10 
11 class Cursor
12 {
13 public:
14  enum class Type {
17  No, Hand
18  };
19 
20  friend class Window;
21 
22 public:
23  Cursor();
24  Cursor(Type type);
25  Cursor(const Cursor& other) = delete;
26  Cursor(Cursor&& other) noexcept;
27 
29 
30  bool LoadFromPixels(const Uint8* pixels, Vector2u size, Vector2u hotspot);
31  bool LoadFromSurface(SDL_Surface* surface, Vector2u hotspot);
32  bool LoadFromSystem(Type type);
33 
34 private:
35  SDL_Cursor* cursor;
36 };
37 
38 SDLU_END
Basic utility macros, typedefs...
uint8_t Uint8
Definition: Util.hpp:17
#define SDLU_BEGIN
Definition: Util.hpp:32
Provides a structure for simple vector calculations.
Definition: Cursor.hpp:12
Cursor(Type type)
bool LoadFromSurface(SDL_Surface *surface, Vector2u hotspot)
bool LoadFromPixels(const Uint8 *pixels, Vector2u size, Vector2u hotspot)
Type
Definition: Cursor.hpp:14
bool LoadFromSystem(Type type)
Cursor(Cursor &&other) noexcept
Cursor(const Cursor &other)=delete
Stores information about a window. You probably want RenderWindow.
Definition: Window.hpp:26
A struct to handle basic 2D vector operations.
Definition: Vector2.hpp:22