1 //// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
2 //// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3 //// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
4 //// PARTICULAR PURPOSE.
6 //// Copyright (c) Microsoft Corporation. All rights reserved
10 #include "BasicMath.h"
12 // this struct represents the vertex format for the shapes generated in the functions below
15 float3 pos; // position
16 float3 norm; // surface normal vector
17 float2 tex; // texture coordinate
20 // this struct represents the vertex format for all shapes generated in the functions below
23 float3 pos; // position
24 float2 tex; // texture coordinate
25 float3 uTan; // texture coordinate u-tangent vector
26 float3 vTan; // texture coordinate v-tangent vector
32 BasicShapes(ID3D11Device *d3dDevice);
34 _Out_ ID3D11Buffer **vertexBuffer,
35 _Out_ ID3D11Buffer **indexBuffer,
36 _Out_opt_ unsigned int *vertexCount,
37 _Out_opt_ unsigned int *indexCount
41 _Out_ ID3D11Buffer **vertexBuffer,
42 _Out_ ID3D11Buffer **indexBuffer,
43 _Out_opt_ unsigned int *vertexCount,
44 _Out_opt_ unsigned int *indexCount
47 _Out_ ID3D11Buffer **vertexBuffer,
48 _Out_ ID3D11Buffer **indexBuffer,
49 _Out_opt_ unsigned int *vertexCount,
50 _Out_opt_ unsigned int *indexCount
52 void CreateTangentSphere(
53 _Out_ ID3D11Buffer **vertexBuffer,
54 _Out_ ID3D11Buffer **indexBuffer,
55 _Out_opt_ unsigned int *vertexCount,
56 _Out_opt_ unsigned int *indexCount
58 void CreateReferenceAxis(
59 _Out_ ID3D11Buffer **vertexBuffer,
60 _Out_ ID3D11Buffer **indexBuffer,
61 _Out_opt_ unsigned int *vertexCount,
62 _Out_opt_ unsigned int *indexCount
66 Microsoft::WRL::ComPtr<ID3D11Device> m_d3dDevice;
68 void CreateVertexBuffer(
69 _In_ unsigned int numVertices,
70 _In_ BasicVertex *vertexData,
71 _Out_ ID3D11Buffer **vertexBuffer
74 void CreateIndexBuffer(
75 _In_ unsigned int numIndices,
76 _In_ unsigned short *indexData,
77 _Out_ ID3D11Buffer **indexBuffer
80 void CreateTangentVertexBuffer(
81 _In_ unsigned int numVertices,
82 _In_ TangentVertex *vertexData,
83 _Out_ ID3D11Buffer **vertexBuffer