SDL_GL_SwapBuffers()
is working only with SDL1, with SDL2 it got substitued by
SDL_GL_SwapWindow(sdl_window);
see https://wiki.libsdl.org/MigrationGuide for details (search for SDL_GL_SwapWindow in the page)