glColor4f?

This is my code:

Update:

		if (alphaIn > 0){
			alphaIn--;
		}
		
		System.out.println(alphaIn);

Render:

		glEnable(GL_BLEND);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		
		glColor4f(0, 0, 0, alphaIn);
		glBegin(GL_QUADS);
		glVertex2f(0, 0);
		glVertex2f(Display.getWidth(), 0);
		glVertex2f(Display.getWidth(), Display.getHeight());
		glVertex2f(0, Display.getHeight());
		glEnd();
		
		glDisable(GL_BLEND);

The problem is that glColor4f doesn’t change the alpha channel inbetween 0-255. It only changes when alphaIn is 255 or 0 specifically. So, essentially, it stays black until alphaIn reaches 0, then instantly turns white; completely defeating its purpose.

Insight is appreciated.

the valid floats are in the range 0…1, not 0…255

Oh. Right. I was so tired when I wrote this, I feel ridiculous now…Thanks. lol.

I was using this function last night - shouldn’t you be using a float with 0.0 being glass and 1.0 being opaque?