starting the System with my own ScriptModule
Posted: Tue Jun 28, 2005 00:11
Hello,
I have written a ScriptModule which provides no functionality. It is just enough to compile. I am specifying it when initializing the System singleton along with the renderer. I don't know what effect this has on the System, but it is causing a crash during initialization now. The crash occurs during initialization of the System, however an exception is throw from CEGUIDefaultResourceProvider.cpp. Here is that code:
I was expecting my new usage of the ScriptModule to not be so intrusive. Is this a poor assumption? If I don't specify the ScriptModule, and the only constructor argument is the renderer, it runs fine. Here is how I initialize the System:
and here is my ?harmless? ScriptModule:
By the way, once I can get the System intialized without crashing, which of the virtual function(s) should I implement to handle (xml defined) Event tags, given a known 'registry' of application callbacks?
Thanks, -granx
I have written a ScriptModule which provides no functionality. It is just enough to compile. I am specifying it when initializing the System singleton along with the renderer. I don't know what effect this has on the System, but it is causing a crash during initialization now. The crash occurs during initialization of the System, however an exception is throw from CEGUIDefaultResourceProvider.cpp. Here is that code:
Code: Select all
void DefaultResourceProvider::loadRawDataContainer(...)
{
...
std::ifstream dataFile(filename.c_str(), std::ios::binary|std::ios::ate);
if( dataFile.fail())
{
throw InvalidRequestException((utf8*) "DefaultResourceProvider::load - " + filename + " does not exist");
}
I was expecting my new usage of the ScriptModule to not be so intrusive. Is this a poor assumption? If I don't specify the ScriptModule, and the only constructor argument is the renderer, it runs fine. Here is how I initialize the System:
Code: Select all
new CEGUI::System(new CEGUI::OpenGLRenderer(0), _script);
and here is my ?harmless? ScriptModule:
Code: Select all
///\todo improve this.
class ScriptModule : public CEGUI::ScriptModule
{
public:
ScriptModule(Application* a): _app(a)
{
}
virtual ~ScriptModule()
{
}
virtual void executeScriptFile(const CEGUI::String& filename, const CEGUI::String& resourceGroup = "")
{
}
virtual int executeScriptGlobal(const CEGUI::String& function_name)
{
return 0;
}
virtual bool executeScriptedEventHandler(const CEGUI::String& handler_name, const CEGUI::EventArgs& e)
{
return false;
}
virtual void executeString(const CEGUI::String& str)
{
}
private:
ScriptModule(); // not implemented by design
Application* _app;
};
By the way, once I can get the System intialized without crashing, which of the virtual function(s) should I implement to handle (xml defined) Event tags, given a known 'registry' of application callbacks?
Thanks, -granx