Guest User

Untitled

a guest
Nov 18th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public void draw(Texture tx) {
  2. glEnable(GL_TEXTURE_2D);
  3. glBegin(GL_QUADS);
  4. glColor3f(1f, 1f, 1f);
  5. glTexCoord2f(0,0); // Top left
  6. glVertex2i(xPos, 0);
  7. glTexCoord2f(1,0); // Top right
  8. glVertex2i(xPos + 112, 0);
  9. glTexCoord2f(1,1); // Bottom right
  10. glVertex2i(xPos + 112, tx.getImageHeight());
  11. glTexCoord2f(0,1); // Bottom left
  12. glVertex2i(xPos, tx.getImageHeight());
  13. glEnd();
  14. glDisable(GL_TEXTURE_2D);
  15. System.out.println(tx.getImageWidth() + " / " + tx.getImageHeight());
  16. }
Add Comment
Please, Sign In to add comment