use SDL_WINDOWPOS_CENTERED_DISPLAY and SDL_WINDOWPOS_UNDEFINED_DISPLAY i...

...nstead of coordinates

I was told by an SDL dev that this is the correct way.