package client.renderer.texture;

import java.io.IOException;

import org.lwjgl.opengl.GL11;

import client.renderer.GlState;

public abstract class Texture
{
    protected int glTextureId = -1;

    public final int getGlTextureId()
    {
        if (this.glTextureId == -1)
        {
            this.glTextureId = GL11.glGenTextures();
        }

        return this.glTextureId;
    }

    public final void deleteGlTexture()
    {
        if (this.glTextureId != -1)
        {
            GlState.deleteTexture(this.glTextureId);
            this.glTextureId = -1;
        }
    }
    
    public abstract void loadTexture() throws IOException;
}
