Initialize engine and context.