SDL2 Multiple screens

Author: George Hayes
Published:
There are two methods the first is creating a single window that covers both screens the second is creating multiple windows.

The following based on having two 1920 x 1080 monitors.
first method
window = SDL_CreateWindow("Lots of Terrain", 0, 0, 3840, 1080, SDL_WINDOW_FULLSCREEN );

Second method
window0 = SDL_CreateWindow("Lots of Terrain", 0, 0, 1920, 1080, SDL_WINDOW_FULLSCREEN );
window1 = SDL_CreateWindow("Lots of Terrain", 1920, 0, 1920, 1080, SDL_WINDOW_FULLSCREEN );

In the first method you simply write the data to the screen position you want.
In the second method you have to use the correct window to address the screen.