Really? How low is this level actually? Because I remember my OpenGL class' professor did this in less than 50 lines.
Imagine writing GlCreateContext yourself, for starters, as has been done in the link I posted.
Imagine writing GlCreateContext yourself, for starters, as has been done in the link I posted.