File: beScreen.h

package info (click to toggle)
devil 1.6.7-5%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 11,536 kB
  • ctags: 7,441
  • sloc: ansic: 35,573; sh: 8,075; cpp: 7,465; pascal: 792; makefile: 399; python: 47
file content (84 lines) | stat: -rw-r--r-- 2,315 bytes parent folder | download | duplicates (5)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//============================================================//
// File:		beScreen.h
// 
// Date:		10-19-2000
//============================================================//
#ifndef BESCREEN_H
#define BESCREEN_H

#define BE_SCREENFLAGS_FULLSCREEN               0x00000000
#define BE_SCREENFLAGS_WINDOWED                 0x00000001
#define BE_SCREENFLAGS_BACKBUFFERS              0x00000002

struct beScreenParams
{
        long			m_Flags;                // BE_SCREENFLAGS_xxxx

        unsigned int	m_iScreenWidth;          // x-resolution
        unsigned int	m_iScreenHeight;         // y-resolution
        unsigned int	m_iScreenBitCount;       // color resolution (ignored in windowed mode)

        unsigned int	m_iBackBufferCount;      // number of back-buffers (max 1 in windowed mode)

        HWND            m_OwnerWnd;              // handle of owner window

        long			m_sclFlags;              // additional cooperative flags
};

class beScreen
{

public:

	beScreen();
	~beScreen();

	bool Initialize(beScreenParams sparam);
	void Delete();

	bool Flip();

	void Move();

	beDirectDrawSurface *			GetPrimarySurface()		{ return m_pddsPrimary; };
	beDirectDrawSurface *			GetBackBufferSurface()	{ return m_pddsBackBuffer; };
	beDirectDraw *					GetDirectDraw()			{ return m_pDDraw; };
	beScreenParams					GetScreenParams()		{ return m_ScreenParams; };
	
	RECT							GetScreenRect()			{ return m_rcScreen; };
	RECT							GetViewportRect()		{ return m_rcViewport; };
	
	// Pixel-Plotting
	WORD							GetRBits()				{ return m_wRBits; };
	WORD							GetGBits()				{ return m_wGBits; };
	WORD							GetBBits()				{ return m_wBBits; };
	WORD							GetRPos()				{ return m_wRPos; };
	WORD							GetGPos()				{ return m_wGPos; };
	WORD							GetBPos()				{ return m_wBPos; };

protected:

	bool InitializeSurfaces();
	void InitializeMask();

private:

	RECT							m_rcViewport;           // Pos. & size to blt from
	RECT							m_rcScreen;             // Screen pos. for blt

    beDirectDraw *                  m_pDDraw;
    beDirectDrawSurface *			m_pddsPrimary;
    beDirectDrawSurface *			m_pddsBackBuffer;

	beScreenParams					m_ScreenParams;

	// Pixel-Plotting
	WORD							m_wRBits;
	WORD							m_wGBits;
	WORD							m_wBBits;
	WORD							m_wRPos;
	WORD							m_wGPos;
	WORD							m_wBPos;
};

#endif