Using lwjgl and slick-util I've been trying to use certain pieces of a spritesheet as textures. lwjgl uses glTexCoord2f(); to map coordinates to individual vertices, and the coordinates it takes in are normalized (between 1 and 0), so I've been using this code to make the coordinates only use a small piece of the full Texture:
glTexCoord2f(0 / 128, 0 / 128); glVertex2f(0, 0);
glTexCoord2f(0 / 128, 8 / 128); glVertex2f(0, 32);
glTexCoord2f(8 / 128, 8 / 128); glVertex2f(32, 32);
glTexCoord2f(8 / 128, 0 / 128); glVertex2f(32, 0);
but whenever I used normalized coordinates that are a fraction of the images size I just get a solid square that had 50% alpha.
My question is: what am I doing that's making the texture coordinates screw up? Is there a better way to go about this?
Any help is appreciated, thanks in advance!