Following a tutorial, I can load textures. how it looks:
guy = TextureLoader.getTexture("PNG", new FileInputStream(new File("res/guy.png")));
Initialized code ^
now I draw it:
..other stuff
guy.bind();
glBegin(GL_QUADS);
glTexCoord2f(0, 0); glVertex2i(p.getx(), p.gety()); // Upper-left
glTexCoord2f(1, 0); glVertex2i(p.getx() + 150, p.gety()); // Upper-right
glTexCoord2f(1, 1); glVertex2i(p.getx() + 150, p.gety() + 150); // Bottom-right
glTexCoord2f(0, 1); glVertex2i(p.getx(), p.gety() + 150); // Bottom-left
glEnd();
I tried doing the following for another image but I got the same image.(different locations ofcourse)