So, in my texture class, I want to be able to get a buffered image (or any kind of image data) from lwjgl based off of a texture id. Is there a way to do that?
you do use the search function of this board, right ?
Shouldn’t you have the image data in the first place if you even have an ID for it?
You’d have to read from the texture’s buffer, then decode that into a bufferedimage.
I won’t go into detail because a) I don’t know the exact API calls (if they exist); and b) Agro is right; why do you even need to do this? You should think about how you are going about this problem, and just do things the sensible way.
Very easy to find this through a google search.
There are realistically very few instances where this is a good approach. If you need to modify something per-pixel, and you can’t use a shader, then just store the image in RAM after you decode it (either through ImageIO, PNGDecoder, etc).
It’s really slow to grab pixels from a texture, and not supported in GL ES (mobile/web).