|
Sparkle 0.0.1
|
Widget that forwards input and paint events to a GameEngine. More...
#include <spk_game_engine_widget.hpp>


Public Member Functions | |
| GameEngineWidget (const std::wstring &p_name, spk::Widget *p_parent) | |
| Builds a game engine widget. | |
| void | setGameEngine (spk::GameEngine *p_engine) |
| Sets the game engine to drive rendering and input. | |
| spk::GameEngine * | gameEngine () |
| Returns the current game engine pointer. | |
| const spk::GameEngine * | gameEngine () const |
| Returns the current game engine pointer. | |
| Public Member Functions inherited from spk::Widget | |
| void | takeFocus (FocusType p_focusType) |
| Grants this widget ownership of the requested focus type. | |
| void | releaseFocus (FocusType p_focusType) |
| Releases a previously acquired focus type. | |
| bool | hasFocus (FocusType p_focusType) const |
| Checks if this widget currently owns a focus type. | |
| void | takeAllFocus () |
| Acquires both keyboard and mouse focus. | |
| void | releaseAllFocus () |
| Releases both keyboard and mouse focus types. | |
| Widget (const std::wstring &p_name, Widget *p_parent) | |
| Builds a widget optionally attached to a parent. | |
| void | addChild (Widget *p_child) override |
| Adds a child widget and sorts the hierarchy by layer. | |
| const float & | layer () const |
| Current rendering layer of the widget. | |
| void | setLayer (const float &p_newLayer) |
| Updates the widget layer and propagates relative offsets to children. | |
| const std::wstring & | name () const |
| Retrieves the widget name. | |
| void | setName (const std::wstring &p_name) |
| Sets the widget name. | |
| void | setGeometry (const spk::Extend2D &p_geometry) override |
| Requests a specific viewport and scissor region for the widget. | |
| const spk::Extend2D & | geometry () const |
| Returns the current widget geometry. | |
| const spk::OpenGL::ViewRegion & | viewRegion () const |
| Accesses the computed view region. | |
| const spk::OpenGL::FrameBufferObject & | frameBufferObject () const |
| Returns the frame buffer object used for widget rendering. | |
| const spk::OpenGL::FrameBufferObject & | fbo () const |
| Alias for frameBufferObject(). | |
| void | requireGeometryChange () |
| Marks the widget view region as needing recomputation. | |
| Public Member Functions inherited from spk::InherenceObject< Widget > | |
| virtual void | removeChild (Widget *p_child) |
| Removes a child from this node. | |
| Widget * | parent () const |
| Returns the parent pointer. | |
| virtual std::vector< Widget * > & | children () |
| Returns the children vector. | |
| void | clearChildren () |
| Clears the children list and resets each child's parent pointer. | |
| Public Member Functions inherited from spk::ActivableObject | |
| ActivableObject () | |
| Builds a deactivated object. | |
| ActivableObject (ActivationStatus p_initial) | |
| Builds with a custom initial activation state. | |
| void | activate () |
| Sets the state to Activated. | |
| void | deactivate () |
| Sets the state to Deactivated. | |
| void | toggle () |
| Toggles between activated and deactivated states. | |
| bool | isActive () const |
| Checks whether the object is currently activated. | |
| Contract | addActivationCallback (const Job &p_callback) |
| Registers a callback executed when the object activates. | |
| Contract | addDeactivationCallback (const Job &p_callback) |
| Registers a callback executed when the object deactivates. | |
| Public Member Functions inherited from spk::StatefulObject< ActivationStatus > | |
| StatefulObject (const ActivationStatus &p_initialState) | |
| Builds with an initial state. | |
| StatefulObject & | operator= (const StatefulObject &p_other)=delete |
| void | setState (const ActivationStatus &p_newState) |
| Sets a new state and triggers callbacks registered for it. | |
| ActivationStatus | state () const |
| Returns the current state. | |
| Contract | addCallback (const ActivationStatus &p_state, const Job &p_callback) |
| Subscribes a callback for a specific state. | |
| Public Member Functions inherited from spk::ResizableElement | |
| SizeHint & | sizeHint () |
| Returns mutable size hint data. | |
| const SizeHint & | sizeHint () const |
| Returns const size hint data. | |
Protected Member Functions | |
| void | _onGeometryChange () override |
| Updates engine viewport when geometry changes. | |
| void | _onPaintEvent (spk::PaintEvent &p_event) override |
| Paint event forwarded to the game engine. | |
| void | _onKeyPressEvent (spk::KeyPressEvent &p_event) override |
| Forwards key press events to the game engine. | |
| void | _onKeyReleaseEvent (spk::KeyReleaseEvent &p_event) override |
| Forwards key release events to the game engine. | |
| void | _onGlyphEvent (spk::GlyphEvent &p_event) override |
| Forwards glyph input events to the game engine. | |
| void | _onMousePressEvent (spk::MousePressEvent &p_event) override |
| Forwards mouse press events to the game engine. | |
| void | _onMouseReleaseEvent (spk::MouseReleaseEvent &p_event) override |
| Forwards mouse release events to the game engine. | |
| void | _onMouseDoubleClickEvent (spk::MouseDoubleClickEvent &p_event) override |
| Forwards mouse double click events to the game engine. | |
| void | _onMouseMotionEvent (spk::MouseMotionEvent &p_event) override |
| Forwards mouse motion events to the game engine. | |
| void | _onMouseWheelEvent (spk::MouseWheelEvent &p_event) override |
| Forwards mouse wheel events to the game engine. | |
| void | _onEnterResizeModeEvent (spk::EnterResizeModeEvent &p_event) override |
| Forwards enter resize mode events to the game engine. | |
| void | _onResizeEvent (spk::ResizeEvent &p_event) override |
| Forwards resize events to the game engine. | |
| void | _onExitResizeModeEvent (spk::ExitResizeModeEvent &p_event) override |
| Forwards exit resize mode events to the game engine. | |
| void | _onQuitEvent (spk::QuitEvent &p_event) override |
| Forwards quit events to the game engine. | |
| void | _onMoveEvent (spk::MoveEvent &p_event) override |
| Forwards move events to the game engine. | |
| void | _onFullScreenModeEvent (spk::FullScreenModeEvent &p_event) override |
| Forwards fullscreen mode events to the game engine. | |
| void | _onMaximizedModeEvent (spk::MaximizedModeEvent &p_event) override |
| Forwards maximized mode events to the game engine. | |
| void | _onFocusEvent (spk::FocusEvent &p_event) override |
| Forwards focus events to the game engine. | |
| void | _onUpdateEvent (spk::UpdateEvent &p_event) override |
| Forwards update events to the game engine. | |
Additional Inherited Members | |
| Public Types inherited from spk::Widget | |
| enum class | FocusType { Keyboard = 0 , Mouse = 1 } |
| Types of focus a widget can own. | |
| Public Types inherited from spk::ActivableObject | |
| using | Contract = StatefulObject<ActivationStatus>::Contract |
| Subscription handle controlling callback lifetime. | |
| using | Job = StatefulObject<ActivationStatus>::Job |
| Callback signature executed on activation state changes. | |
| Public Types inherited from spk::StatefulObject< ActivationStatus > | |
| using | Contract |
| Handle allowing subscribers to manage callback lifetimes. | |
| using | Job |
| Callable invoked when the object transitions to a state. | |
| Static Public Member Functions inherited from spk::Widget | |
| static Widget * | focusedWidget (FocusType p_focusType) |
| Retrieves the widget currently owning a focus type. | |
| Static Public Attributes inherited from spk::Widget | |
| static const size_t | NbFocusType = 2 |
| Number of focus slots tracked at runtime. | |
Widget that forwards input and paint events to a GameEngine.
| spk::GameEngineWidget::GameEngineWidget | ( | const std::wstring & | p_name, |
| spk::Widget * | p_parent ) |
Builds a game engine widget.
| p_name | Widget name. |
| p_parent | Parent widget. |

|
overrideprotectedvirtual |
Forwards enter resize mode events to the game engine.
| p_event | Enter resize mode event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards exit resize mode events to the game engine.
| p_event | Exit resize mode event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards focus events to the game engine.
| p_event | Focus event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards fullscreen mode events to the game engine.
| p_event | Fullscreen event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Updates engine viewport when geometry changes.
Reimplemented from spk::Widget.

|
overrideprotectedvirtual |
Forwards glyph input events to the game engine.
| p_event | Glyph event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards key press events to the game engine.
| p_event | Key press event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards key release events to the game engine.
| p_event | Key release event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards maximized mode events to the game engine.
| p_event | Maximized event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards mouse double click events to the game engine.
| p_event | Mouse double click event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards mouse motion events to the game engine.
| p_event | Mouse motion event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards mouse press events to the game engine.
| p_event | Mouse press event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards mouse release events to the game engine.
| p_event | Mouse release event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards mouse wheel events to the game engine.
| p_event | Mouse wheel event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards move events to the game engine.
| p_event | Move event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Paint event forwarded to the game engine.
| p_event | Paint event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards quit events to the game engine.
| p_event | Quit event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards resize events to the game engine.
| p_event | Resize event payload. |
Reimplemented from spk::Widget.
|
overrideprotectedvirtual |
Forwards update events to the game engine.
| p_event | Update event payload. |
Reimplemented from spk::Widget.
| spk::GameEngine * spk::GameEngineWidget::gameEngine | ( | ) |
Returns the current game engine pointer.
| const spk::GameEngine * spk::GameEngineWidget::gameEngine | ( | ) | const |
Returns the current game engine pointer.
| void spk::GameEngineWidget::setGameEngine | ( | spk::GameEngine * | p_engine | ) |
Sets the game engine to drive rendering and input.
| p_engine | Game engine pointer. |
