MCPcopy Create free account
hub / github.com/axmolengine/axmol / onGLFWMouseMoveCallBack

Method onGLFWMouseMoveCallBack

core/platform/RenderViewImpl.cpp:1140–1173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1138}
1139
1140void RenderViewImpl::onGLFWMouseMoveCallBack(GLFWwindow* window, double x, double y)
1141{
1142 _mouseX = (float)x;
1143 _mouseY = (float)y;
1144
1145 _mouseX /= this->getFrameZoomFactor();
1146 _mouseY /= this->getFrameZoomFactor();
1147
1148 if (_isInRetinaMonitor)
1149 {
1150 if (_retinaFactor == 1)
1151 {
1152 _mouseX *= 2;
1153 _mouseY *= 2;
1154 }
1155 }
1156 if (!_isTouchDevice)
1157 {
1158 if (_captured)
1159 {
1160 intptr_t id = 0;
1161 this->handleTouchesMove(1, &id, &_mouseX, &_mouseY);
1162 }
1163 }
1164
1165 float cursorX = transformInputX(_mouseX);
1166 float cursorY = transformInputY(_mouseY);
1167
1168 EventMouse event(EventMouse::MouseEventType::MOUSE_MOVE);
1169 // Set current button
1170 EventMouse::MouseButton mouseButton{EventMouse::MouseButton::BUTTON_UNSET};
1171 event.setMouseInfo(cursorX, cursorY, checkMouseButton(window));
1172 Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);
1173}
1174
1175#if defined(__EMSCRIPTEN__)
1176void RenderViewImpl::onWebTouchCallback(int eventType, const EmscriptenTouchEvent* touchEvent)

Callers 1

Calls 6

getFrameZoomFactorMethod · 0.95
transformInputYFunction · 0.85
getInstanceFunction · 0.85
handleTouchesMoveMethod · 0.80
checkMouseButtonFunction · 0.70
dispatchEventMethod · 0.45

Tested by

no test coverage detected