本文整理汇总了C++中FontMap::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ FontMap::begin方法的具体用法?C++ FontMap::begin怎么用?C++ FontMap::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontMap
的用法示例。
在下文中一共展示了FontMap::begin方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReloadFonts
/**
** Reload OpenGL fonts
*/
void ReloadFonts()
{
for (FontMap::iterator it = Fonts.begin(); it != Fonts.end(); ++it) {
CFont &font = *it->second;
font.Reload();
}
}
示例2: FreeOpenGLFonts
/**
** Free OpenGL fonts
*/
void FreeOpenGLFonts()
{
for (FontMap::iterator it = Fonts.begin(); it != Fonts.end(); ++it) {
CFont &font = *it->second;
font.FreeOpenGL();
}
}
示例3: LoadFonts
/**
** Load all fonts.
*/
void LoadFonts()
{
for (FontMap::iterator it = Fonts.begin(); it != Fonts.end(); ++it) {
CFont &font = *it->second;
font.Load();
}
// TODO: remove this
SmallFont = CFont::Get("small");
GameFont = CFont::Get("game");
}
示例4: CleanFonts
/**
** Clean up the font module.
*/
void CleanFonts()
{
for (FontMap::iterator it = Fonts.begin(); it != Fonts.end(); ++it) {
CFont *font = it->second;
font->Clean();
delete font;
}
if (UseOpenGL) {
FontColorGraphics.clear();
}
Fonts.clear();
for (FontColorMap::iterator it = FontColors.begin(); it != FontColors.end(); ++it) {
delete it->second;
}
FontColors.clear();
SmallFont = NULL;
GameFont = NULL;
}
示例5: CleanFonts
/**
** Clean up the font module.
*/
void CleanFonts()
{
for (FontMap::iterator it = Fonts.begin(); it != Fonts.end(); ++it) {
CFont *font = it->second;
font->Clean();
delete font;
}
#if defined(USE_OPENGL) || defined(USE_GLES)
if (UseOpenGL) {
FontColorGraphics.clear();
}
#endif
Fonts.clear();
for (FontColorMap::iterator it = FontColors.begin(); it != FontColors.end(); ++it) {
delete it->second;
}
FontColors.clear();
SmallFont = nullptr;
GameFont = nullptr;
}
示例6: info
Font *Font::Create(TextFormat &inFormat,double inScale,GlyphRotation inRotation,bool inNative,bool inInitRef)
{
FontInfo info(inFormat,inScale,inRotation,inNative);
Font *font = 0;
FontMap::iterator fit = sgFontMap.find(info);
if (fit!=sgFontMap.end())
{
font = fit->second;
if (inInitRef)
font->IncRef();
return font;
}
FontFace *face = 0;
AutoGCRoot *bytes = 0;
FontBytesMap::iterator fbit = sgRegisteredFonts.find(WideToUTF8(inFormat.font).c_str());
if (fbit!=sgRegisteredFonts.end())
{
bytes = fbit->second;
}
if (bytes != NULL)
face = FontFace::CreateFreeType(inFormat,inScale,bytes);
if (!face)
face = FontFace::CreateCFFIFont(inFormat,inScale);
if (!face && inNative)
face = FontFace::CreateNative(inFormat,inScale);
if (!face)
face = FontFace::CreateFreeType(inFormat,inScale,NULL);
if (!face && !inNative)
face = FontFace::CreateNative(inFormat,inScale);
if (!face)
return 0;
font = new Font(face,info.height,inRotation,inInitRef);
// Store for Ron ...
font->IncRef();
sgFontMap[info] = font;
// Clear out any old fonts
for (FontMap::iterator fit = sgFontMap.begin(); fit!=sgFontMap.end();)
{
if (fit->second->GetRefCount()==1)
{
fit->second->DecRef();
FontMap::iterator next = fit;
next++;
sgFontMap.erase(fit);
fit = next;
}
else
++fit;
}
return font;
}