Skip to main content
gamedev.net
🔒 Locked

glColor Error?

Started by Galileo430 Aug 1, 2002 at 2:42 PM 2 replies 700+ views
Original Post
Galileo430
Galileo430
For some reason glColor isn''t responding in my game. No matter what color I give it. It gives me semi-transparent black. Below is the sorce as it is. Even if I set glColor4f to 1.0f, 1.0f, 1.0f, 1.0f I still get semi transparent black. I took the code out of here and plugged it into NEHE lesson 2 to make sure it wasn''t my drivers. The polys came out correctly. However this doesn''t seem to want to be anything but semi-transparent black. Ideas? Solutions?
  
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

glColor4f(0.1f, 0.2f, 0.3f, 0.5f);

glBegin(GL_QUADS);
	glVertex2d(256.0f, 144.0f);
	glVertex2d(272.0f, 144.0f);
	glVertex2d(272.0f, 142.0f);
	glVertex2d(256.0f, 142.0f);
	glVertex2d(272.0f, 168.0f);
	glVertex2d(380.0f, 168.0f);
	glVertex2d(380.0f, 0.0f);
	glVertex2d(272.0f, 0.0f);
glEnd();
  
Thanks, Steven
------------------------------------------------------------I wrote the best video game ever, then I woke up...
Brother Bob
Brother Bob
Do you have lighting or texturing enabled, or anything else that affects the color of a fragment?
Galileo430
Galileo430
DOH!

Textureing was on.. Now I feel embarassed.

Thanks guys.
------------------------------------------------------------I wrote the best video game ever, then I woke up...

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.