Beju
03-25-2007, 06:52 PM
Hello, I've just started to use OpenGL and I have some problems with GLUT. Here is my piece of code (straight from some tutorial):
void GLCanvas::Render(void)
{
int a;
char b[10][10];
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0, 0.0, -15.0);
glRotatef(30.0, 1.0, 0.0, 0.0);
glColor4f(0.3, 0.3, 0.3, 1.0);
glutWireTeapot(3.0);
}The problem is: when I compile this code I'm getting:
freeglut ERROR: Function <glutWireTeapot> called without first calling 'glutInit'.So I've thought I just to use that glutInit function:
glutInit(&a, (char **)b);(My program doesn't use arc or argv and I don't pass any glut command-line arguments so I think it makes no difference what will I use as parameters?)
And now I'm getting this error:
freeglut illegal glutInit() reinitialization attemptAnd I am completely lost here :( So was the glut already initialized or not :confused:
I'll be grateful for any advice.
void GLCanvas::Render(void)
{
int a;
char b[10][10];
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0, 0.0, -15.0);
glRotatef(30.0, 1.0, 0.0, 0.0);
glColor4f(0.3, 0.3, 0.3, 1.0);
glutWireTeapot(3.0);
}The problem is: when I compile this code I'm getting:
freeglut ERROR: Function <glutWireTeapot> called without first calling 'glutInit'.So I've thought I just to use that glutInit function:
glutInit(&a, (char **)b);(My program doesn't use arc or argv and I don't pass any glut command-line arguments so I think it makes no difference what will I use as parameters?)
And now I'm getting this error:
freeglut illegal glutInit() reinitialization attemptAnd I am completely lost here :( So was the glut already initialized or not :confused:
I'll be grateful for any advice.