Answer the question
In order to leave comments, you need to log in
Freeglut, keyboard and mouse reading
In short, he does not react to either one or the other.
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA);
glutInitWindowSize(512, 512);
glutInitContextVersion(4, 3);
glutInitContextProfile(GLUT_CORE_PROFILE);
<b> glutMouseFunc(mousemove);
glutKeyboardFunc(keybord);
</b> glutIdleFunc(IdleFunc);
glutCreateWindow(argv[0]);
glewExperimental = GL_TRUE;
if (glewInit()) {
cerr << "Unable to initialize GLEW ...exiting" << endl;
exit(EXIT_FAILURE);
}
init();
glutDisplayFunc(display);
glutMainLoop();
}
void mousemove(int button, int state, int x, int y){
printf("I'm here\n");
//И еще чуть-чуть кода, который ничего особо не делает
}
void keybord(unsigned char key,int x, int y){
printf("Hi");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question