2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-11 02:27:43 +00:00

boo lambda-API refactor

This commit is contained in:
Jack Andersen
2016-03-30 09:15:32 -10:00
parent 83b89ceee6
commit b756005aad
28 changed files with 362 additions and 251 deletions

View File

@@ -10,36 +10,42 @@ void ViewResources::init(boo::IGraphicsDataFactory* factory, FontCache* fcache,
if (!factory || !fcache || !theme)
Log.report(logvisor::Fatal, "all arguments of ViewResources::init() must be non-null");
m_pixelFactor = pf;
m_theme = theme;
m_factory = factory;
m_theme = theme;
m_fcache = fcache;
unsigned dpi = 72.f * m_pixelFactor;
m_curveFont = fcache->prepCurvesFont(m_factory, AllCharFilter, false, 8.f, dpi);
switch (factory->platform())
m_curveFont = fcache->prepCurvesFont(factory, AllCharFilter, false, 8.f, dpi);
m_resData = factory->commitTransaction(
[&](boo::IGraphicsDataFactory::Context& ctx) -> bool
{
case boo::IGraphicsDataFactory::Platform::OGL:
init<boo::GLDataFactory>(static_cast<boo::GLDataFactory*>(factory), *theme, fcache);
break;
switch (ctx.platform())
{
case boo::IGraphicsDataFactory::Platform::OGL:
init<boo::GLDataFactory::Context>(static_cast<boo::GLDataFactory::Context&>(ctx), *theme, fcache);
break;
#if _WIN32
case boo::IGraphicsDataFactory::Platform::D3D11:
case boo::IGraphicsDataFactory::Platform::D3D12:
init<boo::ID3DDataFactory>(static_cast<boo::ID3DDataFactory*>(factory), *theme, fcache);
break;
case boo::IGraphicsDataFactory::Platform::D3D11:
case boo::IGraphicsDataFactory::Platform::D3D12:
init<boo::ID3DDataFactory::Context>(static_cast<boo::ID3DDataFactory::Context&>(ctx), *theme, fcache);
break;
#endif
#if BOO_HAS_METAL
case boo::IGraphicsDataFactory::Platform::Metal:
init<boo::MetalDataFactory>(static_cast<boo::MetalDataFactory*>(factory), *theme, fcache);
break;
case boo::IGraphicsDataFactory::Platform::Metal:
init<boo::MetalDataFactory::Context>(static_cast<boo::MetalDataFactory::Context&>(ctx), *theme, fcache);
break;
#endif
#if BOO_HAS_VULKAN
case boo::IGraphicsDataFactory::Platform::Vulkan:
init<boo::VulkanDataFactory>(static_cast<boo::VulkanDataFactory*>(factory), *theme, fcache);
break;
case boo::IGraphicsDataFactory::Platform::Vulkan:
init<boo::VulkanDataFactory::Context>(static_cast<boo::VulkanDataFactory::Context&>(ctx), *theme, fcache);
break;
#endif
default:
Log.report(logvisor::Fatal, _S("unable to init view system for %s"), factory->platformName());
}
m_resData = factory->commit();
default:
Log.report(logvisor::Fatal, _S("unable to init view system for %s"), ctx.platformName());
}
return true;
});
}
void ViewResources::prepFontCacheSync()