-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.h
More file actions
53 lines (44 loc) · 902 Bytes
/
Model.h
File metadata and controls
53 lines (44 loc) · 902 Bytes
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include <d3d11.h>
#include <D3DX10math.h>
#include <fstream>
using namespace std;
#include "Texture.h"
class Model
{
private:
struct VertexType
{
D3DXVECTOR3 position;
D3DXVECTOR2 texture;
D3DXVECTOR3 normal;
};
struct ModelType
{
float x, y, z;
float tu, tv;
float nx, ny, nz;
};
public:
Model();
Model(const Model&);
~Model();
bool initialize(ID3D11Device*, char*, WCHAR*);
void shutdown();
void render(ID3D11DeviceContext*);
int getIndexCount();
ID3D11ShaderResourceView* getTexture();
private:
bool initializeBuffers(ID3D11Device*);
void shutdownBuffers();
void renderBuffers(ID3D11DeviceContext*);
bool loadTexture(ID3D11Device*, WCHAR*);
void releaseTexture();
bool loadModel(char*);
void releaseModel();
private:
ID3D11Buffer *m_vertexBuffer, *m_indexBuffer;
int m_vertexCount, m_indexCount;
Texture* m_texture;
ModelType* m_model;
};