25#ifndef TGUI_BACKEND_GUI_GLFW_HPP
26#define TGUI_BACKEND_GUI_GLFW_HPP
28#include <TGUI/Config.hpp>
29#if !TGUI_BUILD_AS_CXX_MODULE
30 #include <TGUI/Backend/Window/BackendGui.hpp>
31 #include <TGUI/Optional.hpp>
36#if !TGUI_BUILD_AS_CXX_MODULE
37 using GLFWwindow =
struct GLFWwindow;
42TGUI_IGNORE_DEPRECATED_WARNINGS_START
44TGUI_MODULE_EXPORT
namespace tgui
94 bool keyCallback(
int key,
int scancode,
int action,
int mods);
158 TGUI_NODISCARD Optional<Event> convertWindowFocusEvent(
int focused);
167 TGUI_NODISCARD Optional<Event> convertSizeEvent(
int width,
int height);
175 TGUI_NODISCARD Optional<Event> convertCharEvent(
unsigned int codepoint);
186 TGUI_NODISCARD Optional<Event> convertKeyEvent(
int key,
int scancode,
int action,
int mods);
195 TGUI_NODISCARD Optional<Event> convertScrollEvent(
double xoffset,
double yoffset);
204 TGUI_NODISCARD Optional<Event> convertCursorPosEvent(
double xpos,
double ypos);
214 TGUI_NODISCARD Optional<Event> convertMouseButtonEvent(
int button,
int action,
int mods);
222 TGUI_NODISCARD Optional<Event> convertCursorEnterEvent(
int entered);
264 void updateContainerSize()
override;
269 GLFWwindow* m_window =
nullptr;
275TGUI_IGNORE_DEPRECATED_WARNINGS_END
Definition BackendGuiGLFW.hpp:49
GLFWwindow * getWindow() const
Returns the window that was provided to the gui.
bool mouseButtonCallback(int button, int action, int mods)
Inform the gui about a mouse button event when a callback from glfwSetMouseButtonCallback occurs.
void setGuiWindow(GLFWwindow *window)
Sets the window on which the gui should be drawn.
bool cursorEnterCallback(int entered)
Inform the gui that the mouse has left or entered the window when a callback from glfwSetCursorEnterC...
bool scrollCallback(double xoffset, double yoffset)
Inform the gui about a scroll event when a callback from glfwSetScrollCallback occurs.
bool charCallback(unsigned int codepoint)
Inform the gui about a char event when a callback from glfwSetCharCallback occurs.
BackendGuiGLFW()
Default constructor.
bool isKeyboardModifierPressed(Event::KeyModifier modifierKey) const override
Checks the state for one of the modifier keys.
void mainLoop(Color clearColor={240, 240, 240}) override
Give the gui control over the main loop.
void updateTextCursorPosition(FloatRect inputRect, Vector2f caretPos) override
This function is called by TGUI when the position of the caret changes in a text field (EditBox or Te...
bool keyCallback(int key, int scancode, int action, int mods)
Inform the gui about a key event when a callback from glfwSetKeyCallback occurs.
bool sizeCallback(int width, int height)
Inform the gui about a framebuffer size event when a callback from glfwSetFramebufferSizeCallback occ...
bool cursorPosCallback(double xpos, double ypos)
Inform the gui about a cursor position event when a callback from glfwSetCursorPosCallback occurs.
bool windowFocusCallback(int focused)
Inform the gui about a focus event when a callback from glfwSetWindowFocusCallback occurs.
~BackendGuiGLFW()
Destructor.
Base class for the Gui.
Definition BackendGui.hpp:47
Wrapper for colors.
Definition Color.hpp:73
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
KeyModifier
Modifiers keys.
Definition Event.hpp:157