Graphics Reference
In-Depth Information
Table 7.2 Indicating possible time stamp values for objects in the three blocks at various points. At the
point at which objects are about to be updated there is never an object with a time stamp
equal to the current global time stamp. Thus, even though only a few objects are cleared
each frame there is never a time stamp conflict.
Frame
Counter
Block 0
Block 1
Block 2
Comment
0
0
0
0
0
All object time stamps are cleared to 0 on
startup
1
1
0/1
0/1
0/1
Incrementing global counter, updating
objects
1
0/1
0/1
Clearing (time stamps of objects in) block
0to1
2
2
1/2
0/1/2
0/1/2
Incrementing global counter, updating
objects
1/2
2
0/1/2
Clearing block 1 to 2
3
3
1/2/3
2/3
0/1/2/3
Incrementing global counter, updating
objects
1/2/3
2/3
3
Clearing block 2 to 3
4
0
0/1/2/3
0/2/3
0/3
Incrementing global counter, updating
objects
0
0/2/3
0/3
Clearing block 0 to 0; now no object with
time stamp of 1
5
1
0/1
0/1/2/3
0/1/3
Incrementing global counter, updating
objects
0/1
1
0/1/3
Clearing block 1 to 1; now no object with
time stamp of 2
6
2
0/1/2
1/2
0/1/2/3
Incrementing global counter, updating
objects
0/1/2
1/2
2
Clearing block 2 to 2; now no object with
time stamp of 3
Once at initialization, all object time stamp counters are cleared to zero.
blockToClear = 0;
tickCounter = 0;
for (i = 0; i < MAX_OBJECTS; i++)
object[i].timeStamp = tickCounter;
 
Search WWH ::




Custom Search