1 // SwiftShader Software Renderer
3 // Copyright(c) 2005-2011 TransGaming Inc.
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.
12 #ifndef D3D9_Direct3DSwapChain9_hpp
13 #define D3D9_Direct3DSwapChain9_hpp
15 #include "Unknown.hpp"
17 #include "Direct3DSurface9.hpp"
19 #include "FrameBufferWin.hpp"
25 class Direct3DDevice9;
27 class Direct3DSwapChain9 : public IDirect3DSwapChain9, public Unknown
30 Direct3DSwapChain9(Direct3DDevice9 *device, D3DPRESENT_PARAMETERS *presentParameters);
32 virtual ~Direct3DSwapChain9();
35 long __stdcall QueryInterface(const IID &iid, void **object);
36 unsigned long __stdcall AddRef();
37 unsigned long __stdcall Release();
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);
49 void reset(D3DPRESENT_PARAMETERS *presentParameters);
51 void setGammaRamp(sw::GammaRamp *gammaRamp, bool calibrate);
52 void getGammaRamp(sw::GammaRamp *gammaRamp);
54 void *lockBackBuffer(int index);
55 void unlockBackBuffer(int index);
60 // Creation parameters
61 Direct3DDevice9 *const device;
62 D3DPRESENT_PARAMETERS presentParameters;
66 sw::FrameBufferWin *frameBuffer;
69 Direct3DSurface9 *backBuffer[3];
73 #endif // D3D9_Direct3DSwapChain9_hpp