Added entry point
This commit is contained in:
parent
dc0549a40e
commit
5f457aa8d1
9 changed files with 89 additions and 44 deletions
40
.gitignore
vendored
40
.gitignore
vendored
|
@ -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**
|
|
@ -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
|
||||
|
|
18
Light Engine/src/Engine/Application.cpp
Normal file
18
Light Engine/src/Engine/Application.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include "Application.h"
|
||||
|
||||
namespace Light {
|
||||
|
||||
Application::Application()
|
||||
{
|
||||
}
|
||||
|
||||
Application::~Application()
|
||||
{
|
||||
}
|
||||
|
||||
void Application::GameLoop()
|
||||
{
|
||||
while (true);
|
||||
}
|
||||
|
||||
}
|
18
Light Engine/src/Engine/Application.h
Normal file
18
Light Engine/src/Engine/Application.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include "Base.h"
|
||||
|
||||
namespace Light {
|
||||
|
||||
class Application
|
||||
{
|
||||
public:
|
||||
Application();
|
||||
virtual ~Application();
|
||||
|
||||
void GameLoop();
|
||||
};
|
||||
|
||||
Application* CreateApplication();
|
||||
|
||||
}
|
9
Light Engine/src/Engine/Base.h
Normal file
9
Light Engine/src/Engine/Base.h
Normal 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
|
14
Light Engine/src/Engine/EntryPoint.h
Normal file
14
Light Engine/src/Engine/EntryPoint.h
Normal 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
|
7
Light Engine/src/LightEngine.h
Normal file
7
Light Engine/src/LightEngine.h
Normal 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
15
Sandbox/SandboxApp.cpp
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <LightEngine.h>
|
||||
|
||||
class Sandbox : public Light::Application
|
||||
{
|
||||
public:
|
||||
Sandbox()
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Light::Application* Light::CreateApplication()
|
||||
{
|
||||
return new Sandbox();
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello world!" << std::endl;
|
||||
std::cin.get();
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue