#include <window.h>
Public Member Functions | |
| Window (Gfx::Driver *gfx, Cursor *cursor) | |
| void | handleMouseMove () |
| void | handleClick () |
| void | handleRightClick () |
| void | handleDoubleClick () |
| void | handleGameLoop () |
| void | render () |
| bool | isMouseInside () const |
| bool | isVisible () const |
| Graphics::Surface * | getScreenshot () const |
Protected Member Functions | |
| virtual void | onMouseMove (const Common::Point &pos) |
| virtual void | onClick (const Common::Point &pos) |
| virtual void | onRightClick (const Common::Point &pos) |
| virtual void | onDoubleClick (const Common::Point &pos) |
| virtual void | onGameLoop () |
| virtual void | onRender ()=0 |
| Common::Point | getRelativeMousePosition () const |
Protected Attributes | |
| Gfx::Driver * | _gfx |
| Cursor * | _cursor |
| Common::Rect | _position |
| bool | _visible |
A window is a portion of the game screen.
A window can handle events happening in its screen portion, as well as render graphics to that same screen portion.
Coordinates inside a window are relative to its top left corner. Rendering happens in a viewport matching the window's screen portion.
| void Stark::Window::handleMouseMove | ( | ) |
Called by the user interface when the mouse moves inside the window
| void Stark::Window::handleClick | ( | ) |
Called by the user interface when the mouse is clicked inside the window
| void Stark::Window::handleRightClick | ( | ) |
Called by the user interface when the mouse is right clicked inside the window
| void Stark::Window::handleDoubleClick | ( | ) |
Called by the user interface when the mouse is double clicked inside the window
| void Stark::Window::handleGameLoop | ( | ) |
Called once per game loop when the screen is active.
| void Stark::Window::render | ( | ) |
Called by the user interface in the render phase of the game loop
| bool Stark::Window::isMouseInside | ( | ) | const |
Is the mouse inside the window?
| bool Stark::Window::isVisible | ( | ) | const |
Is the window visible
| Graphics::Surface* Stark::Window::getScreenshot | ( | ) | const |
Grab a screenshot of the window if it is visible