X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogram.h;h=e78c8ccd0bfef96d0da006827bd6e22dee527973;hb=6c525eff3eaaa617648a869449ed3bddf9c1936d;hp=a7622ecbb586d42d83d9d2380bcdd5d3978d3e24;hpb=798703e937da6b4bbbc4a33f6670ca6fa61e47c3;p=libs%2Fgl.git diff --git a/source/program.h b/source/program.h index a7622ecb..e78c8ccd 100644 --- a/source/program.h +++ b/source/program.h @@ -7,12 +7,17 @@ #include "bindable.h" #include "gl.h" #include "programbuilder.h" +#include "vertexformat.h" namespace Msp { namespace GL { class Shader; +/** +A complete shader program. Programs can be assembled of individual Shaders or +generated with a set of standard features. +*/ class Program: public Bindable { public: @@ -67,9 +72,15 @@ private: bool legacy_vars; public: + /// Constructs an empty Program with no Shaders attached. Program(); + + /// Constructs a Program with standard features. Program(const ProgramBuilder::StandardFeatures &); + + /// Constructs a Program from vertex and fragment shader source code. Program(const std::string &, const std::string &); + private: void init(); public: @@ -81,6 +92,8 @@ public: const ShaderList &get_shaders() const { return shaders; } void bind_attribute(unsigned, const std::string &); + void bind_attribute(VertexComponent, const std::string &); + void bind_fragment_data(unsigned, const std::string &); void link(); private: