sdl - How do you implement Signals and Events in C++? -
sdl - How do you implement Signals and Events in C++? -
i making gui library on top of sdl using c++. (don't inquire me why, doing gain knowledge out of practice in order understand how gui libraries made.) , want create signal connection scheme gtk+ or wxwidgets...
g_signal_connect(mybutton,"clicked",gtk_main_quit); //gtk+ evt_menu(wxid_exit,onquit); //wxwidgets i understand can using function pointers. how add together functions main loop?
or there improve way this?
the simplest way borrowing library, illustration boost::signal or boost::signal2. next best thing implementing own borrowing of features libraries boost::bind (to enable connections) or using c++0x features simplify generic connection of clients (std::function / boost::function).
i recommend utilize boost , signals2 library, there many things can wrong , solved there.
c++ sdl signals
Comments
Post a Comment