Sign in to follow this  

Selected Text Color Inversion?

This topic is 3487 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

This topic is 3487 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this