mojo: Fix map of booleans for python bindings.
[chromium-blink-merge.git] / mojo / examples / sample_app / spinning_cube.h
blobf8d506ddb8f74f1f84e2a94e6d0ce4208a776ab1
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
3 // found in the LICENSE file.
5 #ifndef MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_
6 #define MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_
8 #include <stdint.h>
10 #include "base/memory/scoped_ptr.h"
12 namespace examples {
14 class SpinningCube {
15 public:
16 SpinningCube();
17 ~SpinningCube();
19 void Init(uint32_t width, uint32_t height);
20 void set_direction(int direction) { direction_ = direction; }
21 void set_color(float r, float g, float b) {
22 color_[0] = r;
23 color_[1] = g;
24 color_[2] = b;
26 void SetFlingMultiplier(float drag_distance, float drag_time);
27 void UpdateForTimeDelta(float delta_time);
28 void UpdateForDragDistance(float distance);
29 void Draw();
31 void OnGLContextLost();
33 private:
34 class GLState;
36 void Update();
38 bool initialized_;
39 uint32_t width_;
40 uint32_t height_;
41 scoped_ptr<GLState> state_;
42 float fling_multiplier_;
43 int direction_;
44 float color_[3];
47 } // namespace examples
49 #endif // MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_