去看NEHE的教程,网上都有一堆,源码也有,自己找下吧。。。学习不能太懒哦。
void drawCNString(const char* str)
{ int len, i;
wchar_t * wstring;
HDC hDC = wglGetCurrentDC();
GLuint list = glGenLists(1);
for(i=0,len=0; str[i]!='\0'; ++i, ++len)if( IsDBCSLeadByte(str[i]) )++i;
wstring = new wchar_t[len+1];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, str, -1, wstring, len+1);
wstring[len] = L'\0';
for(i=0; i
glCallList(list);
}
delete wstring;
glDeleteLists(list, 1);
}