Skip to content

Commit

Permalink
resources path improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop committed Aug 31, 2024
1 parent bf6afcc commit 14fb2af
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions OpenGL/src/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ const std::string& Renderer::ResPath() {
fs::path exe_dir = exe_path.parent_path();

// Check for "res/shaders" relative to the executable's directory
if (fs::exists(exe_dir / "res" / "shaders"))
if (fs::exists(exe_dir / "res" / "shaders")) {
res_path = (exe_dir / "res").string() + "/";
else if (fs::exists(RES_PATH "/res/shaders"))
} else if (fs::exists(RES_PATH "/res/shaders")) {
res_path = RES_PATH "/res/";
else
std::cout << "Resource directory not found\n";
} else {
std::cout << "Resource directory not found relative to " << exe_dir << " or " << RES_PATH << std::endl;
res_path = "./res/";
}
}

return res_path;
Expand Down

0 comments on commit 14fb2af

Please sign in to comment.