DarkGDK.Net

From Wikipedia, the free encyclopedia

DarkGDK.Net is one of the options available for game developers who want to leverage their .NET skills for game development. It is supported from both VB.NET and C#, and is based on the DarkBASIC game engine. This product wraps the DarkBASIC engine with COM interop assemblies to make it simple to access the methods from such object oriented languages, and is itself based on the DarkGDK package that exposes these methods to C++ developers. Despite bringing these methods into this object-oriented domain, the process for using them retains a procedural approach that DarkBASIC users would find familiar. This is an easy to understand approach that definitely is worth consideration for less experienced game developers, whilst the engine provides many advanced features that may tempt experienced developers also.

Contents

[edit] Documentation

The documentation provided with the purchased product clearly and accurately describes how to install the libraries and to create an application that references them, both from Visual Studio and from #develop (SharpDevelop). It also provides various samples demonstrating how to use features of the API. The documentation currently (as of 3rd June 2008, within the current available release of DarkGDK.Net) contains little more than this setup information, a complete API tree (Standard HTML Help File output), and then a paragraph or two describing each method's intention, but notably (at least mostly) without sample code. The detail provided in these files is significantly less than is available for various other game development API's (such as XNA and DirectX, or even DarkBASIC), but between the samples and the many DarkBASIC source code resources available it quickly becomes possible to build a working game.

[edit] Sample Code

[edit] C#

class cGame : CDarkGDK
{
  InitDarkGDK(""); // NB: This must be amended to pass the assembley signature reference generated with the Authenicator tool

  oDBCore.SyncOn();
  oDBCore.SyncRate(0);

  oDBImage.LoadImage( "image.bmp", 1 );

  while( oDBP.LoopGDK )
  {
    if( oDBInput.EscapeKey()==1 )
      break;

    // Should add Game Loop code here

    oDBCore.Sync();
  }
}

[edit] VB.Net

Module Main
  Dim oDarkGDK As New CDarkGDK("AuthenticationCodeShouldGoHere...");  // NB: Replace this string with the code from the Authenicator tool

  Public Sub Main()
    oDBDisplay.SetDisplayMode(800, 600, 32)
    oCore.SyncOn()
    oCore.SyncRate(0)

    'NB: Initialisation code should go here
    oDBImage.LoadImage( "fire.png", 1 )

    While oDBP.LoopGDK()
      'NB: Main Game Loop code should go here

      oDBCore.Sync()
    End While
  End Sub
End Module

[edit] Creating a project

[edit] Visual Studio

Create a windows form or console application, and add references to the COM Interop assemblies within the DarkGDK.Net installation directory (DGDKPlugins.dll and Interop.DGDKLib.1.1), and any additional plugin DLLs (such as the ODE Physics plugin) that you are intending to utilise. Amend the main Program class to inherit from CDarkGDK, and you will then find that the standard methods are available in static class objects (such as oDBBitmap, oDBSprite, oDBCore) and class methods (such as InitDarkGDK(...)). To run a DarkGDK.Net application it must first have a .dgdk file generated for it. The instructions that are installed as standard include details on this process.

[edit] #Develop

TO BE ADDED. Please edit and amend with details, but it IS possible to develop DarkGDK.Net applications within the #Develop (SharpDevelop) IDE.

[edit] External References