A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Hi @Sid Kraft ,
The window closes because glutMainLoop() is commented out. That function keeps GLUT processing window events and calls the display function you registered.
I would call it from main after initializing the window:
int main(int argc, char** argv)
{
initWindow(&argc, argv);
glutMainLoop();
return 0;
}
Also change:
glEnd;
to:
glEnd();
The parentheses are required to call the function, as explained in Microsoft’s documentation for compiler warning C4551.
With those changes, the window should remain open and GLUT can call display(). If it stays open but only shows the green background, that would be a separate drawing or coordinate issue.
If this helps resolve your issue, I would appreciate it if you could follow this guidance. It may also help others who encounter the same problem. Thank you.