init();
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Program::Program(const ProgramBuilder::StandardFeatures &features)
{
init();
builder.add_shaders(*this);
link();
}
+#pragma GCC diagnostic pop
Program::Program(const std::string &source)
{
query_uniforms();
query_attributes();
+
+ for(UniformMap::const_iterator i=uniforms.begin(); i!=uniforms.end(); ++i)
+ require_type(i->second.type);
+ for(AttributeMap::const_iterator i=attributes.begin(); i!=attributes.end(); ++i)
+ require_type(i->second.type);
+}
+
+void Program::require_type(GLenum t)
+{
+ switch(t)
+ {
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT2x4:
+ case GL_FLOAT_MAT3x2:
+ case GL_FLOAT_MAT3x4:
+ case GL_FLOAT_MAT4x2:
+ case GL_FLOAT_MAT4x3:
+ { static Require _req(NV_non_square_matrices); }
+ break;
+ }
}
void Program::query_uniforms()
void Program::Loader::standard()
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ProgramBuilder::StandardFeatures feat;
load_sub(feat);
ProgramBuilder builder(feat);
builder.add_shaders(obj);
+#pragma GCC diagnostic pop
}
void Program::Loader::vertex_shader(const string &src)