Skip to content

Commit d89fd6a

Browse files
committed
Fixing some live shader compilation issues on windows.
1 parent 31a6e39 commit d89fd6a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

visage_utils/file_system.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,16 @@ namespace visage {
107107
}
108108

109109
std::string loadFileAsString(const File& file) {
110-
std::ifstream stream(file);
110+
std::ifstream stream(file, std::ios::binary);
111111
if (!stream)
112112
return {};
113113

114-
return { std::istreambuf_iterator<char>(stream), std::istreambuf_iterator<char>() };
114+
stream.seekg(0, std::ios::end);
115+
std::string out;
116+
out.resize(static_cast<size_t>(stream.tellg()));
117+
stream.seekg(0, std::ios::beg);
118+
stream.read(out.data(), out.size());
119+
return out;
115120
}
116121

117122
File hostExecutable() {

0 commit comments

Comments
 (0)