2 * Copyright 2011 Joakim Sindholt <opensource@zhasha.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
23 #include "swapchain9ex.h"
26 #include "nine_helpers.h"
28 #define DBG_CHANNEL DBG_SWAPCHAIN
31 NineSwapChain9Ex_ctor( struct NineSwapChain9Ex
*This
,
32 struct NineUnknownParams
*pParams
,
34 ID3DPresent
*pPresent
,
35 D3DPRESENT_PARAMETERS
*pPresentationParameters
,
36 struct d3dadapter9_context
*pCTX
,
38 D3DDISPLAYMODEEX
*mode
)
40 return NineSwapChain9_ctor(&This
->base
, pParams
, implicit
, pPresent
,
41 pPresentationParameters
, pCTX
, hFocusWindow
, mode
);
45 NineSwapChain9Ex_dtor( struct NineSwapChain9Ex
*This
)
47 NineSwapChain9_dtor(&This
->base
);
51 NineSwapChain9Ex_GetLastPresentCount( struct NineSwapChain9Ex
*This
,
52 UINT
*pLastPresentCount
)
54 STUB(D3DERR_INVALIDCALL
);
58 NineSwapChain9Ex_GetPresentStats( struct NineSwapChain9Ex
*This
,
59 D3DPRESENTSTATS
*pPresentationStatistics
)
61 STUB(D3DERR_INVALIDCALL
);
65 NineSwapChain9Ex_GetDisplayModeEx( struct NineSwapChain9Ex
*This
,
66 D3DDISPLAYMODEEX
*pMode
,
67 D3DDISPLAYROTATION
*pRotation
)
69 D3DDISPLAYROTATION rot
;
71 user_assert(pMode
!= NULL
, E_POINTER
);
72 if (!pRotation
) { pRotation
= &rot
; }
74 return ID3DPresent_GetDisplayMode(This
->base
.present
, pMode
, pRotation
);
77 IDirect3DSwapChain9ExVtbl NineSwapChain9Ex_vtable
= {
78 (void *)NineUnknown_QueryInterface
,
79 (void *)NineUnknown_AddRef
,
80 (void *)NineUnknown_Release
,
81 (void *)NineSwapChain9_Present
,
82 (void *)NineSwapChain9_GetFrontBufferData
,
83 (void *)NineSwapChain9_GetBackBuffer
,
84 (void *)NineSwapChain9_GetRasterStatus
,
85 (void *)NineSwapChain9_GetDisplayMode
,
86 (void *)NineUnknown_GetDevice
, /* actually part of NineSwapChain9 iface */
87 (void *)NineSwapChain9_GetPresentParameters
,
88 (void *)NineSwapChain9Ex_GetLastPresentCount
,
89 (void *)NineSwapChain9Ex_GetPresentStats
,
90 (void *)NineSwapChain9Ex_GetDisplayModeEx
93 static const GUID
*NineSwapChain9Ex_IIDs
[] = {
94 &IID_IDirect3DSwapChain9Ex
,
95 &IID_IDirect3DSwapChain9
,
101 NineSwapChain9Ex_new( struct NineDevice9
*pDevice
,
103 ID3DPresent
*pPresent
,
104 D3DPRESENT_PARAMETERS
*pPresentationParameters
,
105 struct d3dadapter9_context
*pCTX
,
107 D3DDISPLAYMODEEX
*mode
,
108 struct NineSwapChain9Ex
**ppOut
)
110 NINE_DEVICE_CHILD_NEW(SwapChain9Ex
, ppOut
, pDevice
, /* args */
111 implicit
, pPresent
, pPresentationParameters
,
112 pCTX
, hFocusWindow
, mode
);