Texture problems

I’ve just started writing a 2D game, my first with lwjgl, and I noticed that the image I loaded was a bit skewed. The image was much wider and shorter than it should be. The image is a 24-bit png. The projection setup I’m using looks like this:

GLU.gluOrtho2D(0, Game.gameWidth, 0, Game.gameHeight);

I’m trying to map an image to a quad so that the corners of the image meet up with the corners of the quad, code looks like this:

GL11.glPushMatrix();
GL11.glTranslatef(x, y, 0);
GL11.glBegin(GL11.GL_QUADS);
GL11.glTexCoord2f(1f, 0); GL11.glVertex2f(400, 0);
GL11.glTexCoord2f(1f, 1f); GL11.glVertex2f(400, 400);
GL11.glTexCoord2f(0, 1f); GL11.glVertex2f(0, 400);
GL11.glTexCoord2f(0, 0); GL11.glVertex2f(0, 0);
GL11.glEnd();
GL11.glPopMatrix();

I tried a different image that doesn’t use transparency and it draws a black square the actual size of the image with the actual image occupying the lower-lefhand side of that square, heres a screen:

http://www.cyntaks.com/projects/images/misc/screen.png

the current color is set to red, so I don’t know why the square is black. Btw, I’m using KevGlass’s TextureLoader class from space invaders 104. Any ideas?

ah crud, figured it out… I forgot that I need to use power of two textures, the images were mishapen cause kev’s texture loader class uses the closes size that is a power of two if you give an image with illegal dimensions. I do have another texture problem though. I have two textures, one of them is 256x256 and the other is 512x128, I measured the time required to load the two textures and its about 1200 milliseconds, 1000 if I don’t flip the images first. That seems way too long, is it?

If you start or are using v0.94 of LWJGL, it now includes basic DevIL support. You can check out NeHe Lesson 6 tutorial for how to use it.