opengl 里 state==GLUT_DOWN 这句是什么意思??
if(button==GLUT_LEFT_BUTTON){if(state==GLUT_DOWN){mousedown=true;loopr=false;}elsemou...
if(button == GLUT_LEFT_BUTTON)
{
if(state == GLUT_DOWN)
{ mousedown = true; loopr = false;}
else
mousedown=false;
}
if (button== GLUT_RIGHT_BUTTON)
{if(state == GLUT_DOWN)
loopr=true; glutTimerFunc(200,timer,0);
上下文 展开
{
if(state == GLUT_DOWN)
{ mousedown = true; loopr = false;}
else
mousedown=false;
}
if (button== GLUT_RIGHT_BUTTON)
{if(state == GLUT_DOWN)
loopr=true; glutTimerFunc(200,timer,0);
上下文 展开
2个回答
展开全部
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)
……
//相当于“如果鼠标右键被按下”
意法半导体(中国)投资有限公司
2023-06-12 广告
2023-06-12 广告
单片机,即单片微控制器,也称为单片微型计算机,是将中央处理器(CPU)、存储器(ROM,RAM)、输入/输出接口和其他功能部件集成在一块 在一个小块的集成电路上,从而实现对整个电路或系统的数字式控制。单片机不是完成某一个逻辑功能的芯片,而是...
点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询