Having problems displaying text with lesson 43. And I didn't get the information about "zlib1.dll" either.
When I try to output text nothing displays. Here's my draw function:
void draw(void){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glColor3f(1.0f, 1.0f, 1.0f);
glPushMatrix();
glLoadIdentity();
glTranslatef(0, 0, -5);
freetype::print(our_font, 320, 200, "This is a test\whee");
glPopMatrix();
glTranslatef(0.0f, 0.0f, -13.0f);
RotateScene(EYE_RADIUS, RotateCamY, RotateCamX, 180.0);
lighting();
quadricsSettings();
drawGlobe(4.0f, 100);
drawStars(200.0f, 10);
glFlush();
}
Am I doing something wrong? I want white text displayed in my OpenGL window. I haven't positioned it yet but I want it in the top right corner of the screen later.
Why am I seeing nothing?
I'm not getting any errors on the code and the rest of my program works just as it should.
After some looking around I found out that the zlib1.dll that was missing was supposed to go into the project folder.
Thanks for the GREAT tutorials!
Marcus Axelsson
Edit:
I got an error here
// in file: freetype.cpp
const char *start_line = text;
vector<string> lines;
for(const char *c = text; *c; c++){
if(*c == '\n'){
string line;
for(const char *n = start_line; n < c; n++){
line.append(1, *n);
}
lines.push_back(line);
start_line = c + 1;
}
}
if(start_line){
string line;
for(const char *n = start_line; n < c; n++){
line.append(1, *n);
}
lines.push_back(line);
}
error C2065: 'c' : undeclared identifier
I solved that by adding const char *c = text; Beneath vector<string> lines;.
I also get a lot of conversion and trucation warnings as well as one signed/unsigned mismatch.
I guess the warnings doesn't really matter that much. But there it is.
And I still can't get the text to show :)
[Edited by - tre on December 2, 2009 5:22:15 PM]