To solve the problem of flashback of calling class function of glutsolidcube() in Win32 program

The problem
Functions such as glutSolidCube() are used in Win32 to flash back without reporting an error.
To solve
GlutSolidCube, GlutSolidSphere and other functions will first check whether GLUT is initialized, and exit the program if GLUT is not initialized.
Therefore, put the following code in WinMain() :

int argc = 0;
char *argv[10] = {};
glutInit(&argc, argv);

Can solve


Read More: