Ported the DrawLine to cpp