A GUI library for games that's so small you won't even know its there.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
lel-guecs/sfml/textures.hpp

27 lines
605 B

#pragma once
#include <cstdint>
#include <vector>
#include <string>
#include <SFML/Graphics.hpp>
#include <unordered_map>
#include <memory>
namespace textures {
struct SpriteTexture {
std::shared_ptr<sf::Sprite> sprite = nullptr;
std::shared_ptr<sf::Texture> texture = nullptr;
};
struct TextureManager {
std::vector<sf::Image> surfaces;
std::unordered_map<std::string, SpriteTexture> sprite_textures;
std::unordered_map<wchar_t, int> char_to_texture;
};
void init();
SpriteTexture get(const std::string& name);
sf::Image load_image(const std::string& filename);
}