X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprogram.h;h=642bcf5e7755652734069e33d9df182a0e2fad96;hb=2579be0c3bf50f060364b937e6b2446ea3547e4b;hp=132c21d5b126ec7d1dc3d2d9bb94ec1814747fb0;hpb=3f7b09b2e12830eb439889b300f0d6591c4952ac;p=libs%2Fgl.git diff --git a/source/program.h b/source/program.h index 132c21d5..642bcf5e 100644 --- a/source/program.h +++ b/source/program.h @@ -6,6 +6,7 @@ #include #include "bindable.h" #include "gl.h" +#include "programbuilder.h" namespace Msp { namespace GL { @@ -29,28 +30,6 @@ public: void vertex_shader(const std::string &); }; - struct StandardFeatures - { - class Loader: public DataFile::ObjectLoader - { - public: - Loader(StandardFeatures &); - }; - - bool texture; - bool material; - bool lighting; - bool specular; - bool normalmap; - bool shadow; - bool reflection; - bool transform; - - StandardFeatures(); - - std::string create_flags() const; - }; - struct UniformBlockInfo; struct UniformInfo @@ -85,10 +64,11 @@ private: UniformBlockMap uniform_blocks; UniformMap uniforms; unsigned uniform_layout_hash; + bool legacy_vars; public: Program(); - Program(const StandardFeatures &); + Program(const ProgramBuilder::StandardFeatures &); Program(const std::string &, const std::string &); private: void init(); @@ -98,17 +78,15 @@ public: void attach_shader(Shader &shader); void attach_shader_owned(Shader *shader); void detach_shader(Shader &shader); - void add_standard_shaders(const StandardFeatures &); -private: - static std::string process_standard_source(const char **, const std::string &); -public: const ShaderList &get_shaders() const { return shaders; } void bind_attribute(unsigned, const std::string &); + void bind_fragment_data(unsigned, const std::string &); void link(); private: static unsigned compute_layout_hash(const std::vector &); + static bool uniform_location_compare(const UniformInfo *, const UniformInfo *); public: bool is_linked() const { return linked; } std::string get_info_log() const; @@ -120,6 +98,8 @@ public: const UniformInfo &get_uniform_info(const std::string &) const; int get_uniform_location(const std::string &) const; + bool uses_legacy_variables() const { return legacy_vars; } + void bind() const; static void unbind(); };