init();
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Program::Program(const ProgramBuilder::StandardFeatures &features)
{
init();
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ProgramBuilder builder(features);
builder.add_shaders(*this);
-#pragma GCC diagnostic pop
link();
}
+#pragma GCC diagnostic pop
Program::Program(const std::string &source)
{
string Program::get_info_log() const
{
GLsizei len = get_program_i(id, GL_INFO_LOG_LENGTH);
- char *buf = new char[len+1];
- glGetProgramInfoLog(id, len+1, &len, buf);
- string log(buf, len);
- delete[] buf;
+ string log(len+1, 0);
+ glGetProgramInfoLog(id, len+1, &len, &log[0]);
+ log.erase(len);
return log;
}