• Advertisement
Sign in to follow this  

Color in OpenGL

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

Is there any sort of standard struct/class for colors in C++? I ask only because I'm working on an engine and I want it to be as standards compliant as possible. Would it be better to just leave coloring to 3 floats, or to use a preexisting library?

Share this post


Link to post
Share on other sites
Advertisement
I said the wrong thing, but I think it is going to be the same answer either way. I meant to say if there is a way of dealing with this specifically with OpenGL. I don't want to have my program built on top of a class if there is already one that everyone is using, I'd rather use that. But since it is so simple, I figure there probably is no standard class.

Edit: Do you think I should include the alpha with the color? I thought it was a good idea at first, but then I thought that a lot of times you want to keep the same color and draw it at different alphas, but then I thought it isn't very difficult to change the alpha in this theoretical class.

Share this post


Link to post
Share on other sites
Sometimes you will want an alpha, sometimes you won't. Just use 1.0 for alpha in cases where you don't need to set it to anything else. But most of all, don't overthink this trivial issue.

Share this post


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

  • Advertisement