|
| | SfmlWindow (int32_t screenWidth, int32_t screenHeight, std::string title) |
| | ~SfmlWindow ()=default |
| bool | isOpen () override |
| | notice if the window is open
|
| void | close () override |
| | close the window
|
| Vector2f | getPosition () override |
| | Where the window sits on the desktop, in pixels, origin top-left of the primary screen.
|
| void | setPosition (Vector2f position) override |
| | Move the window on the desktop.
|
| Vector2f | getSize () override |
| | The drawable area, in pixels - NOT the desktop size. A hit-test built on IMouse::getPosition() compares against this one.
|
| void | setSize (Vector2f size) override |
| | Resize the drawable area.
|
| void | setFrameLimit (int32_t limit) override |
| | Set the Frame Limit object.
|
| void | setMouseVisibility (bool visible) override |
| | Show or hide the system cursor over THIS window.
|
| int32_t | getDelta () override |
| | Get the Delta object.
|
| bool | pollEvent () override |
| | Drains the whole queue into _events and folds it into state. Called again in the same frame it finds the native queue empty, appends nothing, and answers the same thing.
|
| void | eventClose () override |
| | notice the window that a close was requested
|
| void | beginDraw () override |
| | allowing to draw 2D on the window
|
| void | endDraw () override |
| | end the 2D drawing
|
| void | drawPoly (graphic::IPolygon *polygon) override |
| | draw a polygon
|
| void | drawSprite (graphic::ISprite *sprite) override |
| | draw a sprite
|
| void | drawText (graphic::IText *text) override |
| | draw a text
|
| virtual | ~IWindow2 ()=default |
| virtual | ~IWindow ()=default |
| | Destroy the IWindow object.
|
Sfml Window class - implements IWindow2 only, sfml has no 3D.
All input state is rebuilt from the window's own events, never through a global OS query : sf::Keyboard::isKeyPressed() would need the "Input
Monitoring" permission on macOS, while events reach the focused window normally.
sfml has a queue and raylib has not, so this is where the two are made to agree : pollEvent() drains the whole queue into _events and folds it into state, endDraw() drops it. Between the two, every read is idempotent - which is what lets an arcade and the game running inside it read the same key in the same frame without either one stealing it.
| void SfmlWindow::setMouseVisibility |
( |
bool | visible | ) |
|
|
inlineoverridevirtual |
Show or hide the system cursor over THIS window.
For any game that draws its own pointer - a crosshair, a selection ring - where the native arrow sitting on top of it is just a second, wrong cursor.
Scoped to the window, not to the desktop : leaving it puts the arrow back, and closing the window can never strand the user without a pointer. Vendors whose cursor is process-wide (raylib) restore it on close for the same reason.
Hiding does NOT capture the mouse : IMouse::getPosition() keeps answering, and the pointer still leaves the window normally.
- Parameters
-
Implements graphic::IWindow.