Depth testing is not working

I have stumbled upon a problem which I don’t even understand why it is a problem. I’ve done a few OpenGL applications and depth testing has never bothered me. This error I am having has taking me a while to pin point the problem - the depth testing not working. The cubes, on the screen, have the faces drawn over each other. While it may seem like a simple problem, I used to think it was a problem with blitting the depth buffer among other things.

[li]Depth buffer is working - in shader gl_FragCoord.z works correctly[/li][/ul]

So to be clear, I want the depth testing to work.
Also I have been through tons of google pages and nothing is helping. This issue has been bothering me on and off for days (for a period I just ignored it).

The code I present is not all the code, but just what I think is relevant - if everything should be working I will release more code.
Functions that are ran:

void Program::Init()
	SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);

	std::cout << "Initialising" << std::endl;
	glViewport(0, 0, Options::width, Options::height);

	glewExperimental = true; // Needed in core profile
	if (glewInit() != GLEW_OK) {
		fprintf(stderr, "Failed to initialize GLEW

//	window.setVerticalSyncEnabled(true);

	sf::Mouse::setPosition(sf::Vector2i(Options::width / 2, Options::height / 2), window);

	network = new Network();
	std::cout << "dwoidjwaoidwaodj 
	LoadGameState(GameState::INGAME, false);


void Program::GLInit() {

	lampShader = Shader("StandardVertex.shader", "LightingFragmentShader.shader");
	ourShader = Shader("VertexShader.shader", "SimpleFragmentShader.shader");
	screenShader = Shader("FrameVertexShader.shader", "FrameFragmentShader.shader");
	skyboxShader = Shader("SkyboxVertex.shader", "SkyboxFragment.shader");
	cubeDepthShader = Shader("CubeDepthVertex.shader", "CubeDepthFragment.shader", &std::string("CubeDepthGeometry.shader"));
	debugDepthQuad = Shader("SimpleVertex.shader", "DepthFragment.shader");
	blurShader = Shader("SimpleVertex.shader", "BloomFragment.shader");
	bloomShader = Shader("SimpleVertex.shader", "FinalBloom.shader");

	depthShader = Shader("VertexDepth.shader", "EmptyFragment.shader");

	geometryPass = Shader("GeometryVertex.shader", "GeometryFragment.shader");
	lightingPass = Shader("SimpleVertex.shader", "LightingFragment.shader");
	shaderSSAO = Shader("SimpleVertex.shader", "SSAOFragment.shader");
	shaderSSAOblur = Shader("SimpleVertex.shader", "SSAOBlurFragment.shader");

	colliders = Shader("VertexShader.shader", "GreenFragment.shader");






void Program::RunGame()

	scene->mainCamera.Input(Options::deltaTime, window);


	if(timeSinceGameStart.getElapsedTime().asSeconds() > 5.0f)


	glClearColor(0.32f, 0.5f, 0.58f, 1.0f);


	projection = glm::mat4();
	view = glm::mat4();
	// view/projection transformations
	projection = glm::perspective(glm::radians(Options::fov), (float)Options::width / (float)Options::height, 0.1f, 100.0f);
	view = scene->mainCamera.GetViewMatrix();

	lampShader.setMat4("projection", projection);
	lampShader.setMat4("view", view);
	lampShader.setInt("setting", Options::settings);
	glm::mat4 model;
	for (unsigned int i = 0; i < lights.size(); i++)
		model = glm::mat4();
		model = glm::translate(model, lights[i].position);
		model = glm::scale(model, glm::vec3(0.125f));
		lampShader.setMat4("model", model);
		lampShader.setVec3("lightColor", lights[i].colour);

	if (Options::showColliders) {
		colliders.setMat4("projection", projection);
		colliders.setMat4("view", view);


I hope this is enough to understand. All of the functions I have tested and are not the problem. The main area is where I the lights in the main loop.

I was just noticing the standardization of your shader filenames, except the depth shaders, the debugDepthQuad and depthShader fragment shaders have names that are not expected. Could this be the source of aggravation?