| 1234567891011121314151617 |
- #include "osg_utility.h"
- #include <boost/iostreams/device/mapped_file.hpp>
- #include <filesystem>
- namespace fs = std::filesystem;
- std::string load_shader(const std::string &shader_name) {
- using boost::iostreams::mapped_file;
- // TODO: load from current binary directory
- const fs::path shader_prefix = "/home/tpx/ext/project/DepthGuide/src/render_osg/shaders";
- const auto shader_path = shader_prefix / shader_name;
- const auto shader = mapped_file(shader_path);
- assert(shader.is_open());
- return {shader.const_data(), shader.size()};
- }
|