TGUI 1.11
Loading...
Searching...
No Matches
BackendRaylib.hpp
1
2//
3// TGUI - Texus' Graphical User Interface
4// Copyright (C) 2012-2025 Bruno Van de Velde (vdv_b@tgui.eu)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#ifndef TGUI_BACKEND_RAYLIB_HPP
26#define TGUI_BACKEND_RAYLIB_HPP
27
28#include <TGUI/Backend/Window/Backend.hpp>
29#include <TGUI/Backend/Window/Raylib/BackendGuiRaylib.hpp>
30
31#include <raylib.h>
32
33#include <unordered_map>
34#include <map>
35
37
38TGUI_IGNORE_DEPRECATED_WARNINGS_START // Required for VS2017 due to inheriting a function that we deprecated
39
40namespace tgui
41{
45 class TGUI_API BackendRaylib : public Backend
46 {
47 public:
48
59 void setMouseCursorStyle(Cursor::Type type, const std::uint8_t* pixels, Vector2u size, Vector2u hotspot) override;
60
69
76 void setMouseCursor(BackendGui* gui, Cursor::Type type) override;
77
85 TGUI_DEPRECATED("Use gui.isKeyboardModifierPressed(modifierKey) instead") TGUI_NODISCARD bool isKeyboardModifierPressed(Event::KeyModifier modifierKey) override;
86
92 void setClipboard(const String& contents) override;
93
99 TGUI_NODISCARD String getClipboard() const override;
100
101#ifdef TGUI_SYSTEM_ANDROID
110 TGUI_NODISCARD std::unique_ptr<std::uint8_t[]> readFileFromAndroidAssets(const String& filename, std::size_t& fileSize) const override;
111#endif
112 };
113
115}
116
117TGUI_IGNORE_DEPRECATED_WARNINGS_END
118
120
121#endif // TGUI_BACKEND_RAYLIB_HPP
Base class for the Gui.
Definition BackendGui.hpp:45
Definition BackendRaylib.hpp:46
String getClipboard() const override
Returns the contents of the clipboard.
void setMouseCursorStyle(Cursor::Type type, const std::uint8_t *pixels, Vector2u size, Vector2u hotspot) override
Changes the look of a certain mouse cursor by using a bitmap.
void resetMouseCursorStyle(Cursor::Type type) override
Changes the look of a certain mouse cursor back to the system theme.
void setClipboard(const String &contents) override
Changes the contents of the clipboard.
void setMouseCursor(BackendGui *gui, Cursor::Type type) override
Changes the mouse cursor when the mouse is on top of the window to which the gui is attached.
bool isKeyboardModifierPressed(Event::KeyModifier modifierKey) override
Checks the state for one of the modifier keys.
virtual std::unique_ptr< std::uint8_t[]> readFileFromAndroidAssets(const String &filename, std::size_t &fileSize) const
Uses the AssetManager on Android to read a file and return its contents.
Backend()=default
Default constructor.
Type
List of available cursors.
Definition Cursor.hpp:48
Wrapper class to store strings.
Definition String.hpp:94
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36
Definition Event.hpp:38