|
发表于 2010-11-19 09:02:03
|
显示全部楼层
RE:[原创]OpenGL入门学习——第十六课
我不是全用你的程序,只是drawCNString用的是你的函数。我写的不是控制台程序,相关代码如下:
wglMakeCurrent(m_hdc,m_hRC);
wglUseFontBitmaps(m_hdc,32,223,m_FontBase);
glEnable(GL_SCISSOR_TEST);
glScissor(rt.left,0,rt.Width(),rt.Height());
glClearColor(GetRValue(BackgroundColor)/255.0f,GetGValue (BackgroundColor)/255.0f,GetBValue(BackgroundColor)/255.0f,0.0);
glClear(GL_COLOR_BUFFER_BIT);
glDisable(GL_SCISSOR_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0,0,rt.Width(),rt.Height());
gluOrtho2D(0,rt.right,rt.bottom,0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRasterPos2f(m_Left-6,m_Bottom+m_DisCFY+5);
drawCNString("我是初学者");
glFinish();
SwapBuffers(m_hdc);
最后修改于2008-9-4 14:17:00 |
|