Projects and Structure


Plugin Header File
You will probably want to create one header file for your plugin that will be included by all source files. This header file should define any appropriate symbols and then include messiah_main.h (see messiah_main.h for more information). This is also where you will want to add all of your global variables and functions as well as any typedefs you'll be using. The name of this file will typically be YourPluginName.h.
Main Plugin File
This file, typically called PluginMain.c will contain your plugin's messiahEntry() and messiahExit() functions. Like all of the source files in your project, this one will include YourPluginName.h. Prior to including that file however you will need to define _MAINPLUGIN_FILE indicating that this is the Main Plugin File. The main (pun intended) consequence of this is that all of the Component function pointers will be declared in this file. In all other files they will be declared as extern.
Your plugin's Main Plugin File must be a C language file, the rest of your plugin may be written in C++.
Code Files
The remaining files are related to the individual modules that your plugin defines. Typically this will be one file per module and will be called NameModuleType.c where ModuleType is replaced with the actual type of your module (e.g. MathShader.c).
You may also want to partition each module's code into several files, perhaps one that contains the access_func() and one for each supporting entry_func(). These are all just suggestions of course, you are free to partition your code however you see fit.
Includes
One of your code files must define the symbol _MAINPLUGIN_FILE prior to including messiah_main.h, which is the only header that you will include directly. Our suggestion is that you define this symbol in, that's right, the Main Plugin File (PluginMain.c). You also need to make sure to have included all of the headers for all of the components that you are using. This is done indirectly by defining certain symbols prior to including messiah_main.h. You can simply include headers for all components by defining the symbol _MESSIAH_FULL_API, or you can include selectively by defining the symbol _MESSIAH_API_COMPONENT where COMPONENT is replaced with the component's name. The headers that you request should match the components you request in your messiahEntry() function to avoid compiler errors. Note that some components are dependant on others, for example is dependant upon ARG, however you only need to define _MESSIAH_API_FUNCTION
Linking
You do not need to link to any messiah libraries, in fact there are none for you to link to. So there.
Template Files
For your convienence we have provided several "template" files that contain skeleton code for messiah modules. You will need to copy and rename the files, then un-comment the parts of the code you wish to use. There are also a few strings that you will want to replace with your own (such as your module's name). These template files are located in SDK/TemplateFiles. For an example of using these files to build a project see the Simple Bones Tutorial.
Directory Structure
DirectoryStructure.gif
It is recommended that you create your projects in the SDK directory, this way you can easily move a project to a newer version of messiah. In the image above you would set your include path to "../include/" to find the API headers. You would also set your build path to "../../plugins/".


© 2003 pmG WorldWide, LLC.


www.projectmessiah.com

groups.yahoo.com/pmGmessiah

Last Updated on Thu Jul 10 04:49:37 2003