Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How do you check for free graphics memory?

Author
Message
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 25th Feb 2012 18:52
We know that mobile devices have limited graphics memory & ram.

Ipod Touch has 256mb and many cheap Android devices have 128Mb.

Are you taking any precautions when loading a good number of graphic files in your app?

What will happen if the user has 2-3 apps in the background taking up most of the available memory, and your app is launched?

Does AppGameKit exit or display the red cross if gfx cannot be loaded in memory?

Will there be any specific commands in the future to check the available free memory so that we can at least pop up an error message?
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 25th Feb 2012 19:27 Edited at: 25th Feb 2012 19:37
There aren't actually any commands in AppGameKit which would let you check for free memory.

Though, I can answer one of your questions,

Quote: "Does AppGameKit exit or display the red cross if gfx cannot be loaded in memory?"


Nope, application crashes with error that there's no free memory left (memory heap).

@EDIT
Just a small counting:

One 32x32 RGBA (.png) image is 4096 bytes.
One MB is 1048576 bytes.

Then, if we have 60MB free, we could store 15360 32x32 RGBA images.

@EDIT2

I think I'm doing something wrong with the counting

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 27th Feb 2012 18:25 Edited at: 27th Feb 2012 18:26
The math checks out. However, whilst the RAM may be hundreds on MB the graphics memory is usually smaller, old iOS devices (e.g. 2nd gen iPod Touch) recommend not using more than 24MB of graphics memory. Newer devices may get away with more.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 27th Feb 2012 20:22
So no one seems to be doing any kind of checks in code.
Just keep the gfx size low and fingers crossed!

Will there be mem commands in the future?
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 27th Feb 2012 20:56
Quote: "Will there be mem commands in the future?"


I think that if yes, then they'd be applied after all the important upates. I'd wait till those are done, and then suggest it later on

Login to post a reply

Server time is: 2024-05-19 12:02:27
Your offset time is: 2024-05-19 12:02:27