Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- include/Makefile.in | 2 +- include/d3dx10core.h | 116 +++++++++++++++++++++++++++++++++++++++++ include/d3dx10core.idl | 75 -------------------------- 3 files changed, 117 insertions(+), 76 deletions(-) create mode 100644 include/d3dx10core.h delete mode 100644 include/d3dx10core.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 9b397ffa183..e262d7d3936 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -142,7 +142,7 @@ SOURCES = \ d3dvec.inl \ d3dx10.h \ d3dx10async.h \ - d3dx10core.idl \ + d3dx10core.h \ d3dx10math.h \ d3dx10tex.h \ d3dx11.h \ diff --git a/include/d3dx10core.h b/include/d3dx10core.h new file mode 100644 index 00000000000..053e3a9c072 --- /dev/null +++ b/include/d3dx10core.h @@ -0,0 +1,116 @@ +/* + * Copyright 2015 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "d3dx10.h" + +DEFINE_GUID(IID_ID3DX10ThreadPump, 0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb); + +#define INTERFACE ID3DX10DataLoader +DECLARE_INTERFACE(ID3DX10DataLoader) +{ + STDMETHOD(Load)(THIS) PURE; + STDMETHOD(Decompress)(THIS_ void **data, SIZE_T *bytes) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** ID3DX10DataLoader methods ***/ +#define ID3DX10DataLoader_Load(p) (p)->lpVtbl->Load(p) +#define ID3DX10DataLoader_Decompress(p,a,b) (p)->lpVtbl->Decompress(p,a,b) +#define ID3DX10DataLoader_Destroy(p) (p)->lpVtbl->Destroy(p) +#else +/*** ID3DX10DataLoader methods ***/ +#define ID3DX10DataLoader_Load(p) (p)->Load() +#define ID3DX10DataLoader_Decompress(p,a,b) (p)->Decompress(a,b) +#define ID3DX10DataLoader_Destroy(p) (p)->Destroy() +#endif + +#define INTERFACE ID3DX10DataProcessor +DECLARE_INTERFACE(ID3DX10DataProcessor) +{ + STDMETHOD(Process)(THIS_ void *data, SIZE_T bytes) PURE; + STDMETHOD(CreateDeviceObject)(THIS_ void **dataobject) PURE; + STDMETHOD(Destroy)(THIS) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** ID3DX10DataProcessor methods ***/ +#define ID3DX10DataProcessor_Process(p,a,b) (p)->lpVtbl->Process(p,a,b) +#define ID3DX10DataProcessor_CreateDeviceObject(p,a) (p)->lpVtbl->CreateDeviceObject(p,a) +#define ID3DX10DataProcessor_Destroy(p) (p)->lpVtbl->Destroy(p) +#else +/*** ID3DX10DataProcessor methods ***/ +#define ID3DX10DataProcessor_Process(p,a,b) (p)->Process(a,b) +#define ID3DX10DataProcessor_CreateDeviceObject(p,a) (p)->CreateDeviceObject(a) +#define ID3DX10DataProcessor_Destroy(p) (p)->Destroy() +#endif + +#define INTERFACE ID3DX10ThreadPump +DECLARE_INTERFACE_(ID3DX10ThreadPump, IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + /*** ID3DX10ThreadPump methods ***/ + STDMETHOD(AddWorkItem)(THIS_ ID3DX10DataLoader *loader, ID3DX10DataProcessor *processor, + HRESULT *result, void **object) PURE; + STDMETHOD_(UINT, GetWorkItemCount)(THIS) PURE; + STDMETHOD(WaitForAllItems)(THIS) PURE; + STDMETHOD(ProcessDeviceWorkItems)(THIS_ UINT count) PURE; + STDMETHOD(PurgeAllItems)(THIS) PURE; + STDMETHOD(GetQueueStatus)(THIS_ UINT *queue, UINT *processqueue, UINT *devicequeue) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) +/*** IUnknown methods ***/ +#define ID3DX10ThreadPump_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define ID3DX10ThreadPump_AddRef(p) (p)->lpVtbl->AddRef(p) +#define ID3DX10ThreadPump_Release(p) (p)->lpVtbl->Release(p) +/*** ID3DX10ThreadPump methods ***/ +#define ID3DX10ThreadPump_AddWorkItem(p,a,b,c,d) (p)->lpVtbl->AddWorkItem(p,a,b,c,d) +#define ID3DX10ThreadPump_GetWorkItemCount(p) (p)->lpVtbl->GetWorkItemCount(p) +#define ID3DX10ThreadPump_WaitForAllItems(p) (p)->lpVtbl->WaitForAllItems(p) +#define ID3DX10ThreadPump_ProcessDeviceWorkItems(p,a) (p)->lpVtbl->ProcessDeviceWorkItems(p,a) +#define ID3DX10ThreadPump_PurgeAllItems(p) (p)->lpVtbl->PurgeAllItems(p) +#define ID3DX10ThreadPump_GetQueueStatus(p,a,b,c) (p)->lpVtbl->GetQueueStatus(p,a,b,c) +#else +/*** IUnknown methods ***/ +#define ID3DX10ThreadPump_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define ID3DX10ThreadPump_AddRef(p) (p)->AddRef() +#define ID3DX10ThreadPump_Release(p) (p)->Release() +/*** ID3DX10ThreadPump methods ***/ +#define ID3DX10ThreadPump_AddWorkItem(p,a,b,c,d) (p)->AddWorkItem(a,b,c,d) +#define ID3DX10ThreadPump_GetWorkItemCount(p) (p)->GetWorkItemCount() +#define ID3DX10ThreadPump_WaitForAllItems(p) (p)->WaitForAllItems() +#define ID3DX10ThreadPump_ProcessDeviceWorkItems(p,a) (p)->ProcessDeviceWorkItems(a) +#define ID3DX10ThreadPump_PurgeAllItems(p) (p)->PurgeAllItems() +#define ID3DX10ThreadPump_GetQueueStatus(p,a,b,c) (p)->GetQueueStatus(a,b,c) +#endif + +HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *device); +HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, unsigned int flags, ID3D10Device **device); +HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, unsigned int flags, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain, + ID3D10Device **device); +typedef interface ID3D10Device1 ID3D10Device1; +HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *device, ID3D10Device1 **device1); diff --git a/include/d3dx10core.idl b/include/d3dx10core.idl deleted file mode 100644 index 88f13d07650..00000000000 --- a/include/d3dx10core.idl +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2015 Alistair Leslie-Hughes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -import "oaidl.idl"; -import "ocidl.idl"; -import "dxgi.idl"; -import "d3dcommon.idl"; - -[ - object, - local, - pointer_default(unique) -] -interface ID3DX10DataLoader -{ - HRESULT Load(); - HRESULT Decompress([out] void **data, [in] SIZE_T *bytes); - HRESULT Destroy(); -} - -[ - object, - local, - pointer_default(unique) -] -interface ID3DX10DataProcessor -{ - HRESULT Process([in] void *data, [in] SIZE_T bytes); - HRESULT CreateDeviceObject([out] void **dataobject); - HRESULT Destroy(); -} - - -[ - object, - local, - pointer_default(unique), - uuid(c93fecfa-6967-478a-abbc-402d90621fcb) -] -interface ID3DX10ThreadPump : IUnknown -{ - HRESULT AddWorkItem([in] ID3DX10DataLoader *loader, [in] ID3DX10DataProcessor *processor, - [in] HRESULT *result, [out] void **object); - UINT GetWorkItemCount(); - - HRESULT WaitForAllItems(); - HRESULT ProcessDeviceWorkItems([in] UINT count); - - HRESULT PurgeAllItems(); - HRESULT GetQueueStatus([in] UINT *queue, [in] UINT *processqueue, [in] UINT *devicequeue); -} - -cpp_quote("HRESULT WINAPI D3DX10UnsetAllDeviceObjects(ID3D10Device *device);") -cpp_quote("HRESULT WINAPI D3DX10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,") -cpp_quote(" HMODULE swrast, unsigned int flags, ID3D10Device **device);") -cpp_quote("HRESULT WINAPI D3DX10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type,") -cpp_quote(" HMODULE swrast, unsigned int flags, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain,") -cpp_quote(" ID3D10Device **device);") -interface ID3D10Device1; -cpp_quote("HRESULT WINAPI D3DX10GetFeatureLevel1(ID3D10Device *device, ID3D10Device1 **device1);")