Fix crash in SpeechRecognizerImpl introduced in AudioParams refactor.
[chromium-blink-merge.git] / ppapi / examples / gles2_spinning_cube / spinning_cube.h
blob84a302c2dec0c7cc96673183dd4c30da0cc07639
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_EXAMPLES_GLES2_SPINNING_CUBE_SPINNING_CUBE_H_
6 #define PPAPI_EXAMPLES_GLES2_SPINNING_CUBE_SPINNING_CUBE_H_
8 #include "ppapi/c/pp_stdint.h"
10 class SpinningCube {
11 public:
12 SpinningCube();
13 ~SpinningCube();
15 void Init(uint32_t width, uint32_t height);
16 void set_direction(int direction) { direction_ = direction; }
17 void SetFlingMultiplier(float drag_distance, float drag_time);
18 void UpdateForTimeDelta(float delta_time);
19 void UpdateForDragDistance(float distance);
20 void Draw();
22 void OnGLContextLost();
24 private:
25 class GLState;
27 // Disallow copy and assign.
28 SpinningCube(const SpinningCube& other);
29 SpinningCube& operator=(const SpinningCube& other);
31 void Update();
33 bool initialized_;
34 uint32_t width_;
35 uint32_t height_;
36 // Owned ptr.
37 GLState* state_;
38 float fling_multiplier_;
39 int direction_;
42 #endif // PPAPI_EXAMPLES_GLES2_SPINNING_CUBE_SPINNING_CUBE_H_