textures du model

This commit is contained in:
StratiX0
2024-03-21 10:59:13 +01:00
parent fac2881d85
commit f943d9c05f
13 changed files with 902 additions and 54 deletions

View File

@@ -1,6 +1,3 @@
////////////////////////////////////////////////////////////////////////////////
// Filename: modelclass.h
////////////////////////////////////////////////////////////////////////////////
#ifndef _MODELCLASS_H_
#define _MODELCLASS_H_
@@ -12,6 +9,11 @@
#include <directxmath.h>
using namespace DirectX;
///////////////////////
// MY CLASS INCLUDES //
///////////////////////
#include "textureclass.h"
////////////////////////////////////////////////////////////////////////////////
// Class name: ModelClass
@@ -19,10 +21,11 @@ using namespace DirectX;
class ModelClass
{
private:
struct VertexType
{
XMFLOAT3 position;
XMFLOAT4 color;
XMFLOAT2 texture;
};
public:
@@ -30,20 +33,25 @@ public:
ModelClass(const ModelClass&);
~ModelClass();
bool Initialize(ID3D11Device*);
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