코드 문제는 없어보이는데...
빌드만 하면 오류가 .....뭔지 1도 모르겠어요...
책에있는거 그대로 적었는데 왜 이럴까요..
#include<glut.h>
#include<gl\GL.h>
#include<gl\GLU.h>
GLboolean IsSphere = true;
GLboolean IsSmall = true;
void MyDisplay() {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.5, 0, 0.5);
if ((IsSphere) && (IsSmall))
glutWireSphere(0.2, 15, 15);
else if ((IsSphere) && (!IsSmall))
glutWireSphere(0.4, 15, 15);
else if ((!IsSphere) && (IsSmall))
glutWireTorus(0.2, 0.5, 40, 40);
else glutWireTorus(0.2, 0.5, 40, 20);
glFlush();
}
void MyMainMenu(int entryID) {
if (entryID == 1)
IsSphere = true;
else if (entryID = 2)
IsSphere = false;
else if (entryID == 3)
exit(0);
glutPostRedisplay();
}
void MySubMenu(int entryID) {
if (entryID == 1)
IsSmall = true;
else if (entryID == 2)
IsSmall = false;
glutPostRedisplay();
}
int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB);
glutInitWindowSize(300, 300);
glutInitWindowPosition(0, 0);
glutCreateWindow("openGL Example Drawing. DisplayList");
glClearColor(1.0, 1.0, 1.0, 1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, 1.0, -1.0);
GLint MySubMenuID = glutCreateMenu(MySubMenu);
glutAddMenuEntry("Small one", 1);
glutAddMenuEntry("Big one", 2);
GLint MyMainMenuID = glutCreateMenu(MyMainMenu);
glutAddMenuEntry("Draw Sphere", 1);
glutAddMenuEntry("Draw Torus", 2);
glutAddSubMenu("Change Size", MySubMenuID);
glutAddMenuEntry("Exit", 3);
glutAttachMenu(GLUT_RIGHT_BUTTON);
glutDisplayFunc(MyDisplay);
glutMainLoop();
return 0;
}
코드 전문입니다