YourGameLib
Loading...
Searching...
No Matches
lightsource.h
Go to the documentation of this file.
1/*
2Copyright (c) 2019-2024 Alexander Scholz
3
4This software is provided 'as-is', without any express or implied
5warranty. In no event will the authors be held liable for any damages
6arising from the use of this software.
7
8Permission is granted to anyone to use this software for any purpose,
9including commercial applications, and to alter it and redistribute it
10freely, subject to the following restrictions:
11
121. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
162. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
183. This notice may not be removed or altered from any source distribution.
19*/
20#ifndef YOURGAME_GLLIGHTSOURCE_H
21#define YOURGAME_GLLIGHTSOURCE_H
22
23#include <array>
24
25namespace yourgame
26{
27 namespace gl
28 {
30 {
31 public:
32 std::array<float, 12> data();
33 std::array<float, 3> ambient();
34 std::array<float, 3> diffuse();
35 std::array<float, 3> specular();
36 std::array<float, 3> position();
37 void setAmbient(std::array<float, 3> col);
38 void setDiffuse(std::array<float, 3> col);
39 void setSpecular(std::array<float, 3> col);
40 void setPosition(std::array<float, 3> pos);
41
42 private:
43 // ambient, diffuse, specular, position
44 std::array<float, 12> m_data = {{0.0f, 0.0f, 0.0f,
45 1.0f, 1.0f, 1.0f,
46 1.0f, 1.0f, 1.0f,
47 0.0f, 0.0f, 0.0f}};
48 };
49 } // namespace gl
50} // namespace yourgame
51
52#endif
Definition lightsource.h:30
std::array< float, 3 > position()
Definition lightsource.cpp:46
std::array< float, 3 > ambient()
Definition lightsource.cpp:31
std::array< float, 3 > specular()
Definition lightsource.cpp:41
void setAmbient(std::array< float, 3 > col)
Definition lightsource.cpp:51
void setSpecular(std::array< float, 3 > col)
Definition lightsource.cpp:65
std::array< float, 3 > diffuse()
Definition lightsource.cpp:36
void setDiffuse(std::array< float, 3 > col)
Definition lightsource.cpp:58
std::array< float, 12 > data()
Definition lightsource.cpp:26
void setPosition(std::array< float, 3 > pos)
Definition lightsource.cpp:72
Definition audio.h:27