PDA

View Full Version : some question about GLUT



zhouyanbing
05-22-2005, 09:01 PM
I am a beginner in OpenGL program,
when I use GLUT to bulid my program ,firt my progrma is functionly, but When I bulid secondly

the keybord event message can't handle ,why?

here is my code ,hope someone to help me


void keybord(unsigned char key,int x,int y)
{
switch(key)
{
case 'f':
case 'F':
mode=GL_FLAT;
glutPostRedisplay();
break ;
case 's':
case 'S':
mode=GL_SMOOTH;
glutPostRedisplay();
break;
case 'y':
case 'Y':
blight=true;
glutPostRedisplay();
break;
case 'n':
case 'N':
blight=false;
glutPostRedisplay();
break;
case 27:
exit(0);
break;

default:
break;

}

}in mani function I have call it use glutKeyboardFunc(keybord);

Ehsan Kamrani
05-22-2005, 09:49 PM
This keyboard function has no error.Can you please give more information to us?--Can you copy your program here?
-Ehsan-

dorbie
05-22-2005, 09:51 PM
Don't crosspost and don't post a question in advanced when you know it belongs in beginners.