 |
Gorgon Game Engine
|
Go to the documentation of this file.
5 #include "../Graphics/Font.h"
6 #include "../Utils/Assert.h"
8 namespace Gorgon {
namespace Resource {
38 virtual void Prepare()
override;
40 virtual void Discard()
override;
44 return data !=
nullptr;
84 static Font *
LoadResource(std::weak_ptr<File> file, std::shared_ptr<Reader> reader,
unsigned long size);
constexpr Type File
File.
Definition: GID.h:84
void save(Writer &writer) const override
Definition: Font.cpp:41
virtual GID::Type GetGID() const override
This function shall return Gorgon ID of this resource.
Definition: Font.h:34
void SetRenderer(Graphics::GlyphRenderer &renderer)
Changes the renderer to the given renderer.
Definition: Font.cpp:14
constexpr Type Font
Definition: GID.h:199
Should be implemented by the systems aimed to render fonts on the screen.
Definition: Font.h:67
Graphics::GlyphRenderer * data
Definition: Font.h:89
Graphics::GlyphRenderer & Release()
Releases the renderer.
Definition: Font.h:75
virtual void Discard() override
This function shall discard any transitional data which is not vital after Prepare function is issued...
Definition: Font.cpp:252
virtual void Prepare() override
This function will only prepare images loaded from a resource, does not work for images loaded later.
Definition: Font.cpp:245
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
void RemoveRenderer()
Removes the renderer from this resource.
Definition: Font.h:55
bool isowner
Definition: Font.h:93
#define ASSERT(expression, message,...)
Replaces regular assert to allow messages and backtrace.
Definition: Assert.h:161
Collection is a container for reference typed objects.
Definition: Collection.h:21
Font(const Font &)=delete
static Font * LoadResource(std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long size)
This function loads a bitmap font resource from the given file.
Definition: Font.cpp:116
This class is the base for all Gorgon Resources.
Definition: Base.h:20
This class allows resource objects to save their data to a stream.
Definition: Writer.h:59
Containers::Collection< Image > tobeprepared
Definition: Font.h:91
virtual ~Font()
Definition: Font.h:20
bool HasRenderer() const
Returns true if the resource has renderer.
Definition: Font.h:43
Type to store GID information.
Definition: GID.h:23
Graphics::GlyphRenderer & GetRenderer() const
Returns the renderer stored in this resource.
Definition: Font.h:48
Font resource.
Definition: Font.h:16
Font()
Definition: Font.h:18
void AssumeRenderer(Graphics::GlyphRenderer &renderer)
Changes the renderer to the given renderer and assumes ownership.
Definition: Font.h:66