I use SFML to create the window. In this screenshot the cube should be behind the pyramid but it just doesn't work. Here is the minimal code I used: #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <SFML/Graphics.hpp> #include "ResourcePath.hpp" void resize(); void drawScene(); void initGL(); float rtri = 0; float rquad = 0; float z = -10.0f; int main (int argc, const char * argv[]) { // Create the main window sf::RenderWindow *window = new sf::RenderWindow(); window->Create( sf::VideoMode( 800, 600, 32 ), "Collision Detection", sf::Style::Close ); sf::Event event; bool run = true;