You got a problem there:
glutInitDisplayMode(GLUT_RGBA || GLUT_DOUBLE || GLUT_DEPTH);
Boolean OR ||
is something different than bit OR |
. You want to bit OR bitmasks |
, not boolean or them. Apart from that, in this way you will get a OpenGL-3 compatibility profile context, not a core context.