Minor Changes

This commit is contained in:
Light 2021-09-11 11:29:44 +04:30
parent 645f65af4e
commit 32341d184c
16 changed files with 9 additions and 504 deletions

View file

@ -1,55 +0,0 @@
project "GLAD"
-- Output Directories --
location "%{wks.location}/Dependencies/GLAD"
targetdir (target_dir)
objdir (object_dir)
-- Compiler --
kind "StaticLib"
language "C"
-- Project Files ---
files
{
"src/glad.c",
"include/glad/glad.h",
"include/KHR/khrplatform.h",
"%{prj.location}/build.lua",
}
-- Includes --
includedirs
{
"%{prj.location}/include/"
}
--- Filters ---
-- windows
filter "system:windows"
systemversion "latest"
staticruntime "On"
defines
{
"_CRT_SECURE_NO_WARNINGS",
}
flags { "MultiProcessorCompile" }
-- debug
filter "configurations:Debug"
runtime "Debug"
symbols "on"
-- release
filter "configurations:Release"
runtime "Release"
optimize "on"
-- distribution
filter "configurations:Distribution"
runtime "Release"
optimize "full"

@ -1 +0,0 @@
Subproject commit 36b8d3a8aa988f6b80185c3368514c1048544152

@ -1 +0,0 @@
Subproject commit 80f6716cf5f3708066fd43134e892bfdeaeb5ff1

@ -1 +0,0 @@
Subproject commit 449bc986ba6f4c5e10e32828783f9daef2a77644

View file

@ -60,4 +60,4 @@ if(WIN32)
target_link_libraries(Engine D3DCompiler)
endif()
message("______________________________________________________________________")
message("______________________________________________________________________")

View file

@ -1,128 +0,0 @@
project "Engine"
-- Output Directories --
location "%{wks.location}/Engine/"
targetdir (target_dir)
objdir (object_dir)
-- Compiler --
kind "StaticLib"
language "C++"
cppdialect "C++17"
pchsource "src/Engine/ltpch.cpp"
pchheader "ltpch.h"
-- Project Files --
files
{
-- src
"%{prj.location}/src/**.h",
"%{prj.location}/src/**.cpp",
-- res
"%{prj.location}/res/**",
-- build.lua
"%{prj.location}/build.lua",
}
-- Includes --
includedirs
{
-- engine
"%{include_dirs.engine}",
"%{include_dirs.engine_platform_graphics}",
"%{include_dirs.engine_platform_os}",
-- 3rd party
"%{include_dirs.entt}",
"%{include_dirs.glad}",
"%{include_dirs.glfw}",
"%{include_dirs.glm}",
"%{include_dirs.imgui}",
"%{include_dirs.imgui_backends}",
"%{include_dirs.spdlog}",
"%{include_dirs.stb_image}",
"%{include_dirs.volk}",
"%{include_dirs.shaderc}",
"%{include_dirs.vulkan_sdk}",
}
-- Libraries --
libdirs
{
"%{lib_dirs.vulkan_sdk}",
}
-- Links --
links
{
"GLFW",
"GLAD",
"ImGui",
"stb_image",
"entt",
"shaderc",
"%{libs.spirv_cross}",
}
--- Filters ---
-- windows
filter "system:windows"
defines "LIGHT_PLATFORM_WINDOWS"
systemversion "latest"
staticruntime "on"
links
{
"d3d11.lib",
"dxguid.lib",
"D3DCompiler.lib",
}
flags { "MultiProcessorCompile" }
filter { "system:windows", "files:src/Platform/OS/Linux/**.**" }
flags { "ExcludeFromBuild" }
-- linux
filter "system:linux"
defines "LIGHT_PLATFORM_LINUX"
links
{
"dl",
}
buildoptions
{
"-lgtest",
"-lpthread",
}
filter { "system:linux", "files:src/Platform/GraphicsAPI/DirectX/**.**" }
flags { "ExcludeFromBuild" }
filter { "system:linux", "files:src/Platform/OS/Windows/**.**" }
flags "ExcludeFromBuild"
-- debug
filter "configurations:Debug"
defines "LIGHT_DEBUG"
symbols "on"
-- release
filter "configurations:Release"
defines "LIGHT_RELEASE"
optimize "on"
-- distribution
filter "configurations:Distribution"
defines "LIGHT_DIST"
optimize "full"
filter { "files:**.hlsl" }
flags "ExcludeFromBuild"
shadermodel "4.0"

View file

@ -66,7 +66,6 @@ namespace Light {
{
// update layers
LT_PROFILE_SCOPE("GameLoop::Update");
LT_PROFILE_SCOPE("GameLoop::Updated");
for (auto it = m_LayerStack->begin(); it != m_LayerStack->end(); it++)
(*it)->OnUpdate(deltaTimer.GetDeltaTime());

View file

@ -32,13 +32,14 @@ namespace Light {
bool QuadRendererProgram::Advance()
{
if (m_MapCurrent + 4 >= m_MapEnd)
m_MapCurrent += 4;
if (m_MapCurrent >= m_MapEnd)
{
LT_ENGINE_WARN("QuadRendererProgram::Advance: 'VertexBuffer' map went beyond 'MaxVertices': {}", m_MaxVertices);
return false;
}
m_MapCurrent += 4;
m_QuadCount++;
return true;
}

View file

@ -1,88 +0,0 @@
project "Mirror"
-- Output Directories --
location "%{wks.location}/Mirror/"
targetdir (target_dir)
objdir (object_dir)
-- Compiler --
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
-- Project Files ---
files
{
-- src
"%{prj.location}/src/**.h",
"%{prj.location}/src/**.cpp",
-- res
"%{prj.location}/res/**",
-- build.lua
"%{prj.location}/build.lua",
}
-- Includes --
includedirs
{
-- engine
"%{include_dirs.engine}",
"%{include_dirs.engine_platform_graphics}",
"%{include_dirs.engine_platform_os}",
-- 3rd party
"%{include_dirs.entt}",
"%{include_dirs.glm}",
"%{include_dirs.imgui}",
"%{include_dirs.imgui_backends}",
"%{include_dirs.spdlog}",
"%{include_dirs.stb_image}",
}
-- Links --
links
{
"Engine",
"GLFW",
"GLAD",
"ImGui",
"stb_image" ,
"entt",
}
--- Filters ---
-- windows
filter "system:windows"
defines "LIGHT_PLATFORM_WINDOWS"
systemversion "latest"
staticruntime "On"
flags { "MultiProcessorCompile" }
-- linux
filter "system:linux"
defines "LIGHT_PLATFORM_LINUX"
links
{
"dl",
"pthread",
}
-- debug
filter "configurations:Debug"
defines "LIGHT_DEBUG"
symbols "on"
-- release
filter "configurations:Release"
defines "LIGHT_RELEASE"
optimize "on"
-- distribution
filter "configurations:Distribution"
defines "LIGHT_DIST"
optimize "full"

View file

@ -9,6 +9,7 @@ namespace Light {
m_PropertiesPanel = CreateRef<PropertiesPanel>();
m_SceneHierarchyPanel = CreateRef<SceneHierarchyPanel>(m_Scene, m_PropertiesPanel);
SummonAwesomeness();
m_Framebuffer = Framebuffer::Create({ 1, 1, 1 }, GraphicsContext::GetSharedContext());
@ -26,7 +27,6 @@ namespace Light {
m_Direction.x = Input::GetKeyboardKey(Key::A) ? -1.0f :
Input::GetKeyboardKey(Key::D) ? 1.0f : 0.0f;
m_Direction.y = Input::GetKeyboardKey(Key::S) ? -1.0f :
Input::GetKeyboardKey(Key::W) ? 1.0f : 0.0f;

View file

@ -17,11 +17,11 @@ Will support:
* Mac
## Getting Started
1. Run `git clone --recurse-submodules -j4 https://github.com/Light3039/Light`
1. `git clone --recurse-submodules -j4 https://github.com/Light3039/Light <folder_name>`
* (If you cloned non-recursively run `git submodule update --init`)
2. Open BuildScripts folder and build the project
3. Use the Mirror project (Demo project will be added in the future)
2. `cd <folder_name>/CMake`
3. `cmake ..`
4. Build and run the Mirror project
## Acknowledgments
Huge thanks to these people:

View file

@ -1,88 +0,0 @@
project "Sandbox"
-- Output Directories --
location "%{wks.location}/Sandbox/"
targetdir (target_dir)
objdir (object_dir)
-- Compiler --
kind "ConsoleApp"
language "C++"
cppdialect "C++17"
-- Project Files ---
files
{
-- src
"%{prj.location}/src/**.h",
"%{prj.location}/src/**.cpp",
-- res
"%{prj.location}/res/**",
-- build.lua
"%{prj.location}/build.lua",
}
-- Includes --
includedirs
{
-- engine
"%{include_dirs.engine}",
"%{include_dirs.engine_platform_graphics}",
"%{include_dirs.engine_platform_os}",
-- 3rd party
"%{include_dirs.entt}",
"%{include_dirs.glm}",
"%{include_dirs.imgui}",
"%{include_dirs.imgui_backends}",
"%{include_dirs.spdlog}",
"%{include_dirs.stb_image}",
}
-- Links --
links
{
"Engine",
"GLFW",
"GLAD",
"ImGui",
"stb_image" ,
"entt",
}
--- Filters ---
-- windows
filter "system:windows"
defines "LIGHT_PLATFORM_WINDOWS"
systemversion "latest"
staticruntime "On"
flags { "MultiProcessorCompile" }
-- linux
filter "system:linux"
defines "LIGHT_PLATFORM_LINUX"
links
{
"dl",
"pthread",
}
-- debug
filter "configurations:Debug"
defines "LIGHT_DEBUG"
symbols "on"
-- release
filter "configurations:Release"
defines "LIGHT_RELEASE"
optimize "on"
-- distribution
filter "configurations:Distribution"
defines "LIGHT_DIST"
optimize "full"

View file

@ -1,13 +0,0 @@
[Window][Debug##Default]
Pos=60,60
Size=400,400
Collapsed=0
[Window][Dear ImGui Demo]
ViewportPos=259,212
ViewportId=0xE927CF2F
Size=388,391
Collapsed=0
[Docking][Data]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

View file

@ -1,39 +0,0 @@
#define LIGHT_ENTRY_POINT
#include <LightEngine.h>
#include "SandboxLayer.h"
class Sandbox : public Light::Application
{
private:
SandboxLayer* m_SandboxLayer;
public:
Sandbox()
{
LT_CLIENT_TRACE("Sandbox::Sandbox");
// Set window properties
Light::WindowProperties properties;
properties.title = "Sandbox";
properties.size = glm::uvec2(800u, 600u);
properties.vsync = true;
m_Window->SetProperties(properties);
// Attach the sandbox layer
m_SandboxLayer = new SandboxLayer("SandboxLayer");
Light::LayerStack::AttachLayer(m_SandboxLayer);
}
~Sandbox()
{
LT_CLIENT_TRACE("Sandbox::~Sandbox");
}
};
Light::Application* Light::CreateApplication()
{
// note: don't use the logger here, it is not initialized yet
return new Sandbox();
}

View file

@ -1,81 +0,0 @@
#include <LightEngine.h>
class SandboxLayer : public Light::Layer
{
private:
// scene
Light::Scope<Light::Scene> m_SandboxScene;
// camera
Light::Ref<Light::Camera> m_Camera;
glm::vec2 m_Direction = { 0.0f, 0.0f };
float m_Speed = 1.2f;
public:
SandboxLayer(const std::string& name)
: Light::Layer(name)
{
// initialize scene & camera
m_SandboxScene = Light::CreateScope<Light::Scene>();
m_Camera = Light::CreateRef<Light::Camera>(glm::vec2(0.0f), 800.0f / 600.0f, 1.0f);
// initialize test quads
Light::ResourceManager::LoadTexture("awesomeface", "res/Textures/awesomeface.png");
Light::Ref<Light::Texture> awesomeface = Light::ResourceManager::GetTexture("awesomeface");
for (int i = 0; i < 100; i++)
{
glm::vec3 position = glm::vec3(-1.0f + (-100.0f / 400.0f) + ((rand() % 1000) / 400.0f), -1.0f + (-100.0f / 300.0f) + ((rand() % 800) / 300.0f), 0.0f);
glm::vec2 size = glm::vec2(100 / 400.0f, 100 / 300.0f);
m_SandboxScene->CreateEntity("awesomeface" + i, position, size).AddComponent<Light::SpriteRendererComponent>(awesomeface);
}
}
void OnRender() override
{
Light::Renderer::BeginScene(m_Camera);
m_SandboxScene->OnRender();
Light::Renderer::EndScene();
}
bool OnKeyPressed(const Light::KeyPressedEvent& event) override
{
if (event.GetKey() == Light::Key::A)
m_Direction.x += -1.0f;
if(event.GetKey() == Light::Key::D)
m_Direction.x += 1.0f;
if (event.GetKey() == Light::Key::W)
m_Direction.y += 1.0f;
if (event.GetKey() == Light::Key::S)
m_Direction.y += -1.0f;
return true;
}
bool OnKeyReleased(const Light::KeyReleasedEvent& event) override
{
// #todo: add input class
if (event.GetKey() == Light::Key::A)
m_Direction.x -= -1.0f;
if (event.GetKey() == Light::Key::D)
m_Direction.x -= 1.0f;
if (event.GetKey() == Light::Key::W)
m_Direction.y -= 1.0f;
if (event.GetKey() == Light::Key::S)
m_Direction.y -= -1.0f;
return true;
}
void OnUpdate(float deltaTime) override
{
m_Camera->Move(m_Direction * m_Speed * deltaTime);
m_Camera->CalculateProjection();
m_Camera->CalculateView();
}
};