Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: mojo/examples/sample_app/spinning_cube.h

Issue 684543003: Move //mojo/examples to //examples (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/examples/sample_app/sample_app.cc ('k') | mojo/examples/sample_app/spinning_cube.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_
6 #define MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_
7
8 #include <stdint.h>
9
10 #include "base/memory/scoped_ptr.h"
11
12 namespace examples {
13
14 class SpinningCube {
15 public:
16 SpinningCube();
17 ~SpinningCube();
18
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;
25 }
26 void SetFlingMultiplier(float drag_distance, float drag_time);
27 void UpdateForTimeDelta(float delta_time);
28 void UpdateForDragDistance(float distance);
29 void Draw();
30
31 void OnGLContextLost();
32
33 private:
34 class GLState;
35
36 void Update();
37
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];
45 };
46
47 } // namespace examples
48
49 #endif // MOJO_EXAMPLES_SAMPLE_APP_SPINNING_CUBE_H_
OLDNEW
« no previous file with comments | « mojo/examples/sample_app/sample_app.cc ('k') | mojo/examples/sample_app/spinning_cube.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698