forked from TheCherno/Hazel
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New shader system, added Python scripts for retrieving dependencies, …
…added uniform buffers, added command line args, and better premake scripts
- Loading branch information
Showing
28 changed files
with
710 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
-- Hazel Dependencies | ||
|
||
VULKAN_SDK = os.getenv("VULKAN_SDK") | ||
|
||
IncludeDir = {} | ||
IncludeDir["stb_image"] = "%{wks.location}/Hazel/vendor/stb_image" | ||
IncludeDir["yaml_cpp"] = "%{wks.location}/Hazel/vendor/yaml-cpp/include" | ||
IncludeDir["GLFW"] = "%{wks.location}/Hazel/vendor/GLFW/include" | ||
IncludeDir["Glad"] = "%{wks.location}/Hazel/vendor/Glad/include" | ||
IncludeDir["ImGui"] = "%{wks.location}/Hazel/vendor/ImGui" | ||
IncludeDir["ImGuizmo"] = "%{wks.location}/Hazel/vendor/ImGuizmo" | ||
IncludeDir["glm"] = "%{wks.location}/Hazel/vendor/glm" | ||
IncludeDir["entt"] = "%{wks.location}/Hazel/vendor/entt/include" | ||
IncludeDir["shaderc"] = "%{wks.location}/Hazel/vendor/shaderc/include" | ||
IncludeDir["SPIRV_Cross"] = "%{wks.location}/Hazel/vendor/SPIRV-Cross" | ||
IncludeDir["VulkanSDK"] = "%{VULKAN_SDK}/Include" | ||
|
||
LibraryDir = {} | ||
|
||
LibraryDir["VulkanSDK"] = "%{VULKAN_SDK}/Lib" | ||
LibraryDir["VulkanSDK_Debug"] = "%{wks.location}/Hazel/vendor/VulkanSDK/Lib" | ||
|
||
Library = {} | ||
Library["Vulkan"] = "%{LibraryDir.VulkanSDK}/vulkan-1.lib" | ||
Library["VulkanUtils"] = "%{LibraryDir.VulkanSDK}/VkLayer_utils.lib" | ||
|
||
Library["ShaderC_Debug"] = "%{LibraryDir.VulkanSDK_Debug}/shaderc_sharedd.lib" | ||
Library["SPIRV_Cross_Debug"] = "%{LibraryDir.VulkanSDK_Debug}/spirv-cross-cored.lib" | ||
Library["SPIRV_Cross_GLSL_Debug"] = "%{LibraryDir.VulkanSDK_Debug}/spirv-cross-glsld.lib" | ||
Library["SPIRV_Tools_Debug"] = "%{LibraryDir.VulkanSDK_Debug}/SPIRV-Toolsd.lib" | ||
|
||
Library["ShaderC_Release"] = "%{LibraryDir.VulkanSDK}/shaderc_shared.lib" | ||
Library["SPIRV_Cross_Release"] = "%{LibraryDir.VulkanSDK}/spirv-cross-core.lib" | ||
Library["SPIRV_Cross_GLSL_Release"] = "%{LibraryDir.VulkanSDK}/spirv-cross-glsl.lib" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include <chrono> | ||
|
||
namespace Hazel { | ||
|
||
class Timer | ||
{ | ||
public: | ||
Timer() | ||
{ | ||
Reset(); | ||
} | ||
|
||
void Timer::Reset() | ||
{ | ||
m_Start = std::chrono::high_resolution_clock::now(); | ||
} | ||
|
||
float Timer::Elapsed() | ||
{ | ||
return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now() - m_Start).count() * 0.001f * 0.001f * 0.001f; | ||
} | ||
|
||
float Timer::ElapsedMillis() | ||
{ | ||
return Elapsed() * 1000.0f; | ||
} | ||
|
||
private: | ||
std::chrono::time_point<std::chrono::high_resolution_clock> m_Start; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "hzpch.h" | ||
#include "UniformBuffer.h" | ||
|
||
#include "Hazel/Renderer/Renderer.h" | ||
#include "Platform/OpenGL/OpenGLUniformBuffer.h" | ||
|
||
namespace Hazel { | ||
|
||
Ref<UniformBuffer> UniformBuffer::Create(uint32_t size, uint32_t binding) | ||
{ | ||
switch (Renderer::GetAPI()) | ||
{ | ||
case RendererAPI::API::None: HZ_CORE_ASSERT(false, "RendererAPI::None is currently not supported!"); return nullptr; | ||
case RendererAPI::API::OpenGL: return CreateRef<OpenGLUniformBuffer>(size, binding); | ||
} | ||
|
||
HZ_CORE_ASSERT(false, "Unknown RendererAPI!"); | ||
return nullptr; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include "Hazel/Core/Base.h" | ||
|
||
namespace Hazel { | ||
|
||
class UniformBuffer | ||
{ | ||
public: | ||
virtual ~UniformBuffer() {} | ||
virtual void SetData(const void* data, uint32_t size, uint32_t offset = 0) = 0; | ||
|
||
static Ref<UniformBuffer> Create(uint32_t size, uint32_t binding); | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.