programmer17
01-23-2012, 04:05 PM
I need to read the integers from a file and print it.
I know how to read but not how to comvert int to char*.
my printing function goes like:
void glutPrint(float x, float y, LPVOID font, char *text, float red, float green, float blue) // text printing function
{
if(!text || !strlen(text)) return;
bool blending = false;
if(glIsEnabled(GL_BLEND)) blending = true;
glEnable(GL_BLEND);
glColor3f(red,green,blue);
glRasterPos2f(x,y);
while (*text) {
glutBitmapCharacter(font, *text);
text++;
}
if(!blending) glDisable(GL_BLEND);
}
coding in c++ using glut
I know how to read but not how to comvert int to char*.
my printing function goes like:
void glutPrint(float x, float y, LPVOID font, char *text, float red, float green, float blue) // text printing function
{
if(!text || !strlen(text)) return;
bool blending = false;
if(glIsEnabled(GL_BLEND)) blending = true;
glEnable(GL_BLEND);
glColor3f(red,green,blue);
glRasterPos2f(x,y);
while (*text) {
glutBitmapCharacter(font, *text);
text++;
}
if(!blending) glDisable(GL_BLEND);
}
coding in c++ using glut