In a statement like this
void mousebuttonhandler(int button, int state, int x, int y)
{
int counter;
if (button == GLUT_LEFT_BUTTON && state == 0)
counter ++;
printf("Mouse button event, button=%d, state=%d, x=%d, y=%d\n, ", button, state, x, y);
glutPostRedisplay();
}
It appears that im trying to count the mouse clicks, but of course this wouldnt work. After the function call is done for void mousebuttonhandler counter is deleted.
I am brand spanking new to glut and i can't really think of away to accomplish counting mouse clicks. In java this would be simple, any help would be appreciated.
thanks
-sm