package speiger.src.coreengine.rendering.tesselation.commands;

import java.nio.ByteBuffer;

public class DrawElementsIndirectCommand implements IndirectCommand {
	int count;
	int primCount;
	int firstIndex; 
	int baseVertex; 
	int baseInstance;
	
	public DrawElementsIndirectCommand() {
	}
	
	public DrawElementsIndirectCommand(int count, int primCount, int firstIndex, int baseVertex, int baseInstance) {
		set(count, primCount, firstIndex, baseVertex, baseInstance);
	}
	
	@Override
	public DrawElementsIndirectCommand write(ByteBuffer buffer) { 
		buffer.putInt(count).putInt(primCount).putInt(firstIndex).putInt(baseVertex).putInt(baseInstance); 
		return this;
	}
	
	@Override
	public DrawElementsIndirectCommand read(ByteBuffer buffer) {
		count = buffer.getInt();
		primCount = buffer.getInt();
		firstIndex = buffer.getInt();
		baseVertex = buffer.getInt();
		baseInstance = buffer.getInt();
		return this;
	}
	
	public int getCount() { return count; }
	public int getPrimCount() { return primCount; }
	public int getFirstIndex() { return firstIndex; }
	public int getBaseVertex() { return baseVertex; }
	public int getBaseInstance() { return baseInstance; }
	
	public DrawElementsIndirectCommand set(int count, int primCount, int firstIndex, int baseVertex, int baseInstance) {
		this.count = count;
		this.primCount = primCount;
		this.firstIndex = firstIndex;
		this.baseVertex = baseVertex;
		this.baseInstance = baseInstance;
		return this;
	}
	
	public DrawElementsIndirectCommand setCount(int count) {
		this.count = count;
		return this;
	}
	
	public DrawElementsIndirectCommand setPrimCount(int primCount) {
		this.primCount = primCount; 
		return this;
	}
	
	public DrawElementsIndirectCommand setFirstIndex(int firstIndex) {
		this.firstIndex = firstIndex;
		return this;
	}
	
	public DrawElementsIndirectCommand setBaseVertex(int baseVertex) {
		this.baseVertex = baseVertex;
		return this;
	}
	
	public DrawElementsIndirectCommand setBaseInstance(int baseInstance) {
		this.baseInstance = baseInstance;
		return this;
	}
	
	
}