以下是 ID3D11Device 接口的定义:
DECLARE_INTERFACE_(ID3D11Device, IUnknown)
{
// Methods for creating resources and managing the device
STDMETHOD(CreateBuffer)(THIS_ const D3D11_BUFFER_DESC *pDesc, const D3D11_SUBRESOURCE_DATA *pInitialData, ID3D11Buffer **ppBuffer) PURE;
STDMETHOD(CreateTexture1D)(THIS_ const D3D11_TEXTURE1D_DESC *pDesc, const D3D11_SUBRESOURCE_DATA *pInitialData, ID3D11Texture1D **ppTexture1D) PURE;
STDMETHOD(CreateTexture2D)(THIS_ const D3D11_TEXTURE2D_DESC *pDesc, const D3D11_SUBRESOURCE_DATA *pInitialData, ID3D11Texture2D **ppTexture2D) PURE;
STDMETHOD(CreateTexture3D)(THIS_ const D3D11_TEXTURE3D_DESC *pDesc, const D3D11_SUBRESOURCE_DATA *pInitialData, ID3D11Texture3D **ppTexture3D) PURE;
// ... (其他创建资源的方法)
// Methods for creating views
STDMETHOD(CreateRenderTargetView)(THIS_ ID3D11Resource *pResource, const D3D11_RENDER_TARGET_VIEW_DESC *pDesc, ID3D11RenderTargetView **ppRTView) PURE;
STDMETHOD(CreateDepthStencilView)(THIS_ ID3D11Resource *pResource, const D3D11_DEPTH_STENCIL_VIEW_DESC *pDesc, ID3D11DepthStencilView **ppDepthStencilView) PURE;
STDMETHOD(CreateShaderResourceView)(THIS_ ID3D11Resource *pResource, const D3D11_SHADER_RESOURCE_VIEW_DESC *pDesc, ID3D11ShaderResourceView **ppSRView) PURE;
// ... (其他创建视图的方法)
// Methods for creating shaders
STDMETHOD(CreateVertexShader)(THIS_ const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D11ClassLinkage *pClassLinkage, ID3D11VertexShader **ppVertexShader) PURE;
STDMETHOD(CreatePixelShader)(THIS_ const void *pShaderBytecode, SIZE_T BytecodeLength, ID3D11ClassLinkage *pClassLinkage, ID3D11PixelShader **ppPixelShader) PURE;
// ... (其他创建着色器的方法)
// ... (其他方法用于设备管理和状态设置)
};
ID3D11Device 接口派生自 IUnknown 接口,它包含一系列方法,用于创建各种资源(如缓冲区、纹理等)、视图(如渲染目标视图、深度模板视图等)和着色器(如顶点着色器、像素着色器等),以及管理设备状态等。
通过 ID3D11Device 接口,应用程序可以与 Direct3D 11 图形设备进行交互,创建和配置渲染管线所需的各种资源和对象,以实现图形渲染和计算。
转载请注明出处:http://www.zyzy.cn/article/detail/25785/Win32 API/D3d11.h/ID3D11Device