|
|
求助,为什么DrawText输出中文是乱码
就是这样...........
头文件如下:
#ifndef INITFONT_H
#define INITFONT_H
#include "d3d9.h"
#include "d3dx9.h"
bool InitFont(IDirect3DDevice9 *D3DDevice,ID3DXFont *&pFont)
{
D3DXFONT_DESCA d3dFont;
//创建字体
ZeroMemory(&d3dFont,sizeof(D3DXFONT_DESCA));
//设置字体名称和高度
strcpy(d3dFont.FaceName,"NEW");
d3dFont.Height=80;
d3dFont.Width=16;
d3dFont.Italic=false;
//创建字体对象
if(FAILED(D3DXCreateFontIndirect(D3DDevice,&d3dFont,&pFont)))
{
MessageBox(NULL,"error","Font",MB_OK);
return false;
}
return true;
}
#endif
///////////////////////不华丽的分割线///////////////////////////////////
主函数中这样:
g_pFont->DrawText(NULL,"错了啊!!!!!!",-1,&TextPort,0,D3DCOLOR_RGBA(255,255,255,255));
/////////////////////////////
结果却这样:
|
|