[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with Glut and mouse



Hello all,
I've a problem using GLUT. I'm coding an arkanoid game
and I've attacched the right mouse button to the menu:

     glutAttachMenu(GLUT_RIGHT_BUTTON);

The problem is that I would like that the game stops
when I press the right mouse button, so I added this:

void glutMouseEvent(int button, int state, int x, int y){
        if((button==GLUT_RIGHT_BUTTON)&&(state==GLUT_DOWN))
                stop=0;
        else
        if((button==GLUT_RIGHT_BUTTON)&&(state==GLUT_UP))
                stop=1;
}

But this only works if I don't attach the right mouse button
to the menu. It seems that they cannot work together.
Is there any way to do it?
PS:Sorry for my bad english

bye,
    Andrea
    voidstar@tin.it