Hi folks!
Take a look at this screenshot from my ““game””:
http://img84.imageshack.us/img84/2901/screen9fh.png
Why is the image like that? I was expecting the samurai to be on foot =D
Code that renders the image:
/**
* Draw the sprite at the specified location
*
* @param x The x location at which to draw this sprite
* @param y The y location at which to draw this sprite
*/
public void draw(int x, int y) {
GL gl = Game.getRenderer().getGL();
gl.glPushMatrix();
texture.bind();
gl.glTranslatef(x, y, 0);
gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
TextureCoords coords = texture.getImageTexCoords();
gl.glBegin(GL.GL_QUADS);
{
gl.glTexCoord2f(coords.left(), coords.bottom());
gl.glVertex2f(0, 0);
gl.glTexCoord2f(coords.right(), coords.bottom());
gl.glVertex2f(0, texture.getHeight());
gl.glTexCoord2f(coords.right(), coords.top());
gl.glVertex2f(texture.getWidth(), texture.getHeight());
gl.glTexCoord2f(coords.left(), coords.top());
gl.glVertex2f(texture.getWidth(), 0);
}
gl.glEnd();
gl.glPopMatrix();
}