Files
SDLPongCPP/.svn/pristine/74/74c3382f797d9533e208771c7c2c2b43096c675a.svn-base
T
2018-06-25 21:48:45 -04:00

86 lines
1.4 KiB
Plaintext

#include "cTextType.hpp"
/*** Custom Header Files ***/
#include "../UtilityEngine/cUtility.hpp"
using TextTypeEngine::cTextType;
using UtilityEngine::cUtility;
/*static*/ cTextType* cTextType::sp_inst = nullptr;
//private
cTextType::cTextType()
{
}
cTextType::~cTextType()
{
CleanUp();
TTF_Quit();
}
//public:
///Functions
/*static*/ cTextType& cTextType::Inst()
{
if (sp_inst == nullptr)
sp_inst = new cTextType();
return *sp_inst;
}
/*static*/ void cTextType::Delete()
{
delete sp_inst;
sp_inst = nullptr;
}
const bool cTextType::Initialize() const
{
bool rtn = IsInit();
if (rtn == false) {
if (TTF_Init() == 0) {
cUtility::Inst().Message("True Type Font Initialized.");
rtn = true;
} else
cUtility::Inst().Message("Could not initialize True Type Font. TTF_Init():", __AT__, cUtility::eTypeSDL::TTF);
}
return rtn;
}
/* Creates the cTextType's*/
const bool cTextType::Setup()
{
/*bool rtn = false;
CleanUp();
rtn = Init();
return rtn;*/
return true;
}
void cTextType::CleanUp()
{
}
void cTextType::PrintVersion() const
{
cUtility::Inst().PrintVersion(cUtility::eTypeSDL::TTF);
}
///Sets
///Gets
const bool cTextType::IsInit() const
{
bool rtn = false;
if (TTF_WasInit() != 0) {
cUtility::Inst().Message("True Type Font is initialized.");
rtn = true;
} else
cUtility::Inst().Message("True Type Font is not initialized.");
return rtn;
}