X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fprogram.h;h=40c1d320f861e81d662ec2aa8e118e3191a5c602;hb=096481bcb88844ec28fd33147ed5010bfe2e15d9;hp=f318c60639012ea66f9da3c43139003cae519202;hpb=ea7832c7c1ffab00cc1168bc8c41375fdd0eae86;p=libs%2Fgl.git diff --git a/source/core/program.h b/source/core/program.h index f318c606..40c1d320 100644 --- a/source/core/program.h +++ b/source/core/program.h @@ -5,12 +5,14 @@ #include #include #include "bindable.h" +#include "datatype.h" #include "gl.h" #include "vertexformat.h" namespace Msp { namespace GL { +class GlslModule; class Module; class Shader; @@ -66,7 +68,7 @@ public: unsigned size; unsigned array_stride; unsigned matrix_stride; - GLenum type; + DataType type; }; struct UniformBlockInfo @@ -83,7 +85,7 @@ public: std::string name; unsigned location; unsigned size; - GLenum type; + DataType type; }; typedef std::map UniformMap; @@ -92,7 +94,7 @@ public: private: unsigned id; - std::vector shader_ids; + std::vector stage_ids; const Module *module; bool linked; UniformBlockMap uniform_blocks; @@ -119,7 +121,12 @@ public: virtual ~Program(); void add_stages(const Module &, const std::map & = std::map()); +private: + unsigned add_stage(GLenum); + void add_glsl_stages(const GlslModule &, const std::map &); + void compile_glsl_stage(unsigned); +public: DEPRECATED void attach_shader(Shader &shader); DEPRECATED void attach_shader_owned(Shader *shader); DEPRECATED void detach_shader(Shader &shader); @@ -131,7 +138,6 @@ public: void link(); private: - static void require_type(GLenum); void query_uniforms(); void query_uniform_blocks(const std::vector &); void query_attributes();