Loading Images

Started by Melcadrien, October 21, 2009, 21:25:47

Previous topic - Next topic

Melcadrien

I've found out how to load images, but is there a way to load them without the requirement of resizing the image(meaning when it's loaded it stays as-is)?

I'm partially new to this library and am learning as I go(most of it is just figuring things out through old code).

Kai

What exactly do you mean by "resizing"?
The images, however you load them (slick or Java ImageIO), are just a bunch of bytes in memory.

Nothing gets resized in that loading-stage like upscaling or downscaling the images in any way.

I think you mean how you actually project the image on a primitive onto the screen.

To achieve a 1:1 projection, you have to use an orthogonal projection matrix that scales the [-1, 1] range to the pixel-width/height range of the screen. If you then render a quad with the loaded texture applied to it, you will get a 1 pixel = 1 texel mapping.