X-Git-Url: http://git.tdb.fi/?p=libs%2Fgltk.git;a=blobdiff_plain;f=source%2Froot.cpp;h=8b06f4788f9f4ae45b8837ed63f6c1569b8bc62a;hp=f4bad55beb546dfa91ee0dd9d960a7a0451b2fed;hb=5791712b89bda9d70987592620c659b7b9f2435b;hpb=2b1a962fba03a01d641f5b6e2b8d75c6e71e2d40 diff --git a/source/root.cpp b/source/root.cpp index f4bad55..8b06f47 100644 --- a/source/root.cpp +++ b/source/root.cpp @@ -1,4 +1,7 @@ #include +#include +#include +#include #include #include #include @@ -38,6 +41,18 @@ void Root::init(Graphics::Window *window) camera.set_orthographic(geom.w, geom.h); update_camera(); + if(GL::ARB_shader_objects) + { + shprog = new GL::Program; + GL::ProgramBuilder::StandardFeatures features; + features.material = true; + features.texture = true; + GL::ProgramBuilder(features).add_shaders(*shprog); + shprog->link(); + } + else + shprog = 0; + update_style(); if(mouse) @@ -57,6 +72,7 @@ void Root::init(Graphics::Window *window) Root::~Root() { + delete shprog; if(own_input) { delete keyboard; @@ -115,6 +131,7 @@ void Root::render() const GL::Bind bind_blend(GL::Blend::alpha()); GL::Renderer renderer(&camera); + renderer.set_shader_program(shprog); Widget::render(renderer); }