Platform/PlatformApplication: adding create() method.
This commit is contained in:
parent
0540f5d201
commit
b91b9f3768
3 changed files with 24 additions and 0 deletions
|
|
@ -52,6 +52,7 @@ local system_module = Module("source/System", {
|
|||
})
|
||||
|
||||
local platform_common_module = Module("source/Platform", {
|
||||
"PlatformApplication.cpp",
|
||||
"PlatformDisplay.cpp"
|
||||
})
|
||||
|
||||
|
|
|
|||
21
source/Platform/PlatformApplication.cpp
Normal file
21
source/Platform/PlatformApplication.cpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
#include "PlatformApplication.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Platform/Win32/Win32Application.h>
|
||||
typedef sp::Win32Application ApplicationType;
|
||||
#elif defined(__linux__) || defined(unix) || defined(__unix) || defined(__unix__)
|
||||
#include <Platform/Unix/UnixApplication.h>
|
||||
typedef sp::UnixApplication ApplicationType;
|
||||
#else
|
||||
#error "No Application implementation exists"
|
||||
#endif
|
||||
|
||||
namespace sp {
|
||||
|
||||
PlatformApplication* PlatformApplication::create()
|
||||
{
|
||||
return new ApplicationType;
|
||||
}
|
||||
|
||||
} // namespace sp
|
||||
|
|
@ -11,6 +11,8 @@ class MessageQueue;
|
|||
class PlatformApplication
|
||||
{
|
||||
public :
|
||||
static PlatformApplication* create();
|
||||
|
||||
virtual void init() = 0;
|
||||
|
||||
virtual void shutdown() = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue