package speiger.src.coreengine.platform.graphics.opengl.texture;

import speiger.src.coreengine.platform.graphics.api.texture.Texture;
import speiger.src.coreengine.platform.graphics.api.texture.TextureSettings;
import speiger.src.coreengine.platform.graphics.opengl.utils.GLFunctions;

public class GLTexture extends Texture {
	int id;
	
	public GLTexture(TextureSettings settings, int id, int width, int height) {
		super(settings, width, height);
		this.id = id;
	}
	
	public int id() {
		return id;
	}
	
	@Override
	public boolean isRemoved() {
		return id == 0;
	}
	
	@Override
	public void remove() {
		if(id == 0) return;
		GLFunctions.deleteTextures(id);
		id = 0;
	}
	
}
