Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Maximum Number of Items in an Array

$
0
0
If you can not fix this, it may be a solution to just load the next 10 frames arount your current frame in memory.

-------------------------------------------------------------------------------------------------------------
0      5      10      15      20
                  ^
                  |
         currently here
      |                        |
      | load all frames  |
      | within this range|

If the position changes, you can update the bounds of your array (maybe in a different thread) and set the images you don't need at the moment to NULL.
So you have an array of size 1100, filled with null values. When you load your program you can initialise the array to contain real references for the first 10 frames. On frame 2 load the 11. image and so on...

Viewing all articles
Browse latest Browse all 1768

Trending Articles