OSDN Git Service

Add an attach debugger dialog.
[android-x86/external-swiftshader.git] / src / D3D9 / Direct3DSwapChain9.hpp
1 // SwiftShader Software Renderer
2 //
3 // Copyright(c) 2005-2011 TransGaming Inc.
4 //
5 // All rights reserved. No part of this software may be copied, distributed, transmitted,
6 // transcribed, stored in a retrieval system, translated into any human or computer
7 // language by any means, or disclosed to third parties without the explicit written
8 // agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
9 // or implied, including but not limited to any patent rights, are granted to you.
10 //
11
12 #ifndef D3D9_Direct3DSwapChain9_hpp
13 #define D3D9_Direct3DSwapChain9_hpp
14
15 #include "Unknown.hpp"
16
17 #include "Direct3DSurface9.hpp"
18
19 #include "FrameBufferWin.hpp"
20
21 #include <d3d9.h>
22
23 namespace D3D9
24 {
25         class Direct3DDevice9;
26
27         class Direct3DSwapChain9 : public IDirect3DSwapChain9, public Unknown
28         {
29         public:
30                 Direct3DSwapChain9(Direct3DDevice9 *device, D3DPRESENT_PARAMETERS *presentParameters);
31
32                 virtual ~Direct3DSwapChain9();
33
34                 // IUnknown methods
35                 long __stdcall QueryInterface(const IID &iid, void **object);
36                 unsigned long __stdcall AddRef();
37                 unsigned long __stdcall Release();
38
39                 // IDirect3DSwapChain9 methods
40                 long __stdcall Present(const RECT *sourceRect, const RECT *destRect, HWND destWindowOverride, const RGNDATA *dirtyRegion, unsigned long flags);
41                 long __stdcall GetFrontBufferData(IDirect3DSurface9 *destSurface);
42                 long __stdcall GetBackBuffer(unsigned int index, D3DBACKBUFFER_TYPE type, IDirect3DSurface9 **backBuffer);
43                 long __stdcall GetRasterStatus(D3DRASTER_STATUS *rasterStatus);
44                 long __stdcall GetDisplayMode(D3DDISPLAYMODE *displayMode);
45                 long __stdcall GetDevice(IDirect3DDevice9 **device);
46                 long __stdcall GetPresentParameters(D3DPRESENT_PARAMETERS *presentParameters);
47
48                 // Internal methods
49                 void reset(D3DPRESENT_PARAMETERS *presentParameters);
50
51                 void setGammaRamp(sw::GammaRamp *gammaRamp, bool calibrate);
52                 void getGammaRamp(sw::GammaRamp *gammaRamp);
53
54                 void *lockBackBuffer(int index);
55                 void unlockBackBuffer(int index);
56
57         private:
58                 void release();
59
60                 // Creation parameters
61                 Direct3DDevice9 *const device;
62                 D3DPRESENT_PARAMETERS presentParameters;
63
64                 bool lockable;
65
66                 sw::FrameBufferWin *frameBuffer;
67
68         public:   // FIXME
69                 Direct3DSurface9 *backBuffer[3];
70         };
71 }
72
73 #endif // D3D9_Direct3DSwapChain9_hpp