Stencil Shadows not working

Hello. So I’m trying to figure out how to have stencil shadows in my project with multiple lights. I’m trying to do it like this: http://lwjgl.org/forum/index.php?topic=5203.0 but in 3D.

This is my code:

for (Light light : lights) {
glColorMask(false, false, false, false);
glStencilFunc(GL_ALWAYS, 1, 1);
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);

				glCallList(displayList);

				glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
				glStencilFunc(GL_EQUAL, 0, 1);
				glColorMask(true, true, true, true);

				Shader.lightShader.enable();
				updateUniforms();
				light.updateUniforms(normalMatrix);
			
				glEnable(GL_BLEND);
				glBlendFunc(GL_ONE, GL_ONE);
				
				glCallList(displayList);

				glDisable(GL_BLEND);
				Shader.lightShader.disable();

				glClear(GL_STENCIL_BUFFER_BIT);
			}

Previously, I would render my scene like this:

	Shader.lightShader.enable();
	updateUniforms();
	glEnable(GL_BLEND);

	for (int i = 0; i < lights.size(); i++) {
		Light light = lights.get(i);
		light.quadraticAttenuation = 1f / lights.size();
		light.updateUniforms(normalMatrix);

		if (i > 0) glBlendFunc(GL_ONE, GL_ONE);
		glCallList(displayList);
	}
	glDisable(GL_BLEND);
	Shader.lightShader.disable();

“displayList” contains all of the objects in my scene. Could anyone give some help? Cheers.

(PS: Please use Code-Tags)

A list of useful tutorials:
http://ogldev.atspace.co.uk/www/tutorial40/tutorial40.html
http://joshbeam.com/articles/stenciled_shadow_volumes_in_opengl/
http://www.angelfire.com/games5/duktroa/RealTimeShadowTutorial.htm (This one has code-examples)

These are the tutorials I used when I tried to understand how Notch implemented shadows in his 0x10c prototype.
That should help!

Code tags?

Thanks LK, you’re never on Skype anymore! Or check your emails.

Code Tags:

[ code ] your code here [ /code ] (Without the spaces!)

Also, I am on(line on) skype right now.