13#ifndef SFMLGRAPHIC_MODULE_HPP
14#define SFMLGRAPHIC_MODULE_HPP
16#include "IGraphic2Module.hpp"
40 const char *
type()
const override {
return IGraphic2Module::contract; }
41 const char *
name()
const override {
return "sfml"; }
44 graphic::IWindow2 *
createWindow(int32_t screenWidth, int32_t screenHeight, std::string title)
override {
60 graphic::IWindow2 *
window()
override {
return _window; }
67 void deleteKeyboard(graphic::IKeyboard *keyboard)
override {
delete keyboard; }
72 void deleteMouse(graphic::IMouse *mouse)
override {
delete mouse; }
77 void deleteGamepad(graphic::IGamepad *gamepad)
override {
delete gamepad; }
96 graphic::IPolygon *
createPolygon(std::vector<Vector2f> points)
override {
112 graphic::IText *
createText(std::string text, graphic::IFont *font)
override {
121 graphic::IWindow2 *_window =
nullptr;
Sfml Font class - owns the loaded font. SfmlText only references it (sf::Text itself already takes a ...
Definition SfmlFont.hpp:27
Unlike raylib's GamepadButton (normalized Xbox-style layout), sf::Joystick exposes raw numbered butto...
Definition SfmlGamepad.hpp:35
Sfml only implements IGraphic2Module - no IGraphic3Module, sfml has no native 3D. No fake IModel here...
Definition SfmlGraphicModule.hpp:34
graphic::ISprite * createSprite(graphic::ITexture *texture) override
Definition SfmlGraphicModule.hpp:104
void deleteMouse(graphic::IMouse *mouse) override
Definition SfmlGraphicModule.hpp:72
graphic::IPolygon * createPolygon(std::vector< Vector2f > points) override
Definition SfmlGraphicModule.hpp:96
const char * type() const override
Definition SfmlGraphicModule.hpp:40
graphic::IWindow2 * createWindow(int32_t screenWidth, int32_t screenHeight, std::string title) override
Definition SfmlGraphicModule.hpp:44
graphic::IFont * createFont(std::string path) override
Definition SfmlGraphicModule.hpp:88
SfmlGraphicModule()=default
void deleteWindow(graphic::IWindow2 *window) override
Definition SfmlGraphicModule.hpp:54
graphic::IGamepad * createGamepad(graphic::IWindow *window) override
Definition SfmlGraphicModule.hpp:74
void deleteSprite(graphic::ISprite *sprite) override
Definition SfmlGraphicModule.hpp:107
void deleteTexture(graphic::ITexture *texture) override
Definition SfmlGraphicModule.hpp:83
void deleteFont(graphic::IFont *font) override
Definition SfmlGraphicModule.hpp:91
graphic::IKeyboard * createKeyboard(graphic::IWindow *window) override
Definition SfmlGraphicModule.hpp:64
graphic::IMouse * createMouse(graphic::IWindow *window) override
Definition SfmlGraphicModule.hpp:69
graphic::IWindow2 * window() override
Definition SfmlGraphicModule.hpp:60
void deleteGamepad(graphic::IGamepad *gamepad) override
Definition SfmlGraphicModule.hpp:77
void deletePolygon(graphic::IPolygon *polygon) override
Definition SfmlGraphicModule.hpp:99
const char * name() const override
Definition SfmlGraphicModule.hpp:41
graphic::IText * createText(std::string text, graphic::IFont *font) override
Definition SfmlGraphicModule.hpp:112
~SfmlGraphicModule()=default
void deleteText(graphic::IText *text) override
Definition SfmlGraphicModule.hpp:115
graphic::ITexture * createTexture(std::string path) override
Definition SfmlGraphicModule.hpp:80
void deleteKeyboard(graphic::IKeyboard *keyboard) override
Definition SfmlGraphicModule.hpp:67
Maps the contract's keys to sfml scancodes, and reads the state the window accumulated while popping ...
Definition SfmlKeyboard.hpp:41
Maps the contract's buttons to sfml buttons, and reads the state the window accumulated while popping...
Definition SfmlMouse.hpp:29
Definition SfmlPolygon.hpp:25
Sfml Sprite class - references a SfmlTexture, does not own it. Deleting the sprite never touches the ...
Definition SfmlSprite.hpp:27
Sfml Text class - references a SfmlFont, does not own it. Deleting the text never touches the font.
Definition SfmlText.hpp:28
Sfml Texture class - owns the loaded texture. SfmlSprite only references it (sf::Sprite itself alread...
Definition SfmlTexture.hpp:28
Sfml Window class - implements IWindow2 only, sfml has no 3D.
Definition SfmlWindow.hpp:46