From: Mikko Rasa Date: Wed, 27 Nov 2013 10:05:01 +0000 (+0200) Subject: Remove ambient color from Light X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=787e0f5daaccb912fd351b26f9cb9026719ab384 Remove ambient color from Light It doesn't make much sense, as there's already the global ambient color in Lighting. I haven't ever used it either, so remove directly instead of deprecating. --- diff --git a/source/light.cpp b/source/light.cpp index 4b2e289c..21925364 100644 --- a/source/light.cpp +++ b/source/light.cpp @@ -11,7 +11,6 @@ unsigned Light::current_unit = 0; vector Light::current_lights(1); Light::Light(): - ambient(0), diffuse(1), specular(1), position(0, 0, 1, 0), @@ -24,11 +23,6 @@ Light::Light(): attenuation[2] = 0; } -void Light::set_ambient(const Color &c) -{ - ambient = c; -} - void Light::set_diffuse(const Color &c) { diffuse = c; @@ -72,7 +66,6 @@ void Light::bind() const { GLenum l = GL_LIGHT0+current_unit; enable(l); - glLightfv(l, GL_AMBIENT, &ambient.r); glLightfv(l, GL_DIFFUSE, &diffuse.r); glLightfv(l, GL_SPECULAR, &specular.r); glLightfv(l, GL_POSITION, &position.x); diff --git a/source/light.h b/source/light.h index fb3410c7..658e8287 100644 --- a/source/light.h +++ b/source/light.h @@ -11,7 +11,6 @@ namespace GL { class Light { private: - Color ambient; Color diffuse; Color specular; Vector4 position; @@ -26,10 +25,8 @@ private: public: Light(); - void set_ambient(const Color &c); void set_diffuse(const Color &c); void set_specular(const Color &c); - const Color &get_ambient() const { return ambient; } const Color &get_diffuse() const { return diffuse; } const Color &get_specular() const { return specular; }