opengl 里 state==GLUT_DOWN 这句是什么意思??
答案:2 悬赏:60 手机版
解决时间 2021-12-02 14:32
- 提问者网友:未信
- 2021-12-02 06:08
opengl 里 state==GLUT_DOWN 这句是什么意思??
最佳答案
- 五星知识达人网友:雾月
- 2021-12-02 06:26
if(state == GLUT_DOWN) //callback was due to a press (of a mouse button)
//相当于“如果某个鼠标键被按下”
if(state == GLUT_UP) //callback was due to a release (of a mouse button)
//相当于“如果某个鼠标键被放开(弹起)”
if (button== GLUT_LEFT_BUTTON) //callback was due to a release/press of the LEFT button
//相当于“如果鼠标左键被按下或者被放开”
if (button== GLUT_RIGHT_BUTTON) //callback was due to a release/press of the RIGHT button
//相当于“如果鼠标右键被按下或者被放开”
if (button== GLUT_MIDDLE_BUTTON) //callback was due to a release/press of the MIDDLE
//button
//相当于“如果鼠标中键被按下或者被放开”
因此,
if(button == GLUT_LEFT_BUTTON)
{
if(state == GLUT_DOWN)
……
//相当于“如果鼠标左键被按下”
if(button == GLUT_RIGHT_BUTTON)
{
if(state == GLUT_DOWN)
……
//相当于“如果鼠标右键被按下”
//相当于“如果某个鼠标键被按下”
if(state == GLUT_UP) //callback was due to a release (of a mouse button)
//相当于“如果某个鼠标键被放开(弹起)”
if (button== GLUT_LEFT_BUTTON) //callback was due to a release/press of the LEFT button
//相当于“如果鼠标左键被按下或者被放开”
if (button== GLUT_RIGHT_BUTTON) //callback was due to a release/press of the RIGHT button
//相当于“如果鼠标右键被按下或者被放开”
if (button== GLUT_MIDDLE_BUTTON) //callback was due to a release/press of the MIDDLE
//button
//相当于“如果鼠标中键被按下或者被放开”
因此,
if(button == GLUT_LEFT_BUTTON)
{
if(state == GLUT_DOWN)
……
//相当于“如果鼠标左键被按下”
if(button == GLUT_RIGHT_BUTTON)
{
if(state == GLUT_DOWN)
……
//相当于“如果鼠标右键被按下”
全部回答
- 1楼网友:何以畏孤独
- 2021-12-02 06:39
这是glut里定义的一个量,表示鼠标左键被按下
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯