This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Must call CreateSurface in OnDisplayInit?


Must call CreateSurface in OnDisplayInit?

Postby martinreddy » May 25, 2009 @ 10:22am

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.
martinreddy
pm Member
 
Posts: 5
Joined: Mar 31, 2009 @ 7:19pm


Postby edge » May 26, 2009 @ 11:15am

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).
EDGELIB: Cross-platform mobile development at your fingertips
http://www.edgelib.com
User avatar
edge
pm Member
 
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands


Return to EDGELIB


Sort


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.

Moderator:

edge

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron