X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogram.cpp;h=82308b3405e0c42cc2086925c7633bd6b6a08770;hb=ccbfdfa0d9d796244b1ecc0fa3faa2c50304811b;hp=f56beec73260b58a4eff644aacf4f8d89f4329e0;hpb=9dc2c20e8c7ac91d932b12492591b65786e24b0f;p=libs%2Fgl.git diff --git a/source/program.cpp b/source/program.cpp index f56beec7..82308b34 100644 --- a/source/program.cpp +++ b/source/program.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include "buffer.h" #include "error.h" @@ -115,6 +116,12 @@ void Program::link() if(!linked) throw compile_error(get_info_log()); +#ifdef DEBUG + std::string info_log = get_info_log(); + if(!info_log.empty()) + IO::print("Program link info log:\n%s", info_log); +#endif + unsigned count = get_program_i(id, GL_ACTIVE_UNIFORMS); vector uniforms_by_index(count); for(unsigned i=0; i(n.substr(open_bracket+1, n.size()-2-open_bracket)); - i = uniforms.find(n.substr(0, open_bracket)); - if(i!=uniforms.end() && i->second.block->bind_point<0 && offsetsecond.size) - return i->second.location+offset; - } - } return -1; - } return i->second.block->bind_point<0 ? i->second.location : -1; } @@ -332,6 +326,7 @@ Program::Loader::Loader(Program &p): { add("attribute", &Loader::attribute); add("fragment_shader", &Loader::fragment_shader); + add("geometry_shader", &Loader::geometry_shader); add("standard", &Loader::standard); add("vertex_shader", &Loader::vertex_shader); } @@ -351,6 +346,11 @@ void Program::Loader::fragment_shader(const string &src) obj.attach_shader_owned(new FragmentShader(src)); } +void Program::Loader::geometry_shader(const string &src) +{ + obj.attach_shader_owned(new GeometryShader(src)); +} + void Program::Loader::standard() { ProgramBuilder::StandardFeatures feat;