Remove Utility module and move its content to Core and TextRenderer modules
This commit is contained in:
committed by
Jérôme Leclercq
parent
965a00182c
commit
e64c2b036e
28
src/Nazara/Core/Buffer.cpp
Normal file
28
src/Nazara/Core/Buffer.cpp
Normal 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user