Moved shaders to standalone source file
This commit is contained in:
@@ -46,10 +46,10 @@ ugly::ShaderProgramBuilder &ugly::ShaderProgramBuilder::attachFromMemory(GLenum
|
||||
|
||||
|
||||
ugly::ShaderProgramBuilder &ugly::ShaderProgramBuilder::attachFromFile(GLenum type, const char *filename) {
|
||||
auto file = std::ifstream{filename};
|
||||
file.exceptions(std::ios_base::badbit);
|
||||
std::ostringstream ss;
|
||||
ss << file.rdbuf();
|
||||
auto file = std::filebuf{};
|
||||
auto ss = std::ostringstream{};
|
||||
ss.exceptions(std::ios_base::badbit);
|
||||
ss << file.open(filename, std::ios_base::in);
|
||||
return attachFromMemory(type, ss.str().c_str());
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ GLuint ugly::ShaderProgramBuilder::link() {
|
||||
char buf[512];
|
||||
glGetProgramInfoLog(mProgram, 512, NULL, buf);
|
||||
std::cerr << "Failed to link program:\n\t" << buf << '\n';
|
||||
throw Error{"program failed to link"};
|
||||
throw Error{"program failed to link"};
|
||||
}
|
||||
|
||||
auto result = mProgram;
|
||||
|
||||
Reference in New Issue
Block a user