Did you use SDL_CreateWindowFrom();?