fixing opengl implementation in main.cpp