mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 23:00:42 +00:00
Lots of stuff
This commit is contained in:
23
GpD3D/GpDisplayDriverFactory.cpp
Normal file
23
GpD3D/GpDisplayDriverFactory.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#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];
|
Reference in New Issue
Block a user