void  FPhysCommandHandler::DeferredDeleteCPUDispathcer(physx::PxCpuDispatcher * CPUDispatcher)
{
	check(CPUDispatcher);

	FPhysPendingCommand Command;
	Command.Pointer.CPUDispatcher = CPUDispatcher;
	Command.CommandType = PhysCommand::DeleteCPUDispatcher;

	EnqueueCommand(Command);
}
void  FPhysCommandHandler::DeferredDeleteSimEventCallback(physx::PxSimulationEventCallback * SimEventCallback)
{
	check(SimEventCallback);

	FPhysPendingCommand Command;
	Command.Pointer.SimEventCallback = SimEventCallback;
	Command.CommandType = PhysCommand::DeleteSimEventCallback;

	EnqueueCommand(Command);
}
void FPhysCommandHandler::DeferredRelease(physx::apex::NxApexInterface* ApexInterface)
{
	check(ApexInterface);

	FPhysPendingCommand Command;
	Command.Pointer.ApexInterface = ApexInterface;
	Command.CommandType = PhysCommand::Release;

	EnqueueCommand(Command);

}
void FPhysCommandHandler::DeferredRelease(physx::PxScene* PScene)
{
	check(PScene);

	FPhysPendingCommand Command;
	Command.Pointer.PScene = PScene;
	Command.CommandType = PhysCommand::ReleasePScene;

	EnqueueCommand(Command);

}
int main(void)
{
	char command[10];
	QUEUE *pQueue = malloc(sizeof(QUEUE));

	pQueue->front = NULL;
	pQueue->rear  = NULL;
	pQueue->count = 0;

	while(true)
	{
		printf(">>");
		scanf("%s",command);

		if(!CheckCommand(command))
		{
			puts("[Invalid]");
			continue;
		}
		
		if(!strcmp(command,"q")||!strcmp(command,"quit")) break;

		else if(!strcmp(command,"h")||!strcmp(command,"history"))
		{
			printf("queue count = %d\n",pQueue->count);

			EnqueueCommand(pQueue,command);
		}
		else
		{
			printf("[Valid] %s\n",command);

			EnqueueCommand(pQueue,command);
		}
	}

	return 0;
}