]> git.tdb.fi Git - libs/gl.git/blobdiff - source/material.h
Remove support for legacy OpenGL features
[libs/gl.git] / source / material.h
index e1bfec4caa0707419941b88476394955ab651244..17ea88391238ec31533261578c43ae244cf4e3a7 100644 (file)
@@ -15,12 +15,9 @@ parameters, but does not include texturing.  Materials interact with light
 soucres and ambient lighting to produce the base color of a surface.  Textures
 can be used to add detail.
 
-Material provides a set of uniform variables for use with shaders.  Standard
-shaders generated by ProgramBuilder only use it when legacy mode is disabled.
-
-In legacy mode, materials are applied with several calls to glMaterial.
+Material provides a set of uniform variables for use with shaders.
 */
-class Material: public BindableWithDefault<Material>
+class Material
 {
 public:
        class Loader: public DataFile::CollectionObjectLoader<Material>
@@ -44,15 +41,6 @@ public:
        };
 
 private:
-       enum ParameterMask
-       {
-               AMBIENT = 1,
-               DIFFUSE = 2,
-               SPECULAR = 4,
-               EMISSION = 8,
-               SHININESS = 16
-       };
-
        Color ambient;
        Color diffuse;
        Color specular;
@@ -64,10 +52,6 @@ private:
 public:
        Material();
 
-private:
-       void update_parameter(int) const;
-
-public:
        /** Sets the ambient color of the material.  Provided to shaders with the
        name material.ambient. */
        void set_ambient(const Color &);
@@ -96,11 +80,8 @@ public:
        float get_shininess() const { return shininess; }
        float get_reflectivity() const { return reflectivity; }
 
-       /** Returns the uniforms for the material.  Not needed for shaders that use
-       the legacy built-in uniform gl_FrontMaterial and have no reflections. */
+       /** Returns the uniforms for the material. */
        const ProgramData &get_shader_data() const { return shdata; }
-
-       void bind() const;
 };
 
 } // namespace GL