Pre-Loading Graphics

I was going to wait until I setup a title screen and created a level load task, but I might as well get some insight on it now since I keep thinking about it….

Which is….

Is there a way to pre-load graphics? I remember when I used a(n) engine back in the days which had loading hiccups and the only way to stop them was to pre-load the graphics at level start up (which were causing the hiccups).

I want to attempt this with P3D since some object/structures will need more time to load and I would like to avoid hiccups once a level has started to run.

P3D is different from anything I’ve ever used, so I’m guessing the logic is something much more simple. Engines of the past allowed for resources that make up an object to be loaded, but were not put to use until the object itself was needed.

I’m guessing… With P3D, the best thing to do is just pre-load the objects which cause the hiccups at level startup, because they don’t have to be inserted into the scene graph right away. (which is one of the neat thing’s about the scene graphic concept)

That’s were my problem come in…

The user will create objects, which load in whenever they get created; so I can’t pre-load an object because I don’t know which ones the user will create… Follow me?

If I seem confusing, sorry…I’m drinking wine. :laughing: !! My mind goes down the toilet whenever I drink alcohol; that’s why I’m stopping all programming for today since I’ve tasted sweet wine.

Anyway……

What I want to do is load all the resources for the object which causes longer loading times and have those resources hold in memory until they are needed (which will be when the object is created…if it’s created at all).

(Sigh…) I would imagine if that was possible python’s cleaning would just dump the resources because they aren’t being used anyway….

Hum……

Oh I give up… (the wine has my brain now)

The functionality of P3D is just so different and I really don’t expect it to work like anything I’ve used in the past (if it did I would be shocked).

Oh man… I’m already feeling fuzzy in the head. :laughing:


I’m adding sound to the GUI system now and setting up an Audio manager for common sounds/music. Things seems much more “livelier” now since I can hear buttons click and some testing music playing.

That’s a pretty long and confusing piece of a post…

You can preload models and textures using the usual loadModel and loadTexture methods. If you keep some references to the loaded nodes, they’ll be cached for sure, if you don’t they’ll be cached, too, but might get garbage collected by chance. For models and their attached textures you can also make the loading asynchronous by providing a callback. Maybe this old code helps you in a way: github.com/nemesis13/Azure–Inf … eloader.py . It only works for models, though.