Make window global a pointer.