]> git.tdb.fi Git - libs/gl.git/blobdiff - source/program.h
Rewrite light binding to match textures
[libs/gl.git] / source / program.h
index 21b38c255e7262d77d01800c2204d27c75c7f0f8..a7622ecbb586d42d83d9d2380bcdd5d3978d3e24 100644 (file)
@@ -6,6 +6,7 @@
 #include <msp/datafile/objectloader.h>
 #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<StandardFeatures>
-               {
-               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,10 +78,6 @@ 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 &);
@@ -121,6 +97,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();
 };