Khaotic Engine Reborn
Loading...
Searching...
No Matches
sprite_class.h
1#ifndef _SPRITECLASS_H_
2#define _SPRITECLASS_H_
3
4
6// INCLUDES //
8#include <directxmath.h>
9#include <fstream>
10using namespace DirectX;
11
12
14// MY CLASS INCLUDES //
16#include "texture_class.h"
17
18
20// Class name: sprite_class
23{
24private:
25 struct VertexType
26 {
27 XMFLOAT3 position;
28 XMFLOAT2 texture;
29 };
30
31public:
35
36 bool Initialize(ID3D11Device*, ID3D11DeviceContext*, int, int, char*, int, int);
37 void Shutdown();
38 bool Render(ID3D11DeviceContext*);
39 void Update(float);
40
41 int GetIndexCount();
42 ID3D11ShaderResourceView* GetTexture();
43
44 void SetRenderLocation(int, int);
45
46private:
47 bool InitializeBuffers(ID3D11Device*);
48 void ShutdownBuffers();
49 bool UpdateBuffers(ID3D11DeviceContext*);
50 void RenderBuffers(ID3D11DeviceContext*);
51
52 bool LoadTextures(ID3D11Device*, ID3D11DeviceContext*, char*);
53 void ReleaseTextures();
54
55private:
56 ID3D11Buffer* m_vertexBuffer, * m_indexBuffer;
57 int m_vertexCount, m_indexCount, m_screenWidth, m_screenHeight, m_bitmapWidth, m_bitmapHeight, m_renderX, m_renderY, m_prevPosX, m_prevPosY;
58 texture_class* m_Textures;
59 float m_frameTime, m_cycleTime;
60 int m_currentTexture, m_textureCount;
61};
62
63#endif