Quantcast
Channel: openFrameworks - Latest posts
Viewing all articles
Browse latest Browse all 40524

Question about memory consumption in oF

$
0
0

I am starting a new project that requires around 200 animated sprites to be playing at the same time so I knocked together a couple of small demos, one in oF and one in WPF/C#. All I have done is make a basic sprite class that loads a directory of images into memory. I then make 200 of these objects and play them back in a loop.

In the sprite class in oF I am setting setUseTexture to false and assigning the pixels to another ofImage that is drawn to screen.

Surprisingly the WPF application works better than the oF application and I am wondering why.

WPF - starts instantly, 20% CPU, 1GB memory.
oF - memory hits close to 2GB and crashes while loading the images.

I know a sprite sheet would be better in oF but am wondering why it is struggling to keep up with WPF (which in my experience is normally a lot slower/more memory intensive) in this instance.

Can anyone shed any light on this?


Viewing all articles
Browse latest Browse all 40524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>