OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TUMBLER_TUMBLER_H_ | 5 #ifndef EXAMPLES_TUMBLER_TUMBLER_H_ |
6 #define EXAMPLES_TUMBLER_TUMBLER_H_ | 6 #define EXAMPLES_TUMBLER_TUMBLER_H_ |
7 | 7 |
8 #include <pthread.h> | 8 #include <pthread.h> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // Called by the browser to handle the postMessage() call in Javascript. | 44 // Called by the browser to handle the postMessage() call in Javascript. |
45 virtual void HandleMessage(const pp::Var& message); | 45 virtual void HandleMessage(const pp::Var& message); |
46 | 46 |
47 // Called by the browser to handle incoming input events. | 47 // Called by the browser to handle incoming input events. |
48 virtual bool HandleInputEvent(const pp::InputEvent& event); | 48 virtual bool HandleInputEvent(const pp::InputEvent& event); |
49 | 49 |
50 // Bind and publish the module's methods to JavaScript. | 50 // Bind and publish the module's methods to JavaScript. |
51 void InitializeMethods(ScriptingBridge* bridge); | 51 void InitializeMethods(ScriptingBridge* bridge); |
52 | 52 |
53 // Set the camera orientation to the quaternion in |args[0]|. |args| must | 53 // Set the camera orientation to the quaternion in |args[0]|. |args| must |
54 // have length at least 1; the first element is expeted to be an Array | 54 // have length at least 1; the first element is expected to be an Array |
55 // object containing 4 floating point number elements (the quaternion). | 55 // object containing 4 floating point number elements (the quaternion). |
56 // This method is bound to the JavaScript "setCameraOrientation" method and | 56 // This method is bound to the JavaScript "setCameraOrientation" method and |
57 // is called like this: | 57 // is called like this: |
58 // module.setCameraOrientation([0.0, 1.0, 0.0, 0.0]); | 58 // module.setCameraOrientation([0.0, 1.0, 0.0, 0.0]); |
59 void SetCameraOrientation( | 59 void SetCameraOrientation( |
60 const tumbler::ScriptingBridge& bridge, | 60 const tumbler::ScriptingBridge& bridge, |
61 const tumbler::MethodParameter& parameters); | 61 const tumbler::MethodParameter& parameters); |
62 | 62 |
63 // Called to draw the contents of the module's browser area. | 63 // Called to draw the contents of the module's browser area. |
64 void DrawSelf(); | 64 void DrawSelf(); |
(...skipping 10 matching lines...) Expand all Loading... |
75 | 75 |
76 SharedOpenGLContext opengl_context_; | 76 SharedOpenGLContext opengl_context_; |
77 // Wouldn't it be awesome if we had boost::scoped_ptr<>? | 77 // Wouldn't it be awesome if we had boost::scoped_ptr<>? |
78 Cube* cube_; | 78 Cube* cube_; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace tumbler | 81 } // namespace tumbler |
82 | 82 |
83 #endif // EXAMPLES_TUMBLER_TUMBLER_H_ | 83 #endif // EXAMPLES_TUMBLER_TUMBLER_H_ |
84 | 84 |
OLD | NEW |