⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 d3d9.h

📁 开放源码的编译器open watcom 1.6.0版的源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/*

	d3d9.h - Header file for the Direct3D9 API

	Written by Filip Navara <xnavara@volny.cz>

	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.

*/

#ifndef _D3D9_H
#define _D3D9_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif

#ifndef DIRECT3D_VERSION
#define DIRECT3D_VERSION  0x0900
#endif

#if (DIRECT3D_VERSION >= 0x0900)

#include <objbase.h>
#include "d3d9types.h"
#include "d3d9caps.h"

#define D3D_SDK_VERSION	31
#define D3DCREATE_FPU_PRESERVE	0x02
#define D3DCREATE_MULTITHREADED	0x04
#define D3DCREATE_PUREDEVICE	0x10
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING	0x20
#define D3DCREATE_HARDWARE_VERTEXPROCESSING	0x40
#define D3DCREATE_MIXED_VERTEXPROCESSING	0x80
#define D3DSPD_IUNKNOWN	1
#define D3DSGR_NO_CALIBRATION	0
#define D3DSGR_CALIBRATE	1
#define MAKE_D3DHRESULT(code)	MAKE_HRESULT(1,0x876,code)
#define MAKE_D3DSTATUS(code)	MAKE_HRESULT(0,0x876,code)
#define D3D_OK	0
#define D3DOK_NOAUTOGEN	MAKE_D3DSTATUS(2159)
#define D3DERR_WRONGTEXTUREFORMAT	MAKE_D3DHRESULT(2072)
#define D3DERR_UNSUPPORTEDCOLOROPERATION	MAKE_D3DHRESULT(2073)
#define D3DERR_UNSUPPORTEDCOLORARG	MAKE_D3DHRESULT(2074)
#define D3DERR_UNSUPPORTEDALPHAOPERATION	MAKE_D3DHRESULT(2075)
#define D3DERR_UNSUPPORTEDALPHAARG	MAKE_D3DHRESULT(2076)
#define D3DERR_TOOMANYOPERATIONS	MAKE_D3DHRESULT(2077)
#define D3DERR_CONFLICTINGTEXTUREFILTER	MAKE_D3DHRESULT(2078)
#define D3DERR_UNSUPPORTEDFACTORVALUE	MAKE_D3DHRESULT(2079)
#define D3DERR_CONFLICTINGRENDERSTATE	MAKE_D3DHRESULT(2081)
#define D3DERR_UNSUPPORTEDTEXTUREFILTER	MAKE_D3DHRESULT(2082)
#define D3DERR_CONFLICTINGTEXTUREPALETTE	MAKE_D3DHRESULT(2086)
#define D3DERR_DRIVERINTERNALERROR	MAKE_D3DHRESULT(2087)
#define D3DERR_NOTFOUND	MAKE_D3DHRESULT(2150)
#define D3DERR_MOREDATA	MAKE_D3DHRESULT(2151)
#define D3DERR_DEVICELOST	MAKE_D3DHRESULT(2152)
#define D3DERR_DEVICENOTRESET	MAKE_D3DHRESULT(2153)
#define D3DERR_NOTAVAILABLE	MAKE_D3DHRESULT(2154)
#define D3DERR_OUTOFVIDEOMEMORY	MAKE_D3DHRESULT(380)
#define D3DERR_INVALIDDEVICE	MAKE_D3DHRESULT(2155)
#define D3DERR_INVALIDCALL	MAKE_D3DHRESULT(2156)
#define D3DERR_DRIVERINVALIDCALL	MAKE_D3DHRESULT(2157)
#define D3DERR_WASSTILLDRAWING	MAKE_D3DHRESULT(540)
#define D3DADAPTER_DEFAULT	0
#define D3DCURSOR_IMMEDIATE_UPDATE	1
#define D3DENUM_HOST_ADAPTER	1
#define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER	1
#define D3DPV_DONOTCOPYDATA	1
#define D3DENUM_NO_WHQL_LEVEL	2
#define D3DPRESENT_BACK_BUFFERS_MAX	3
#define VALID_D3DENUM_FLAGS	3
#define D3DMAXNUMPRIMITIVES	0xFFFF
#define D3DMAXNUMVERTICES	0xFFFF
#define D3DCURRENT_DISPLAY_MODE	0xEFFFFF

#ifdef __cplusplus
extern "C" {
#endif
extern const GUID IID_IDirect3D9;
extern const GUID IID_IDirect3DDevice9;
extern const GUID IID_IDirect3DVolume9;
extern const GUID IID_IDirect3DSwapChain9;
extern const GUID IID_IDirect3DResource9;
extern const GUID IID_IDirect3DSurface9;
extern const GUID IID_IDirect3DVertexBuffer9;
extern const GUID IID_IDirect3DIndexBuffer9;
extern const GUID IID_IDirect3DBaseTexture9;
extern const GUID IID_IDirect3DCubeTexture9;
extern const GUID IID_IDirect3DTexture9;
extern const GUID IID_IDirect3DVolumeTexture9;
extern const GUID IID_IDirect3DVertexDeclaration9;
extern const GUID IID_IDirect3DVertexShader9;
extern const GUID IID_IDirect3DPixelShader9;
extern const GUID IID_IDirect3DStateBlock9;
extern const GUID IID_IDirect3DQuery9;
#ifdef __cplusplus
};
#endif

typedef _COM_interface IDirect3D9 IDirect3D9;
typedef _COM_interface IDirect3DDevice9 IDirect3DDevice9;
typedef _COM_interface IDirect3DVolume9 IDirect3DVolume9;
typedef _COM_interface IDirect3DSwapChain9 IDirect3DSwapChain9;
typedef _COM_interface IDirect3DResource9 IDirect3DResource9;
typedef _COM_interface IDirect3DSurface9 IDirect3DSurface9;
typedef _COM_interface IDirect3DVertexBuffer9 IDirect3DVertexBuffer9;
typedef _COM_interface IDirect3DIndexBuffer9 IDirect3DIndexBuffer9;
typedef _COM_interface IDirect3DBaseTexture9 IDirect3DBaseTexture9;
typedef _COM_interface IDirect3DCubeTexture9 IDirect3DCubeTexture9;
typedef _COM_interface IDirect3DTexture9 IDirect3DTexture9;
typedef _COM_interface IDirect3DVolumeTexture9 IDirect3DVolumeTexture9;
typedef _COM_interface IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9;
typedef _COM_interface IDirect3DVertexShader9 IDirect3DVertexShader9;
typedef _COM_interface IDirect3DPixelShader9 IDirect3DPixelShader9;
typedef _COM_interface IDirect3DStateBlock9 IDirect3DStateBlock9;
typedef _COM_interface IDirect3DQuery9 IDirect3DQuery9;

#undef INTERFACE
#define INTERFACE IDirect3D9
DECLARE_INTERFACE_(IDirect3D9,IUnknown)
{
	STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS) PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;
	STDMETHOD(RegisterSoftwareDevice)(THIS_ void* pInitializeFunction) PURE;
	STDMETHOD_(UINT,GetAdapterCount)(THIS) PURE;
	STDMETHOD(GetAdapterIdentifier)(THIS_ UINT,DWORD,D3DADAPTER_IDENTIFIER9*) PURE;
	STDMETHOD_(UINT,GetAdapterModeCount)(THIS_ UINT,D3DFORMAT) PURE;
	STDMETHOD(EnumAdapterModes)(THIS_ UINT,D3DFORMAT,UINT,D3DDISPLAYMODE*) PURE;
	STDMETHOD(GetAdapterDisplayMode)(THIS_ UINT,D3DDISPLAYMODE*) PURE;
	STDMETHOD(CheckDeviceType)(THIS_ UINT,D3DDEVTYPE,D3DFORMAT,D3DFORMAT,BOOL) PURE;
	STDMETHOD(CheckDeviceFormat)(THIS_ UINT,D3DDEVTYPE,D3DFORMAT,DWORD,D3DRESOURCETYPE,D3DFORMAT) PURE;
	STDMETHOD(CheckDeviceMultiSampleType)(THIS_ UINT,D3DDEVTYPE,D3DFORMAT,BOOL,D3DMULTISAMPLE_TYPE,DWORD*) PURE;
	STDMETHOD(CheckDepthStencilMatch)(THIS_ UINT,D3DDEVTYPE,D3DFORMAT,D3DFORMAT,D3DFORMAT) PURE;
	STDMETHOD(CheckDeviceFormatConversion)(THIS_ UINT,D3DDEVTYPE,D3DFORMAT,D3DFORMAT) PURE;
	STDMETHOD(GetDeviceCaps)(THIS_ UINT,D3DDEVTYPE,D3DCAPS9*) PURE;
	STDMETHOD_(HMONITOR,GetAdapterMonitor)(THIS_ UINT) PURE;
	STDMETHOD(CreateDevice)(THIS_ UINT,D3DDEVTYPE,HWND,DWORD,D3DPRESENT_PARAMETERS*,IDirect3DDevice9**) PURE;
};
typedef struct IDirect3D9 *LPDIRECT3D9, *PDIRECT3D9;

#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirect3D9_QueryInterface(p,a,b)	(p)->lpVtbl->QueryInterface(p,a,b)
#define IDirect3D9_AddRef(p)	(p)->lpVtbl->AddRef(p)
#define IDirect3D9_Release(p)	(p)->lpVtbl->Release(p)
#define IDirect3D9_RegisterSoftwareDevice(p,a)	(p)->lpVtbl->RegisterSoftwareDevice(p,a)
#define IDirect3D9_GetAdapterCount(p)	(p)->lpVtbl->GetAdapterCount(p)
#define IDirect3D9_GetAdapterIdentifier(p,a,b,c)	(p)->lpVtbl->GetAdapterIdentifier(p,a,b,c)
#define IDirect3D9_GetAdapterModeCount(p,a,b)	(p)->lpVtbl->GetAdapterModeCount(p,a,b)
#define IDirect3D9_EnumAdapterModes(p,a,b,c,d)	(p)->lpVtbl->EnumAdapterModes(p,a,b,c,d)
#define IDirect3D9_GetAdapterDisplayMode(p,a,b)	(p)->lpVtbl->GetAdapterDisplayMode(p,a,b)
#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e)	(p)->lpVtbl->CheckDeviceType(p,a,b,c,d,e)
#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f)	(p)->lpVtbl->CheckDeviceFormat(p,a,b,c,d,e,f)
#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f)	(p)->lpVtbl->CheckDeviceMultiSampleType(p,a,b,c,d,e,f)
#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e)	(p)->lpVtbl->CheckDepthStencilMatch(p,a,b,c,d,e)
#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d)	(p)->lpVtbl->CheckDeviceFormatConversion(p,a,b,c,d)
#define IDirect3D9_GetDeviceCaps(p,a,b,c)	(p)->lpVtbl->GetDeviceCaps(p,a,b,c)
#define IDirect3D9_GetAdapterMonitor(p,a)	(p)->lpVtbl->GetAdapterMonitor(p,a)
#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f)	(p)->lpVtbl->CreateDevice(p,a,b,c,d,e,f)
#else
#define IDirect3D9_QueryInterface(p,a,b)	(p)->QueryInterface(a,b)
#define IDirect3D9_AddRef(p)	(p)->AddRef()
#define IDirect3D9_Release(p)	(p)->Release()
#define IDirect3D9_RegisterSoftwareDevice(p,a)	(p)->RegisterSoftwareDevice(a)
#define IDirect3D9_GetAdapterCount(p)	(p)->GetAdapterCount()
#define IDirect3D9_GetAdapterIdentifier(p,a,b,c)	(p)->GetAdapterIdentifier(a,b,c)
#define IDirect3D9_GetAdapterModeCount(p,a,b)	(p)->GetAdapterModeCount(a,b)
#define IDirect3D9_EnumAdapterModes(p,a,b,c,d)	(p)->EnumAdapterModes(a,b,c,d)
#define IDirect3D9_GetAdapterDisplayMode(p,a,b)	(p)->GetAdapterDisplayMode(a,b)
#define IDirect3D9_CheckDeviceType(p,a,b,c,d,e)	(p)->CheckDeviceType(a,b,c,d,e)
#define IDirect3D9_CheckDeviceFormat(p,a,b,c,d,e,f)	(p)->CheckDeviceFormat(a,b,c,d,e,f)
#define IDirect3D9_CheckDeviceMultiSampleType(p,a,b,c,d,e,f)	(p)->CheckDeviceMultiSampleType(a,b,c,d,e,f)
#define IDirect3D9_CheckDepthStencilMatch(p,a,b,c,d,e)	(p)->CheckDepthStencilMatch(a,b,c,d,e)
#define IDirect3D9_CheckDeviceFormatConversion(p,a,b,c,d)	(p)->CheckDeviceFormatConversion(a,b,c,d)
#define IDirect3D9_GetDeviceCaps(p,a,b,c)	(p)->GetDeviceCaps(a,b,c)
#define IDirect3D9_GetAdapterMonitor(p,a)	(p)->GetAdapterMonitor(a)
#define IDirect3D9_CreateDevice(p,a,b,c,d,e,f)	(p)->CreateDevice(a,b,c,d,e,f)
#endif

#undef INTERFACE
#define INTERFACE IDirect3DDevice9
DECLARE_INTERFACE_(IDirect3DDevice9,IUnknown)
{
	STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
	STDMETHOD_(ULONG,AddRef)(THIS) PURE;
	STDMETHOD_(ULONG,Release)(THIS) PURE;
	STDMETHOD(TestCooperativeLevel)(THIS) PURE;
	STDMETHOD_(UINT,GetAvailableTextureMem)(THIS) PURE;
	STDMETHOD(EvictManagedResources)(THIS) PURE;
	STDMETHOD(GetDirect3D)(THIS_ IDirect3D9**) PURE;
	STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9*) PURE;
	STDMETHOD(GetDisplayMode)(THIS_ UINT,D3DDISPLAYMODE*) PURE;
	STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS*) PURE;
	STDMETHOD(SetCursorProperties)(THIS_ UINT,UINT,IDirect3DSurface9*) PURE;
	STDMETHOD_(void,SetCursorPosition)(THIS_ int,int,DWORD) PURE;
	STDMETHOD_(BOOL,ShowCursor)(THIS_ BOOL) PURE;
	STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS*,IDirect3DSwapChain9**) PURE;
	STDMETHOD(GetSwapChain)(THIS_ UINT,IDirect3DSwapChain9**) PURE;
	STDMETHOD_(UINT,GetNumberOfSwapChains)(THIS) PURE;
	STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS*) PURE;
	STDMETHOD(Present)(THIS_ CONST RECT*,CONST RECT*,HWND,CONST RGNDATA*) PURE;
	STDMETHOD(GetBackBuffer)(THIS_ UINT,UINT,D3DBACKBUFFER_TYPE,IDirect3DSurface9**) PURE;
	STDMETHOD(GetRasterStatus)(THIS_ UINT,D3DRASTER_STATUS*) PURE;
	STDMETHOD(SetDialogBoxMode)(THIS_ BOOL) PURE;
	STDMETHOD_(void,SetGammaRamp)(THIS_ UINT,DWORD,CONST D3DGAMMARAMP*) PURE;
	STDMETHOD_(void,GetGammaRamp)(THIS_ UINT,D3DGAMMARAMP*) PURE;
	STDMETHOD(CreateTexture)(THIS_ UINT,UINT,UINT,DWORD,D3DFORMAT,D3DPOOL,IDirect3DTexture9**,HANDLE*) PURE;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -