displaying text help
hello all. Im having a problem with NeHe''s tutorial aout bitmapped fonts. I can compile his code for it and everything just fine, but im trying to take the functions glPrint, glBuildFont, and Killfont from the turorial and put them into a different program based on a different tutorial im working on. I can get it to compile and everything fine, but i cant get it to actually display the text. I put all the cpp files in a zip here (well, its a link to the zip since sphosting wont let me link directly...) so if you could take a look at it and tell me whats wrong, i would greatly appreciate it (ive been working with it all day but cant figure it out). thanks!
chris
PS: Im using MSVC++ 6
McDougal...DUCK McDougal
http://www.labino.net
Make sure your viewport is setup to the same dimensions as the NeHe tutorial or adjust the calling functions to compensate for the differences.
Also, take a look at glOrtho, as it is particularly useful with text displays.
procedure TMainForm.Animate;
begin
// Set the viewport
glViewport(0, 0, ClientWidth, ClientHeight);
// Update the projection matrix:
glMatrixMode(GL_PROJECTION);
// Load current matrix
glLoadIdentity;
// Set Ortho Mode
glOrtho(0, ClientWidth, ClientHeight, 0, -1, 1);
// Solid Models
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
glColor3f(1, 1, 1);
TextFont.Print(1, 15, ''FPS: '');
TextFont.Print(100, 15, ''Polys: '');
end;
Jason
Also, take a look at glOrtho, as it is particularly useful with text displays.
procedure TMainForm.Animate;
begin
// Set the viewport
glViewport(0, 0, ClientWidth, ClientHeight);
// Update the projection matrix:
glMatrixMode(GL_PROJECTION);
// Load current matrix
glLoadIdentity;
// Set Ortho Mode
glOrtho(0, ClientWidth, ClientHeight, 0, -1, 1);
// Solid Models
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
glColor3f(1, 1, 1);
TextFont.Print(1, 15, ''FPS: '');
TextFont.Print(100, 15, ''Polys: '');
end;
Jason
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement