Struct default constructor - need some kind of solution for C++ interop

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Fri Sep 9 22:56:55 PDT 2016


Am Fri, 09 Sep 2016 14:46:31 +0000
schrieb Ethan Watson <gooberman at gmail.com>:

> […]
> 
> First and foremost, resources are processed offline to match the 
> ideal binary format for the target platform. The industry has 
> been using DXT textures for over a decade now, and they've been 
> supported on consoles. The overwhelming majority of textures are 
> thus baked in to such a format. Whichever format is chosen, on 
> disk the file will essentially represent the resource's final 
> layout in memory.

I understand that.

> Second, file loading. You can't just go loading files any old 
> time you want in a streaming-based, or even just straight up 
> multithreaded, engine if you expect to keep within performance 
> targets and not lock up every thread you've created. They need 
> scheduling. Thus, resource creation needs to go through several 
> steps:
> 
> * Something requests a resource, goes to sleep
> * File loader schedules appropriately, notifies on load complete
> * Object gets resource load notification, does work to hook it up 
>   to whatever API needs it

...and the objects are probably created ahead of time in a
pool, to avoid allocations? In such a scheme it is only
natural to not have I/O in ctors. But what about the parts of
the code that handle the game initialization before streaming
starts? Is there no

  config = new GameConfig("settings.ini");

or

  db = new AssetDatabase("menu.pkg");

that perform I/O during construction and potentially display
an exception error messages ?

-- 
Marco



More information about the Digitalmars-d mailing list