POV-Ray : Newsgroups : povray.general : Workarounds for persistent variables. : Re: Workarounds for persistent variables. Server Time
1 Aug 2024 22:21:26 EDT (-0400)
  Re: Workarounds for persistent variables.  
From: Mike Williams
Date: 9 Mar 2005 15:49:13
Message: <EB0yfAADF2LCFwrV@econym.demon.co.uk>
Wasn't it gregjohn who wrote:
>What's the smartest SDL coding option to replace what might have been done
>with persistent variables?
>
>1) Recalculating the events of  frames 1 to n-1 for every nth frame;
>
>2) writing to disk each time there's an event that needs to be remembered.

Which one is smartest depends on how long it takes to calculate the
changes from one frame to the next.

If the calculations are quick, recalculate each time. Once you know how
to calculate one frame it's easier to write a simple loop round the
calculation than to add file handling.

If the calculations are slow, write to disk.

>Q: What happens however upon each re-opening of a file-- will the old
>material that's in the file be discarded, or are newly written records
>appended at the end?

The #fopen command has a "write" option which zaps any existing data,
and an "append" option which appends the data to the end.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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