I'm a bit confused as to how GLFWImage and GLFWImage.Buffer work. The glfwSetWindowIcon method takes in a Buffer as a parameter. How exactly do I use these to set the icon? Looking into GLFWImage, I know how to "load" one by setting the width, height, and pixels, (I think), but I don't know how to turn that into a GLFWImage.Buffer to give to the method.
The Events sample has an example, here (https://github.com/LWJGL/lwjgl3/blob/7e1dcb80160d9dbce2b041cbf84eec0da15f2661/modules/core/src/test/java/org/lwjgl/demo/glfw/Events.java#L87). A struct Buffer class basically represents an array of the corresponding struct type. The API is similar to NIO buffers, except each element is a struct value, instead of a primitive value.
Ah okay, I got it working, thank you. Would using STB to load the images straight from the disk work, or do they have to be read by the SeekableByteChannel then loaded from memory?
Yes, if the images are plain files.