25#ifndef TGUI_BACKEND_GUI_SDL_HPP
26#define TGUI_BACKEND_GUI_SDL_HPP
28#include <TGUI/extlibs/IncludeSDL.hpp>
29#if SDL_MAJOR_VERSION < 3
30 #include <SDL_touch.h>
33#include <TGUI/Config.hpp>
34#if !TGUI_BUILD_AS_CXX_MODULE
35 #include <TGUI/Backend/Window/BackendGui.hpp>
40TGUI_MODULE_EXPORT
namespace tgui
72 using BackendGui::handleEvent;
165 void updateContainerSize()
override;
175#if ((SDL_MAJOR_VERSION == 2) && (SDL_MINOR_VERSION < 26))
179 virtual void updateFramebufferSize() = 0;
185 SDL_Window* m_window =
nullptr;
186 float m_dpiScale = 1;
188 bool m_textInputStarted =
false;
189 SDL_Rect m_textInputRect = {};
191 bool m_touchFirstFingerDown =
false;
192 SDL_FingerID m_touchFirstFingerId = 0;
193 SDL_TouchID m_touchFirstFingerTouchId = 0;
Definition BackendGuiSDL.hpp:45
void startTextInput(FloatRect inputRect) override
This function is called by TGUI when focusing a text field (EditBox or TextArea). It may result in th...
void mainLoop(Color clearColor={240, 240, 240}) override
Give the gui control over the main loop.
BackendGuiSDL()=default
Default constructor.
SDL_Window * getWindow() const
Returns the window that was provided to the gui.
void setGuiWindow(SDL_Window *window)
Sets the window on which the gui should be drawn.
bool convertEvent(const SDL_Event &eventSDL, Event &eventTGUI)
Helper function that converts an SDL event to a TGUI event.
bool isKeyboardModifierPressed(Event::KeyModifier modifierKey) const override
Checks the state for one of the modifier keys.
void stopTextInput() override
This function is called by TGUI when unfocusing a text field (EditBox or TextArea)....
bool handleEvent(const SDL_Event &event)
Passes the event to the widgets.
virtual void presentScreen()=0
Shows the drawn content with SDL_GL_SwapWindow or SDL_RenderPresent, depending on the renderer.
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...
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