light_source.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2011 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 */
00028 
00031 
00032 #pragma once
00033 
00034 #include "api_gl1.h"
00035 #include "../Core/System/sharedptr.h"
00036 #include "../Core/Math/vec3.h"
00037 
00038 class CL_Colorf;
00039 class CL_LightSource_GL1_Impl;
00040 
00044 class CL_API_GL1 CL_LightSource_GL1
00045 {
00047 public:
00049         CL_LightSource_GL1();
00050 
00051         ~CL_LightSource_GL1();
00052 
00054 public:
00058         float get_spot_exponent() const;
00059 
00062         float get_spot_cutoff() const;
00063 
00066         float get_constant_attenuation() const;
00067 
00070         float get_linear_attenuation() const;
00071 
00074         float get_quadratic_attenuation() const;
00075 
00077         CL_Colorf get_ambient_intensity() const;
00078 
00080         CL_Colorf get_diffuse_intensity() const;
00081 
00083         CL_Colorf get_specular_intensity() const;
00084 
00086         CL_Vec4f get_position() const;
00087 
00089         CL_Vec4f get_spot_direction() const;
00090 
00092 public:
00096         void set_spot_exponent(float spot_exponent);
00097 
00100         void set_spot_cutoff(float spot_cutoff);
00101 
00104         void set_constant_attenuation(float constant_attenuation);
00105 
00108         void set_linear_attenuation(float linear_attenuation);
00109 
00112         void set_quadratic_attenuation(float quadratic_attenuation);
00113 
00115         void set_ambient_intensity(const CL_Colorf &color);
00116 
00118         void set_diffuse_intensity(const CL_Colorf &color);
00119 
00121         void set_specular_intensity(const CL_Colorf &color);
00122 
00133         void set_position(const CL_Vec4f &position);
00134 
00136         void set_spot_direction(const CL_Vec3f &spot_direction);
00137 
00139 private:
00140         CL_SharedPtr<CL_LightSource_GL1_Impl> impl;
00141 };
00142