use of org.lwjgl.glfw.GLFWImage in project jmonkeyengine by jMonkeyEngine.
the class GlfwMouseInputVR method createGlfwCursor.
private long createGlfwCursor(JmeCursor jmeCursor) {
GLFWImage glfwImage = new GLFWImage(BufferUtils.createByteBuffer(GLFWImage.SIZEOF));
// TODO: currently animated cursors are not supported
IntBuffer imageData = jmeCursor.getImagesData();
ByteBuffer buf = BufferUtils.createByteBuffer(imageData.capacity() * 4);
buf.asIntBuffer().put(imageData);
glfwImage.set(jmeCursor.getWidth(), jmeCursor.getHeight(), buf);
return glfwCreateCursor(glfwImage, jmeCursor.getXHotSpot(), jmeCursor.getYHotSpot());
}
Aggregations