@@ -0,0 +1,2239 @@
+package org.freeworld.client.render;%0A%0Aimport org.lwjgl.BufferUtils;%0Aimport org.lwjgl.util.glu.GLU;%0A%0Aimport javax.imageio.ImageIO;%0Aimport java.awt.image.BufferedImage;%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.nio.ByteBuffer;%0Aimport java.nio.IntBuffer;%0Aimport java.util.HashMap;%0A%0Aimport static org.lwjgl.opengl.GL11.*;%0A%0A/**%0A * Created by NeutronStars on 09/07/2017%0A */%0Apublic class Texture %7B%0A%0A    private static HashMap%3CString, Integer%3E idMap = new HashMap%3C%3E();%0A%0A    private String path;%0A%0A    public Texture(String resourceName)%7B%0A        try%7B%0A            if (idMap.containsKey(resourceName)) return;%0A%0A            this.path = resourceName;%0A%0A            IntBuffer ib = BufferUtils.createIntBuffer(1);%0A            ib.clear();%0A            glGenTextures(ib);%0A            int id = ib.get(0);%0A            idMap.put(resourceName, Integer.valueOf(id));%0A%0A            glBindTexture(3553, id);%0A%0A            glTexParameteri(3553, 10241, GL_NEAREST);%0A            glTexParameteri(3553, 10240, GL_NEAREST);%0A%0A            BufferedImage img = ImageIO.read(Texture.class.getResourceAsStream(resourceName));%0A%0A            int w = img.getWidth();%0A            int h = img.getHeight();%0A%0A            ByteBuffer pixels = BufferUtils.createByteBuffer(w * h * 4);%0A            int%5B%5D rawPixels = new int%5Bw * h%5D;%0A%0A            img.getRGB(0, 0, w, h, rawPixels, 0, w);%0A%0A            for (int i = 0; i %3C rawPixels.length; i++)%7B%0A                int a = rawPixels%5Bi%5D %3E%3E 24 & 0xFF;%0A                int r = rawPixels%5Bi%5D %3E%3E 16 & 0xFF;%0A                int g = rawPixels%5Bi%5D %3E%3E 8 & 0xFF;%0A                int b = rawPixels%5Bi%5D & 0xFF;%0A%0A                rawPixels%5Bi%5D = (a %3C%3C 24 %7C b %3C%3C 16 %7C g %3C%3C 8 %7C r);%0A            %7D%0A%0A            pixels.asIntBuffer().put(rawPixels);%0A            GLU.gluBuild2DMipmaps(3553, 6408, w, h, 6408, 5121, pixels);%0A            glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);%0A        %7Dcatch (IOException e)%7B%0A            throw new RuntimeException(%22!!%22);%0A        %7D%0A    %7D%0A%0A    public void bind()%7B%0A        glEnable(GL_TEXTURE_2D);%0A        glBindTexture(GL_TEXTURE_2D, ((Integer)idMap.get(path)).intValue());%0A    %7D%0A%0A    public void unBind()%7B%0A        glDisable(GL_TEXTURE_2D);%0A    %7D%0A%7D%0A

Add class Texture