1
0
Fork 0
spectre/source/Platform/PlatformApplication.cpp
Henrik Hautakoski c7d380c4b0 source/Platform/PlatformApplication: rename create() to get() and just return a statically allocated implementation.
As we just this throughout the whole program. and platform can be determined at compile time. we might as well allocate it statically.
2022-09-12 21:12:32 +02:00

22 lines
462 B
C++

#include "PlatformApplication.h"
#ifdef SPECTRE_PLATFORM_WIN
#include <Platform/Win32/Win32Application.h>
typedef sp::Win32Application ApplicationImpl;
#elif SPECTRE_PLATFORM_UNIX
#include <Platform/Unix/UnixApplication.h>
typedef sp::UnixApplication ApplicationImpl;
#else
#error "No Application implementation exists"
#endif
namespace sp {
PlatformApplication* PlatformApplication::get()
{
static ApplicationImpl inst;
return &inst;
}
} // namespace sp