What should i use to load images in lwjgl?
I thought this would be a good place to post this question.
LWJGL doesn’t have a built in texture loader so what is the best thing to use to load textures.
I tried the slick-util but it gave me an error. If it is possible to load images without any added libraries that would be awesome.
this is the error that the slick util gave me:
WARN:class org.newdawn.slick.opengl.PNGImageData failed to read the data
java.lang.UnsupportedOperationException: Unsupported format for this image
Thanks in advance!!
Ned
EDIT:
I sorted that problem however if somebody could tell me how to use a part of an image so i can make a sprite sheet, that would be awesome
Thanks in advance !!
Comments
GMan1337
05. Jul 2014 · 15:40 UTC
Im not much experiensed wiht Java Light wight game librari
sorry man. all i haerd is that its a game set of jars for easy game development :d here ill give you a link to some videos to help you out
best of luck!
sorry man. all i haerd is that its a game set of jars for easy game development :d here ill give you a link to some videos to help you out
best of luck!
FyberOptic
05. Jul 2014 · 17:41 UTC
I’ve used slick-util quite a bit with LWJGL and never had that particular problem. Perhaps it’s not able to interpret something added by the program you’re making the PNGs in. Try opening and saving them again in another program, just to help rule that out.
Nnnnneeeedddd
05. Jul 2014 · 18:27 UTC
Ok thanks guys. I worked out that the image had to be a power of two. Also if somebody could tell me how to use only a part of an image with slick-util so i could make a sprite sheet that would be amazing.
FyberOptic
05. Jul 2014 · 22:33 UTC
Ah okay cool, glad you got it sorted.
Nnnnneeeedddd
06. Jul 2014 · 08:50 UTC
Thanks dude you are awesome!!!!! 😀 😀
jedilemons
08. Jul 2014 · 13:17 UTC
I always just load it through a BufferedImage and put the pixel information into a ByteBuffer by doing
marccspro
10. Jul 2014 · 08:37 UTC
Here is my way of loading textures in lwjgl: