Mintoris
Oct 20, 2017, 12:47 PM *
Welcome, Guest.

login

register

Did you miss your activation email?


Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Detect atlas loading completion  (Read 480 times)
FabianClub
Full Member
***
Posts: 46


« on: Jun 10, 2017, 08:29 AM »

Hello everybody!

Let's see if anyone knows how I can fix this:

I charge the atlas (GenLoadAtlas), which is 4096x4096 and I use a background with GenSplashScreen. While the atlas is being loaded, the program continues to execute the program code.
On more powerful phones or tablets, this is done quite fast.
But in less powerful devices, loading the atlas takes more time. Then the program continues to advance and continues the game, but the atlas is not yet loaded.
Is there any Mintoris statement, or some other way of detecting that you have finished uploading the atlas to graphic memory?
If it is not, I think that it could be implemented in future versions, some thing that does this check, like those that already exist (IsAudioPlaying, IsGenPaused, etc.)

Thank you all!
Logged
Chuck
Global Moderator
Hero Member
*****
Posts: 1837



« Reply #1 on: Jun 12, 2017, 01:21 PM »

Hmm, yes. I'll have to put something in to check for that condition. Maybe you could put a wait 250 or so in for now to make sure everything is loaded. Also 4096x4096 is really big for the atlas. It won't work on most older phones.
Logged
FabianClub
Full Member
***
Posts: 46


« Reply #2 on: Jun 12, 2017, 07:38 PM »

I found a method that I will now share with you all. It works for me at various points in my program.

With the following procedure you can detect that the atlas is loaded.

First the splash screen should be removed (if it is in use).


Program...

GenSplashScreen Off   'only if it was in use
j = GenGetPlayedTime()
loadatlas1:
k = GenGetPlayedTime()
If (k-j)<3 then loadatlas1

...Program

More useful on phones or tablets older, or less powerful.
« Last Edit: Jun 13, 2017, 06:56 PM by FabianClub » Logged
Chuck
Global Moderator
Hero Member
*****
Posts: 1837



« Reply #3 on: Jun 13, 2017, 07:26 PM »

Yes that should work for now.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.026 seconds with 17 queries.