I'm currently trying to learn, how to program with LWJGL 3, and there are not a lot of tutorials/books/documentations about it (not just in java, but in C too). I got over most of these problems, but I couldn't find any materials about how to render with ByteBuffers or how to convert them into textures. Thanks for the help.
Asked
Active
Viewed 260 times
-1
-
Have any code? What did you try so far? – Nick DeFazio Oct 25 '15 at 15:38
-
I have set up a method for loading up textures in ByteBuffers (with PNGDecoder), it returns a ByteBuffer. – Bálint Oct 25 '15 at 15:43
-
You can have a look at the [LWJGL 3 demos](https://github.com/LWJGL/lwjgl3/tree/master/modules/core/src/test/java/org/lwjgl/demo), which show you how to do many common things. The [stb/Image demo](https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/test/java/org/lwjgl/demo/stb/Image.java) has an example on how to load textures with STB. – javac Oct 26 '15 at 08:15
1 Answers
0
After a while, I found out, that you can use the glTexImage2D
method, to store a ByteBuffer in a texture.

Bálint
- 4,009
- 2
- 16
- 27