sfml_impl 0.1.0
Vendor SFML 3.0.2 : IGraphic2Module / IAudioModule
Loading...
Searching...
No Matches
SfmlWindow Class Reference

Sfml Window class - implements IWindow2 only, sfml has no 3D. More...

#include <SfmlWindow.hpp>

Inheritance diagram for SfmlWindow:
Collaboration diagram for SfmlWindow:

Public Member Functions

 SfmlWindow (int32_t screenWidth, int32_t screenHeight, std::string title)
 
 ~SfmlWindow ()=default
 
bool isOpen () override
 
void close () override
 
Vector2f getPosition () override
 
void setPosition (Vector2f position) override
 
Vector2f getSize () override
 
void setSize (Vector2f size) override
 
void setFrameLimit (int32_t limit) override
 
void setMouseVisibility (bool visible) override
 
int32_t getDelta () override
 
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
 
void beginDraw () override
 
void endDraw () override
 
void drawPoly (graphic::IPolygon *polygon) override
 
void drawSprite (graphic::ISprite *sprite) override
 
void drawText (graphic::IText *text) override
 

Friends

class SfmlKeyboard
 
class SfmlMouse
 
class SfmlGamepad
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SfmlWindow()

SfmlWindow::SfmlWindow ( int32_t  screenWidth,
int32_t  screenHeight,
std::string  title 
)
inline

◆ ~SfmlWindow()

SfmlWindow::~SfmlWindow ( )
default

Member Function Documentation

◆ beginDraw()

void SfmlWindow::beginDraw ( )
inlineoverride

◆ close()

void SfmlWindow::close ( )
inlineoverride

◆ endDraw()

void SfmlWindow::endDraw ( )
inlineoverride

◆ eventClose()

void SfmlWindow::eventClose ( )
inlineoverride

◆ getDelta()

int32_t SfmlWindow::getDelta ( )
inlineoverride

◆ getPosition()

Vector2f SfmlWindow::getPosition ( )
inlineoverride

◆ getSize()

Vector2f SfmlWindow::getSize ( )
inlineoverride

◆ isOpen()

bool SfmlWindow::isOpen ( )
inlineoverride

◆ pollEvent()

bool SfmlWindow::pollEvent ( )
inlineoverride

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.

◆ setFrameLimit()

void SfmlWindow::setFrameLimit ( int32_t  limit)
inlineoverride

◆ setMouseVisibility()

void SfmlWindow::setMouseVisibility ( bool  visible)
inlineoverride

◆ setPosition()

void SfmlWindow::setPosition ( Vector2f  position)
inlineoverride

◆ setSize()

void SfmlWindow::setSize ( Vector2f  size)
inlineoverride

Friends And Related Symbol Documentation

◆ SfmlGamepad

friend class SfmlGamepad
friend

◆ SfmlKeyboard

friend class SfmlKeyboard
friend

◆ SfmlMouse

friend class SfmlMouse
friend

The documentation for this class was generated from the following file: