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

import speiger.src.coreengine.platform.graphics.api.core.GraphicsFence;
import speiger.src.coreengine.platform.graphics.opengl.core.GLCommandQueue.Frame;

public class GLFence implements GraphicsFence {
	boolean removed = false;
	Frame frame;
	
	public GLFence(Frame frame) {
		this.frame = frame;
	}

	@Override
	public boolean isRemoved() {
		return removed;
	}
	
	@Override
	public void remove() {
		removed = true;
	}
	
	@Override
	public boolean awaitCompletion(long timeout) {
		return removed || frame.isCompleted(timeout);
	}
	
}
