我是OPengl初学者,能把那份窗口客户区显示图形字符的程序发给我么?ruanjiacheng123@163.com。非常之感谢

2025-01-04 15:45:33
推荐回答(2个)
回答1:

去看NEHE的教程,网上都有一堆,源码也有,自己找下吧。。。学习不能太懒哦。

回答2:

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 { wglUseFontBitmapsW(hDC, wstring[i], 1, list);
glCallList(list);
}
delete wstring;
glDeleteLists(list, 1);
}