-
Notifications
You must be signed in to change notification settings - Fork 0
/
LightSource.h
45 lines (33 loc) · 878 Bytes
/
LightSource.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef LIGHTSOURCE_H
#define LIGHTSOURCE_H
#include <SFML/Graphics.hpp>
namespace LightSourceType
{
enum Type{ LIGHT_RADIAL, LIGHT_CONICAL };
};
class LightSource
{
protected:
sf::Vector2i m_Offset;
sf::IntRect m_Rect;
sf::Color m_Color;
sf::Texture* m_Texture;
LightSourceType::Type m_Type;
void setBrightness(sf::Uint8 brightness);
public:
int getX();
int getY();
int getW();
int getH();
sf::Vector2i getOffset();
void setOffset(int x, int y);
void setLocation(int x, int y);
sf::IntRect getRect();
sf::Color getColor();
sf::Texture* getTexture();
static LightSource* createRadialLightSource(sf::IntRect rect, sf::Color);
static LightSource* createConicalLightSource(sf::IntRect rect, sf::Color);
LightSource(sf::IntRect rect, sf::Color color, LightSourceType::Type type);
~LightSource();
};
#endif