OpenGL Global Variables

Hello. I’ve just started C++ not long ago and only know some basics on OpenGL. I was taught to use global variables to animate( rotate, translate, … ) the scene in glutDisplayFunc(MyDisplay) by changing the variables in other part of the program. So, I know global variables have it’s disadvantages so i was wondering how to go around doing it without global variables ?

The way glut works, you need global variables, because you can’t pass variables to MyDisplay.
It can even be a single global var, holding a struct with all the details needed to draw the display.

So if i don’t wanna use global variables, what do you suggest ?

I am partial to GLFW : http://www.glfw.org/index.html

+1 for glfw

Though sadly, GLFW does not (yet) have a way to create an sRGB framebuffer.

Okay! I will read about it thanks!