Question

I'm using CEGUI 0.8.2. How can I load all resources from binary? I've created resource only dll containing all needed resources such as .ttf .font .schema .imageset .looknfeel and .png for imageset. I'm using Direct3D renderer and no graphics engine. I know how to load resources from files stored on hard drive, but I want to encapsulate some of these resources into a dll file. There are some methods in current api to load it from RawDataContainer.

e.g.

FontManager::getSingleton().createFromContainer(rawFont);

but this loads .font xml that referencing font.ttf, so how to load ALL resources from binary file? even .ttf and .png files?

Était-ce utile?

La solution

I've got an information from official cegui forum that only way how to do it, is to create custom resource provider by extending ResourceProvider class and implement loadRawDataContainer function. Then you have to initialize cegui system manually instead of calling bootstrapSystem function.

Manual initialization:

guiRenderer = &Direct3D11Renderer::create(device, context); 
if (System::getSingletonPtr()) CEGUI_THROW(InvalidRequestException("CEGUI::System object is already initialised.")); 
System::create(*guiRenderer, &ceguiResourceProvider); // inject custom resource provider
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top