Some organization cleanup

This commit is contained in:
2024-10-04 05:58:00 -04:00
parent 3f86e2ce1f
commit 0127b2dfeb
15 changed files with 19 additions and 17 deletions

View File

@@ -14,9 +14,9 @@
#include "KeyboardMovementController.hpp"
#include "camera/Camera.hpp"
#include "camera/CameraManager.hpp"
#include "engine/Average.hpp"
#include "engine/assets/TransferManager.hpp"
#include "engine/assets/model/builders/SceneBuilder.hpp"
#include "engine/assets/transfer/TransferManager.hpp"
#include "engine/math/Average.hpp"
#include "engine/math/literals/size.hpp"
namespace fgl::engine
@@ -56,6 +56,7 @@ namespace fgl::engine
void EngineContext::tickDeltaTime()
{
ZoneScoped;
// Get delta time
const auto now { fgl::clock::now() };
const std::chrono::duration< double, std::chrono::seconds::period > time_diff { now - last_tick };
@@ -67,6 +68,7 @@ namespace fgl::engine
void EngineContext::tickSimulation()
{
ZoneScoped;
// TODO: This is where we'll start doing physics stuff.
// The first step here should be culling things that aren't needed to be ticked.
// Perhaps implementing a tick system that doesn't care about the refresh rate might be good?
@@ -75,6 +77,7 @@ namespace fgl::engine
void EngineContext::renderCameras( FrameInfo frame_info )
{
ZoneScoped;
auto& camera_manager { CameraManager::getInstance() };
for ( auto& current_camera_ptr : camera_manager.getCameras() )
{
@@ -90,9 +93,9 @@ namespace fgl::engine
void EngineContext::renderFrame()
{
ZoneScoped;
if ( auto& command_buffer = m_renderer.beginFrame(); *command_buffer )
{
ZoneScopedN( "Render" );
const FrameIndex frame_index { m_renderer.getFrameIndex() };
const PresentIndex present_idx { m_renderer.getPresentIndex() };
@@ -181,8 +184,10 @@ namespace fgl::engine
{
memory::TransferManager::getInstance().submitNow();
ZoneScopedN( "Poll" );
glfwPollEvents();
{
ZoneScopedN( "Poll" );
glfwPollEvents();
}
const auto new_time { fgl::clock::now() };

View File

@@ -47,6 +47,7 @@ namespace fgl::engine
void Camera::updateInfo( const FrameIndex frame_index )
{
ZoneScoped;
CameraInfo current_camera_info { .projection = getProjectionMatrix(),
.view = getViewMatrix(),
.inverse_view = getInverseViewMatrix() };
@@ -68,6 +69,7 @@ namespace fgl::engine
void Camera::pass( FrameInfo& frame_info )
{
ZoneScopedN( "Camera::pass" );
if ( m_cold && m_swapchain )
{
//TODO: Make some way to destroy the swapchain in a deffered manner.

View File

@@ -129,6 +129,7 @@ namespace fgl::engine
void CameraRenderer::pass( FrameInfo& frame_info, CameraSwapchain& camera_swapchain )
{
ZoneScopedN( "CameraRenderer::pass" );
m_culling_system.startPass( frame_info );
auto& command_buffer { frame_info.command_buffer };

View File

@@ -1,7 +0,0 @@
//
// Created by kj16609 on 2/29/24.
//
#pragma once
#include "midpoint.hpp"

View File

@@ -4,7 +4,7 @@
#include "BufferVector.hpp"
#include "engine/assets/TransferManager.hpp"
#include "engine/assets/transfer/TransferManager.hpp"
#include "engine/memory/buffers/Buffer.hpp"
namespace fgl::engine::memory

View File

@@ -6,7 +6,7 @@
#include "BufferVector.hpp"
#include "concepts.hpp"
#include "engine/assets/TransferManager.hpp"
#include "engine/assets/transfer/TransferManager.hpp"
#include "engine/math/literals/size.hpp"
#include "engine/debug/logging/logging.hpp"

View File

@@ -7,7 +7,7 @@
#include <limits>
#include <stdexcept>
#include "engine/assets/TransferManager.hpp"
#include "engine/assets/transfer/TransferManager.hpp"
#include "engine/descriptors/DescriptorSet.hpp"
#include "pipelines/Attachment.hpp"
#include "renderpass/RenderPass.hpp"

View File

@@ -34,6 +34,7 @@ namespace fgl::engine
void GuiSystem::pass( FrameInfo& info )
{
ZoneScopedN( "GuiSystem::pass" );
auto& command_buffer { setupSystem( info ) };
command_buffer.draw( 3, 1, 0, 0 );

View File

@@ -49,9 +49,9 @@ namespace fgl::engine
void LineDrawer::pass( FrameInfo& info )
{
ZoneScopedN( "LineDrawer::pass" );
debug::drawAxisHelper();
ZoneScopedN( "Debug line drawing" );
auto& command_buffer { setupSystem( info ) };
TracyVkZone( info.tracy_ctx, *command_buffer, "Draw debug lines" );

View File

@@ -7,7 +7,7 @@
#include <initializer_list>
#include "engine/FrameInfo.hpp"
#include "engine/assets/TransferManager.hpp"
#include "engine/assets/transfer/TransferManager.hpp"
#include "engine/descriptors/DescriptorSet.hpp"
#include "engine/assets/image/Image.hpp"
#include "engine/assets/image/ImageView.hpp"