1 /*****************************************************************************\
2      Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
3                 This file is licensed under the Snes9x License.
4    For further information, consult the LICENSE file in the root directory.
5 \*****************************************************************************/
6 
7 // CDirectDraw.h: interface for the CDirectDraw class.
8 //
9 //////////////////////////////////////////////////////////////////////
10 
11 #if !defined(CDIRECTDRAW_H_INCLUDED)
12 #define CDIRECTDRAW_H_INCLUDED
13 
14 #include "IS9xDisplayOutput.h"
15 
16 #if _MSC_VER >= 1000
17 #pragma once
18 #endif // _MSC_VER >= 1000
19 
20 #if DIRECTDRAW_SUPPORT
21 
22 class CDirectDraw: public IS9xDisplayOutput
23 {
24 public:
25 	HRESULT dErr;
26 	LPDIRECTDRAW lpDD;
27 	LPDIRECTDRAWCLIPPER lpDDClipper;
28 	LPDIRECTDRAWPALETTE lpDDPalette;
29 
30 	LPDIRECTDRAWSURFACE2 lpDDSPrimary2;
31 	LPDIRECTDRAWSURFACE2 lpDDSOffScreen2;
32 
33 	RECT SizeHistory [10];
34 
35 	int width, height;
36 	char depth;
37 	bool doubleBuffered;
38 	bool clipped;
39 	bool dDinitialized;
40 
41 	unsigned char *convertBuffer;
42 	unsigned int filterScale;
43 
44 	DDPIXELFORMAT DDPixelFormat;
45 public:
46 	bool SetDisplayMode(
47 		int pWidth, int pHeight, int pScale,
48 		char pDepth, int pRefreshRate, bool pWindowed,
49 		bool pDoubleBuffered);
50     void GetPixelFormat ();
51 	void DeInitialize();
52 	bool Initialize (HWND hWnd);
53 
54 	void Render(SSurface Src);
55 	bool ApplyDisplayChanges(void);
56 	bool ChangeRenderSize(unsigned int newWidth, unsigned int newHeight);
57 	bool SetFullscreen(bool fullscreen);
58 	void SetSnes9xColorFormat();
59 
60 	void EnumModes(std::vector<dMode> *modeVector);
61 
62 	CDirectDraw();
63 	virtual ~CDirectDraw();
64 };
65 
66 #endif
67 
68 #endif // !defined(CDIRECTDRAW_H_INCLUDED)
69