|
|
 |
« Reply #1 on: December 04, 2008, 09:27:13 am » |
|
In CS manual, it told us how to create our own plugin. I followed its steps , and used the code to create a plugin, it name is "myplugin" as the manual told me, then i use the new plugin in one of the cs' tutorial —— simple1 (the application i have run successfully before, and the way to use the plugin ,I also followed the manual strickly.) But when i run "simple1" again( which have add the using of the new plugin ) , it told me that I can't load the plugin ,i don't know why?!
the part of the code is followed:
bool Simple::OnInitialize(int /*argc*/, char* /*argv*/ []) { if (!csInitializer::RequestPlugins(GetObjectRegistry(), CS_REQUEST_VFS, CS_REQUEST_OPENGL3D, CS_REQUEST_ENGINE, CS_REQUEST_FONTSERVER, CS_REQUEST_IMAGELOADER, CS_REQUEST_LEVELLOADER, CS_REQUEST_REPORTER, CS_REQUEST_PLUGIN("crystalspace.mygame.plugin", iMyApi), CS_REQUEST_REPORTERLISTENER, CS_REQUEST_END)) return ReportError("Failed to initialize plugins!");
………… }
bool Simple::SetupModules () { csRef<iMyApi> my = csQueryRegistry<iMyApi> (object_reg); if (!my) return ReportError("Failed to locate iMyApi!"); my->DoSomething (1, csVector3 (2, 3, 4)); printf ("%d\n", my->GetSomething ()); ………… }
Please help me !! Thank you!!
|