~ Initial SDL2 implementation
Limitation - Dependent projects need to set NAZARA_PLATFORM_SDL2 if nazara has been build with SDL2 since OpenGL.hpp (and maybe some other headers) exposes platform details - SDL2 window doesn't supports async window since the API isn't fitting for now - Contexts parameters can't be changed until we close all the SDL windows (SDL limitation)
This commit is contained in:
45
src/Nazara/Platform/SDL2/CursorImpl.hpp
Normal file
45
src/Nazara/Platform/SDL2/CursorImpl.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright (C) 2017 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Platform module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CURSORIMPL_HPP
|
||||
#define NAZARA_CURSORIMPL_HPP
|
||||
|
||||
#include <array>
|
||||
#include <Nazara/Platform/Enums.hpp>
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Utility/Image.hpp>
|
||||
|
||||
#include <SDL2/SDL_mouse.h>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class Image;
|
||||
|
||||
class CursorImpl
|
||||
{
|
||||
friend class Cursor;
|
||||
|
||||
public:
|
||||
bool Create(const Image& image, int hotSpotX, int hotSpotY);
|
||||
bool Create(SystemCursor cursor);
|
||||
|
||||
void Destroy();
|
||||
|
||||
SDL_Cursor* GetCursor();
|
||||
|
||||
private:
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
SDL_Cursor* m_cursor = nullptr;
|
||||
SDL_Surface* m_icon = nullptr;
|
||||
Image m_iconImage;
|
||||
|
||||
static std::array<SDL_SystemCursor, SystemCursor_Max + 1> s_systemCursorIds;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_CURSORIMPL_HPP
|
||||
Reference in New Issue
Block a user