TGUI
0.9.5
|
Backend that uses SDL. More...
#include <TGUI/Backends/SDL/BackendSDL.hpp>
Public Member Functions | |
BackendSDL () | |
Default constructor. | |
~BackendSDL () | |
Destructor. | |
void | attachGui (GuiBase *gui) override |
Informs the backend that a new gui object has been created. | |
void | detatchGui (GuiBase *gui) override |
Informs the backend that a gui object is being destroyed. | |
Font | createDefaultFont () override |
Creates and returns the default font for all widgets. | |
std::shared_ptr< BackendFontBase > | createFont () override |
Creates a new font object. | |
std::shared_ptr< BackendTextBase > | createText () override |
Creates a new text object. | |
std::shared_ptr< BackendTextureBase > | createTexture () override |
Creates a new texture object. | |
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 | setMouseCursor (GuiBase *gui, Cursor::Type type) override |
Changes the mouse cursor when the mouse is on top of the window to which the gui is attached. | |
void | openVirtualKeyboard (const FloatRect &inputRect) override |
Opens the virtual keyboard on Android and iOS. | |
void | closeVirtualKeyboard () override |
Closes the virtual keyboard on Android and iOS. | |
bool | isKeyboardModifierPressed (Event::KeyModifier modifierKey) override |
Checks the state for one of the modifier keys. | |
void | setClipboard (const String &contents) override |
Changes the contents of the clipboard. | |
String | getClipboard () const override |
Returns the contents of the clipboard. | |
std::shared_ptr< BackendRenderTargetSDL > | createGuiRenderTarget (GuiSDL *gui, SDL_Window *window) |
Sets the SDL window to which the gui will render and returns a new render target object to interact with. | |
void | changeTexture (GLuint textureId, bool force) |
Changes the bound texture if another texture was currently set. | |
Public Member Functions inherited from tgui::BackendBase | |
BackendBase ()=default | |
Default constructor. | |
BackendBase (const BackendBase &)=delete | |
BackendBase & | operator= (const BackendBase &)=delete |
virtual | ~BackendBase ()=default |
Virtual destructor. | |
void | setDestroyOnLastGuiDetatch (bool destroyOnDetatch) |
Informs the backend whether it should destroy itself when the last Gui is detached from it. | |
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. | |
Static Public Member Functions | |
static bool | convertEvent (const SDL_Event &eventSDL, Event &eventTGUI) |
Helper function that converts an SDL event to a TGUI event. | |
Additional Inherited Members | |
Protected Attributes inherited from tgui::BackendBase | |
bool | m_destroyOnLastGuiDetatch = false |
String | m_clipboardContents |
Backend that uses SDL.
|
overridevirtual |
Informs the backend that a new gui object has been created.
gui | Newly created gui |
Implements tgui::BackendBase.
void tgui::BackendSDL::changeTexture | ( | GLuint | textureId, |
bool | force | ||
) |
Changes the bound texture if another texture was currently set.
textureId | Texture to pass to glBindTexture |
force | Call glBindTexture even if the id was still the same. This is required when calling this function after creating a new texture, as it could be reusing the id that was previously cached. |
This function has to be used instead of glBindTexture so that the backend knows the last used texture
|
overridevirtual |
Closes the virtual keyboard on Android and iOS.
Implements tgui::BackendBase.
|
static |
Helper function that converts an SDL event to a TGUI event.
eventSFML | The input SDL event |
eventTGUI | The output TGUI event |
|
overridevirtual |
Creates and returns the default font for all widgets.
Implements tgui::BackendBase.
|
overridevirtual |
Creates a new font object.
Implements tgui::BackendBase.
std::shared_ptr< BackendRenderTargetSDL > tgui::BackendSDL::createGuiRenderTarget | ( | GuiSDL * | gui, |
SDL_Window * | window | ||
) |
Sets the SDL window to which the gui will render and returns a new render target object to interact with.
gui | The gui for which the render target should be created |
window | SDL window to draw on |
|
overridevirtual |
Creates a new text object.
Implements tgui::BackendBase.
|
overridevirtual |
Creates a new texture object.
Implements tgui::BackendBase.
|
overridevirtual |
Informs the backend that a gui object is being destroyed.
gui | Gui object that is about to be deconstructed |
Implements tgui::BackendBase.
|
overridevirtual |
Returns the contents of the clipboard.
Reimplemented from tgui::BackendBase.
|
overridevirtual |
Checks the state for one of the modifier keys.
modifierKey | The modifier key of which the state is being queried |
Implements tgui::BackendBase.
|
overridevirtual |
Opens the virtual keyboard on Android and iOS.
inputRect | Part of the screen where the text input is located |
Implements tgui::BackendBase.
|
overridevirtual |
Changes the look of a certain mouse cursor back to the system theme.
type | Cursor that should no longer use a custom bitmap |
Implements tgui::BackendBase.
|
overridevirtual |
Changes the contents of the clipboard.
contents | New contents of the clipboard |
Reimplemented from tgui::BackendBase.
|
overridevirtual |
Changes the mouse cursor when the mouse is on top of the window to which the gui is attached.
gui | The gui that represents the window for which the mouse cursor should be changed |
type | Which cursor to use |
Implements tgui::BackendBase.
|
overridevirtual |
Changes the look of a certain mouse cursor by using a bitmap.
type | Cursor that should make use of the bitmap |
pixels | Pointer to an array with 4*size.x*size.y elements, representing the pixels in 32-bit RGBA format |
size | Size of the cursor |
hotspot | Pixel coordinate within the cursor image which will be located exactly at the mouse pointer position |
Implements tgui::BackendBase.