aboutsummaryrefslogtreecommitdiff
path: root/layer_box.h
blob: bba2f98cd8d583da01134dd7580a38e1af6ee05c (plain)
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
#ifndef __LAYER_BOX_H
#define __LAYER_BOX_H

#include <SDL.h>

#include "osc_graphics.h"
#include "layer.h"

class LayerBox : public Layer {
	Sint16 x1, y1, x2, y2;
	Uint8 r, g, b, a;

public:
	LayerBox(const char *name, SDL_Rect geo, float opacity,
		 SDL_Color color) : Layer(name)
	{
		LayerBox::geo(geo);
		LayerBox::color(color);
		LayerBox::alpha(opacity);
	}

	void geo(SDL_Rect geo);
	void alpha(float opacity);

	void
	color(SDL_Color color)
	{
		r = color.r;
		g = color.g;
		b = color.b;
	}


	void frame(SDL_Surface *target);
};

#endif