GLSL 'include' support

This commit is contained in:
MihailRis
2023-11-28 16:13:49 +03:00
parent e6ecd558a9
commit a60cc70246
20 changed files with 238 additions and 35 deletions
+4
View File
@@ -4,6 +4,7 @@
#include <iostream>
#include <memory>
#include <stdint.h>
#include <stdexcept>
using std::ios;
using std::string;
@@ -57,6 +58,9 @@ char* files::read_bytes(path filename, size_t& length) {
std::string files::read_string(path filename) {
size_t size;
unique_ptr<char> chars (read_bytes(filename, size));
if (chars == nullptr) {
throw std::runtime_error("could not to load file '"+filename.string()+"'");
}
return string(chars.get(), size);
}