Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void renderSprite(Sprite sprite, int x, int y) {
- Texture t = sprite.getTexture();
- int xpos = x;
- int ypos = y;
- int width = sprite.getWidth();
- int height = sprite.getHeight();
- float xit = (float) sprite.getTextureX();
- float yit = (float) sprite.getTextureY();
- float wit = (float) sprite.getWidthInTexture();
- float hit = (float) sprite.getHeightInTexture();
- this.setSpriteUBO(xpos, ypos, width, height, xit, yit, wit, hit);
- this.gl.glBindVertexArray(this.spriteVAO);
- this.gl.glBindTexture(GL_TEXTURE_2D, t.getID());
- this.gl.glUseProgram(this.defaultProgram.getID());
- this.gl.glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, 0);
- this.gl.glUseProgram(0);
- this.gl.glBindTexture(GL_TEXTURE_2D, 0);
- this.gl.glBindVertexArray(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement