Convert int array to Texture

Hey all.

I’m trying to convert an int array to a texture (From Slick, or whatever format) to be mapped onto a OGL Surface. No problems loading an image from file and putting it on the OGL object. Anyone have ideas how I can go about this? Pretty much what I’m doing is making a perlin noise type texture and want to be able to put it onto a surface.
Thanks.

You’ll need to use glTexImage2D to create your own texture. Take a look at here for a basic idea of how that works. This is what slick is using under the covers to create textures.

Or if you don’t need the noise to be dynamic, you could just save it off to a png using javax.imageio.ImageIO and then load it up. You’d need to convert your int array into a BufferedImage first. I suppose if you were going that route, you’d be better off using Photoshop or Gimp to generate the thing in the first place, though…

I guess you could do that on the fly too, if you really wanted, but that’d be quite a hack :slight_smile: