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)
……
//相当于“如果鼠标右键被按下”
威孚半导体技术
2024-08-19 广告
2024-08-19 广告
威孚(苏州)半导体技术有限公司是一家专注生产、研发、销售晶圆传输设备整机模块(EFEM/SORTER)及核心零部件的高科技半导体公司。公司核心团队均拥有多年半导体行业从业经验,其中技术团队成员博士、硕士学历占比80%以上,依托丰富的软件底层...
点击进入详情页
本回答由威孚半导体技术提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询