Added entry point

This commit is contained in:
Light3039 2021-05-20 10:21:08 +04:30
parent dc0549a40e
commit 5f457aa8d1
9 changed files with 89 additions and 44 deletions

40
.gitignore vendored
View file

@ -1,37 +1,7 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Directories
.vs/
bin/
bin-int/
.vs/
**.vcx**
# VS Files
**.vcxproj**

View file

@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Light Engine", "Light Engine\Light Engine.vcxproj", "{039B5335-8EC7-4005-AFF9-833E1B760755}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sandbox", "Sandbox\Sandbox.vcxproj", "{A72B03C9-4FE6-4288-AE22-8DD8E4E37A4D}"
ProjectSection(ProjectDependencies) = postProject
{039B5335-8EC7-4005-AFF9-833E1B760755} = {039B5335-8EC7-4005-AFF9-833E1B760755}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View file

@ -0,0 +1,18 @@
#include "Application.h"
namespace Light {
Application::Application()
{
}
Application::~Application()
{
}
void Application::GameLoop()
{
while (true);
}
}

View file

@ -0,0 +1,18 @@
#pragma once
#include "Base.h"
namespace Light {
class Application
{
public:
Application();
virtual ~Application();
void GameLoop();
};
Application* CreateApplication();
}

View file

@ -0,0 +1,9 @@
#pragma once
#if defined(LT_PLATFORM_WINDOWS)
#define LT_BUILD_PLATFORM "Windows"
#elif defined(LT_PLATFORM_LINUX)
#error "Unsupported platform: UNIX"
#else
#error "Unsupported platform: Unknown"
#endif

View file

@ -0,0 +1,14 @@
#pragma once
#ifdef LT_PLATFORM_WINDOWS
extern Light::Application* Light::CreateApplication();
int main(int argc, char** argv)
{
auto application = Light::CreateApplication();
application->GameLoop();
delete application;
}
#endif

View file

@ -0,0 +1,7 @@
#pragma once
#include "Engine/Base.h"
#include "Engine/Application.h"
#include "Engine/EntryPoint.h"

15
Sandbox/SandboxApp.cpp Normal file
View file

@ -0,0 +1,15 @@
#include <LightEngine.h>
class Sandbox : public Light::Application
{
public:
Sandbox()
{
}
};
Light::Application* Light::CreateApplication()
{
return new Sandbox();
}

View file

@ -1,9 +0,0 @@
#include <iostream>
int main()
{
std::cout << "Hello world!" << std::endl;
std::cin.get();
return 0;
}