Re: TurboSphere
Reply #480 –
I fixed changing the Image of a Shape.
Trying to use this uncovered a HUGE problem with modifying Images and how they are managed. It's all fixed now, and I'm glad I caught the issue so soon.
Now, Images are properly maintained until their Image object and all Shapes that use the Image are destroyed, and changing the Image of a Shape using
some_shape.image = new Image("image.png");
correctly removes the reference for the old image.
Previously code like that would ALWAYS destroy the underlying GL texture of the old image, which would either cause that image to be garbage or blank, or (most perplexingly) the next call to `new Image' would create a new GL texture of the same name. This made the old Images that were replaced hold the new texture, because the old image used the old GL texture name, which was now the new image's texture, and had been overwritten by the new Image!
That took the last two days to figure out. It was fun, but also quite a nice challenge..