Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pixels = new byte[width * height * 4];
- ByteBuffer buffer = ByteBuffer.allocateDirect(pixels.length);
- int totalHeight = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
- int totalWidth = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
- int tForm = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_INTERNAL_FORMAT);
- GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, (int)(Math.floor(totalWidth * minU)), (int)(Math.floor(totalHeight * minV)), width, height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
- buffer.get(pixels);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement