ClanLib  2.3.7
light_source.h
Go to the documentation of this file.
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2011 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 */
28 
31 
32 #pragma once
33 
34 #include "api_gl1.h"
35 #include "../Core/System/sharedptr.h"
36 #include "../Core/Math/vec3.h"
37 
38 class CL_Colorf;
39 class CL_LightSource_GL1_Impl;
40 
45 {
47 public:
50 
52 
54 public:
58  float get_spot_exponent() const;
59 
62  float get_spot_cutoff() const;
63 
66  float get_constant_attenuation() const;
67 
70  float get_linear_attenuation() const;
71 
74  float get_quadratic_attenuation() const;
75 
77  CL_Colorf get_ambient_intensity() const;
78 
80  CL_Colorf get_diffuse_intensity() const;
81 
83  CL_Colorf get_specular_intensity() const;
84 
86  CL_Vec4f get_position() const;
87 
89  CL_Vec4f get_spot_direction() const;
90 
92 public:
96  void set_spot_exponent(float spot_exponent);
97 
100  void set_spot_cutoff(float spot_cutoff);
101 
104  void set_constant_attenuation(float constant_attenuation);
105 
108  void set_linear_attenuation(float linear_attenuation);
109 
112  void set_quadratic_attenuation(float quadratic_attenuation);
113 
115  void set_ambient_intensity(const CL_Colorf &color);
116 
118  void set_diffuse_intensity(const CL_Colorf &color);
119 
121  void set_specular_intensity(const CL_Colorf &color);
122 
133  void set_position(const CL_Vec4f &position);
134 
136  void set_spot_direction(const CL_Vec3f &spot_direction);
137 
139 private:
140  CL_SharedPtr<CL_LightSource_GL1_Impl> impl;
141 };
142