View Full Version : OpenGL Global Variables
03-01-2012, 06:13 AM
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 ?
03-01-2012, 06:40 AM
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.
03-01-2012, 06:51 AM
So if i don't wanna use global variables, what do you suggest ?
03-01-2012, 07:43 AM
I am partial to GLFW : http://www.glfw.org/index.html
03-01-2012, 11:27 AM
+1 for glfw
03-01-2012, 12:34 PM
Though sadly, GLFW does not (yet) have a way to create an sRGB framebuffer.
03-01-2012, 10:18 PM
Okay! I will read about it thanks!
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.