26#ifndef TGUI_BACKEND_GUI_SDL_HPP
27#define TGUI_BACKEND_GUI_SDL_HPP
29#include <TGUI/extlibs/IncludeSDL.hpp>
30#if SDL_MAJOR_VERSION < 3
31 #include <SDL_touch.h>
34#include <TGUI/Config.hpp>
35#if TGUI_BUILD_AS_CXX_MODULE
38 #include <TGUI/Backend/Window/BackendGui.hpp>
43TGUI_MODULE_EXPORT
namespace tgui
76 using BackendGui::handleEvent;
168 void updateContainerSize()
override;
179#if ((SDL_MAJOR_VERSION == 2) && (SDL_MINOR_VERSION < 26))
183 virtual void updateFramebufferSize() = 0;
189 SDL_Window* m_window =
nullptr;
190 float m_dpiScale = 1;
192 bool m_textInputStarted =
false;
193 SDL_Rect m_textInputRect = {};
195 bool m_touchFirstFingerDown =
false;
196 SDL_FingerID m_touchFirstFingerId = 0;
197 SDL_TouchID m_touchFirstFingerTouchId = 0;
Definition BackendGuiSDL.hpp:48
void startTextInput(FloatRect inputRect) override
This function is called by TGUI when focusing a text field (EditBox or TextArea). It may result in th...
TGUI_NODISCARD bool convertEvent(const SDL_Event &eventSDL, Event &eventTGUI)
Helper function that converts an SDL event to a TGUI event.
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.
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:48
Wrapper for colors.
Definition Color.hpp:72
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:39