begenning the refactor

This commit is contained in:
Kbz-8
2024-03-27 23:03:54 +01:00
parent b5983ac24b
commit 0e04356ea7
131 changed files with 2135 additions and 1192 deletions

View File

@@ -0,0 +1,42 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cmd_manager.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/02 17:50:52 by maldavid #+# #+# */
/* Updated: 2024/03/25 19:01:30 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
#include <pre_compiled.h>
#include <renderer/command/cmd_manager.h>
namespace mlx
{
void CmdManager::init() noexcept
{
_cmd_pool.init();
for(int i = 0; i < MAX_FRAMES_IN_FLIGHT; i++)
_cmd_buffers[i].init(CmdBuffer::kind::long_time, this);
}
void CmdManager::beginRecord(int active_image_index)
{
_cmd_buffers[active_image_index].beginRecord();
}
void CmdManager::endRecord(int active_image_index)
{
_cmd_buffers[active_image_index].endRecord();
}
void CmdManager::destroy() noexcept
{
for(int i = 0; i < MAX_FRAMES_IN_FLIGHT; i++)
_cmd_buffers[i].destroy();
_cmd_pool.destroy();
}
}