I'm trying to play around with OpenGl and python on macos. And when I run the code from tutorial I get errors:
GLUT Warning: The following is a new check for GLUT 3.0; update your code.
GLUT Fatal Error: redisplay needed for window 1, but no display callback.
The code I try to run:
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB)
glutInitWindowSize(300, 300)
glutInitWindowPosition(50, 50)
glutInit(sys.argv)
glutCreateWindow(b"Happy New Year!")
glutMainLoop()
There's already a question about this problem on Stack Overflow, but a clear answer wasn't given to this question. As far as I understand, I should add
glutDisplayFunc(glutCreateWindow)
right before
glutMainLoop()
But if I do so, I get another error:
TypeError: this function takes at least 1 argument (0 given)
What's wrong?