void UIButton::comp(){ state = _getState(mousePosition, mouseState); if(state == UIState::UP && callbackPtr != NULL){ return (void)callbackPtr(callbackParam); } }
void InterfaceGl::addButton( const std::string &name, const std::function<void ()> &callback, const std::string &optionsStr ) { std::shared_ptr<std::function<void ()> > callbackPtr( new std::function<void ()>( callback ) ); mButtonCallbacks.push_back( callbackPtr ); TwAddButton( mBar.get(), name.c_str(), implButtonCallback, (void*)callbackPtr.get(), optionsStr.c_str() ); }