Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void getTextureForFace(int face) {
- PaintFace pface = renderBlock.paintedFaces[face];
- if (textureBuffer == null) {
- textureBuffer = ByteBuffer.allocateDirect(ARRAY_SIZE);
- textureBuffer.order(ByteOrder.nativeOrder());
- }
- if (textureId <= 0) {
- textureId = GL11.glGenTextures();
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
- GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
- }
- GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId);
- textureBuffer.clear();
- textureBuffer.put(pface.points);
- textureBuffer.flip();
- GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, ROW, ROW, 0, GL11.GL_RGBA, GL11.GL_BYTE, textureBuffer);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement