Hello, I have a font system using FreeType to rasterize TrueType fonts to textures, which I then draw to the screen on tri strips to display text. The problem with this is it seems that the text could be clearer if I was drawing it with some form of raster copy to get a 1:1 copy and have no filtering blurring it.
So I was wondering what is the best method of drawing a texture to the screen to prevent any sort of filtering and just get a 1:1 copy? I know of glDrawPixels, but I’d like to use a texture so I don’t have to copy the image data over the bus every single time.
Thanks for any help!
- Disable filtering (use GL_NEAREST)
- Setup correct matrices:
// Code below "switch" OPenGL to 2D mode.
// Upper left corner is (0,0).
// Provide size as size of your viewport
void Begin2DMode(vec2i size)
glOrtho(0.0, size.x, size.y, 0.0, -1.0, 1.0);
// Example of usage
// render 3d stuff
// render text and other 2d stuff here