Access builtin resources through a global instance
authorMikko Rasa <tdb@tdb.fi>
Tue, 4 May 2021 20:13:33 +0000 (23:13 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 4 May 2021 20:30:07 +0000 (23:30 +0300)
commitfe2fc291a4fc618425c64112c9ffd3519f0b8a3e
treead6f580e8f2ea72d85ae46f118a01352aae8a4b1
parent08d0a9f283b71e874b769b2661389b0aca598f4f
Access builtin resources through a global instance

Explicitly passing the Resources reference causes problems when some
classes in a hierarchy need it and others don't.  It's also awkward in
RenderPass::set_material and PostProcessor templates.  It doesn't even
matter which instance is passed in since the data is builtin anyway.

The first created Resources instance is now registered as the one to use
for builtin data, unless suppressed by a constructor parameter.
25 files changed:
demos/desertpillars/source/desertpillars.cpp
source/builders/sequencebuilder.cpp
source/builders/sequencetemplate.cpp
source/builders/sequencetemplate.h
source/effects/ambientocclusion.cpp
source/effects/ambientocclusion.h
source/effects/bloom.cpp
source/effects/bloom.h
source/effects/colorcurve.cpp
source/effects/colorcurve.h
source/effects/environmentmap.cpp
source/effects/environmentmap.h
source/effects/postprocessor.h
source/effects/shadowmap.cpp
source/effects/shadowmap.h
source/effects/sky.cpp
source/effects/sky.h
source/materials/material.cpp
source/materials/material.h
source/materials/renderpass.cpp
source/materials/renderpass.h
source/render/occludedscene.cpp
source/render/occludedscene.h
source/resources/resources.cpp
source/resources/resources.h