#### Archived

This topic is now archived and is closed to further replies.

# ANWTH : Interface based plug-in systems Part 2

This topic is 5318 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

#define MAKESTRID(ch0, ch1, ch2, ch3)                       \
((ulong)(byte)(ch0) | ((ulong)(byte)(ch1) << 8) |   \
((ulong)(byte)(ch2) << 16) | ((ulong)(byte)(ch3) << 24 )) 
NOTE : ulong is my own abbreviation of unsigned long. To create an identifier I simply do :
ulong uMyID = MAKESTRID(''M'', ''y'', ''I'', ''D'');
uMyID then contains a value corresponding to the value I set by the MAKESTRID. 2.1.2 The type definition An important second entry in our information structure is the type of module we have loaded. This can but doesn''t have to be split into 2 parts : a major type and a sub type. A major type could be an animation system, a file system, a 2D module, a 3D module, etc. A minor type could be an animation controller, a cab file loader, a graphic file format or an 3d material. I like the idea of having a major and a sub type because that allows me quickly skip modules I don''t want. Basically this entries are enums like this :
enum PLUGIN_TYPE
{
PT_2D = 0,
PT_3D,
PT_Anim,
...
};

enum PLUGIN_SUBTYPE
{
PST_ANIM_CONTROL_QUAT_ROTATION,
...
} 
2.1.3 The code type. This can be a very important information, too. An entry that tells me of which type the DLL is : Retail or Debug. This would give the possibility to tell the system that handles the plug-in : "Ok, just hand me all retail compiled plug-ins" or "Give me the debug plug-ins only. I want to debug..." The code type itself can be an enum :
enum PLUGIN_CODETYPE
{
PT_CT_DEBUG = 0,
PT_CT_RELEASE,
PT_CT_UNKNOWN
}; 
struct SPlugInDesc
{
ulong			uID;
PLUGIN_TYPE		uType;
PLUGIN_SUBTYPE	uSubType;
PLUGIN_CODETYPE uCodeType;

const char*		pAuthor;
const char*		pName;
const char*		pShortDesc;
const char*		pLongDesc;
ulong			uVersion;
}; 
This structure should help you to recognize your plug-in. I hope that there were some interesting things for you in here. The next part of this ANWTH lecture is given on monday since I have quite some stuff to do this week-end. Don''t forget : Reply to this thread if you have any suggestion or something to point out. Metron

• 11
• 10
• 9
• 48
• 12
• ### Forum Statistics

• Total Topics
631388
• Total Posts
2999718
×