parent
a18d60dcb0
commit
767147c301
@ -0,0 +1,58 @@ |
|||||||
|
#pragma once |
||||||
|
#include <memory> |
||||||
|
#include <string> |
||||||
|
#include <SFML/Graphics/Color.hpp> |
||||||
|
#include <SFML/Graphics/Sprite.hpp> |
||||||
|
#include <SFML/Graphics/Texture.hpp> |
||||||
|
|
||||||
|
namespace guecs { |
||||||
|
using std::string; |
||||||
|
|
||||||
|
struct Theme { |
||||||
|
sf::Color BLACK{0, 0, 0}; |
||||||
|
sf::Color DARK_DARK{10, 10, 10}; |
||||||
|
sf::Color DARK_MID{30, 30, 30}; |
||||||
|
sf::Color DARK_LIGHT{60, 60, 60}; |
||||||
|
sf::Color MID{100, 100, 100}; |
||||||
|
sf::Color LIGHT_DARK{150, 150, 150}; |
||||||
|
sf::Color LIGHT_MID{200, 200, 200}; |
||||||
|
sf::Color LIGHT_LIGHT{230, 230, 230}; |
||||||
|
sf::Color WHITE{255, 255, 255}; |
||||||
|
sf::Color TRANSPARENT = sf::Color::Transparent; |
||||||
|
|
||||||
|
int PADDING = 3; |
||||||
|
int BORDER_PX = 1; |
||||||
|
unsigned int TEXT_SIZE = 30; |
||||||
|
int LABEL_SIZE = 20; |
||||||
|
sf::Color FILL_COLOR{255,0,0,255}; |
||||||
|
sf::Color TEXT_COLOR{255,0,0,255}; |
||||||
|
sf::Color BG_COLOR{255,0,0,255}; |
||||||
|
sf::Color BORDER_COLOR{255,0,0,255}; |
||||||
|
sf::Color BG_COLOR_DARK{0,0,0,255}; |
||||||
|
std::string FONT_FILE_NAME{"you_forgot_to_init.otf"}; |
||||||
|
}; |
||||||
|
|
||||||
|
struct SpriteTexture { |
||||||
|
std::shared_ptr<sf::Sprite> sprite = nullptr; |
||||||
|
std::shared_ptr<sf::Texture> texture = nullptr; |
||||||
|
}; |
||||||
|
|
||||||
|
class Backend { |
||||||
|
public: |
||||||
|
virtual SpriteTexture texture_get(const string& name) = 0; |
||||||
|
|
||||||
|
virtual void sound_play(const string& name) = 0; |
||||||
|
|
||||||
|
virtual void sound_stop(const string& name) = 0; |
||||||
|
|
||||||
|
virtual std::shared_ptr<sf::Shader> shader_get(const std::string& name) = 0; |
||||||
|
|
||||||
|
virtual bool shader_updated() = 0; |
||||||
|
virtual Theme theme() = 0; |
||||||
|
}; |
||||||
|
|
||||||
|
extern Backend* BACKEND; |
||||||
|
extern Theme THEME; |
||||||
|
|
||||||
|
void init(Backend* backend); |
||||||
|
} |
Loading…
Reference in new issue