libglui / glui

GLUI is a GLUT-based C++ user interface library which provides controls such as buttons, checkboxes, radio buttons, and spinners to OpenGL applications. It is window-system independent, using GLUT or FreeGLUT.
Other
194 stars 82 forks source link

std::function for GLUI callbacks #82

Open nigels-com opened 7 years ago

nigels-com commented 7 years ago

This change replaces GLUI_CB and the associated IDs and pointers with simply std::function<void(void)>. This allows for using C++ lambdas for GLUI callbacks, including std::bind.

For example:

new GLUI_Button( glui, "Quit", []() { printf("Exit\n"); exit(0); } );