OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_ | 5 #ifndef PPAPI_EXAMPLES_GLES2_SPINNING_CUBE_SPINNING_CUBE_H_ |
6 #define MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_ | 6 #define PPAPI_EXAMPLES_GLES2_SPINNING_CUBE_SPINNING_CUBE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include "ppapi/c/pp_stdint.h" |
9 | |
10 #include "base/memory/scoped_ptr.h" | |
11 | |
12 namespace mojo { | |
13 namespace examples { | |
14 | 9 |
15 class SpinningCube { | 10 class SpinningCube { |
16 public: | 11 public: |
17 SpinningCube(); | 12 SpinningCube(); |
18 ~SpinningCube(); | 13 ~SpinningCube(); |
19 | 14 |
20 void Init(uint32_t width, uint32_t height); | 15 void Init(uint32_t width, uint32_t height); |
21 void set_direction(int direction) { direction_ = direction; } | 16 void set_direction(int direction) { direction_ = direction; } |
22 void SetFlingMultiplier(float drag_distance, float drag_time); | 17 void SetFlingMultiplier(float drag_distance, float drag_time); |
23 void UpdateForTimeDelta(float delta_time); | 18 void UpdateForTimeDelta(float delta_time); |
24 void UpdateForDragDistance(float distance); | 19 void UpdateForDragDistance(float distance); |
25 void Draw(); | 20 void Draw(); |
26 | 21 |
27 void OnGLContextLost(); | 22 void OnGLContextLost(); |
28 | 23 |
29 private: | 24 private: |
30 class GLState; | 25 class GLState; |
31 | 26 |
| 27 // Disallow copy and assign. |
| 28 SpinningCube(const SpinningCube& other); |
| 29 SpinningCube& operator=(const SpinningCube& other); |
| 30 |
32 void Update(); | 31 void Update(); |
33 | 32 |
34 bool initialized_; | 33 bool initialized_; |
35 uint32_t width_; | 34 uint32_t width_; |
36 uint32_t height_; | 35 uint32_t height_; |
37 scoped_ptr<GLState> state_; | 36 // Owned ptr. |
| 37 GLState* state_; |
38 float fling_multiplier_; | 38 float fling_multiplier_; |
39 int direction_; | 39 int direction_; |
40 }; | 40 }; |
41 | 41 |
42 } // namespace examples | 42 #endif // PPAPI_EXAMPLES_GLES2_SPINNING_CUBE_SPINNING_CUBE_H_ |
43 } // namespace mojo | |
44 | |
45 #endif // MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_ | |
OLD | NEW |