Ive tried to use SDL2 recently. Before I use it in my existing projects I wanted to write a basic app that puts something minimal on the screen using the "old" and "modern" OpenGL. It turned out fine, so I thought Im sharing the source. (plus Ive added some comments to it.) I hope Im not posting this to the wrong place.
It uses GLLoad to get the GL functions but you can replace it with GLEW or any other library.
It works for me on both Linux and Windows.(compiled with GCC, using C++11 standard). ....you have to install/add the necessary libraries to your project of course.
I hope it helps someone to start using OpenGL or SDL.