mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 23:00:42 +00:00
24 lines
689 B
C++
24 lines
689 B
C++
#include "GpDisplayDriverFactory.h"
|
|
#include "GpDisplayDriverProperties.h"
|
|
|
|
#include <assert.h>
|
|
|
|
IGpDisplayDriver *GpDisplayDriverFactory::CreateDisplayDriver(const GpDisplayDriverProperties &properties)
|
|
{
|
|
assert(properties.m_type < EGpDisplayDriverType_Count);
|
|
|
|
if (ms_registry[properties.m_type])
|
|
return ms_registry[properties.m_type](properties);
|
|
else
|
|
return nullptr;
|
|
}
|
|
|
|
void GpDisplayDriverFactory::RegisterDisplayDriverFactory(EGpDisplayDriverType type, FactoryFunc_t func)
|
|
{
|
|
assert(type < EGpDisplayDriverType_Count);
|
|
|
|
ms_registry[type] = func;
|
|
}
|
|
|
|
GpDisplayDriverFactory::FactoryFunc_t GpDisplayDriverFactory::ms_registry[EGpDisplayDriverType_Count];
|