d3dadapter/present: Add new API to ID3DPresent
The API will enable better support for the commonly used DISCARD swapchain parameter. Signed-off-by: Axel Davy <axel.davy@ens.fr>
This commit is contained in:
@@ -35,6 +35,22 @@ typedef struct ID3DPresentGroup ID3DPresentGroup;
|
|||||||
typedef struct ID3DAdapter9 ID3DAdapter9;
|
typedef struct ID3DAdapter9 ID3DAdapter9;
|
||||||
typedef struct D3DWindowBuffer D3DWindowBuffer;
|
typedef struct D3DWindowBuffer D3DWindowBuffer;
|
||||||
|
|
||||||
|
/* Available since version 1.3 */
|
||||||
|
typedef struct _D3DPRESENT_PARAMETERS2_ {
|
||||||
|
/* Whether D3DSWAPEFFECT_DISCARD is allowed to release the
|
||||||
|
* D3DWindowBuffers in any order, and eventually with a delay.
|
||||||
|
* FALSE (Default): buffers should be released as soon as possible.
|
||||||
|
* TRUE: it is allowed to release some buffers with a delay, and in
|
||||||
|
* a random order. */
|
||||||
|
BOOL AllowDISCARDDelayedRelease;
|
||||||
|
/* User preference for D3DSWAPEFFECT_DISCARD with D3DPRESENT_INTERVAL_IMMEDIATE.
|
||||||
|
* FALSE (Default): User prefers presentation to occur as soon as possible,
|
||||||
|
* with potential tearings.
|
||||||
|
* TRUE: User prefers presentation to be tear free. Requires
|
||||||
|
* AllowDISCARDDelayedRelease to have any effect. */
|
||||||
|
BOOL TearFreeDISCARD;
|
||||||
|
} D3DPRESENT_PARAMETERS2, *PD3DPRESENT_PARAMETERS2, *LPD3DPRESENT_PARAMETERS2;
|
||||||
|
|
||||||
/* Presentation backend for drivers to display their brilliant work */
|
/* Presentation backend for drivers to display their brilliant work */
|
||||||
typedef struct ID3DPresentVtbl
|
typedef struct ID3DPresentVtbl
|
||||||
{
|
{
|
||||||
@@ -75,6 +91,11 @@ typedef struct ID3DPresentVtbl
|
|||||||
BOOL (WINAPI *ResolutionMismatch)(ID3DPresent *This);
|
BOOL (WINAPI *ResolutionMismatch)(ID3DPresent *This);
|
||||||
HANDLE (WINAPI *CreateThread)(ID3DPresent *This, void *pThreadfunc, void *pParam);
|
HANDLE (WINAPI *CreateThread)(ID3DPresent *This, void *pThreadfunc, void *pParam);
|
||||||
BOOL (WINAPI *WaitForThread)(ID3DPresent *This, HANDLE thread);
|
BOOL (WINAPI *WaitForThread)(ID3DPresent *This, HANDLE thread);
|
||||||
|
/* Available since version 1.3 */
|
||||||
|
HRESULT (WINAPI *SetPresentParameters2)(ID3DPresent *This, D3DPRESENT_PARAMETERS2 *pParameters);
|
||||||
|
BOOL (WINAPI *IsBufferReleased)(ID3DPresent *This, D3DWindowBuffer *buffer);
|
||||||
|
/* Wait a buffer gets released. */
|
||||||
|
HRESULT (WINAPI *WaitBufferReleaseEvent)(ID3DPresent *This);
|
||||||
} ID3DPresentVtbl;
|
} ID3DPresentVtbl;
|
||||||
|
|
||||||
struct ID3DPresent
|
struct ID3DPresent
|
||||||
@@ -106,6 +127,9 @@ struct ID3DPresent
|
|||||||
#define ID3DPresent_ResolutionMismatch(p) (p)->lpVtbl->ResolutionMismatch(p)
|
#define ID3DPresent_ResolutionMismatch(p) (p)->lpVtbl->ResolutionMismatch(p)
|
||||||
#define ID3DPresent_CreateThread(p,a,b) (p)->lpVtbl->CreateThread(p,a,b)
|
#define ID3DPresent_CreateThread(p,a,b) (p)->lpVtbl->CreateThread(p,a,b)
|
||||||
#define ID3DPresent_WaitForThread(p,a) (p)->lpVtbl->WaitForThread(p,a)
|
#define ID3DPresent_WaitForThread(p,a) (p)->lpVtbl->WaitForThread(p,a)
|
||||||
|
#define ID3DPresent_SetPresentParameters2(p,a) (p)->lpVtbl->SetPresentParameters2(p,a)
|
||||||
|
#define ID3DPresent_IsBufferReleased(p,a) (p)->lpVtbl->IsBufferReleased(p,a)
|
||||||
|
#define ID3DPresent_WaitBufferReleaseEvent(p) (p)->lpVtbl->WaitBufferReleaseEvent(p)
|
||||||
|
|
||||||
typedef struct ID3DPresentGroupVtbl
|
typedef struct ID3DPresentGroupVtbl
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user