diff --git a/Dependencies/GLAD/build.lua b/Dependencies/GLAD/build.lua deleted file mode 100644 index 9cda096..0000000 --- a/Dependencies/GLAD/build.lua +++ /dev/null @@ -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" diff --git a/Dependencies/glslang b/Dependencies/glslang deleted file mode 160000 index 36b8d3a..0000000 --- a/Dependencies/glslang +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 36b8d3a8aa988f6b80185c3368514c1048544152 diff --git a/Dependencies/shaderc b/Dependencies/shaderc deleted file mode 160000 index 80f6716..0000000 --- a/Dependencies/shaderc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 80f6716cf5f3708066fd43134e892bfdeaeb5ff1 diff --git a/Dependencies/spirv-headers b/Dependencies/spirv-headers deleted file mode 160000 index 449bc98..0000000 --- a/Dependencies/spirv-headers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 449bc986ba6f4c5e10e32828783f9daef2a77644 diff --git a/Engine/CMakeLists.txt b/Engine/CMakeLists.txt index 5d815be..5d8e1b9 100644 --- a/Engine/CMakeLists.txt +++ b/Engine/CMakeLists.txt @@ -60,4 +60,4 @@ if(WIN32) target_link_libraries(Engine D3DCompiler) endif() -message("______________________________________________________________________") +message("______________________________________________________________________") \ No newline at end of file diff --git a/Engine/build.lua b/Engine/build.lua deleted file mode 100644 index d1a5dec..0000000 --- a/Engine/build.lua +++ /dev/null @@ -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" \ No newline at end of file diff --git a/Engine/src/Engine/Core/Application.cpp b/Engine/src/Engine/Core/Application.cpp index 1e83195..b69ed00 100644 --- a/Engine/src/Engine/Core/Application.cpp +++ b/Engine/src/Engine/Core/Application.cpp @@ -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()); diff --git a/Engine/src/Engine/Graphics/RendererPrograms/QuadRendererProgram.cpp b/Engine/src/Engine/Graphics/RendererPrograms/QuadRendererProgram.cpp index 6cc8b81..84814dd 100644 --- a/Engine/src/Engine/Graphics/RendererPrograms/QuadRendererProgram.cpp +++ b/Engine/src/Engine/Graphics/RendererPrograms/QuadRendererProgram.cpp @@ -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; } diff --git a/Mirror/build.lua b/Mirror/build.lua deleted file mode 100644 index 1a9f646..0000000 --- a/Mirror/build.lua +++ /dev/null @@ -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" \ No newline at end of file diff --git a/Mirror/src/EditorLayer.cpp b/Mirror/src/EditorLayer.cpp index e90256f..a3eba51 100644 --- a/Mirror/src/EditorLayer.cpp +++ b/Mirror/src/EditorLayer.cpp @@ -9,6 +9,7 @@ namespace Light { m_PropertiesPanel = CreateRef(); m_SceneHierarchyPanel = CreateRef(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; diff --git a/README.md b/README.md index 759e70c..ef149b9 100644 --- a/README.md +++ b/README.md @@ -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 ` * (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 /CMake` +3. `cmake ..` +4. Build and run the Mirror project ## Acknowledgments Huge thanks to these people: diff --git a/Sandbox/build.lua b/Sandbox/build.lua deleted file mode 100644 index c954f80..0000000 --- a/Sandbox/build.lua +++ /dev/null @@ -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" \ No newline at end of file diff --git a/Sandbox/default_gui_layout.ini b/Sandbox/default_gui_layout.ini deleted file mode 100644 index ee99ff8..0000000 --- a/Sandbox/default_gui_layout.ini +++ /dev/null @@ -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] - diff --git a/Sandbox/res/Textures/awesomeface.png b/Sandbox/res/Textures/awesomeface.png deleted file mode 100644 index 58daba0..0000000 Binary files a/Sandbox/res/Textures/awesomeface.png and /dev/null differ diff --git a/Sandbox/src/SandboxApp.cpp b/Sandbox/src/SandboxApp.cpp deleted file mode 100644 index b057cb4..0000000 --- a/Sandbox/src/SandboxApp.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#define LIGHT_ENTRY_POINT -#include - -#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(); -} \ No newline at end of file diff --git a/Sandbox/src/SandboxLayer.h b/Sandbox/src/SandboxLayer.h deleted file mode 100644 index ea95622..0000000 --- a/Sandbox/src/SandboxLayer.h +++ /dev/null @@ -1,81 +0,0 @@ -#include - -class SandboxLayer : public Light::Layer -{ -private: - // scene - Light::Scope m_SandboxScene; - - // camera - Light::Ref 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(); - m_Camera = Light::CreateRef(glm::vec2(0.0f), 800.0f / 600.0f, 1.0f); - - // initialize test quads - Light::ResourceManager::LoadTexture("awesomeface", "res/Textures/awesomeface.png"); - Light::Ref 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(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(); - } - -};