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

Function checkMouseButton

core/platform/RenderViewImpl.cpp:350–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348//////////////////////////////////////////////////////////////////////////
349
350static EventMouse::MouseButton checkMouseButton(GLFWwindow* window)
351{
352 EventMouse::MouseButton mouseButton{EventMouse::MouseButton::BUTTON_UNSET};
353 if (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS)
354 {
355 mouseButton = static_cast<ax::EventMouse::MouseButton>(GLFW_MOUSE_BUTTON_LEFT);
356 }
357 else if (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS)
358 {
359 mouseButton = static_cast<ax::EventMouse::MouseButton>(GLFW_MOUSE_BUTTON_RIGHT);
360 }
361 else if (glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS)
362 {
363 mouseButton = static_cast<ax::EventMouse::MouseButton>(GLFW_MOUSE_BUTTON_MIDDLE);
364 }
365 return mouseButton;
366}
367
368RenderViewImpl::RenderViewImpl(bool initglfw)
369 : _captured(false)

Callers 2

Calls 1

glfwGetMouseButtonFunction · 0.85

Tested by

no test coverage detected