-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73810f3
commit f86b702
Showing
3 changed files
with
210 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef DXVK_SDL2_H | ||
#define DXVK_SDL2_H | ||
|
||
#include <windows.h> | ||
|
||
extern HRESULT dxvkInitWSI(void* factory); | ||
|
||
#endif /* DXVK_SDL2_H */ | ||
|
||
#ifdef DXVK_SDL2_IMPL | ||
|
||
#include <dxvk_wsi.h> | ||
|
||
/* TODO: Define static functions for WSI vtable */ | ||
|
||
static const DxvkCustomWsi dxvk_sdl2_wsi = { | ||
NULL | ||
}; | ||
|
||
HRESULT dxvkInitWSI(void* factory) | ||
{ | ||
IDxvkWsi *wsi; | ||
HRESULT res = IDXGIFactory1_QueryInterface( | ||
(IDXGIFactory1*) factory, | ||
&IID_IDxvkWsi, | ||
(void**) &wsi | ||
); | ||
if (FAILED(res)) | ||
{ | ||
return res; | ||
} | ||
|
||
return IDxvkWsi_SetWSI(wsi, &dxvk_sdl2_wsi); | ||
} | ||
|
||
#endif /* DXVK_SDL2_IMPL */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* TODO: Could be autogenerated by WIDL, but it's not... */ | ||
|
||
#ifdef _WIN32 | ||
#ifndef __REQUIRED_RPCNDR_H_VERSION__ | ||
#define __REQUIRED_RPCNDR_H_VERSION__ 475 | ||
#endif | ||
#include <rpc.h> | ||
#include <rpcndr.h> | ||
#endif | ||
|
||
#ifndef COM_NO_WINDOWS_H | ||
#include <windows.h> | ||
#include <ole2.h> | ||
#endif | ||
|
||
#ifndef DXVK_WSI_H | ||
#define DXVK_WSI_H | ||
|
||
#ifndef __IDxvkWsi_FWD_DEFINED__ | ||
#define __IDxvkWsi_FWD_DEFINED__ | ||
typedef interface IDxvkWsi IDxvkWsi; | ||
#ifdef __cplusplus | ||
interface IDxvkWsi; | ||
#endif /* __cplusplus */ | ||
#endif | ||
|
||
/* DXVK WSI Application Function Table */ | ||
typedef struct DxvkCustomWsi | ||
{ | ||
/* TODO: vtable to pass to IDxvkWsi */ | ||
LPVOID filler; | ||
} DxvkCustomWsi; | ||
|
||
/***************************************************************************** | ||
* IDxvkWsi interface | ||
*/ | ||
#ifndef __IDxvkWsi_INTERFACE_DEFINED__ | ||
#define __IDxvkWsi_INTERFACE_DEFINED__ | ||
|
||
DEFINE_GUID(IID_IDxvkWsi, 0x00000000, 0x0000, 0x0000, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00); | ||
#if defined(__cplusplus) && !defined(CINTERFACE) | ||
MIDL_INTERFACE("00000000-0000-0000-0000-000000000000") | ||
IDxvkWsi : public IUnknown | ||
{ | ||
virtual HRESULT STDMETHODCALLTYPE SetWSI( | ||
DxvkWsi *wsi) = 0; | ||
}; | ||
#ifdef __CRT_UUID_DECL | ||
__CRT_UUID_DECL(IDxvkWsi, 0x00000000, 0x0000, 0x0000, 0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00) | ||
#endif | ||
#else | ||
typedef struct IDxvkWsiVtbl { | ||
BEGIN_INTERFACE | ||
|
||
/*** IUnknown methods ***/ | ||
HRESULT (STDMETHODCALLTYPE *QueryInterface)( | ||
IDxvkWsi *This, | ||
REFIID riid, | ||
void **ppvObject); | ||
|
||
ULONG (STDMETHODCALLTYPE *AddRef)( | ||
IDxvkWsi *This); | ||
|
||
ULONG (STDMETHODCALLTYPE *Release)( | ||
IDxvkWsi *This); | ||
|
||
/*** IDxvkWsi methods ***/ | ||
HRESULT (STDMETHODCALLTYPE *SetWSI)( | ||
IDxvkWsi *This, | ||
const DxvkCustomWsi *wsi); | ||
|
||
END_INTERFACE | ||
} IDxvkWsiVtbl; | ||
|
||
interface IDxvkWsi { | ||
CONST_VTBL IDxvkWsiVtbl* lpVtbl; | ||
}; | ||
|
||
#ifdef COBJMACROS | ||
#ifndef WIDL_C_INLINE_WRAPPERS | ||
/*** IUnknown methods ***/ | ||
#define IDxvkWsi_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject) | ||
#define IDxvkWsi_AddRef(This) (This)->lpVtbl->AddRef(This) | ||
#define IDxvkWsi_Release(This) (This)->lpVtbl->Release(This) | ||
/*** IDxvkWsi methods ***/ | ||
#define IDxvkWsi_SetWSI(This,wsi) (This)->lpVtbl->SetWSI(This,wsi) | ||
#else | ||
/*** IUnknown methods ***/ | ||
static FORCEINLINE HRESULT IDxvkWsi_QueryInterface(IDxvkWsi* This,REFIID riid,void **ppvObject) { | ||
return This->lpVtbl->QueryInterface(This,riid,ppvObject); | ||
} | ||
static FORCEINLINE ULONG IDxvkWsi_AddRef(IDxvkWsi* This) { | ||
return This->lpVtbl->AddRef(This); | ||
} | ||
static FORCEINLINE ULONG IDxvkWsi_Release(IDxvkWsi* This) { | ||
return This->lpVtbl->Release(This); | ||
} | ||
/*** IDxvkWsi methods ***/ | ||
static FORCEINLINE HRESULT IDxvkWsi_SetWSI(IDxvkWsi* This,const DxvkCustomWsi *wsi) { | ||
return This->lpVtbl->SetWSI(This,wsi); | ||
} | ||
#endif | ||
#endif | ||
|
||
#endif | ||
|
||
|
||
#endif /* __IDxvkWsi_INTERFACE_DEFINED__ */ | ||
|
||
#endif /* DXVK_WSI_H */ |