aboutsummaryrefslogtreecommitdiff
path: root/lib/gdi/gfbdc.h
blob: 23051c4f7207fc351142214c937a86147d06f410 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef __gfbdc_h
#define __gfbdc_h

#include "fb.h"
#include "gpixmap.h"
#include "grc.h"

class gFBDC;

SWIG_IGNORE(gFBDC);
class gFBDC: public gDC
{
#ifndef SWIG
	fbClass *fb;
	static gFBDC *instance;
	void exec(gOpcode *opcode);
	unsigned char ramp[256], rampalpha[256]; // RGB ramp 0..255
	int brightness, gamma, alpha;
	void calcRamp();
	void setPalette();
	gSurface surface, surface_back;
	int m_enable_double_buffering;
	int m_xres, m_yres;
#else
	gFBDC();
	virtual ~gFBDC();
#endif
public:
	void setResolution(int xres, int yres);
#ifndef SWIG
	void reloadSettings();
	void setAlpha(int alpha);
	void setBrightness(int brightness);
	void setGamma(int gamma);

	int getAlpha() { return alpha; }
	int getBrightness() { return brightness; }
	int getGamma() { return gamma; }

	int haveDoubleBuffering() { return m_enable_double_buffering; }

	void saveSettings();

	gFBDC();
	virtual ~gFBDC();
	static int getInstance(ePtr<gFBDC> &ptr) { if (!instance) return -1; ptr = instance; return 0; }
	int islocked() { return fb->islocked(); }
#endif
};
SWIG_TEMPLATE_TYPEDEF(ePtr<gFBDC>, gFBDC);
SWIG_EXTEND(ePtr<gFBDC>,
	static ePtr<gFBDC> getInstance()
	{
		extern ePtr<gFBDC> NewgFBDCPtr(void);
		return NewgFBDCPtr();
	}
);

#endif