Files
NazaraEngine/include/Nazara/Graphics/TextureSamplerCache.hpp
SirLynix 5130a2ff84 Remove Config.hpp options and refactor headers
- Rename Config.hpp to Export.hpp
- Remove Debug.hpp and DebugOff.hpp (not used anymore)
2024-02-19 15:11:34 +01:00

41 lines
1.2 KiB
C++

// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Export.hpp
#pragma once
#ifndef NAZARA_GRAPHICS_TEXTURESAMPLERCACHE_HPP
#define NAZARA_GRAPHICS_TEXTURESAMPLERCACHE_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Graphics/Export.hpp>
#include <Nazara/Renderer/TextureSampler.hpp>
#include <unordered_map>
namespace Nz
{
class RenderDevice;
class NAZARA_GRAPHICS_API TextureSamplerCache
{
public:
inline TextureSamplerCache(std::shared_ptr<RenderDevice> device);
TextureSamplerCache(const TextureSamplerCache&) = delete;
TextureSamplerCache(TextureSamplerCache&&) = delete;
~TextureSamplerCache() = default;
const std::shared_ptr<TextureSampler>& Get(const TextureSamplerInfo& info);
TextureSamplerCache& operator=(const TextureSamplerCache&) = delete;
TextureSamplerCache& operator=(TextureSamplerCache&&) = delete;
private:
std::shared_ptr<RenderDevice> m_device;
std::unordered_map<TextureSamplerInfo, std::shared_ptr<TextureSampler>> m_samplers;
};
}
#include <Nazara/Graphics/TextureSamplerCache.inl>
#endif // NAZARA_GRAPHICS_TEXTURESAMPLERCACHE_HPP