1.10 |
Screen in an SDL window. More...
#include <sdlscreen.h>
Public Member Functions | |
SDLScreen (Application &app, const Size &size=Size(800, 480), const std::string &name={}) | |
SDLScreen (const SDLScreen &)=delete | |
SDLScreen (SDLScreen &&)=delete | |
~SDLScreen () override | |
void | flip (const DamageArray &damage) override |
Perform a flip of the buffers. | |
SDLScreen & | operator= (const SDLScreen &)=delete |
SDLScreen & | operator= (SDLScreen &&)=delete |
void | quit () |
void | schedule_flip () override |
Schedule a flip to occur later. | |
Public Member Functions inherited from Screen | |
Screen () noexcept | |
Screen (const Screen &)=default | |
Screen (Screen &&) noexcept=default | |
virtual | ~Screen () noexcept=default |
void | async_flip (bool async) |
Set if asynchronous buffer flips are used. | |
EGT_NODISCARD Rect | box () const |
Bounding box for the screen. | |
virtual EGT_NODISCARD size_t | brightness () const |
Get the current brightness of the screen. | |
virtual void | brightness (size_t brightness) |
Set the brightness of the screen. | |
EGT_NODISCARD shared_cairo_t | context () const |
Get the context for the screen. | |
EGT_NODISCARD PixelFormat | format () const |
Get the format of the screen. | |
virtual EGT_NODISCARD bool | have_planes () const |
Returns true if the screen supports planes. | |
virtual void | high_fidelity () |
Configure high fidelity options. | |
virtual uint32_t | index () |
If the screen implementation manages multiple buffers, this will return the index of the current buffer. | |
virtual EGT_NODISCARD bool | is_composer () const |
Returns true if this is a screen used with the Microchip Graphic Composer. | |
virtual void | low_fidelity () |
Configure low fidelity options. | |
virtual EGT_NODISCARD size_t | max_brightness () const |
Get the max brightness of the screen. | |
Screen & | operator= (const Screen &)=default |
Screen & | operator= (Screen &&) noexcept=default |
EGT_NODISCARD Size | size () const |
Size of the screen. | |
Protected Member Functions | |
void | key_event (EventId e, const Key &key) |
void | pointer_event (EventId e, const Pointer &pointer) |
void | sdl_draw (const DamageArray &damage) |
Protected Member Functions inherited from Screen | |
virtual void | copy_to_buffer (ScreenBuffer &buffer) |
Copy the framebuffer to the current composition buffer. | |
void | copy_to_buffer_software (ScreenBuffer &buffer) |
Copy the framebuffer to the current composition buffer. | |
void | init (const Size &size, PixelFormat format=PixelFormat::argb8888) |
void | init (void **ptr, uint32_t count, const Size &size, PixelFormat format=PixelFormat::argb8888) |
Static Protected Member Functions | |
static KeyboardCode | sdl_to_egtkeys (int key) |
Protected Attributes | |
Application & | m_app |
Application reference. | |
SDLInput | m_in |
Custom input for dispatching events. | |
asio::io_context | m_io |
Internal io context. | |
std::atomic< bool > | m_quit {false} |
Flag to quit thread. | |
std::thread | m_thread |
Internal thread for event processing. | |
Protected Attributes inherited from Screen | |
bool | m_async {false} |
Perform flips asynchronously if supported. | |
BufferArray | m_buffers |
Screen buffer array. | |
shared_cairo_t | m_cr |
Composition surface context. | |
PixelFormat | m_format {} |
Format of the screen. | |
Size | m_size |
Size of the screen. | |
shared_cairo_surface_t | m_surface |
Composition surface. | |
Additional Inherited Members | |
Public Types inherited from Screen | |
using | DamageArray = std::vector< Rect > |
Type used for damage arrays. | |
Static Public Member Functions inherited from Screen | |
static void | damage_algorithm (Screen::DamageArray &damage, Rect rect) |
This function implements the algorithm for adding damage rectangles to a list. | |
Protected Types inherited from Screen | |
using | BufferArray = std::vector< ScreenBuffer > |
Type used for an array of ScreenBuffer objects. | |
Screen in an SDL window.
|
explicit |
app | Application instance this screen is associated with. |
size | Size of the screen. |
|
override |
|
overridevirtual |
Perform a flip of the buffers.
This iterates the buffers and puts the composition buffer into the screen buffers.
Reimplemented from Screen.
|
inline |
|
inlineoverridevirtual |
Schedule a flip to occur later.
This is needed if a flip should occur sometime in the future to the hardware.
Implements Screen.
|
protected |
|
staticprotected |
|
protected |
Application reference.
|
protected |
Custom input for dispatching events.
|
protected |
Internal io context.
|
protected |
Flag to quit thread.
|
protected |
Internal thread for event processing.