diff --git a/examples/gaussian-blur-view/README.md b/examples/gaussian-blur-view/README.md new file mode 100644 index 0000000..7d53456 --- /dev/null +++ b/examples/gaussian-blur-view/README.md @@ -0,0 +1,5 @@ +This example shows the GuassianBlurView in action. + +Press 1, touch or click in order to toggle the blurring. + +Used to test render tasks, frame buffers and fence syncs. diff --git a/examples/gaussian-blur-view/gaussian-blur-view-example.cpp b/examples/gaussian-blur-view/gaussian-blur-view-example.cpp index e9ff1cc..83defd3 100644 --- a/examples/gaussian-blur-view/gaussian-blur-view-example.cpp +++ b/examples/gaussian-blur-view/gaussian-blur-view-example.cpp @@ -116,25 +116,30 @@ private: if(PointState::DOWN == state) { - if(!mActivate) - { - mActivate = true; - mGaussianBlurView.Activate(); + ToggleBlurState(); + } - mOnLabel.SetProperty(Actor::Property::VISIBLE, true); - mOffLabel.SetProperty(Actor::Property::VISIBLE, false); - } - else - { - mActivate = false; - mGaussianBlurView.Deactivate(); + return true; + } - mOnLabel.SetProperty(Actor::Property::VISIBLE, false); - mOffLabel.SetProperty(Actor::Property::VISIBLE, true); - } + void ToggleBlurState() + { + if(!mActivate) + { + mActivate = true; + mGaussianBlurView.Activate(); + + mOnLabel.SetProperty(Actor::Property::VISIBLE, true); + mOffLabel.SetProperty(Actor::Property::VISIBLE, false); } + else + { + mActivate = false; + mGaussianBlurView.Deactivate(); - return true; + mOnLabel.SetProperty(Actor::Property::VISIBLE, false); + mOffLabel.SetProperty(Actor::Property::VISIBLE, true); + } } void OnKeyEvent(const KeyEvent& event) @@ -145,6 +150,10 @@ private: { mApplication.Quit(); } + else if(!event.GetKeyName().compare("1")) + { + ToggleBlurState(); + } } }