Mercurial > hg > Members > kono > Cerium
changeset 1042:b067fd5d8859
add button api.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 07 Dec 2010 18:58:10 +0900 |
parents | ce2e2c3efab3 |
children | 283b15633c0f |
files | Renderer/Engine/Application.h Renderer/Engine/Button.cc Renderer/Engine/Button.h Renderer/Engine/viewer.cc |
diffstat | 4 files changed, 14 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Application.h Mon Dec 06 18:04:18 2010 +0900 +++ b/Renderer/Engine/Application.h Tue Dec 07 18:58:10 2010 +0900 @@ -15,7 +15,7 @@ Application(); virtual ~Application(); - virtual void app_main(Viewer *viewer){}; + virtual void app_loop(Viewer *viewer){}; virtual HTaskPtr application_task(HTaskPtr next, Viewer* viewer){return next;}; virtual MainLoopPtr init(Viewer *viewer, int w, int h) = 0; };
--- a/Renderer/Engine/Button.cc Mon Dec 06 18:04:18 2010 +0900 +++ b/Renderer/Engine/Button.cc Tue Dec 07 18:58:10 2010 +0900 @@ -25,6 +25,17 @@ } /** + * ボタンの状態を初期化する + */ +void +Button::reset(void) +{ + push = 0; + hold = 0; + release = 0; +} + +/** * @retval 1 ボタンが押された(このフレームのみ) * @retval 0 押されていない */
--- a/Renderer/Engine/Button.h Mon Dec 06 18:04:18 2010 +0900 +++ b/Renderer/Engine/Button.h Tue Dec 07 18:58:10 2010 +0900 @@ -11,6 +11,7 @@ void push_work(void); void release_work(void); + void reset(void); int isPush(void); int isHold(void); int isRelease(void);
--- a/Renderer/Engine/viewer.cc Mon Dec 06 18:04:18 2010 +0900 +++ b/Renderer/Engine/viewer.cc Tue Dec 07 18:58:10 2010 +0900 @@ -315,7 +315,7 @@ pixels = dev->flip_screen(pixels); sgroot->updateControllerState(); - app->app_main(this); + app->app_loop(this); //TaskArray を使うか使わないか if (sgroot->gtask_array != NULL) {