Updated the SFML support stuff to use the Config that can be oriented at a BASE_DIR to find stuff relative to the config file.
This commit is contained in:
parent
4d71f552aa
commit
de0d957c66
6 changed files with 28 additions and 8 deletions
|
@ -16,9 +16,10 @@ namespace shaders {
|
|||
}
|
||||
|
||||
bool load_shader(std::string name, nlohmann::json& settings) {
|
||||
std::string file_name = settings["file_name"];
|
||||
auto file_name = settings["file_name"];
|
||||
auto file_path = Config::path_to(file_name);
|
||||
auto ptr = std::make_shared<sf::Shader>();
|
||||
bool good = ptr->loadFromFile(file_name, sf::Shader::Type::Fragment);
|
||||
bool good = ptr->loadFromFile(file_path, sf::Shader::Type::Fragment);
|
||||
|
||||
if(good) {
|
||||
configure_shader_defaults(ptr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue