There's a library called glut which includes that function. For the following code to work you got to include gl/glut.h and link glut32.lib. If you don't have those, just google around a little bit
Here's the code:
Code:
void writeString(char* string, int x, int y, void* font)
{
glRasterPos2i(x, y);
int len = strlen(string);
for (int i=0; i < len; i++)
{
glutBitmapCharacter(font, string[i]);
}
}
void setOrthographicProjection() {
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, SCREEN_WIDTH, 0, SCREEN_HEIGHT);
glScalef(1, -1, 1);
glTranslatef(0, -SCREEN_HEIGHT, 0);
glMatrixMode(GL_MODELVIEW);
}
void resetPerspectiveProjection() {
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
}
I have not written all of this code though, most is taken from a tutorial but I cant remember where :-/ . If you want to use other ways; try Nehe: http://nehe.gamedev.net hes got a lot of great tutorials.
Good luck
Daniel