Upgrade Platform

This commit is contained in:
Jérôme Leclercq
2021-05-24 21:06:55 +02:00
parent 8b0b5295f7
commit ba7c56ddfa
20 changed files with 322 additions and 389 deletions

View File

@@ -8,7 +8,6 @@
#define NAZARA_CURSOR_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/ObjectRef.hpp>
#include <Nazara/Math/Vector2.hpp>
#include <Nazara/Platform/Config.hpp>
#include <Nazara/Platform/Enums.hpp>
@@ -19,51 +18,42 @@ namespace Nz
{
class CursorImpl;
class Cursor;
using CursorConstRef = ObjectRef<const Cursor>;
using CursorRef = ObjectRef<Cursor>;
class NAZARA_PLATFORM_API Cursor : public RefCounted
class NAZARA_PLATFORM_API Cursor
{
friend class Platform;
friend class WindowImpl;
public:
inline Cursor();
inline Cursor(const Image& cursor, const Vector2i& hotSpot, SystemCursor placeholder);
Cursor();
Cursor(const Image& cursor, const Vector2i& hotSpot, SystemCursor placeholder);
Cursor(const Cursor&) = delete;
Cursor(Cursor&&) = delete;
inline ~Cursor();
Cursor(Cursor&&) noexcept;
~Cursor();
bool Create(const Image& cursor, const Vector2i& hotSpot, SystemCursor placeholder);
void Destroy();
inline const Image& GetImage() const;
inline SystemCursor GetSystemCursor() const;
inline bool IsValid() const;
Cursor& operator=(const Cursor&) = delete;
Cursor& operator=(Cursor&&) = delete;
Cursor& operator=(Cursor&&) noexcept;
static inline Cursor* Get(SystemCursor cursor);
template<typename... Args> static CursorRef New(Args&&... args);
static inline std::shared_ptr<Cursor>& Get(SystemCursor cursor);
private:
inline explicit Cursor(SystemCursor systemCursor);
explicit Cursor(SystemCursor systemCursor);
bool Create(SystemCursor cursor);
static bool Initialize();
static void Uninitialize();
Image m_cursorImage;
SystemCursor m_systemCursor;
CursorImpl* m_impl;
std::unique_ptr<CursorImpl> m_impl;
static std::array<Cursor, SystemCursor_Max + 1> s_systemCursors;
static std::array<std::shared_ptr<Cursor>, SystemCursorCount> s_systemCursors;
};
}