PDA

View Full Version : Higlighting bitmap fonts, using shaders or an extra texture?



Vantskruv
07-28-2017, 06:34 AM
Hello, my first post here! :)

So I have been starting a project which requires me to learn a small part of OpenGL.

My project requires me to use fonts, and I have currently successfully made a function which draws a user-decided character and scale from a custom font bitmap, using some sub-texture techniques.

So now comes the part where I want to draw the character highlighted. The requirements for this project will be very simple, as I will only draw in two colors (background and foreground), and the highlighted font will use the foreground color as background and background color as the forground, simple huh?

So the simple question here is, should I use two textures loaded from harddrive, one which shows the font as normal, and the other showing the font as highlighted? Or should I use shaders?

The bitmap font is very simple, using only sharp pixels presenting the font, hence there is no anti-aliasing.