- GLuint i;
-
- st->atoms = malloc(sizeof(atoms));
- st->nr_atoms = sizeof(atoms)/sizeof(*atoms);
- memcpy(st->atoms, atoms, sizeof(atoms));
-
- /* Patch in a pointer to the dynamic state atom:
- */
- for (i = 0; i < st->nr_atoms; i++)
- if (st->atoms[i] == &st_update_constants)
- st->atoms[i] = &st->constants.tracked_state;
-
- memcpy(&st->constants.tracked_state,
- &st_update_constants,
- sizeof(st_update_constants));