代码拉取完成,页面将自动刷新
#pragma once
#include "dut/WinMin.h"
#include "dut/DXTrace.h"
using namespace Microsoft::WRL;
namespace Dut
{
struct MeshIndice
{
ComPtr<ID3D11Buffer> m_pVertexBuffer;
ComPtr<ID3D11Buffer> m_pIndexBuffer;
DXGI_FORMAT m_IndiceType;
unsigned int m_VertexStride;
unsigned int m_NumIndices;
struct Desc
{
const void* vertices;
unsigned int vertexStride;
unsigned int vertexSize;
const void* indices;
unsigned int indiceStride;
unsigned int indiceSize;
unsigned int numIndices;
};
template<typename VertexType, typename IndiceType>
HRESULT Create(ID3D11Device* device,const std::vector<VertexType>& vertices, const std::vector<IndiceType>& indices)
{
Desc desc;
desc.vertices = &vertices[0];
desc.vertexStride = sizeof(VertexType);
desc.vertexSize = sizeof(VertexType) * vertices.size();
desc.indices = &indices[0];
desc.numIndices = indices.size();
desc.indiceStride = sizeof(IndiceType);
desc.indiceSize = indices.size() * sizeof(IndiceType);
return Create(device, desc);
}
HRESULT Create(ID3D11Device* device,const Desc& desc);
void DrawIndexed(ID3D11DeviceContext* context);
private:
DXGI_FORMAT GetIndiceType(const int& sz);
};
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。