OpenGL: glRasterPos
Hi! I''ve been using bitmaps to display text on my OpenGL app and I''m using glRasterPos to position the bitmaps. But it won''t display if the RasterPos is set to a negative value, even though the text I''m displaying is long.
Is there any way around this? Meaning, just say I''m trying to write "XYZ" and the only want the "X" to be out of the screen, but it still displays the YZ?
I''m using wglBuildBitmapFont (I think that''s the name of the function... it''s the font that builds bitmaps using the Windows font) here...
Have a look at.
Some common problems you might encounter may be solved here,
like the problem you have now.
http://www.opengl.org/Coding/KilgardTechniques/oglpitfall/oglpitfall.html
If you don''t want to have a look at this site, then have a look at the code copied from it, which you might find useful
glRasterPos2i(0, 0);
glBitmap(0, 0, 0, 0, xoffset, yoffset, NULL);
drawString("Will not be clipped.");
NextS
Some common problems you might encounter may be solved here,
like the problem you have now.
http://www.opengl.org/Coding/KilgardTechniques/oglpitfall/oglpitfall.html
If you don''t want to have a look at this site, then have a look at the code copied from it, which you might find useful

glRasterPos2i(0, 0);
glBitmap(0, 0, 0, 0, xoffset, yoffset, NULL);
drawString("Will not be clipped.");
NextS
Thanx for the link! It works fine now! (Although it caused some problem if I put glListBase(idnumber) before the glBitmap though... not sure why. It'll cause all the different fonts I'm using to refer to the first font I've created).
By the way, do you know if it's possible to put a texture over these bitmaps? By reading the article in the link, since RasterPos is treated as a single pixel, I'm not sure about it, but I've seen games that are able to do such things easily... Or are they using some other way? The textures are animated, so I doubt they had the textures drawn for each character.
Edited by - Someone on 2/10/00 4:03:21 AM
By the way, do you know if it's possible to put a texture over these bitmaps? By reading the article in the link, since RasterPos is treated as a single pixel, I'm not sure about it, but I've seen games that are able to do such things easily... Or are they using some other way? The textures are animated, so I doubt they had the textures drawn for each character.
Edited by - Someone on 2/10/00 4:03:21 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement