//Header of dllmain.cpp see it for details
#ifndef _DLL_H_
#define _DLL_H_
//this definition is very important cause each exported function is called by DeleD
//with a stdcall and you must use extern "C" cause each function is called by its name
//and the simplest way to export non decorated names is to use this definition
#define DLLEXPORT extern "C" __stdcall __declspec (dllexport)
// plugin reasons have replaced plugin types
#define PR_GETINSTALLDIR 0 //used to get DeleD installation directory
#define PR_GETMEM 1 //used to know how long is the string I want to obtain from DeleD,
//or better how much memory I need to allocate for getting data
#define PR_GETDATA 2 //used to retrieve data from DeleD
#define PR_SETDATA 3 //used to pass data to DeleD
// header items are passed to know what kind of data you want to use
#define HI_SCENEPROPERTIES 0 //used for setting or getting scene properties
#define HI_OBJECTS 1 //used for setting or getting all objects
#define HI_LIGHTS 2 //used for setting or getting all lights
#define HI_MATERIALS 3 //used for setting or getting materials
#define HI_SELECTEDOBJECTS 10 //used for setting or getting only selected objects
#define HI_SELECTEDLIGHTS 11 //used for setting or getting only selected lights
#define HI_SELECTEDMATERIALS 12 //used for setting or getting only selected materials
// plugin errors returned by callback function
#define PE_NOERROR 0 // no errors in callback
#define PE_NODATA 1 // no data to set or get
#define PE_INVALIDVERSION 2 // invalid version
#define PE_INVALIDMEM 3 // invalid memory size
#define PE_INVALIDGET 4 // invalid get operation
#define PE_INVALIDSET 5 // invalid set operation
#define PE_INVALIDHEADER 6 // invalid header
#define PE_INVALIDDATASTRING 7 // invalid data string
#define PE_INVALIDDATAPROPERTY 8 // invalid data property
#define PE_OBJECTDATA 11 // invalid object data
#define PE_LIGHTDATA 12 // invalid light data
#define PE_MATERIALDATA 13 // invalid material data
#define PE_UNKNOWNREASON 98 // callback reason unknown
#define PE_UNKNOWNERROR 99 // unknown error
struct TCbData{ // callback data passed back to application (DeleD)
unsigned Reason; // reason for callback
char *Data; // data to get or set
unsigned DataSize; // size of Data
};
//this a standard definition for callback routine
typedef TCbData * PCbData ; // this is a pointer to callback data
typedef unsigned __stdcall (*TCallBack)(PCbData); // callback function prototype
// passes a pointer to TCbData
//pointer to TCallBack
TCallBack *PCallBack;
#endif /* _DLL_H_ */