Files
NazaraEngine/include/Nazara/Utility/VertexMapper.hpp
Jérôme Leclercq 03e2801dbe Split engine to packages NazaraUtils and NZSL (#375)
* Move code to NazaraUtils and NZSL packages

* Reorder includes

* Tests: Remove glslang and spirv-tools deps

* Tests: Remove glslang init

* Remove NazaraUtils tests and fix Vector4Test

* Fix Linux compilation

* Update msys2-build.yml

* Fix assimp package

* Update xmake.lua

* Update xmake.lua

* Fix shader compilation on MinGW

* Final fixes

* The final fix 2: the fix strikes back!

* Disable cache on CI

* The return of the fix™️
2022-05-25 19:36:10 +02:00

43 lines
1.1 KiB
C++

// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// 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_UTILITY_VERTEXMAPPER_HPP
#define NAZARA_UTILITY_VERTEXMAPPER_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Utility/BufferMapper.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <Nazara/Utility/VertexBuffer.hpp>
#include <Nazara/Utils/SparsePtr.hpp>
namespace Nz
{
class SubMesh;
class NAZARA_UTILITY_API VertexMapper
{
public:
VertexMapper(SubMesh& subMesh);
VertexMapper(VertexBuffer& vertexBuffer);
~VertexMapper();
template<typename T> SparsePtr<T> GetComponentPtr(VertexComponent component, std::size_t componentIndex = 0);
inline const VertexBuffer* GetVertexBuffer() const;
inline UInt64 GetVertexCount() const;
template<typename T> bool HasComponentOfType(VertexComponent component) const;
void Unmap();
private:
BufferMapper<VertexBuffer> m_mapper;
};
}
#include <Nazara/Utility/VertexMapper.inl>
#endif // NAZARA_UTILITY_VERTEXMAPPER_HPP