parent
f3101feca9
commit
055ba6dfd5
@ -1,44 +1,30 @@ |
|||||||
#include "guecs/sfml/backend.hpp" |
#include "guecs/opengl/backend.hpp" |
||||||
#include "guecs/sfml/shaders.hpp" |
|
||||||
#include "guecs/sfml/sound.hpp" |
|
||||||
#include "guecs/sfml/textures.hpp" |
|
||||||
|
|
||||||
namespace sfml { |
namespace sfml { |
||||||
guecs::SpriteTexture Backend::get_sprite(const string& name) { |
guecs::SpriteTexture Backend::get_sprite(const string& name) { |
||||||
auto sp = textures::get(name); |
return {}; |
||||||
return {sp.sprite, sp.texture, sp.frame_size}; |
|
||||||
} |
} |
||||||
|
|
||||||
guecs::SpriteTexture Backend::get_icon(const string& name) { |
guecs::SpriteTexture Backend::get_icon(const string& name) { |
||||||
return get_sprite(name); |
return {}; |
||||||
} |
} |
||||||
|
|
||||||
Backend::Backend() { |
Backend::Backend() { |
||||||
sound::init(); |
|
||||||
shaders::init(); |
|
||||||
textures::init(); |
|
||||||
} |
} |
||||||
|
|
||||||
void Backend::sound_play(const string& name) { |
void Backend::sound_play(const string& name) { |
||||||
sound::play(name); |
|
||||||
} |
} |
||||||
|
|
||||||
void Backend::sound_stop(const string& name) { |
void Backend::sound_stop(const string& name) { |
||||||
sound::stop(name); |
|
||||||
} |
} |
||||||
|
|
||||||
std::shared_ptr<sf::Shader> Backend::get_shader(const std::string& name) { |
std::shared_ptr<Shader> Backend::get_shader(const std::string& name) { |
||||||
return shaders::get(name); |
return nullptr; |
||||||
} |
} |
||||||
|
|
||||||
bool Backend::shader_updated() { |
bool Backend::shader_updated() { |
||||||
if(shaders::updated($shaders_version)) { |
|
||||||
$shaders_version = shaders::version(); |
|
||||||
return true; |
|
||||||
} else { |
|
||||||
return false; |
return false; |
||||||
} |
} |
||||||
} |
|
||||||
|
|
||||||
guecs::Theme Backend::theme() { |
guecs::Theme Backend::theme() { |
||||||
guecs::Theme theme; |
guecs::Theme theme; |
||||||
@ -1,5 +1,5 @@ |
|||||||
#include "guecs/ui.hpp" |
#include "guecs/ui.hpp" |
||||||
#include "guecs/sfml/backend.hpp" |
#include "guecs/opengl/backend.hpp" |
||||||
#include <cassert> |
#include <cassert> |
||||||
#include <iostream> |
#include <iostream> |
||||||
#include <fmt/core.h> |
#include <fmt/core.h> |
||||||
Loading…
Reference in new issue