001package cpw.mods.fml.client; 002 003import java.nio.ByteBuffer; 004 005import org.lwjgl.opengl.GL11; 006 007import net.minecraft.client.renderer.texture.Texture; 008import net.minecraft.client.renderer.texture.TextureStitched; 009 010public class CopySubimageTextureHelper extends TextureHelper { 011 @Override 012 public void doTextureCopy(Texture atlas, Texture source, int atlasX, int atlasY) 013 { 014 if (atlas.getGlTextureId() == -1) 015 { 016 return; 017 } 018 atlas.bindTexture(0); 019 ByteBuffer buffer = source.getTextureData(); 020 buffer.position(0); 021 GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, atlasX, atlasY, source.getWidth(), source.getHeight(), GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer); 022 } 023 024 @Override 025 public void doTextureUpload(TextureStitched source) 026 { 027 // NO OP for copysubimage 028 } 029 030}