I made this library to allow you to use any .net language capable of producing a dll to program DarkGDK with.
The program works by having a generic executable, written in unmanaged C++ and using DarkGDK, which then runs a managed dll, which provides your class library with functions to call any DarkGDK command.
According to this thread:
http://forum.thegamecreators.com/?m=forum_view&t=127379&b=22
I am allowed to distribute this, as long as all code using DarkGDK is in source code only, with no compiled programs, which means that you must download DarkGDK and agree to the DarkGDK license before you can compile and use this library.
Required software/libraries:
Microsoft Visual C++ (any edition, 2005 or above)
[Any .net programming language capable of producing dlls]
SlimDX
DarkGDK
DirectX SDK August 2007
To start, open the file 'DarkManagerDarkManager.sln', and choose build. If DarkGDK is installed correctly, it will build and copy its output to 'ExampleGDKProgram.exe'. Double clicking this will run the example application (which should draw random lines).
To see and edit the code for the example application, open 'ExampleGDKProgramExampleGDKProgram.sln'.
To setup a new project to use this library, create a class library, and then add a reference to 'ManagedWrapper.dll'.
Add a class to your class library which inherits from 'DarkManager.DarkGDKProgram', and implement the Run method. This is where all your code goes.
Copy the executable file 'ExampleGDKProgram.exe' to your project's output directory, and rename it so that it has the same name as the dll file which your project creates.
The 'ManagedWrapper.dll' file should also be in that folder.
To start your program, just run the executable.
All DarkGDK commands can be accessed using the same name, but with a . after the 'db'.
eg.
db.Sync()
Here is some example C# code:
using DarkManager;
namespace MyDarkGDKProgram
{
public class Program : DarkGDKProgram
{
public override void Run()
{
while (db.LoopGDK())
{
db.Line(db.Rnd(db.ScreenWidth()), db.Rnd(db.ScreenHeight()), db.Rnd(db.ScreenWidth()), db.Rnd(db.ScreenHeight()));
db.Sync();
}
}
}
}
Before distributing your complete application you should add code to the C++ executable to get a hash of the your dll, and compare it against the known hash, so that other people can't use the DarkGDK library without downloading and compiling it, and agreeing to its license.
There are plenty of C++ libraries to do this for you, free on the internet, but I will try to provide an example soon