handling windows for opengl drawing