View Full Version : How to change GLubyte to GLclampf ?(color)
Now I have a color of GLubyte.
I will use it in glClearColor(..).
06-05-2004, 09:05 AM
You would need to scale the GLubyte values which ranges from 0 to 255 to the equivalent GLfloat values which would be clamped in the range from 0.0 to 1.0;
ie, (GLfloat) (value) / 255.0
You should probably refer to the docs on the glColor* APIs for how color values can be repesented in either integer or floating point formats.
I have solved this problem.
My code is:
glClearColor((float)GetRValue(m_colBackColor)/255,(float)GetGValue(m_colBackColor)/255,(float)GetBValue(m_colBackColor)/255, 0.5f); // Black Background
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.