Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::SdlDependencyResolver Class Referencefinal

Resolves dependency between SDL resources and provides a valid initialization order. Optionally provide resource name lookup (if user provides resource name during analyzation). More...

#include <SdlDependencyResolver.h>

Public Member Functions

 SdlDependencyResolver ()
 
void analyze (TSpanView< const ISdlResource * > resources, TSpanView< std::string > resourceNames={})
 Submit resources and start to resolve their dependencies. The containers for input do not need to be kept alive after this call.
 
const ISdlResourcenext ()
 Get a resource from the analyzed scene with a valid dependency ordering.
 
std::string_view getResourceName (const ISdlResource *resource) const
 Get resource name by resource pointer. Only valid for the resources in the last analyze() call. String buffer is backed by the resolver.
 

Detailed Description

Resolves dependency between SDL resources and provides a valid initialization order. Optionally provide resource name lookup (if user provides resource name during analyzation).

Constructor & Destructor Documentation

◆ SdlDependencyResolver()

ph::SdlDependencyResolver::SdlDependencyResolver ( )

Member Function Documentation

◆ analyze()

void ph::SdlDependencyResolver::analyze ( TSpanView< const ISdlResource * > resources,
TSpanView< std::string > resourceNames = {} )

Submit resources and start to resolve their dependencies. The containers for input do not need to be kept alive after this call.

Parameters
resourcesResources to be analyzed.
resourceNamesNames for the resources. Must have exactly the same size as resources if provided.

◆ getResourceName()

std::string_view ph::SdlDependencyResolver::getResourceName ( const ISdlResource * resource) const

Get resource name by resource pointer. Only valid for the resources in the last analyze() call. String buffer is backed by the resolver.

◆ next()

const ISdlResource * ph::SdlDependencyResolver::next ( )

Get a resource from the analyzed scene with a valid dependency ordering.

Returns
A resource. Can be called repeatedly until nullptr is returned (which indicates all analyzed resources are returned).

The documentation for this class was generated from the following files: