Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void draw(Texture tx) {
- glEnable(GL_TEXTURE_2D);
- glBegin(GL_QUADS);
- glColor3f(1f, 1f, 1f);
- glTexCoord2f(0,0); // Top left
- glVertex2i(xPos, 0);
- glTexCoord2f(1,0); // Top right
- glVertex2i(xPos + 112, 0);
- glTexCoord2f(1,1); // Bottom right
- glVertex2i(xPos + 112, tx.getImageHeight());
- glTexCoord2f(0,1); // Bottom left
- glVertex2i(xPos, tx.getImageHeight());
- glEnd();
- glDisable(GL_TEXTURE_2D);
- System.out.println(tx.getImageWidth() + " / " + tx.getImageHeight());
- }
Add Comment
Please, Sign In to add comment