Migrating to Linux
This commit is contained in:
13
Engine/Source/Runtime/Core/StartingPoint/CMakeLists.txt
Normal file
13
Engine/Source/Runtime/Core/StartingPoint/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.15...3.30)
|
||||
|
||||
project(StartingPoint)
|
||||
|
||||
set(StartingPoint
|
||||
StartingPoint/EntryPoint.h
|
||||
StartingPoint/StartingPoint.h
|
||||
StartingPoint/private/StartingPoint.cpp
|
||||
)
|
||||
|
||||
set(StartingPointPCH
|
||||
StartingPoint/StartingPointPCH.h
|
||||
)
|
26
Engine/Source/Runtime/Core/StartingPoint/EntryPoint.h
Normal file
26
Engine/Source/Runtime/Core/StartingPoint/EntryPoint.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
// Entry point for Phanes game
|
||||
|
||||
#if defined(P_LINUX_BUILD)
|
||||
|
||||
extern Phanes::Core::Application::PhanesProject* Phanes::Core::Application::CreatePhanesGame();
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Phanes::Core::Logging::Init();
|
||||
PENGINE_LOG_INFO("Logger initialized!");
|
||||
PENGINE_LOG_INFO("Welcome to PhanesEngine!");
|
||||
|
||||
|
||||
auto phanes_game = Phanes::Core::Application::CreatePhanesGame();
|
||||
|
||||
PENGINE_LOG_INFO("Loading project {0}...", phanes_game->GetName());
|
||||
|
||||
phanes_game->Run();
|
||||
|
||||
delete phanes_game;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
41
Engine/Source/Runtime/Core/StartingPoint/StartingPoint.h
Normal file
41
Engine/Source/Runtime/Core/StartingPoint/StartingPoint.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include "StartingPointPCH.h"
|
||||
#include "Core/Core.h"
|
||||
|
||||
// Entrypoint class for any Phanes game.
|
||||
|
||||
namespace Phanes::Core::Application
|
||||
{
|
||||
class PhanesProject
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
std::string projectName;
|
||||
|
||||
public:
|
||||
|
||||
PhanesProject(std::string _ProjectName);
|
||||
virtual ~PhanesProject();
|
||||
|
||||
/**
|
||||
* PhanesEngine main loop.
|
||||
*/
|
||||
void Run();
|
||||
|
||||
/**
|
||||
* Getter for project name;
|
||||
*/
|
||||
|
||||
std::string GetName();
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Function to be overwriten by client.
|
||||
*/
|
||||
|
||||
PhanesProject* CreatePhanesGame();
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
#include <chrono>
|
@@ -0,0 +1,45 @@
|
||||
#include "Core/StartingPoint/StartingPoint.h"
|
||||
|
||||
static void IdleMsg()
|
||||
{
|
||||
std::cout << "\n\nWelcome to PhanesEngine!" << std::endl << std::endl;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
|
||||
std::cout << "It's silent..." << std::endl << std::endl;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
|
||||
std::cout << "To silent." << std::endl;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
|
||||
std::cout << "\nI will go now" << std::endl;
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::seconds(4));
|
||||
|
||||
std::cout << "\nGood by!" << std::endl;
|
||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Phanes::Core::Application::PhanesProject::PhanesProject(std::string _ProjectName)
|
||||
: projectName(_ProjectName)
|
||||
{};
|
||||
|
||||
Phanes::Core::Application::PhanesProject::~PhanesProject()
|
||||
{
|
||||
this->projectName = "Unnamed Project";
|
||||
};
|
||||
|
||||
std::string Phanes::Core::Application::PhanesProject::GetName()
|
||||
{
|
||||
return this->projectName;
|
||||
}
|
||||
|
||||
void Phanes::Core::Application::PhanesProject::Run()
|
||||
{
|
||||
IdleMsg();
|
||||
}
|
Reference in New Issue
Block a user