1
0
Fork 0

source/Game.cpp: use PlatformApplication::create()

This commit is contained in:
Henrik Hautakoski 2020-12-26 17:20:30 +01:00
parent b91b9f3768
commit 2eec1c9f75

View file

@ -4,27 +4,18 @@
#include <Spectre/Game/FPSCounter.h>
#include <Spectre/Input/InputModule.h>
#include <Spectre/System/MessageHandler.h>
#include <Spectre/System/MessageQueue.h>
#include <Spectre/Game.h>
#include <Platform/PlatformApplication.h>
#include <Platform/PlatformMisc.h>
// TODO: move this to Application::create()
#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 {
Game::Game() :
m_running(false)
{
m_platform = new ApplicationType();
m_platform = PlatformApplication::create();
m_graphics = new Graphics(m_platform);
m_input = new InputModule(&m_platform->getInput());
m_messageHandler = new MessageHandler();