Dynamic colors in OpenGL?

glColor3f(1,0,0);

I know that this is red, represented as 255. If I want to use 0x7F 0x0 0x0 for the colors, I would just need to divide each by 0xFF and get their decimal values and put those.

What I’m asking is for the name of a command type thing similar to glOrtho that allows me to set the range from 0 to 255 so I can simply use 127 instead of having to divide by 255 and use as a decimal. Any ideas?

Thanks in advance.

What I’m asking is for the name of a command type thing similar to glOrtho that allows me to set the range from 0 to 255 so I can simply use 127 instead of having to divide by 255 and use as a decimal.

There isn’t one. But you can just use glColor3ub, which takes unsigned bytes instead of floats.

Thanks a lot! :smiley: