我有以下代码:
paintGL()
{
if(mouse_was_clicked)
{
... do the color picking with openGL to identify a clicked element
... !!! now I need to call again paintGL() to switch the selected element from the
old one to the new one but I can't create a recursive cycle!
}
else
{
... normal code to draw the scene and the selected element in red ...
}
}
正如线条所暗示的那样,我需要一种方法来再次调用绘制事件。有没有办法在不产生潜在活锁的情况下实现这一点?比如推迟一个新的绘画活动?