fonttexture.h
来自「一个自己写的游戏引擎,用DirectX 写成」· C头文件 代码 · 共 47 行
H
47 行
//--------------------------------------------------
// Desc: Font Texture 512*32
// Date: 2006.11.02 /update
// Author: artsylee
//
// Copyright (C) 2006 artsylee
//
// 扩展: 可变大小的字体纹理(2006_11_21)
//
//--------------------------------------------------
#ifndef _FONTTEXTURE_
#define _FONTTEXTURE_
#include "Texture.h"
#define FONT_TEXTURE_WIDTH 512
#define FONT_TEXTURE_HEIGHT 32
#define MAX_FONT_TEXTURE 32
struct BMPInfo
{
HBITMAP m_hBitMap;
void *m_pData;
HDC m_hDC;
};
class ASE_DLL CFontTexture : public CTexture
{
public:
CFontTexture();
virtual ~CFontTexture();
void Release();
void CreateFontTexture(int width, int height);
void WriteString(const char *szText, HFONT hFont);
void Clear();
bool Compare(const char *szText) const;
bool IsEmpty() const;
protected:
std::string m_szText;
bool m_bEmpty;
bool m_bInit;
BMPInfo m_BmpInfo;
};
#endif // _FONTTEXTURE_
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?