GLUT displays blank window
c++, glut, macos, opengl
Solution
I copy and pasted the first example "YAT" into xcode
The problem with this example is, that it doesn't request a double buffer, which however doesn't roll very well with MacOS X. It can be done, but there's no sense in actually doing it.
Replace `GLUT_SINGLE` with `GLUT_DOUBLE` in the `glutInitDisplayMode` flags, i.e.
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
and add a `glutSwapBuffers()` at the end of the display function.
Problem
I'm following the GLUT tutorial here. I copy and pasted the first example "YAT" into xcode, slightly modified the includes and found that a blank window is brought up. Unmodified the code is set to display a wireframe teapot. For me, this does not happen. However, if I uncomment the creation of a wire taurus, part of a taurus and the teapot appear in the window. There are also seemingly random combinations of uncommenting and commenting lines under //draw something in the code that will actually cause objects to appear... or just a blank screen. P.S. I know everyone says not to use GLUT but the graphics I will need for my final demo are very basic and everything else I've looked at has felt over my head.