Advertisement

Problem with glColor4ub

Started by July 02, 2002 12:48 PM
1 comment, last by Bleakcabal 22 years, 7 months ago
I am using the following code to render a line :
	glBegin(GL_LINES);
		glColor4ub(255, 255, 255, 255);						
		glVertex2f( (GLfloat)x1, (GLfloat)y1);	
		glVertex2f( (GLfloat)x2, (GLfloat)y2);
	glEnd(); 
But the line isn''t white, it''s greenish. But when I do this glColor4ub(255, 0, 0, 255); I get a red line, tough, it''s dark glColor4ub(0, 255, 0, 255); I get a green line, tough it''s dark too and the same goes for glColor4ub(0, 0, 255, 255); and glColor4ub(255, 0, 255, 255); and glColor4ub(0, 255, 255, 255); Which all seems to work fine, I have tried passing values to glColor4ub of type typedef unsigned char BYTE; but it didn''t change anything... Can anyone help me out with this ? WHO DO THEY THINK THEY''RE FOOLING : YOU ?
WHO DO THEYTHINK THEY'REFOOLING : YOU ?
You probably have lighting or texturing enabled, which also affects the color of the line.
Advertisement
Thanks it was the texturing. I did not know it could affect the color of the line.

WHO DO THEY
THINK THEY''RE
FOOLING : YOU ?



WHO DO THEYTHINK THEY'REFOOLING : YOU ?

This topic is closed to new replies.

Advertisement