static GLfloat Xrot = 20.0, Yrot = 20.0, Zrot = 0.0;
static GLfloat EyeDist = 10;
static GLboolean Anim = GL_TRUE;
+static int win = 0;
struct uniform_info {
EyeDist = 90;
break;
case 27:
+ glutDestroyWindow(win);
exit(0);
}
glutPostRedisplay();
glutInit(&argc, argv);
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
- glutCreateWindow(Demo);
+ win = glutCreateWindow(Demo);
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
static GLenum Filter = GL_NEAREST;
GLenum doubleBuffer;
static float Rot = 0;
+static int win = 0;
static void Init(void)
{
glFrustum(-1, 1, -1, 1, 10, 20);
#endif
glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
glTranslatef(0, 0, -15);
}
Rot -= 10.0;
break;
case 27:
+ glutDestroyWindow(win);
exit(0);
default:
return;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ win = glutCreateWindow("First Tri");
+ if (!win) {
exit(1);
}