POV-Ray : Newsgroups : povray.general : Dynamic arrays in SDL : Dynamic arrays in SDL Server Time
28 Apr 2024 15:38:03 EDT (-0400)
  Dynamic arrays in SDL  
From: Bill Pragnell
Date: 26 Jul 2016 16:30:00
Message: <web.5797c78d621f856f420301460@news.povray.org>
Hi all

I've been tinkering, and noticed that dynamic arrays are possible in SDL. I
wasn't previously aware of this, although naturally, others may have been.
Consider the following:

#macro ExpandArray(Array, N)
 #local Size = dimension_size(Array, 1);
 #local NewSize = Size + N;
 #local NewArray = array[NewSize];
 #for (I, 0, Size-1)
  #ifdef (Array[I])
   #local NewArray[I] = Array[I];
  #end
 #end
 #declare Array = NewArray;
#end

Now this is all fine and good, and terribly useful. But I was wondering: is this
a perfectly cromulent thing to do, or am I abusing the SDL in some way?

Bill


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.