I just started to look at lwjgl3 and found the 'drop' call back.
How can I get a String[] from the drop callback method?
public abstract void drop(long window,
int count,
long names)
the parameter for names is :
Quotepointer to the array of UTF-8 encoded path names of the dropped files
See the GLFW events demo (https://github.com/LWJGL/lwjgl3/blob/master/src/tests/org/lwjgl/demo/glfw/Events.java) on github:
@Override
public void drop(long window, int count, long names) {
printEvent(window, "drop %d file%s", count, count == 1 ? "" : "s");
PointerBuffer nameBuffer = memPointerBuffer(names, count);
for ( int i = 0; i < count; i++ ) {
System.out.format("\t%d: %s%n", i + 1, memDecodeUTF8(memByteBufferNT1(nameBuffer.get(i))));
}
}
A user-friendly utility method should probably be added for this.
Thank you spasi. Works like a charm ;D.
for new commers:
memDecodeUTF8 has already been renamed to memUTF8