ECSTASY
All in the name
Loading...
Searching...
No Matches
ecstasy::integration::sfml Namespace Reference

SFML integration. More...

Classes

class  Encoding
 
class  PollEvents
 Poll events system, polling the events from the RenderWindow resource if present. More...
 
class  RenderWindow
 SFML RenderWindow wrapper. More...
 

Typedefs

using EventListener = std::function< bool(const sf::Event &)>
 Event listener type.
 

Functions

static event::Gamepad::Button getGamepadButton (unsigned int sfmlButton)
 
static event::Gamepad::Axis getGamepadAxis (int sfmlAxis)
 

Detailed Description

SFML integration.

Includes events forward to the event integration.

Note
Enabled by ECSTASY_INTEGRATIONS_SFML.
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2022-11-18)

Typedef Documentation

◆ EventListener

using ecstasy::integration::sfml::EventListener = typedef std::function<bool(const sf::Event &)>

Event listener type.

Parameters
[in]eventEvent to handle.
Returns
true If the event was handled (ie must not be processed anymore).
Author
Andréas Leroux (andre.nosp@m.as.l.nosp@m.eroux.nosp@m.@epi.nosp@m.tech..nosp@m.eu)
Since
1.0.0 (2024-09-26)

Definition at line 32 of file RenderWindow.hpp.

Function Documentation

◆ getGamepadAxis()

static event::Gamepad::Axis ecstasy::integration::sfml::getGamepadAxis ( int  sfmlAxis)
static

Definition at line 47 of file PollEvents.cpp.

48 {
49 switch (sfmlAxis) {
50 case 0: return event::Gamepad::Axis::LeftX;
51 case 1: return event::Gamepad::Axis::LeftY;
52 case 2: return event::Gamepad::Axis::TriggerLeft;
53 case 3: return event::Gamepad::Axis::TriggerRight;
54 case 4: return event::Gamepad::Axis::RightX;
55 case 5: return event::Gamepad::Axis::RightY;
56 case 6: return event::Gamepad::Axis::DPadX;
57 case 7: return event::Gamepad::Axis::DPadY;
58
59 default: return event::Gamepad::Axis::Unknown;
60 }
61 }

◆ getGamepadButton()

static event::Gamepad::Button ecstasy::integration::sfml::getGamepadButton ( unsigned int  sfmlButton)
static

Definition at line 28 of file PollEvents.cpp.

29 {
30 switch (sfmlButton) {
31 case 0: return event::Gamepad::Button::FaceDown;
32 case 1: return event::Gamepad::Button::FaceRight;
33 case 2: return event::Gamepad::Button::FaceLeft;
34 case 3: return event::Gamepad::Button::FaceUp;
35 case 4: return event::Gamepad::Button::BumperLeft;
36 case 5: return event::Gamepad::Button::BumperRight;
37 case 6: return event::Gamepad::Button::MiddleLeft;
38 case 7: return event::Gamepad::Button::MiddleRight;
39 case 8: return event::Gamepad::Button::Middle;
40 case 9: return event::Gamepad::Button::ThumbLeft;
41 case 10: return event::Gamepad::Button::ThumbRight;
42
43 default: return event::Gamepad::Button::Unknown;
44 }
45 }