Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Memory Use Guidelines
#4
I would think that it would be sufficient to check that sounds, images and fonts load correctly at startup. Once they're there, they're there and can be used until they're freed. As for bogging down, I'm generally less concerned about memory usage than I am with CPU load. As long as your memory isn't steadily ticking up, or doing so at specific points in the program, you should be OK.

Using hardware images should help with CPU usage, if you have a lot of images that move around but don't change frequently. That helped me with my billiards program, where the balls moved about the table, but didn't roll.

Move as much of the math as possible outside of loops, and stick to integers and longs if you don't need the precision.

If you're drawing large and/or complex graphics that move beyond the display, you should use algorithms that skip such drawing when a feature is out of the display bounds. That was a big issue with my space flight simulator that took me months to figure out.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply


Messages In This Thread
Memory Use Guidelines - by NakedApe - 08-15-2023, 09:22 PM
RE: Memory Use Guidelines - by mnrvovrfc - 08-15-2023, 10:18 PM
RE: Memory Use Guidelines - by NakedApe - 08-15-2023, 10:58 PM
RE: Memory Use Guidelines - by OldMoses - 08-16-2023, 02:24 AM
RE: Memory Use Guidelines - by SMcNeill - 08-16-2023, 05:40 AM
RE: Memory Use Guidelines - by NakedApe - 08-16-2023, 06:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  computer vision? capture still from webcam to memory & identifying colors & pixels? madscijr 0 428 02-25-2025, 06:16 PM
Last Post: madscijr
  A Question on memory set aside for Zero Dimster 11 1,821 12-01-2024, 04:01 PM
Last Post: SMcNeill
Question Memory full when loading multiple images Ikerkaz 7 1,577 11-03-2024, 05:51 PM
Last Post: bplus
  Loading font from memory help needed... Dav 6 1,413 09-16-2023, 04:03 PM
Last Post: SMcNeill
  Memory Leak NasaCow 12 2,623 05-11-2023, 03:43 PM
Last Post: TerryRitchie

Forum Jump:


Users browsing this thread: 1 Guest(s)