1. You can't use DarkGDK from a plugin, but you can use DBPro commands. Download this program:
http://www.nirsoft.net/utils/dll_export_viewer.html
Open the dlls in the "dbpro/Compiler/plugins/" folder with it, and it will list all the commands you can use from each dll. Make sure the program is showing the decorated function names (the names should have seemingly random symbols on the end, and may begin with a ? symbol)
Once you've found the command you want to use, look at which dll it is from.
To get a handle to the dll:
HANDLE handle = GetModuleHandle("name.dll")
Now for each function in the dll, use a variation of this code:
typedef int (*function_t)(int, float);
function_t function_ptr = (function_t)GetProcAddress(handle, "decorated name");
The typedef makes the code easier to read, but this is equivalent:
int (*function_ptr)(int, float) = (int (*)(int, float))GetProcAddress(handle, "decorated name");
You should change the typedef or equivalent code to use the same return value and parameter types as the command you want to call. After this code you can call the function simply by doing:
int result = function_ptr(10, 20.0f);
Remember that all the rules you follow when making a plugin (ie. hidden first parameter when returning a string, casting floats to dwords, etc.) are all followed by the built in commands as well, so make sure you take them into account.
For the hidden first parameter it should be safe to pass in NULL every time. To cast dword results back into floats, use something like this:
DWORD result = function_ptr();
float result2 = *(float*)&result;
Also, remember that if you use a command from (for example) the Basic2D dll, that dll must be included in the final DBPro exe. The user can do this by using a command from that dll, or you can tell the compiler to do it using two functions:
const char* Dependencies[] =
{
"DBProBasic2DDebug.dll"
};
__declspec ( dllexport ) int GetNumDependencies( void )
{
return sizeof(Dependencies) / sizeof(const char*);
}
__declspec ( dllexport ) char const* GetDependencyID(int ID)
{
return Dependencies[ID];
}
You can use this code directly and just add any dependencies to the array initialiser.
2. Some data is stored in the globstruct (include the header file found at "dbpro\Help\documents\Files\DBO Loader\globstruct.h") A pointer to this struct is passed to a function with the prototype "__declspec ( dllexport ) void ReceiveCoreDataPtr(void* ptr)" if one exists in your plugin.
Other data can be accessed by using functions in the dbpro dlls as shown for part 1, many of which are not accessible as dbpro commands.
The sprite dll doesn't give much access to its internals though.
[b]