Crystal Space
Welcome, Guest. Please login or register.
April 18, 2014, 12:12:39 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7595 Members
Latest Member: Rejestruj1989
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  some problems about how to create my own plugin?
« previous next »
Pages: [1] Print
Author Topic: some problems about how to create my own plugin?  (Read 1437 times)
Jr. Member
**
Posts: 81


View Profile Email
« on: December 04, 2008, 09:14:37 am »

     Hello, ereybody, i am new in cs. I have some problems about how to create my own plugin.
Logged
Jr. Member
**
Posts: 81


View Profile Email
« 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!!
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.15 seconds with 16 queries.