mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
GLSL 'include' support
This commit is contained in:
parent
e6ecd558a9
commit
a60cc70246
20 changed files with 238 additions and 35 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue