If you want to use glBegin() / glEnd() - like immediate API with modern OpenGL, I reecommend using a library called RLGL (https://github.com/raysan5/raylib/blob/master/src/rlgl.h), from Raylib. You'll feel straight at home!