Please attention on my code.......
#include<windows.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <math.h>
static GLfloat spin = 0.0; // Does it use as global variable??
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glColor3f(1.0, 1.0, 1.0);
glRectf(-25.0, -4.0, 25.0, 4.0);
glRectf(-4.0, -25.0, 4.0, 25.0);
glColor3f(0.0, 0.0, 1.0);
glutSolidTorus(1.00, 6.4, 10, 100);
glPopMatrix();
glFlush();
}
void spinDisplay_right1(void)
{
spin = -.60;
glutPostRedisplay();
glRotatef(spin, 0.0, 0.0, 1.0);
}
Note: I think static variable is used as global variable. If I use static variable under any function then it will be local variable
Am I right or not ? Please response my questions.