Fix AMD exposure: pass the window to the factory

I've plugged this into my code and confirmed that it works. Let me know if you'd like me to add a test somewhere.