SDLU/include/structures/Cursor.hpp
2021-04-23 16:29:26 +02:00

38 lines
624 B
C++

#pragma once
#include "Vector2.hpp"
#include "Util.hpp"
struct SDL_Cursor;
struct SDL_Surface;
SDLU_BEGIN
class Cursor
{
public:
enum class Type {
Arrow, IBeam, Wait, Crosshair, WaitArrow,
SizeNWSE, SizeNESW, SizeWE, SizeNS, SizeAll,
No, Hand
};
friend class Window;
public:
Cursor();
Cursor(Type type);
Cursor(const Cursor& other) = delete;
Cursor(Cursor&& other) noexcept;
~Cursor();
bool LoadFromPixels(const Uint8* pixels, Vector2u size, Vector2u hotspot);
bool LoadFromSurface(SDL_Surface* surface, Vector2u hotspot);
bool LoadFromSystem(Type type);
private:
SDL_Cursor* cursor;
};
SDLU_END