Shaders

template <typename GRAPHICS, typename S>
class gdt::pipeline_proxy

Use this class to provide any drawing code with a shader, instead of directly passing a shader reference. This way you can ensure the user will call gdt::pipeline::use because this is the only way the user would be able to access the wrapped shader reference:

my_game::pipeline_proxy<my_game::text_pipeline> get_text_shader() const {
    return my_game::pipeline_proxy<my_game::text_pipeline>(_text_pipeline);
}

...

void render(const my_game::context & ctx) {
    get_text_shader()
        .use(ctx) // now we have the actual text_pipeline object
        .draw(_text);
}