Viewport: DestroyPlatformWindows() checks for the bool CreatedPlatformWindow flag correctly. Note that we set CreatedPlatformWindow=true for the main viewport to allow the back-end to store data in the public Viewport structure (for consistency). (#1542)
viewport->CreatedPlatformWindow=true;// Set this flag so DestroyPlatformWindows() gives a chance for backend to receive DestroyWindow calls for the main viewport.
g.Viewports.push_back(viewport);
g.PlatformIO.MainViewport=g.Viewports[0];// Make it accessible in public-facing GetPlatformIO() immediately (before the first call to EndFrame)