Search in sources :

Example 6 with GLFWImage

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());
}
Also used : GLFWImage(org.lwjgl.glfw.GLFWImage) IntBuffer(java.nio.IntBuffer) ByteBuffer(java.nio.ByteBuffer)

Aggregations

GLFWImage (org.lwjgl.glfw.GLFWImage)6 ByteBuffer (java.nio.ByteBuffer)3 GLFW.glfwWindowHint (org.lwjgl.glfw.GLFW.glfwWindowHint)3 BufferedImage (java.awt.image.BufferedImage)2 IntBuffer (java.nio.IntBuffer)2 Pixmap (com.badlogic.gdx.graphics.Pixmap)1 Graphics2D (java.awt.Graphics2D)1