Remove Utility module and move its content to Core and TextRenderer modules

This commit is contained in:
SirLynix
2024-02-10 22:46:53 +01:00
committed by Jérôme Leclercq
parent 965a00182c
commit e64c2b036e
364 changed files with 2336 additions and 2516 deletions

View File

@@ -0,0 +1,28 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Core/Buffer.hpp>
#include <Nazara/Core/BufferMapper.hpp>
#include <stdexcept>
#include <vector>
#include <Nazara/Core/Debug.hpp>
namespace Nz
{
Buffer::~Buffer() = default;
std::shared_ptr<Buffer> Buffer::CopyContent(const BufferFactory& bufferFactory)
{
if (GetUsageFlags() & BufferUsage::DirectMapping)
{
BufferMapper<Buffer> mapper(*this, 0, GetSize());
return bufferFactory(GetType(), GetSize(), GetUsageFlags(), mapper.GetPointer());
}
else
{
// TODO: Implement GPU to CPU
throw std::runtime_error("buffer is not mappable: not implemented");
}
}
}