📄 d3d.h
字号:
/*==========================================================================; * * Copyright (C) 1995-1996 Microsoft Corporation. All Rights Reserved. * * File: d3d.h * Content: Direct3D include file * ***************************************************************************/#ifndef _D3D_H_#define _D3D_H_#include <stdlib.h>#ifdef _WIN32#define COM_NO_WINDOWS_H#include <objbase.h>#else#include "d3dcom.h"#endif#ifdef _WIN32#define D3DAPI WINAPI#else#define D3DAPI#endif/* * Interface IID's */#if defined( _WIN32 ) && !defined( _NO_COM)DEFINE_GUID( IID_IDirect3D, 0x3BBA0080,0x2421,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );DEFINE_GUID( IID_IDirect3DTexture, 0x2CDCD9E0,0x25A0,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56 );DEFINE_GUID( IID_IDirect3DLight, 0x4417C142,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );DEFINE_GUID( IID_IDirect3DMaterial, 0x4417C144,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );DEFINE_GUID( IID_IDirect3DExecuteBuffer,0x4417C145,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );DEFINE_GUID( IID_IDirect3DViewport, 0x4417C146,0x33AD,0x11CF,0x81,0x6F,0x00,0x00,0xC0,0x20,0x15,0x6E );#endif#ifdef __cplusplusextern "C" {#endif/* * Data structures */#ifdef __cplusplus/* 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined */struct IDirect3D;struct IDirect3DDevice;struct IDirect3DExecuteBuffer;struct IDirect3DLight;struct IDirect3DMaterial;struct IDirect3DTexture;struct IDirect3DViewport;typedef struct IDirect3D *LPDIRECT3D;typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;typedef struct IDirect3DLight *LPDIRECT3DLIGHT;typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;#elsetypedef struct IDirect3D *LPDIRECT3D;typedef struct IDirect3DDevice *LPDIRECT3DDEVICE;typedef struct IDirect3DExecuteBuffer *LPDIRECT3DEXECUTEBUFFER;typedef struct IDirect3DLight *LPDIRECT3DLIGHT;typedef struct IDirect3DMaterial *LPDIRECT3DMATERIAL;typedef struct IDirect3DTexture *LPDIRECT3DTEXTURE;typedef struct IDirect3DViewport *LPDIRECT3DVIEWPORT;#endif#include "d3dtypes.h"#include "d3dcaps.h"/* * IDirect3D */#undef INTERFACE#define INTERFACE IDirect3DDECLARE_INTERFACE_(IDirect3D, IUnknown){ /*** IUnknown methods ***/ STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; /*** IDirect3D methods ***/ STDMETHOD(Initialize) (THIS_ REFIID) PURE; STDMETHOD(EnumDevices)(THIS_ LPD3DENUMDEVICESCALLBACK, LPVOID) PURE; STDMETHOD(CreateLight) (THIS_ LPDIRECT3DLIGHT*, IUnknown*) PURE; STDMETHOD(CreateMaterial) (THIS_ LPDIRECT3DMATERIAL*, IUnknown*) PURE; STDMETHOD(CreateViewport) (THIS_ LPDIRECT3DVIEWPORT*, IUnknown*) PURE; STDMETHOD(FindDevice)(THIS_ LPD3DFINDDEVICESEARCH, LPD3DFINDDEVICERESULT) PURE;};#if !defined(__cplusplus) || defined(CINTERFACE)#define IDirect3D_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)#define IDirect3D_AddRef(p) (p)->lpVtbl->AddRef(p)#define IDirect3D_Release(p) (p)->lpVtbl->Release(p)#define IDirect3D_Initialize(p, a) (p)->lpVtbl->Initialize(p, a)#define IDirect3D_EnumDevices(p, a, b) (p)->lpVtbl->EnumDevices(p, a, b)#define IDirect3D_CreateLight(p, a, b) (p)->lpVtbl->CreateLight(p, a, b)#define IDirect3D_CreateMaterial(p, a, b) (p)->lpVtbl->CreateMaterial(p, a, b)#define IDirect3D_CreateViewport(p, a, b) (p)->lpVtbl->CreateViewport(p, a, b)#define IDirect3D_FindDevice(p, a, b) (p)->lpVtbl->FindDevice(p, a, b)#endif/* * IDirect3DDevice */#undef INTERFACE#define INTERFACE IDirect3DDeviceDECLARE_INTERFACE_(IDirect3DDevice, IUnknown){ /*** IUnknown methods ***/ STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; /*** IDirect3DDevice methods ***/ STDMETHOD(Initialize) (THIS_ LPDIRECT3D, LPGUID, LPD3DDEVICEDESC) PURE; STDMETHOD(GetCaps) (THIS_ LPD3DDEVICEDESC, LPD3DDEVICEDESC) PURE; STDMETHOD(SwapTextureHandles) (THIS_ LPDIRECT3DTEXTURE, LPDIRECT3DTEXTURE) PURE; STDMETHOD(CreateExecuteBuffer) (THIS_ LPD3DEXECUTEBUFFERDESC, LPDIRECT3DEXECUTEBUFFER*, IUnknown*) PURE; STDMETHOD(GetStats) (THIS_ LPD3DSTATS) PURE; STDMETHOD(Execute) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD) PURE; STDMETHOD(AddViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE; STDMETHOD(DeleteViewport) (THIS_ LPDIRECT3DVIEWPORT) PURE; STDMETHOD(NextViewport) (THIS_ LPDIRECT3DVIEWPORT, LPDIRECT3DVIEWPORT*, DWORD) PURE; STDMETHOD(Pick) (THIS_ LPDIRECT3DEXECUTEBUFFER, LPDIRECT3DVIEWPORT, DWORD, LPD3DRECT) PURE; STDMETHOD(GetPickRecords)(THIS_ LPDWORD, LPD3DPICKRECORD) PURE; STDMETHOD(EnumTextureFormats) (THIS_ LPD3DENUMTEXTUREFORMATSCALLBACK, LPVOID) PURE; STDMETHOD(CreateMatrix) (THIS_ LPD3DMATRIXHANDLE) PURE; STDMETHOD(SetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE; STDMETHOD(GetMatrix) (THIS_ D3DMATRIXHANDLE, LPD3DMATRIX) PURE; STDMETHOD(DeleteMatrix) (THIS_ D3DMATRIXHANDLE) PURE; STDMETHOD_(HRESULT, BeginScene) (THIS) PURE; STDMETHOD_(HRESULT, EndScene) (THIS) PURE; STDMETHOD(GetDirect3D) (THIS_ LPDIRECT3D*) PURE;};#if !defined(__cplusplus) || defined(CINTERFACE)#define IDirect3DDevice_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)#define IDirect3DDevice_AddRef(p) (p)->lpVtbl->AddRef(p)#define IDirect3DDevice_Release(p) (p)->lpVtbl->Release(p)#define IDirect3DDevice_Initialize(p, a, b, c) (p)->lpVtbl->Initialize(p, a, b, c)#define IDirect3DDevice_GetCaps(p, a, b) (p)->lpVtbl->GetCaps(p, a, b)#define IDirect3DDevice_SwapTextureHandles(p, a, b) (p)->lpVtbl->SwapTextureHandles(p, a, b)#define IDirect3DDevice_CreateExecuteBuffer(p, a, b, c) (p)->lpVtbl->ExecuteBuffer(p, a, b, c)#define IDirect3DDevice_GetStats(p, a) (p)->lpVtbl->CreateViewport(p, a)#define IDirect3DDevice_Execute(p, a, b, c) (p)->lpVtbl->Execute(p, a, b, c)#define IDirect3DDevice_AddViewport(p, a) (p)->lpVtbl->AddViewport(p, a)#define IDirect3DDevice_DeleteViewport(p, a) (p)->lpVtbl->DeleteViewport(p, a)#define IDirect3DDevice_NextViewport(p, a, b) (p)->lpVtbl->NextViewport(p, a, b)#define IDirect3DDevice_Pick(p, a, b, c, d) (p)->lpVtbl->Pick(p, a, b, c, d)#define IDirect3DDevice_GetPickRecords(p, a, b) (p)->lpVtbl->GetPickRecords(p, a, b)#define IDirect3DDevice_EnumTextureFormats(p, a, b) (p)->lpVtbl->EnumTextureFormats(p, a, b)#define IDirect3DDevice_CreateMatrix(p, a) (p)->lpVtbl->CreateMatrix(p, a)#define IDirect3DDevice_SetMatrix(p, a, b) (p)->lpVtbl->SetMatrix(p, a, b)#define IDirect3DDevice_GetMatrix(p, a, b) (p)->lpVtbl->GetMatrix(p, a, b)#define IDirect3DDevice_DeleteMatrix(p, a) (p)->lpVtbl->DeleteMatrix(p, a)#define IDirect3DDevice_BeginScene(p) (p)->lpVtbl->BeginScene(p)#define IDirect3DDevice_EndScene(p) (p)->lpVtbl->EndScene(p)#define IDirect3DDevice_GetDirect3D(p, a) (p)->lpVtbl->GetDirect3D(p, a)#endif/* * IDirect3DExecuteBuffer */#undef INTERFACE#define INTERFACE IDirect3DExecuteBufferDECLARE_INTERFACE_(IDirect3DExecuteBuffer, IUnknown){ /*** IUnknown methods ***/ STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; STDMETHOD_(ULONG, AddRef) (THIS) PURE; STDMETHOD_(ULONG, Release) (THIS) PURE; /*** IDirect3DExecuteBuffer methods ***/ STDMETHOD(Initialize) (THIS_ LPDIRECT3DDEVICE, LPD3DEXECUTEBUFFERDESC) PURE; STDMETHOD(Lock) (THIS_ LPD3DEXECUTEBUFFERDESC) PURE; STDMETHOD_(HRESULT, Unlock) (THIS) PURE; STDMETHOD(SetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE; STDMETHOD(GetExecuteData) (THIS_ LPD3DEXECUTEDATA) PURE; STDMETHOD(Validate) (THIS_ LPDWORD, LPD3DVALIDATECALLBACK, LPVOID, DWORD) PURE; STDMETHOD(Optimize) (THIS_ DWORD) PURE;};#if !defined(__cplusplus) || defined(CINTERFACE)#define IDirect3DExecuteBuffer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)#define IDirect3DExecuteBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)#define IDirect3DExecuteBuffer_Release(p) (p)->lpVtbl->Release(p)#define IDirect3DExecuteBuffer_Initialize(p, a, b) (p)->lpVtbl->Initialize(p, a, b)#define IDirect3DExecuteBuffer_Lock(p, a) (p)->lpVtbl->Lock(p, a)#define IDirect3DExecuteBuffer_Unlock(p, a) (p)->lpVtbl->Unlock(p)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -