Page 1 of 1

Must call CreateSurface in OnDisplayInit?

PostPosted: May 25, 2009 @ 10:22am
by martinreddy
Hey there,

I am trying to defer loading of my textures until I need them, because if I take too long to load textures on startup on the iPhone then the OS will kill the app after 20 secs.

However, if I do the CreateSurface call during OnNextFrame at the point when I actually need the texture, then when I render it with BltFast all I get is a white quad. This only breaks on the iPhone device itself though - it works fine in the simulator.

Does CreateSurface have to be called inside of OnDisplayInit? Or is there some other recommended way to defer loading of E2DSurfaces?

This is with Edgelib 3.96, iPhone OS 2.2.1, and I am calling UploadTexture and BindTexture on the texture (as I mention, it works fine in the simulator).

Cheers,

Martin.

PostPosted: May 26, 2009 @ 11:15am
by edge
Hi Martin,

We've noticed this issue on the iPhone as well. The best way to handle this at the moment is to create a loading screen in your application.

For example, use the first 20 frames to load several textures (each frame you will be loading a different texture). Show a loading bar how many textures are loaded (to keep the user informed of the loading progress).