PDA

View Full Version : Problem with callback button in GLUI



anoopsethu
11-19-2014, 06:17 PM
I am using OpenGL with GLUI for building UI for my application.
I tried to add a button using the GLUI object glui and passed the callback function btnNext() to it.

glui->add_button("Next", 0, (GLUI_Update_CB)btnNext);

And the btnNext() is defined as

void btnNext(){
orbiter.advance(1);
glutPostRedisplay();
}

This is supposed to move the orbiter object(a sphere) by 1 unit.

But this is not working. Nothing happens on the onclick event of the button. Is this definition valid? Is it legal to call glutPostRedisplay() from inside a callback function?

mhagain
11-20-2014, 01:02 AM
You've posted this question to 3 different sub-forums here. That kind of cross-posting is more likely to annoy people than anything else.