Changeset 1087 for trunk/src/platform/nacl
- Timestamp:
- Nov 25, 2011, 12:30:26 AM (11 years ago)
- Location:
- trunk/src/platform/nacl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/platform/nacl/nacl_instance.cpp
r1084 r1087 18 18 #include <ppapi/cpp/module.h> 19 19 #include <ppapi/cpp/completion_callback.h> 20 #include <ppapi/cpp/input_event.h> 20 21 21 22 #include "core.h" … … 32 33 m_size(0, 0) 33 34 { 34 ;35 RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE); 35 36 } 36 37 … … 102 103 } 103 104 105 bool NaClInstance::HandleInputEvent(const pp::InputEvent& event) 106 { 107 switch (event.GetType()) 108 { 109 case PP_INPUTEVENT_TYPE_MOUSEDOWN: 110 Input::SetMouseButton(pp::MouseInputEvent(event).GetButton()); 111 break; 112 case PP_INPUTEVENT_TYPE_MOUSEUP: 113 Input::UnsetMouseButton(pp::MouseInputEvent(event).GetButton()); 114 break; 115 case PP_INPUTEVENT_TYPE_MOUSEMOVE: 116 Input::SetMousePos(ivec2(pp::MouseInputEvent(event).GetPosition().x(), opengl_context_->GetSize().height() - 1 - pp::MouseInputEvent(event).GetPosition().y())); 117 break; 118 default: 119 break; 120 } 121 return true; 122 } 123 104 124 void NaClInstance::DrawSelf() 105 125 { -
trunk/src/platform/nacl/nacl_instance.h
r1084 r1087 37 37 //void InitializeMethods(ScriptingBridge* bridge); 38 38 39 39 40 // Called to draw the contents of the module's browser area. 40 void DrawSelf();41 virtual bool HandleInputEvent(const pp::InputEvent& event); 41 42 42 // private: 43 // Browser connectivity and scripting support. 44 // ScriptingBridge scripting_bridge_; 43 void DrawSelf(); 45 44 46 SharedOpenGLContext opengl_context_;45 SharedOpenGLContext opengl_context_; 47 46 48 47 ivec2 m_size; -
trunk/src/platform/nacl/opengl_context.h
r1084 r1087 62 62 void ResizeContext(const pp::Size& size); 63 63 64 pp::Size const& GetSize() { return size_; } 65 64 66 /// The OpenGL ES 2.0 interface. 65 67 const struct PPB_OpenGLES2* gles2() const {
Note: See TracChangeset
for help on using the changeset viewer.