Files
cardboy/Firmware/sdk/sfml-port/include_public/SfmlWindow.hpp
2025-07-28 09:39:13 +02:00

42 lines
841 B
C++

//
// Created by Stepan Usatiuk on 26.07.2025.
//
#ifndef SFMLWINDOW_HPP
#define SFMLWINDOW_HPP
#include "Surface.hpp"
#include "Window.hpp"
#include <SFML/Graphics.hpp>
class SfmlSurface : public Surface<SfmlSurface, BwPixel>, public StandardEventQueue<SfmlSurface> {
public:
SfmlSurface(EventLoop* loop);
~SfmlSurface(); // override;
void draw_pixel_impl(unsigned x, unsigned y, const BwPixel& pixel);
void clear_impl();
unsigned get_width_impl() const;
unsigned get_height_impl() const;
template<typename T>
EventHandlingResult handle(const T& event) {
return _window->handle(event);
}
EventHandlingResult handle(SurfaceResizeEvent event);
sf::RenderWindow _sf_window;
sf::Image _image;
sf::Texture _texture;
sf::Sprite _sprite;
};
#endif // SFMLWINDOW_HPP