本文整理汇总了C++中EGLView::handleTouchesBegin方法的典型用法代码示例。如果您正苦于以下问题:C++ EGLView::handleTouchesBegin方法的具体用法?C++ EGLView::handleTouchesBegin怎么用?C++ EGLView::handleTouchesBegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EGLView
的用法示例。
在下文中一共展示了EGLView::handleTouchesBegin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGLFWMouseCallBack
void EGLViewEventHandler::OnGLFWMouseCallBack(GLFWwindow* window, int button, int action, int modify)
{
EGLView* eglView = EGLView::getInstance();
if(nullptr == eglView) return;
if(GLFW_MOUSE_BUTTON_LEFT == button)
{
if(GLFW_PRESS == action)
{
s_captured = true;
if (eglView->getViewPortRect().equals(Rect::ZERO) || eglView->getViewPortRect().containsPoint(Point(s_mouseX,s_mouseY)))
{
int id = 0;
eglView->handleTouchesBegin(1, &id, &s_mouseX, &s_mouseY);
}
}
else if(GLFW_RELEASE == action)
{
s_captured = false;
if (eglView->getViewPortRect().equals(Rect::ZERO) || eglView->getViewPortRect().containsPoint(Point(s_mouseX,s_mouseY)))
{
int id = 0;
eglView->handleTouchesEnd(1, &id, &s_mouseX, &s_mouseY);
}
}
}
}
示例2: if
extern "C" void mouseCB(int button, int state, int x, int y)
{
float fx = x;
float fy = y;
EGLView* pEGLView = EGLView::getInstance();
int id = 0;
if(button != glutLeftButton) return;
if(state == glutMouseDown)
{
pEGLView->handleTouchesBegin(1, &id, &fx, &fy);
buttonDepressed = true;
}
else if(state == glutMouseUp)
{
pEGLView->handleTouchesEnd(1, &id, &fx, &fy);
buttonDepressed = false;
}
}