Separated atlases from Font class
First use of shared_ptr, yay! Former-commit-id: 4c22341fba5674746d5299cf0e8dbf6dc31d5362
This commit is contained in:
40
include/Nazara/Utility/AbstractFontAtlas.hpp
Normal file
40
include/Nazara/Utility/AbstractFontAtlas.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2015 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_ABSTRACTFONTATLAS_HPP
|
||||
#define NAZARA_ABSTRACTFONTATLAS_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/SparsePtr.hpp>
|
||||
#include <Nazara/Math/Rect.hpp>
|
||||
#include <set>
|
||||
|
||||
class NzAbstractImage;
|
||||
class NzFont;
|
||||
class NzImage;
|
||||
|
||||
class NAZARA_API NzAbstractFontAtlas
|
||||
{
|
||||
public:
|
||||
NzAbstractFontAtlas() = default;
|
||||
virtual ~NzAbstractFontAtlas();
|
||||
|
||||
virtual void Clear() = 0;
|
||||
virtual void Free(NzSparsePtr<const NzRectui> rects, NzSparsePtr<unsigned int> layers, unsigned int count) = 0;
|
||||
virtual NzAbstractImage* GetLayer(unsigned int layerIndex) const = 0;
|
||||
virtual unsigned int GetLayerCount() const = 0;
|
||||
virtual bool Insert(const NzImage& image, NzRectui* rect, bool* flipped, unsigned int* layerIndex) = 0;
|
||||
void RegisterFont(NzFont* font);
|
||||
void UnregisterFont(NzFont* font);
|
||||
|
||||
protected:
|
||||
void NotifyCleared();
|
||||
|
||||
private:
|
||||
std::set<NzFont*> m_registredFonts;
|
||||
};
|
||||
|
||||
#endif // NAZARA_ABSTRACTFONTATLAS_HPP
|
||||
Reference in New Issue
Block a user