| 97 | } |
| 98 | |
| 99 | void InputEventBuffer::onPointerInputEvent(const SampleFramework::InputEvent& e, PxU32 x, PxU32 y, PxReal dx, PxReal dy, bool val) |
| 100 | { |
| 101 | checkResetLastInput(); |
| 102 | if(mLastPointerInput && mLastPointerInput->isEqual(e, x, y, dx, dy, val)) |
| 103 | return; |
| 104 | if(mRingBuffer.isFull() || (mRingBuffer.size() > MAX_MOUSE_EVENTS)) |
| 105 | return; |
| 106 | PointerInput& event = mRingBuffer.front().get<PointerInput>(); |
| 107 | PX_PLACEMENT_NEW(&event, PointerInput); |
| 108 | event.e = e; |
| 109 | event.x = x; |
| 110 | event.y = y; |
| 111 | event.dx = dx; |
| 112 | event.dy = dy; |
| 113 | event.val = val; |
| 114 | mLastPointerInput = &event; |
| 115 | mRingBuffer.incFront(1); |
| 116 | } |
| 117 | |
| 118 | void InputEventBuffer::clear() |
| 119 | { |