X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fprogram.cpp;h=c41976ed8eef270a238de46b837e529ad4904dd9;hb=143fed36e93eaa54345dbc5f66cc09e0f6be0519;hp=789fa32473392d75a0bd34a13aac7208ddf14637;hpb=c93e0613e96ec6817e26b533e90dc49d45787941;p=libs%2Fgl.git diff --git a/source/core/program.cpp b/source/core/program.cpp index 789fa324..c41976ed 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -80,6 +80,9 @@ Program::~Program() void Program::add_stages(const Module &mod, const map &spec_values) { + if(!stage_ids.empty()) + throw invalid_operation("Program::add_stages"); + switch(mod.get_format()) { case Module::GLSL: return add_glsl_stages(static_cast(mod), spec_values); @@ -220,6 +223,9 @@ void Program::bind_fragment_data(unsigned index, const string &name) void Program::link() { + if(stage_ids.empty()) + throw invalid_operation("Program::link"); + uniforms.clear(); glLinkProgram(id);