PDA

View Full Version : Do OpenGL commands copy my data right away?



Dat Chu
11-06-2010, 02:59 PM
I have a variable that is on stack
float myVars[4] = {0.f,0.f,1.f,0.f};
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_POSITION, myVars)

Will OpenGL copy the data right at this point? Since after this line my myVars variable will go out of scope and get destroyed.

Alfonse Reinheart
11-06-2010, 03:03 PM
Yes.