2 Copyright (c) 2005-2019 Intel Corporation
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
17 #ifndef FRACTAL_VIDEO_H_
18 #define FRACTAL_VIDEO_H_
20 #include "../../common/gui/video.h"
26 class fractal_video : public video
31 void on_mouse( int x, int y, int key ) {
34 fg->set_num_frames_at_least(20);
35 fg->mouse_click( x, y );
40 void on_key( int key ) {
43 running = false; break;
45 if( fg ) fg->switch_priorities(); break;
48 if( fg ) fg->active_fractal_zoom_in(); break;
50 if( fg ) fg->active_fractal_zoom_out(); break;
53 if( fg ) fg->active_fractal_quality_inc(); break;
55 if( fg ) fg->active_fractal_quality_dec(); break;
58 if( fg ) fg->active_fractal_move_up(); break;
60 if( fg ) fg->active_fractal_move_left(); break;
62 if( fg ) fg->active_fractal_move_down(); break;
64 if( fg ) fg->active_fractal_move_right(); break;
66 if( fg ) fg->set_num_frames_at_least(20);
76 fractal_video() :fg(0) {
77 title = "Dynamic Priorities in TBB: Fractal Example";
81 void set_fractal_group( fractal_group &_fg ) {
86 #endif /* FRACTAL_VIDEO_H_ */