Jump to content
  • Advertisement
Sign in to follow this  

Selected Text Color Inversion?

This topic is 3855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Lately I've been attempting to write a font renderer so I can use text inside my games (I'm doing it with FreeType). I've got it so that I can render a line of text (after a lot of work and learning). I basically take each character, pack them all into a texture, and render a quad for each letter that has the texture mapped to it depending on the character. Now that I've got that done, I want to make it so I can select my text. I think I can manage that part ok, but I want to make the selected text's color inverted. Kinda like the black text becomes white, and then whatever is the "background" of the selected text (the text has an alpha channel) also becomes inverted. Should I render the text, then render a rectangle (or whatever shape is needed for multiple lines of selected text) that inverts the colors based on the glEnable(GL_COLOR_LOGIC_OP); glLogicOp(GL_INVERT); functions? I'd then have to disable GL_COLOR_LOGIC_OP afterwards. Is this the best method or is there a better one?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!