Move InitGL call right after context creation
Add Texture class
Lel segment code into different functions