57 lines
1.1 KiB
C++
57 lines
1.1 KiB
C++
#ifndef _MODELCLASS_H_
|
|
#define _MODELCLASS_H_
|
|
|
|
|
|
//////////////
|
|
// INCLUDES //
|
|
//////////////
|
|
#include <d3d11.h>
|
|
#include <directxmath.h>
|
|
using namespace DirectX;
|
|
|
|
///////////////////////
|
|
// MY CLASS INCLUDES //
|
|
///////////////////////
|
|
#include "textureclass.h"
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
// Class name: ModelClass
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
class ModelClass
|
|
{
|
|
private:
|
|
|
|
struct VertexType
|
|
{
|
|
XMFLOAT3 position;
|
|
XMFLOAT2 texture;
|
|
};
|
|
|
|
public:
|
|
ModelClass();
|
|
ModelClass(const ModelClass&);
|
|
~ModelClass();
|
|
|
|
bool Initialize(ID3D11Device*, ID3D11DeviceContext*, char*);
|
|
void Shutdown();
|
|
void Render(ID3D11DeviceContext*);
|
|
|
|
int GetIndexCount();
|
|
|
|
ID3D11ShaderResourceView* GetTexture();
|
|
|
|
private:
|
|
bool InitializeBuffers(ID3D11Device*);
|
|
void ShutdownBuffers();
|
|
void RenderBuffers(ID3D11DeviceContext*);
|
|
bool LoadTexture(ID3D11Device*, ID3D11DeviceContext*, char*);
|
|
void ReleaseTexture();
|
|
|
|
private:
|
|
ID3D11Buffer* m_vertexBuffer, * m_indexBuffer;
|
|
int m_vertexCount, m_indexCount;
|
|
TextureClass* m_Texture;
|
|
};
|
|
|
|
#endif |