// Copyright (C) 2020 Jérôme Leclercq // This file is part of the "Nazara Engine - Utility module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_SOFTWAREBUFFER_HPP #define NAZARA_SOFTWAREBUFFER_HPP #include #include #include namespace Nz { class Buffer; class NAZARA_UTILITY_API SoftwareBuffer : public AbstractBuffer { public: SoftwareBuffer(Buffer* parent, BufferType type); ~SoftwareBuffer() = default; bool Fill(const void* data, UInt64 offset, UInt64 size) override; bool Initialize(UInt64 size, BufferUsageFlags usage) override; const UInt8* GetData() const; UInt64 GetSize() const; DataStorage GetStorage() const override; void* Map(BufferAccess access, UInt64 offset = 0, UInt64 size = 0) override; bool Unmap() override; private: std::vector m_buffer; bool m_mapped; }; } #endif // NAZARA_SOFTWAREBUFFER_HPP