void GameInit() { sysfont = glictCreateFont("system"); #if (!defined(WINFONT) && !defined(BMPFONT)) #ifndef USEGLUT #error If you dont use GLUT, you need to use either WINFONT or BMPFONT #else sysfont->SetFontParam(GLUT_STROKE_MONO_ROMAN); sysfont->SetRenderFunc(glutxStrokeString); sysfont->SetSizeFunc(glutxStrokeSize); #endif #elif defined(BMPFONT) sysfont->SetFontParam(fonttexture = BMPFontCreate("fontbordered.bmp", 8)); sysfont->SetRenderFunc(BMPFontDraw); sysfont->SetSizeFunc(BMPFontSize); #else // winfont is defined //sysfont->SetFontParam(WinFontCreate("Arial", WINFONT_BOLD, 7)); sysfont->SetFontParam(WinFontCreate("Tahoma", 0 , 7)); sysfont->SetRenderFunc(WinFontDraw); sysfont->SetSizeFunc(WinFontSize); #endif ObjSprInit(); GameModeInit(); if (!sprplayground) if (options.intro) GameModeEnter(GM_LOGO); else GameModeEnter(GM_MAINMENU); else GameModeEnter(GM_SPRPLAYGROUND); }
void Engine::initFont(glictFont **fnt, const char *fontname) { *fnt = glictCreateFont(fontname); if(!*fnt){ std::stringstream s; s << "Cannot load font '" << fontname << "'."; NativeGUIError(s.str().c_str(), "Error loading font"); } (*fnt)->SetRenderFunc(Engine::font_render); (*fnt)->SetSizeFunc(Engine::font_size); #if (GLICT_APIREV >= 85) (*fnt)->SetColorFunc(Engine::font_color); #else #warning GLICT font coloring is not available. Upgrade to GLICT APIREV 85+. #endif }