X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fprogram.h;h=cbb52cd4536e93bd0b2cd65c0f9868cfe946b1f5;hp=36f380a2a9821835d930e0e29736ef2e706778d2;hb=99d25b5ef615a23ef63645fea87596b3384b5ede;hpb=259254bc46e3aec6f719e1aea5e4936569c15b6e diff --git a/source/program.h b/source/program.h index 36f380a2..cbb52cd4 100644 --- a/source/program.h +++ b/source/program.h @@ -1,8 +1,8 @@ #ifndef MSP_GL_PROGRAM_H_ #define MSP_GL_PROGRAM_H_ -#include #include +#include #include #include "bindable.h" #include "gl.h" @@ -31,6 +31,7 @@ public: void attribute(unsigned, const std::string &); void fragment_shader(const std::string &); + void geometry_shader(const std::string &); void standard(); void vertex_shader(const std::string &); }; @@ -53,12 +54,12 @@ public: { std::string name; unsigned data_size; - unsigned bind_point; + int bind_point; std::vector uniforms; LayoutHash layout_hash; }; - typedef std::list ShaderList; + typedef std::vector ShaderList; typedef std::map UniformMap; typedef std::map UniformBlockMap; @@ -79,6 +80,9 @@ public: /// Constructs a Program with standard features. Program(const ProgramBuilder::StandardFeatures &); + /// Constructs a Program from unified source code using ProgramCompiler. + Program(const std::string &); + /// Constructs a Program from vertex and fragment shader source code. Program(const std::string &, const std::string &); @@ -90,7 +94,7 @@ public: void attach_shader(Shader &shader); void attach_shader_owned(Shader *shader); void detach_shader(Shader &shader); - const ShaderList &get_shaders() const { return shaders; } + const ShaderList &get_attached_shaders() const { return shaders; } void bind_attribute(unsigned, const std::string &); void bind_attribute(VertexComponent, const std::string &);