package speiger.src.coreengine.rendering.texturesOld.base;

public abstract class AbstractTexture implements ITexture {
	protected int textureID;

	@Override
	public ITexture makeReloadable() {
		TextureManager.INSTANCE.addTexture(this);
		return this;
	}

	public void setTextureID(int textureID) {
		this.textureID = textureID;
	}

	@Override
	public int getTextureId() {
		return textureID;
	}

	@Override
	public void bindTexture() {
		TextureManager.bindTexture(textureID);
	}
	
	@Override
	public void destroy() {
		deleteTexture();
	}

	@Override
	public void deleteTexture() {
		if (textureID == -1) return;
		TextureManager.INSTANCE.removeTexture(this);
		textureID = -1;
	}

	@Override
	public float getUMin() { return 0F; }
	@Override
	public float getVMin() { return 0F; }
	@Override
	public float getUMax() { return 1F; }
	@Override
	public float getVMax() { return 1F; }
}
