Hey guys!
I have strange problem.
I want to make bitmap fonts. I loaded texture, and now I have to set coords for each letter.
Here it is:
glBindTexture(GL_TEXTURE_2D, tex_font);
glNewList(base+licznik,GL_COMPILE);
glBegin(GL_QUADS);
glTexCoord2f(0.5937 ,1-0.00195);
glVertex2i(0,0);
glTexCoord2f(0.5937+0.06445 ,1-0.00195);
glVertex2i(20,0);
glTexCoord2f(0.5937+0.06445 ,1-0.00195-0.1035); glVertex2i(20,50);
glTexCoord2f(0.5937 , 1-0.00195-0.1035);
glVertex2i(0,50);
glEnd();
glTranslated(10,0,0);
glEndList();
And it's "working". As you can see I put static numbers. These numbers are coords for letter "0" (number actually).
But when I put variables into this code:
glTexCoord2f(poz_x ,(1-poz_y));
glVertex2i(0,0);
glTexCoord2f((poz_x+z_width) ,(1-poz_y));
glVertex2i(20,0);
.....
It's nor working. I can see just a black background - no letters.
I'm 100% sure that variables have the same value. So why it's not working?
(Variables are float)