forked from ScruffyFurn/SumoDX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMeshObject.h
25 lines (21 loc) · 935 Bytes
/
MeshObject.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once
// MeshObject:
// This class is the generic (abstract) representation of D3D11 Indexed triangle
// list. Each of the derived classes is just the constructor for the specific
// geometry primitive. This abstract class does not place any requirements on
// the format of the geometry directly.
// The primary method of the MeshObject is Render. The default implementation
// just sets the IndexBuffer, VertexBuffer and topology to a TriangleList and
// makes a DrawIndexed call on the context. It assumes all other states have
// been set on the context already.
ref class MeshObject abstract
{
internal:
MeshObject();
virtual void Render(_In_ ID3D11DeviceContext *context);
protected private:
Microsoft::WRL::ComPtr<ID3D11Buffer> m_vertexBuffer;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_indexBuffer;
int m_vertexCount;
int m_indexCount;
};