OpenGL-鼠標交互

1. 檢測鼠標的click

 

glutMouseFunc( (void)(*func) ( int button, int state, int x, int y ) )

 

button: GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, BLUT_RIGHT_BUTTON

state: GLUT_DOWN, GLUT_UP

x,y: 左上角爲原點

 

2. 檢測鼠標的動作

 

active motion: 鼠標移動並且有一個鼠標鍵按下

passive motion: 鼠標移動並且無鼠標鍵按下

 

glutMotionFunc( (void)(*func) (int x, int y) )

glutPassiveMotionFunc( (void)(*func) ( int x, int y ) )

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章