GlGetUniformfv for uniform variables declared as arrays

For glGetUniformfv , the documentation states that "To request values ​​stored in uniform variables declared as arrays, call glGetUniform for each element of the array"

Any example / hint on how to do this?

+3
source share
1 answer

All you need to know to do this job is that the single locations of the array are assigned sequentially starting at arrayname[0].

1 . , arrayname[21], arrayname[0], 21.

:

GLint arrayname_0  = glGetUniformLocation (program, "arrayname[0]");
GLint arrayname_21 = glGetUniformLocation (program, "arrayname[21]");

assert (arrayname_0 + 21 == arrayname_21);

21 starrayname, . , , , .

+3

All Articles