Migrating to Linux

This commit is contained in:
Thorben Höhne
2025-02-17 22:31:17 +01:00
parent c65b1c8139
commit 14f3339eee
75 changed files with 125 additions and 71 deletions

View 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
)

View 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

View 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();
}

View File

@@ -0,0 +1,6 @@
#pragma once
#include <string>
#include <iostream>
#include <thread>
#include <chrono>

View File

@@ -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();
}