Yes I have arial.ttf in the same directory as .exe. I even tried full path to it but it still crashes.
I included irrUString.h in CGUIFont.h.
This is full striped code:
Code: Select all
#include <iostream>
#include <irrlicht.h>
#include "CGUITTFont.h"
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main()
{
IrrlichtDevice* device = createDevice( EDT_OPENGL, dimension2d<u32>(640, 480), 32, false, false, false, NULL);
device->setWindowCaption(L"True type test");
IVideoDriver* driver = device->getVideoDriver();
IGUIEnvironment* env = device->getGUIEnvironment();
CGUITTFont* tt_font = CGUITTFont::createTTFont(env, "arial.ttf", 20, false, false);
gui::IGUISkin* skin = env->getSkin();
skin->setFont(tt_font);
while( device->run() && driver)
{
driver->beginScene(true, true, video::SColor(255, 0xBB,0xBB,0xBB));
tt_font->draw( L"Simple font test!", rect<s32>( 0, 0,100, 100), SColor( 0, 50, 50, 50), false, false,0);
driver->endScene();
}
tt_font->drop();
driver->drop();
return 0;
}
I'm very new to Irrlicht so it's possible that I forgot something, or that I striped out a little too much
.