预打算使用windows中的鼠标指针功能,发现效果不佳,和COCOS不是很匹配,最终和cocos使用同一个glfw库的,代码如下:
std::string strCur = "../../res/bg_d.png";
auto image = new (std::nothrow)Image();
image->initWithImageFile(strCur);
GLFWimage *fwImage = new (std::nothrow)GLFWimage();
fwImage->width = image->getWidth();
fwImage->height = image->getHeight();
fwImage->pixels = image->getData();
auto cursor =glfwCreateCursor(fwImage,10, 10);
glfwSetCursor(_mainWindow, cursor);