Files
Aerofoil/GpShell/GpDisplayDriverFactory.cpp

24 lines
689 B
C++
Raw Permalink Normal View History

2019-11-11 00:11:59 -05:00
#include "GpDisplayDriverFactory.h"
#include "GpDisplayDriverProperties.h"
#include <assert.h>
IGpDisplayDriver *GpDisplayDriverFactory::CreateDisplayDriver(const GpDisplayDriverProperties &properties)
{
assert(properties.m_type < EGpDisplayDriverType_Count);
2019-11-11 00:11:59 -05:00
2019-12-29 17:39:19 -05:00
if (ms_registry[properties.m_type])
return ms_registry[properties.m_type](properties);
2019-11-11 00:11:59 -05:00
else
return nullptr;
}
void GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType type, FactoryFunc_t func)
{
assert(type < EGpDisplayDriverType_Count);
2019-12-29 17:39:19 -05:00
ms_registry[type] = func;
2019-11-11 00:11:59 -05:00
}
2019-12-29 17:39:19 -05:00
GpDisplayDriverFactory::FactoryFunc_t GpDisplayDriverFactory::ms_registry[EGpDisplayDriverType_Count];