mirror of
https://github.com/usatiuk/cardboy.git
synced 2025-10-28 23:27:49 +01:00
42 lines
849 B
C++
42 lines
849 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:
|
|
using PixelType = BwPixel;
|
|
|
|
SfmlSurface(EventLoop* loop);
|
|
|
|
~SfmlSurface(); // override;
|
|
|
|
void draw_pixel_impl(unsigned x, unsigned y, const BwPixel& pixel);
|
|
|
|
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
|