Files
khaotic-engine-Reborn/enginecustom/src/inc/system/font_class.h
CatChow0 7c5a6435bb Patch - Adds macro for simplified logging - V14.5.28
Introduces a macro to streamline logging, enhancing code readability and maintainability.

The new macro replaces direct Logger calls with more concise and expressive `LOG_INFO`, `LOG_ERROR` etc. calls, reducing boilerplate code and improving consistency in logging practices across the engine.
2025-10-09 16:58:48 +02:00

65 lines
1.2 KiB
C++

#ifndef _FONTCLASS_H_
#define _FONTCLASS_H_
//////////////
// INCLUDES //
//////////////
#include <directxmath.h>
#include <fstream>
#include "macro.h"
using namespace DirectX;
///////////////////////
// MY CLASS INCLUDES //
///////////////////////
#include "texture_class.h"
////////////////////////////////////////////////////////////////////////////////
// Class name: font_class
////////////////////////////////////////////////////////////////////////////////
class font_class
{
private:
struct FontType
{
float left, right;
int size;
};
struct VertexType
{
XMFLOAT3 position;
XMFLOAT2 texture;
};
public:
font_class();
font_class(const font_class&);
~font_class();
bool Initialize(ID3D11Device*, ID3D11DeviceContext*, int);
void Shutdown();
ID3D11ShaderResourceView* GetTexture();
void BuildVertexArray(void*, char*, float, float);
int GetSentencePixelLength(char*);
int GetFontHeight();
private:
bool LoadFontData(char*);
void ReleaseFontData();
bool LoadTexture(ID3D11Device*, ID3D11DeviceContext*, char*);
void ReleaseTexture();
private:
FontType* m_Font;
texture_class* m_Texture;
float m_fontHeight;
int m_spaceSize;
};
#endif