Had to rename sfml to sfmlbackend because on Windows the filesystem is case insensitive so include <SFML/*> was accidentally including _my_ <sfml/config.hpp> file.
This commit is contained in:
parent
f3f2e90cd2
commit
06ca57e5da
19 changed files with 38 additions and 36 deletions
27
include/sfmlbackend/textures.hpp
Normal file
27
include/sfmlbackend/textures.hpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
#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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue