3 ==============================================================================
5 This file is part of the S.F.Tracker
6 Copyright 2005-7 by Satoshi Fujiwara.
8 S.F.Tracker can be redistributed and/or modified under the terms of the
9 GNU General Public License, as published by the Free Software Foundation;
10 either version 2 of the License, or (at your option) any later version.
12 S.F.Tracker is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with S.F.Tracker; if not, visit www.gnu.org/licenses or write to the
19 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 Boston, MA 02111-1307 USA
22 ==============================================================================
26 * @author S.F. (Satoshi Fujiwara)
29 struct run_message_loop
32 inline WPARAM operator()()
35 while (GetMessage(&msg, NULL, 0, 0))
37 TranslateMessage(&msg);
38 DispatchMessage(&msg);
43 ~run_message_loop(void){};
46 struct peek_message_loop
48 typedef boost::function<void ()> func_type;
49 explicit peek_message_loop(func_type func) {func_ = func;};
50 inline WPARAM operator()()
53 while( WM_QUIT != msg.message )
55 if( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
57 TranslateMessage( &msg );
58 DispatchMessage( &msg );
62 func_(); // Do some rendering