Dear All,
Please tell me exact error in this code.It is showing the runtime error.It is compiling correctly.I am using Windows NT platform.
The window(black) is displaying and after that it is showing run time error.Please tell me where exactly is the error.
#include <glut.h>
#define XSIZE 100
#define YSIZE 100
GLUquadricObj *qobj;
void init()
{
glShadeModel(GL_FLAT);
}
void reshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, (GLfloat)w/(GLfloat)h, 1.0, 20.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
/glTranslatef(0.0,6.2,-10.0);
glRotatef(290.0f,1.0,0.0, 0.0);/
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glTranslatef(-5,0,0);
glRotatef(45,1,0,0);
glPushMatrix();
qobj=gluNewQuadric();
gluCylinder(qobj,20,100,10,10,20,10);
glPopMatrix();
glFlush();
}
void main(int argc,char** argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutInitWindowSize(XSIZE, YSIZE);
glutInitWindowPosition(100, 100);
glutCreateWindow(“FATAL FX’ Pendulum [www.fatalfx.com]”);
init();
glutReshapeFunc(reshape);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}