As we just this throughout the whole program. and platform can be determined at compile time. we might as well allocate it statically.
22 lines
462 B
C++
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
|