1
0
Fork 0

Font: rename Driver stuff to Engine and move subdirectory

This commit is contained in:
Henrik Hautakoski 2020-01-05 23:29:43 +01:00
parent 8b96338e24
commit 5c4eea4ae1
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
11 changed files with 57 additions and 57 deletions

View file

@ -5,27 +5,27 @@
#include <Spectre/Graphics/Image.h>
#include <Spectre/Graphics/Texture.h>
#include <Spectre/Math/Math.h>
#include "Font/FreeTypeDriver.h"
#include "Font/Engine/FreeTypeEngine.h"
namespace sp {
Font::Font() :
m_driver (new FreeTypeDriver())
m_engine (new FreeTypeEngine())
{
}
Font::~Font()
{
delete m_driver;
delete m_engine;
}
bool Font::loadFromFile(const std::string& filename)
{
if (!m_driver->loadFromFile(filename)) {
if (!m_engine->loadFromFile(filename)) {
return false;
}
if (!m_driver->setCharacterSize(22)) {
if (!m_engine->setCharacterSize(22)) {
return false;
}
@ -56,11 +56,11 @@ void Font::loadChar(unsigned char code) const
Image img;
Font::Glyph glyph;
if (!m_driver) {
if (!m_engine) {
return;
}
glyph = m_driver->loadGlyph(code, img);
glyph = m_engine->loadGlyph(code, img);
if (glyph.size > vec2b(0, 0)) {