@Override public TextureHandle generateTexture(int width, int height, ShortBuffer data, String name) { int texture = GL11.glGenTextures(); if (texture == 0) { return null; } //fix strange alpha test problem (minimap and landscape are unaffected) ShortBuffer bfr = BufferUtils.createShortBuffer(data.capacity()); int cap = data.capacity(); for(int i = 0;i != cap;i++) bfr.put(i, data.get(i)); TextureHandle textureHandle = new TextureHandle(this, texture); bindTexture(textureHandle); GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, width, height, 0, GL11.GL_RGBA, GL12.GL_UNSIGNED_SHORT_4_4_4_4, bfr); setTextureParameters(); setObjectLabel(GL11.GL_TEXTURE, texture, name + "-tex"); return textureHandle; }