PDA

View Full Version : aboue glRasterPos and glBitmap?



logzhang
06-13-2013, 05:24 AM
I initialized the programe by following:(running on WinXP)
-----------------------------------------------------------------------------------
glViewport(0, 0, iWidth, iHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

if(iWidth <= iHeight)
{
glOrtho(-nRange, nRange, -nRange * (float)iHeight / iWidth, nRange * (float)iHeight / iWidth, -nRange, nRange);
}
else
{
glOrtho(-nRange * (float)iWidth / iHeight, nRange * (float)iWidth / iHeight, -nRange, nRange, -nRange, nRange);
}
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
-----------------------------------------------------------------------------------

and doing on render by following:

----------------------------------------------------------------------------------
glColor3f(0.0f, 0.0f, 0.0f);
for (int i = 0; i < 1; i++)
{
CPoint pt(0, i * 32);
pt = CGraphic::Cover2GLPoint(pt);
glRasterPos2i(pt.x, pt.y);
for (int j = 0; j < 16; j++)
{
glBitmap(32, 32, 0.0, 0.0, 32.0, 0.0, fire);
}
}

----------------------------------------------------------------------------------

I Coverted the screen point to opengl point, and called glRasterPos2i to set the draw position, but the result is not right.The graphics not all can draw and the glRasterPos was not called effective;
The function of glRasterPos is how to used exactly?