| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXAMPLES_SPINNING_CUBE_SPINNING_CUBE_H_ | 5 #ifndef EXAMPLES_SPINNING_CUBE_SPINNING_CUBE_H_ |
| 6 #define EXAMPLES_SPINNING_CUBE_SPINNING_CUBE_H_ | 6 #define EXAMPLES_SPINNING_CUBE_SPINNING_CUBE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 | 11 |
| 12 namespace examples { | 12 namespace examples { |
| 13 | 13 |
| 14 class GLInterface; |
| 15 |
| 14 class SpinningCube { | 16 class SpinningCube { |
| 15 public: | 17 public: |
| 16 SpinningCube(); | 18 SpinningCube(); |
| 17 ~SpinningCube(); | 19 ~SpinningCube(); |
| 18 | 20 |
| 19 void Init(); | 21 void Init(); |
| 20 void set_direction(int direction) { direction_ = direction; } | 22 void set_direction(int direction) { direction_ = direction; } |
| 21 void set_color(float r, float g, float b) { | 23 void set_color(float r, float g, float b) { |
| 22 color_[0] = r; | 24 color_[0] = r; |
| 23 color_[1] = g; | 25 color_[1] = g; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 35 void OnGLContextLost(); | 37 void OnGLContextLost(); |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 class GLState; | 40 class GLState; |
| 39 | 41 |
| 40 void Update(); | 42 void Update(); |
| 41 | 43 |
| 42 bool initialized_; | 44 bool initialized_; |
| 43 uint32_t width_; | 45 uint32_t width_; |
| 44 uint32_t height_; | 46 uint32_t height_; |
| 47 scoped_ptr<GLInterface> gl_; |
| 45 scoped_ptr<GLState> state_; | 48 scoped_ptr<GLState> state_; |
| 46 float fling_multiplier_; | 49 float fling_multiplier_; |
| 47 int direction_; | 50 int direction_; |
| 48 float color_[3]; | 51 float color_[3]; |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 } // namespace examples | 54 } // namespace examples |
| 52 | 55 |
| 53 #endif // EXAMPLES_SPINNING_CUBE_SPINNING_CUBE_H_ | 56 #endif // EXAMPLES_SPINNING_CUBE_SPINNING_CUBE_H_ |
| OLD | NEW |