Khaotic Engine Reborn
Loading...
Searching...
No Matches
font_class.h
1#ifndef _FONTCLASS_H_
2#define _FONTCLASS_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: font_class
23{
24private:
25 struct FontType
26 {
27 float left, right;
28 int size;
29 };
30
31 struct VertexType
32 {
33 XMFLOAT3 position;
34 XMFLOAT2 texture;
35 };
36
37public:
38 font_class();
39 font_class(const font_class&);
41
42 bool Initialize(ID3D11Device*, ID3D11DeviceContext*, int);
43 void Shutdown();
44
45 ID3D11ShaderResourceView* GetTexture();
46
47 void BuildVertexArray(void*, char*, float, float);
48 int GetSentencePixelLength(char*);
49 int GetFontHeight();
50
51private:
52 bool LoadFontData(char*);
53 void ReleaseFontData();
54 bool LoadTexture(ID3D11Device*, ID3D11DeviceContext*, char*);
55 void ReleaseTexture();
56
57private:
58 FontType* m_Font;
59 texture_class* m_Texture;
60 float m_fontHeight;
61 int m_spaceSize;
62};
63
64#endif