Compare commits

9 Commits

Author SHA1 Message Date
a92404d9b3 Sets up smaller example and fixes build issues 2025-12-16 20:50:14 -05:00
846b972047 Fixes more errors 2025-12-16 20:32:19 -05:00
e94764927b Fixes imgui setup init 2025-12-16 20:11:26 -05:00
1270282db0 Fixes compile errors 2025-12-16 20:08:24 -05:00
66e4d6d05a update modules 2025-12-15 23:16:05 -05:00
ca499e0204 fix module path 2025-12-15 21:54:04 -05:00
9d25b710ee fix module path 2025-12-15 21:36:02 -05:00
4bd60b172d bump libFGL remote 2025-12-15 21:27:37 -05:00
ee7dd0f470 Merge pull request 'depth-prepass' (#1) from depth-prepass into master
Reviewed-on: #1
2025-12-16 00:59:49 +00:00
50 changed files with 64 additions and 66 deletions

7
.gitmodules vendored
View File

@@ -38,8 +38,11 @@
path = dependencies/slang
url = https://github.com/shader-slang/slang.git
[submodule "dependencies/libFGL"]
path = dependencies/libFGL
url = git@github.com:KJNeko/libFGL.git
path = dependencies/libFGL
url = https://git.futuregadgetlabs.net/KJ16609/libFGL.git
[submodule "dependencies/gtest"]
path = dependencies/gtest
url = https://github.com/google/googletest.git
[submodule "dependencies/json"]
path = dependencies/json
url = https://github.com/nlohmann/json.git

View File

@@ -1,2 +1,2 @@
set(SPDLOG_USE_STD_FORMAT ON)
add_subdirectory(${CMAKE_SOURCE_DIR}/dependencies/spdlog ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(${CMAKE_SOURCE_DIR}/dependencies/spdlog ${CMAKE_CURRENT_BINARY_DIR}/bin)

1
dependencies/json vendored Submodule

Submodule dependencies/json added at 9f35919110

View File

@@ -1,8 +1,10 @@
include(dependencies/spdlog)
add_subdirectory(renderer)
add_subdirectory(engine)
add_subdirectory(objectloaders)
#add_subdirectory(editor)
#add_subdirectory(engine)
add_subdirectory(editor)
message("-- Creating SYMLINK ${CMAKE_BINARY_DIR}/shaders -> ${CMAKE_CURRENT_SOURCE_DIR}/shaders")
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/shaders ${CMAKE_BINARY_DIR}/bin/shaders SYMBOLIC)

View File

@@ -33,7 +33,7 @@ namespace fgl::editor
ImGui::CreateContext();
[[maybe_unused]] ImGuiIO& io { ImGui::GetIO() };
//io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
// io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
// io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
io.ConfigWindowsResizeFromEdges = true;
@@ -62,12 +62,12 @@ namespace fgl::editor
.MinImageCount = 2,
.ImageCount = 2,
.PipelineCache = VK_NULL_HANDLE,
.RenderPass = VK_NULL_HANDLE,
.Subpass = 0,
.MSAASamples = VK_SAMPLE_COUNT_1_BIT,
.PipelineInfoMain = { .RenderPass = VK_NULL_HANDLE,
.Subpass = 0,
.MSAASamples = VK_SAMPLE_COUNT_1_BIT,
.PipelineRenderingCreateInfo = pipeline_info },
.UseDynamicRendering = VK_TRUE,
.PipelineRenderingCreateInfo = pipeline_info,
.Allocator = VK_NULL_HANDLE,
.CheckVkResultFn = VK_NULL_HANDLE,

View File

@@ -11,7 +11,9 @@ namespace fgl::engine::gui
{
static std::string name_input_temp {};
name_input_temp = game_object.getName();
ImGui::InputText( "Name", &name_input_temp );
static std::array< char, 1024 > buffer {};
std::memcpy( buffer.data(), name_input_temp.data(), name_input_temp.size() );
ImGui::InputText( "Name", buffer.data(), buffer.size() );
if ( game_object.getName() != name_input_temp ) game_object.setName( name_input_temp );
/*
@@ -38,10 +40,7 @@ namespace fgl::engine::gui
void drawComponentsList( GameObject& game_object )
{
ImGui::PushStyleVar( ImGuiStyleVar_ChildRounding, 5.0f );
ImGui::BeginChild(
"ComponentsList",
ImVec2( 0, 0 ),
ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_Border | ImGuiChildFlags_ResizeY );
ImGui::BeginChild( "ComponentsList", ImVec2( 0, 0 ), ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_ResizeY );
ImGui::SeparatorText( "Components" );
@@ -55,7 +54,7 @@ namespace fgl::engine::gui
ImGui::EndChild();
ImGui::PopStyleVar();
ImGui::BeginChild( "Selected", ImVec2( 0, 0 ), ImGuiChildFlags_Border );
ImGui::BeginChild( "Selected", ImVec2( 0, 0 ) );
if ( SELECTED_COMPONENT != nullptr && std::ranges::find( components, SELECTED_COMPONENT ) != components.end() )
{

View File

@@ -2,7 +2,6 @@
// Created by kj16609 on 6/5/24.
//
// ReSharper disable CppDFAInfiniteRecursion
// ReSharper disable CppInconsistentNaming
// ReSharper disable CppZeroConstantCanBeReplacedWithNullptr
@@ -18,7 +17,8 @@
#include <string_view>
#include "engine/FGL_DEFINES.hpp"
#include "imgui.h"
#include "libFGL/include/fgl/defines.hpp"
namespace ImGui
{

View File

@@ -10,8 +10,6 @@ target_compile_definitions(FGLEngine PUBLIC VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC
target_link_libraries(FGLEngine PUBLIC stdc++exp)
include(dependencies/spdlog)
target_link_libraries(FGLEngine PUBLIC Vulkan::Vulkan ImGui FGLLoader spdlog slang glm)
target_include_directories(FGLEngine SYSTEM PUBLIC ${GLM_INCLUDE_DIRS})
target_link_libraries(FGLEngine PUBLIC glfw Tracy::TracyClient)

View File

@@ -8,9 +8,9 @@
#include <memory>
#include "FGL_DEFINES.hpp"
#include "Sampler.hpp"
#include "debug/Track.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -7,7 +7,7 @@
#include <vulkan/vulkan.hpp>
#include <vulkan/vulkan_raii.hpp>
#include "engine/FGL_DEFINES.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -7,6 +7,7 @@
#include <vulkan/vulkan.hpp>
#include <filesystem>
#include <imgui.h>
#include "debug/Track.hpp"
#include "engine/assets/AssetManager.hpp"

View File

@@ -9,8 +9,8 @@
#include <queue>
#include "TransferData.hpp"
#include "engine/FGL_DEFINES.hpp"
#include "engine/memory/buffers/vector/concepts.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -4,7 +4,6 @@
#pragma once
#include <vulkan/vulkan_raii.hpp>
#include "FGL_DEFINES.hpp"
#include "engine/rendering/RenderingFormats.hpp"
#include "engine/rendering/pipelines/Attachment.hpp"
#include "rendering/CommandBufferPool.hpp"

View File

@@ -8,8 +8,8 @@
#include <unordered_map>
#include <vector>
#include "FGL_DEFINES.hpp"
#include "assets/texture/Texture.hpp"
#include "libFGL/include/fgl/defines.hpp"
#include "rendering/types.hpp"
namespace fgl::engine

View File

@@ -6,9 +6,10 @@
#include <cassert>
#include "engine/FGL_DEFINES.hpp"
#include "engine/clock.hpp"
#include "engine/debug/logging/logging.hpp"
#include "imgui.h"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine::debug
{

View File

@@ -10,8 +10,8 @@
#include <unordered_map>
#include "engine/FGL_DEFINES.hpp"
#include "engine/debug/logging/logging.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine::filesystem
{

View File

@@ -3,7 +3,6 @@
//
#pragma once
#include "engine/FGL_DEFINES.hpp"
#include "engine/primitives/Frustum.hpp"
#include "engine/primitives/vectors/NormalVector.hpp"

View File

@@ -17,13 +17,13 @@ namespace fgl::engine
bool rayHit( [[maybe_unused]] const Ray& ray, [[maybe_unused]] const OrientedBoundingBox< CS::World >& obb )
{
//TODO: Implement raycasts
FGL_TODO();
// FGL_TODO();
return false;
}
bool rayHit( [[maybe_unused]] const Ray& ray, [[maybe_unused]] const AxisAlignedBoundingBox< CS::World >& aabb )
{
FGL_TODO();
// FGL_TODO();
}
} // namespace fgl::engine

View File

@@ -8,9 +8,9 @@
#include <queue>
#include "FGL_DEFINES.hpp"
#include "VulkanBuffer.hpp"
#include "engine/debug/Track.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace vk::raii
{

View File

@@ -7,8 +7,6 @@
#include <iostream>
#include <type_traits>
#include "FGL_DEFINES.hpp"
namespace fgl::engine::memory
{

View File

@@ -7,9 +7,9 @@
#include <variant>
#include "Scale.hpp"
#include "engine/FGL_DEFINES.hpp"
#include "engine/debug/logging/logging.hpp"
#include "engine/primitives/points/Coordinate.hpp"
#include "libFGL/include/fgl/defines.hpp"
#include "rotation/QuatRotation.hpp"
#include "rotation/UniversalRotation.hpp"

View File

@@ -7,6 +7,8 @@
#include "OrientedBoundingBox.hpp"
#include "engine/primitives/lines/LineSegment.hpp"
#define FGL_NOTNANVEC3( ... ) ;
namespace fgl::engine
{

View File

@@ -5,11 +5,12 @@
#pragma once
#include "BoundingBox.hpp"
#include "engine/FGL_DEFINES.hpp"
#include "engine/primitives/Scale.hpp"
#include "engine/primitives/points/Coordinate.hpp"
#include "engine/primitives/vectors/NormalVector.hpp"
#define FGL_NOTNAN(...)
namespace fgl::engine
{
template < CoordinateSpace CType >

View File

@@ -5,11 +5,11 @@
#pragma once
#include "LineBase.hpp"
#include "engine/FGL_DEFINES.hpp"
#include "engine/primitives/CoordinateSpace.hpp"
#include "engine/primitives/planes/concepts.hpp"
#include "engine/primitives/points/Coordinate.hpp"
#include "engine/primitives/vectors/NormalVector.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -5,7 +5,6 @@
#pragma once
#include "LineBase.hpp"
#include "engine/FGL_DEFINES.hpp"
#include "engine/primitives/planes/concepts.hpp"
#include "engine/primitives/points/Coordinate.hpp"
#include "engine/primitives/vectors/NormalVector.hpp"

View File

@@ -4,10 +4,10 @@
#pragma once
#include "engine/FGL_DEFINES.hpp"
#include "engine/primitives/CoordinateSpace.hpp"
#include "engine/primitives/points/Coordinate.hpp"
#include "engine/primitives/vectors/NormalVector.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -4,10 +4,10 @@
#pragma once
#include "engine/FGL_DEFINES.hpp"
#include "engine/primitives/CoordinateSpace.hpp"
#include "engine/primitives/points/Coordinate.hpp"
#include "engine/primitives/vectors/NormalVector.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -3,8 +3,8 @@
//
#pragma once
#include "EulerRotation.hpp"
#include "FGL_DEFINES.hpp"
#include "QuatRotation.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -6,9 +6,9 @@
#include <glm/vec3.hpp>
#include "engine/FGL_DEFINES.hpp"
#include "engine/constants.hpp"
#include "engine/primitives/CoordinateSpace.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -4,7 +4,7 @@
#pragma once
#include <vulkan/vulkan_raii.hpp>
#include "FGL_DEFINES.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -7,7 +7,6 @@
#include <queue>
#include "CommandBuffer.hpp"
#include "FGL_DEFINES.hpp"
#include "constants.hpp"
#include "devices/PhysicalDevice.hpp"
#include "types.hpp"

View File

@@ -6,7 +6,7 @@
#include <vulkan/vulkan_raii.hpp>
#include "engine/FGL_DEFINES.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -6,7 +6,7 @@
#include <vulkan/vulkan.hpp>
#include <vulkan/vulkan_raii.hpp>
#include "engine/FGL_DEFINES.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -5,7 +5,7 @@
#pragma once
#include <vulkan/vulkan_raii.hpp>
#include "engine/FGL_DEFINES.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -6,8 +6,8 @@
#include <vulkan/vulkan_raii.hpp>
#include "engine/FGL_DEFINES.hpp"
#include "engine/rendering/QueuePool.hpp"
#include "libFGL/include/fgl/defines.hpp"
namespace fgl::engine
{

View File

@@ -19,9 +19,9 @@
#include <slang.h>
#pragma GCC diagnostic pop
#include "engine/FGL_DEFINES.hpp"
#include "engine/constants.hpp"
#include "engine/debug/logging/logging.hpp"
#include "libFGL/include/fgl/defines.hpp"
#include "rendering/pipelines/Shader.hpp"
namespace fgl::engine

View File

@@ -10,7 +10,6 @@
#include <unordered_map>
#include "descriptors/DescriptorSetLayout.hpp"
#include "engine/FGL_DEFINES.hpp"
#include "engine/rendering/pipelines/Shader.hpp"
namespace fgl::engine

View File

@@ -15,8 +15,6 @@ target_compile_definitions(FGLRenderer PUBLIC
VULKAN_HPP_SMART_HANDLE_IMPLICIT_CAST
)
include(dependencies/spdlog)
target_link_libraries(FGLRenderer PUBLIC Vulkan::Vulkan FGLLoader spdlog slang glm)
target_include_directories(FGLRenderer SYSTEM PUBLIC ${GLM_INCLUDE_DIRS})
target_link_libraries(FGLRenderer PUBLIC glfw Tracy::TracyClient libFGL)

View File

@@ -72,11 +72,9 @@ namespace fgl::renderer
.apiVersion = VK_API_VERSION_1_4,
};
inline static vk::InstanceCreateInfo s_create_info {
.pApplicationInfo = &s_app_info
};
inline static vk::InstanceCreateInfo s_create_info { .pApplicationInfo = &s_app_info };
Vulkan::Vulkan( const std::string_view app_name ) : m_ctx(), , m_instance( m_ctx, s_create_info )
Vulkan::Vulkan( const std::string_view app_name ) : m_ctx(), m_instance( m_ctx, s_create_info )
{}
Vulkan::~Vulkan()

View File

@@ -26,7 +26,8 @@ namespace fgl::renderer
FGL_DELETE_MOVE( Vulkan );
FGL_DELETE_COPY( Vulkan );
Vulkan();
Vulkan() = delete;
Vulkan( std::string_view app_name );
~Vulkan();
};