Skip to content

Commit dddb68a

Browse files
committed
Add project files.
1 parent a4b2d57 commit dddb68a

File tree

158 files changed

+372579
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+372579
-0
lines changed

Build/rttEngine/Editor/rttEngine.idb

635 KB
Binary file not shown.

Build/rttEngine/Editor/rttEngine.lib

1.72 MB
Binary file not shown.

rtt.sln

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.7.34031.279
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rttEngine", "rttEngine\rttEngine.vcxproj", "{D6EBE376-12D4-4584-870B-31282F1BEDE4}"
7+
EndProject
8+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rttGameTemplate", "rttGameTemplate\rttGameTemplate.vcxproj", "{96999394-5561-4826-B74F-BF1D827FC8B8}"
9+
EndProject
10+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rttAppTemlate", "rttAppTemlate\rttAppTemlate.vcxproj", "{F0329305-7EA5-41E1-9521-385B951C35C7}"
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
DebugGame|x64 = DebugGame|x64
15+
Editor|x64 = Editor|x64
16+
Server|x64 = Server|x64
17+
Shipping|x64 = Shipping|x64
18+
EndGlobalSection
19+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
20+
{D6EBE376-12D4-4584-870B-31282F1BEDE4}.DebugGame|x64.ActiveCfg = NoEditor|x64
21+
{D6EBE376-12D4-4584-870B-31282F1BEDE4}.DebugGame|x64.Build.0 = NoEditor|x64
22+
{D6EBE376-12D4-4584-870B-31282F1BEDE4}.Editor|x64.ActiveCfg = Editor|x64
23+
{D6EBE376-12D4-4584-870B-31282F1BEDE4}.Editor|x64.Build.0 = Editor|x64
24+
{D6EBE376-12D4-4584-870B-31282F1BEDE4}.Server|x64.ActiveCfg = NoEditor|x64
25+
{D6EBE376-12D4-4584-870B-31282F1BEDE4}.Server|x64.Build.0 = NoEditor|x64
26+
{D6EBE376-12D4-4584-870B-31282F1BEDE4}.Shipping|x64.ActiveCfg = NoEditor|x64
27+
{D6EBE376-12D4-4584-870B-31282F1BEDE4}.Shipping|x64.Build.0 = NoEditor|x64
28+
{96999394-5561-4826-B74F-BF1D827FC8B8}.DebugGame|x64.ActiveCfg = Debug|x64
29+
{96999394-5561-4826-B74F-BF1D827FC8B8}.DebugGame|x64.Build.0 = Debug|x64
30+
{96999394-5561-4826-B74F-BF1D827FC8B8}.Editor|x64.ActiveCfg = Debug|x64
31+
{96999394-5561-4826-B74F-BF1D827FC8B8}.Editor|x64.Build.0 = Debug|x64
32+
{96999394-5561-4826-B74F-BF1D827FC8B8}.Server|x64.ActiveCfg = Server|x64
33+
{96999394-5561-4826-B74F-BF1D827FC8B8}.Server|x64.Build.0 = Server|x64
34+
{96999394-5561-4826-B74F-BF1D827FC8B8}.Shipping|x64.ActiveCfg = Release|x64
35+
{96999394-5561-4826-B74F-BF1D827FC8B8}.Shipping|x64.Build.0 = Release|x64
36+
{F0329305-7EA5-41E1-9521-385B951C35C7}.DebugGame|x64.ActiveCfg = Debug|x64
37+
{F0329305-7EA5-41E1-9521-385B951C35C7}.DebugGame|x64.Build.0 = Debug|x64
38+
{F0329305-7EA5-41E1-9521-385B951C35C7}.Editor|x64.ActiveCfg = Debug|x64
39+
{F0329305-7EA5-41E1-9521-385B951C35C7}.Editor|x64.Build.0 = Debug|x64
40+
{F0329305-7EA5-41E1-9521-385B951C35C7}.Server|x64.ActiveCfg = Release|x64
41+
{F0329305-7EA5-41E1-9521-385B951C35C7}.Server|x64.Build.0 = Release|x64
42+
{F0329305-7EA5-41E1-9521-385B951C35C7}.Shipping|x64.ActiveCfg = Release|x64
43+
{F0329305-7EA5-41E1-9521-385B951C35C7}.Shipping|x64.Build.0 = Release|x64
44+
EndGlobalSection
45+
GlobalSection(SolutionProperties) = preSolution
46+
HideSolutionNode = FALSE
47+
EndGlobalSection
48+
GlobalSection(ExtensibilityGlobals) = postSolution
49+
SolutionGuid = {7D8C37A5-37FB-4C6A-9791-56AB2516516C}
50+
EndGlobalSection
51+
EndGlobal

rttAppTemlate/rttAppTemlate.vcxproj

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|x64">
5+
<Configuration>Debug</Configuration>
6+
<Platform>x64</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Release|x64">
9+
<Configuration>Release</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
</ItemGroup>
13+
<PropertyGroup Label="Globals">
14+
<VCProjectVersion>17.0</VCProjectVersion>
15+
<Keyword>Win32Proj</Keyword>
16+
<ProjectGuid>{F0329305-7EA5-41E1-9521-385B951C35C7}</ProjectGuid>
17+
<RootNamespace>rtt</RootNamespace>
18+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
19+
<ProjectName>rttAppTemlate</ProjectName>
20+
</PropertyGroup>
21+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
22+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
23+
<ConfigurationType>DynamicLibrary</ConfigurationType>
24+
<UseDebugLibraries>true</UseDebugLibraries>
25+
<PlatformToolset>v143</PlatformToolset>
26+
<CharacterSet>Unicode</CharacterSet>
27+
</PropertyGroup>
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
29+
<ConfigurationType>DynamicLibrary</ConfigurationType>
30+
<UseDebugLibraries>false</UseDebugLibraries>
31+
<PlatformToolset>v143</PlatformToolset>
32+
<WholeProgramOptimization>true</WholeProgramOptimization>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
36+
<ImportGroup Label="ExtensionSettings">
37+
</ImportGroup>
38+
<ImportGroup Label="Shared">
39+
</ImportGroup>
40+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
41+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
42+
</ImportGroup>
43+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
44+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
45+
</ImportGroup>
46+
<PropertyGroup Label="UserMacros" />
47+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
48+
<ClCompile>
49+
<WarningLevel>Level3</WarningLevel>
50+
<SDLCheck>true</SDLCheck>
51+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
52+
<ConformanceMode>true</ConformanceMode>
53+
<LanguageStandard>stdcpp17</LanguageStandard>
54+
</ClCompile>
55+
<Link>
56+
<SubSystem>Console</SubSystem>
57+
<GenerateDebugInformation>true</GenerateDebugInformation>
58+
</Link>
59+
</ItemDefinitionGroup>
60+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
61+
<ClCompile>
62+
<WarningLevel>Level3</WarningLevel>
63+
<FunctionLevelLinking>true</FunctionLevelLinking>
64+
<IntrinsicFunctions>true</IntrinsicFunctions>
65+
<SDLCheck>true</SDLCheck>
66+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
67+
<ConformanceMode>true</ConformanceMode>
68+
<LanguageStandard>stdcpp17</LanguageStandard>
69+
</ClCompile>
70+
<Link>
71+
<SubSystem>Console</SubSystem>
72+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
73+
<OptimizeReferences>true</OptimizeReferences>
74+
<GenerateDebugInformation>true</GenerateDebugInformation>
75+
</Link>
76+
</ItemDefinitionGroup>
77+
<ItemGroup>
78+
</ItemGroup>
79+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
80+
<ImportGroup Label="ExtensionTargets">
81+
</ImportGroup>
82+
</Project>
+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#include "VulkanLayer.h"
2+
3+
VulkanLayer::VulkanLayer()
4+
{
5+
CreateInstance();
6+
7+
}
8+
9+
VulkanLayer::~VulkanLayer()
10+
{
11+
vkDestroyInstance(instance,nullptr);
12+
}
13+
14+
void VulkanLayer::Draw()
15+
{
16+
17+
}
18+
19+
void VulkanLayer::CreateInstance()
20+
{
21+
22+
23+
uint32_t extensionCount = 0;
24+
vkEnumerateInstanceExtensionProperties(0, &extensionCount, nullptr);
25+
26+
std::vector<VkExtensionProperties> extensions(extensionCount);
27+
std::vector<char*> extensionNames(extensionCount);
28+
vkEnumerateInstanceExtensionProperties(0, &extensionCount, extensions.data());
29+
30+
31+
RTT_LOG("There are "+ std::to_string(extensionCount) + " extensions available:");
32+
for (uint32_t i = 0; i < extensionCount; i++) {
33+
extensionNames[i] = extensions[i].extensionName;
34+
RTT_LOG(" "+ std::string(extensions[i].extensionName));
35+
}
36+
37+
38+
39+
40+
VkApplicationInfo appInfo{};
41+
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
42+
appInfo.pApplicationName = getProcessInfo()->appInfo->name;
43+
appInfo.pEngineName = "rtt";
44+
appInfo.applicationVersion = VK_MAKE_VERSION(0, 0, 0);
45+
appInfo.engineVersion = VK_MAKE_VERSION(1, 1, 1);
46+
appInfo.apiVersion = VK_API_VERSION_1_3;
47+
appInfo.pNext = nullptr;
48+
49+
VkInstanceCreateInfo createInfo{};
50+
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
51+
createInfo.pApplicationInfo = &appInfo;
52+
createInfo.enabledExtensionCount = extensionCount;
53+
createInfo.ppEnabledExtensionNames = extensionNames.data();
54+
createInfo.enabledLayerCount = 0;
55+
createInfo.pNext = nullptr;
56+
57+
VkResult createResult = vkCreateInstance(&createInfo, nullptr, &instance);
58+
if (createResult == VK_SUCCESS) {
59+
RTT_LOG("Instance Created Successfuly");
60+
return;
61+
}
62+
RTT_LOG("Failed to create instance");
63+
}
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#pragma once
2+
#include "Runtime\Layers\RenderingLayer.h"
3+
#include "Vulkan\vulkan.h"
4+
#include <vector>
5+
#include "Runtime\Application\ProcessInfo.h"
6+
7+
class VulkanLayer : public RenderingLayer {
8+
public:
9+
VulkanLayer();
10+
~VulkanLayer();
11+
virtual void Draw() override;
12+
private:
13+
//~Instance
14+
VkInstance instance;
15+
16+
void CreateInstance();
17+
//~Instance
18+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#pragma once
2+
3+
#include "AppInfo.h"
4+
#include <iostream>
5+
#include "Runtime\Logging\Logger.h"
6+
#include "ProcessInfo.h"
7+
8+
#ifdef Win64
9+
#include "Runtime/Surface/Win64/Win64Surface.h"
10+
#define CREATE_GAME(appinfo) \
11+
int main(int argc, char* argv[]) { \
12+
getProcessInfo()->argc = argc; \
13+
getProcessInfo()->argv = argv; \
14+
getProcessInfo()->appInfo = &appInfo; \
15+
Win64Surface surface = Win64Surface(appInfo.name); \
16+
surface.StartUpdateLoop(); return 0; \
17+
};
18+
#endif
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
// App Info struct
4+
struct AppInfo {
5+
// App name
6+
const char* name;
7+
// App version
8+
const char* version;
9+
// App description
10+
const char* description;
11+
// Build ID
12+
const int buildID;
13+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "ProcessInfo.h"
2+
3+
ProcessInfo engineProcessInfo {
4+
};
5+
6+
ProcessInfo* getProcessInfo()
7+
{
8+
return &engineProcessInfo;
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
#include "AppInfo.h"
3+
#include "Runtime\Layers\RenderingLayer.h"
4+
5+
struct ProcessInfo {
6+
int argc;
7+
char** argv;
8+
AppInfo* appInfo;
9+
RenderingLayer* renderingLayer = nullptr;
10+
};
11+
12+
ProcessInfo* getProcessInfo();

rttEngine/Runtime/Layers/Layer.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "Layer.h"
2+
3+
void Layer::PushBack(Sublayer *layer)
4+
{
5+
size_t size = children.size();
6+
children.resize(children.size()+1);
7+
children[size] = layer;
8+
}
9+
10+
void Layer::PopBack()
11+
{
12+
children.pop_back();
13+
}
14+
15+
std::vector<Sublayer*> Layer::GetChildren()
16+
{
17+
return children;
18+
}

rttEngine/Runtime/Layers/Layer.h

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#pragma once
2+
#include "Sublayer.h"
3+
#include <vector>
4+
5+
class Layer {
6+
public:
7+
// Default constructor
8+
Layer() = default;
9+
10+
// Used to push back sublayer into layer
11+
/// ~~Intellisense
12+
/// <summary>Used to push back sublayer into layer</summary>
13+
/// <param name="layer">Layer to pushback</param>
14+
void PushBack(Sublayer* layer);
15+
16+
// Used to pop back lastest sublayer in layer
17+
/// ~~Intellisense
18+
/// <summary>Used to pop back lastest sublayer in layer</summary>
19+
void PopBack();
20+
21+
22+
// Used to get all children in layer
23+
/// ~~Intellisense
24+
/// <summary>Used to get all children in layer</summary>
25+
/// <returns>Returns children components</returns>
26+
std::vector<Sublayer*> GetChildren();
27+
28+
private:
29+
30+
// Children sublayers
31+
std::vector<Sublayer*> children;
32+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "Sublayer.h"
2+
#include "RenderingLayer.h"
3+
4+
void RenderingLayer::Draw()
5+
{
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#pragma once
2+
3+
#include "Sublayer.h"
4+
5+
class RenderingLayer: public Sublayer {
6+
public:
7+
virtual void Draw();
8+
};

rttEngine/Runtime/Layers/Sublayer.cpp

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include "Sublayer.h"
2+
3+
Sublayer::Sublayer()
4+
{
5+
}
6+
7+
Sublayer::~Sublayer()
8+
{
9+
}
10+
11+
Layer* Sublayer::GetParent()
12+
{
13+
return parent;
14+
}
15+
16+
void Sublayer::SetParent(Layer* layer)
17+
{
18+
if (!layer) {
19+
RTT_LOG("Parent is nullptr");
20+
}
21+
parent = layer;
22+
}

rttEngine/Runtime/Layers/Sublayer.h

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
#include "Runtime\Logging\Logger.h"
4+
class Layer;
5+
6+
7+
class Sublayer {
8+
public:
9+
Sublayer();
10+
~Sublayer();
11+
Layer* GetParent();
12+
void SetParent(Layer* layer);
13+
private:
14+
Layer* parent = nullptr;
15+
};

rttEngine/Runtime/Logging/Logger.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "Logger.h"
2+
3+
void logData(std::string data, std::string runnerName)
4+
{
5+
6+
std::cout << "[ " << runnerName << " ] " << data << std::endl;
7+
}

0 commit comments

Comments
 (0)