Skip to content
Steven Arnow edited this page Dec 13, 2013 · 16 revisions

Installing

Linux

  • Install the development packages for SDL, libmodplug, zlib, libbz2 and libmxml v.2.7 (most distro's carry an outdated version. Get new one here )
  • make && sudo make install

It should now be installed! Link your programs with -ldarnit

OpenPandora

I recommend compiling with sebt3's yactfeau cross compiler. After setting up the project with setprj, libdarnit should compile and install fine into the toolchain with just "make && make install". You'll need to install libmxml into your cross compiler.

GCW0

Not supported yet. Will be worked on when the gcw0 gets a working OpenGL|ES driver.

Windows

You don't need to compile libDarnit yourself. Mostly up-to-date builds are available at http://f.rdw.se/libdarnit

First of all, you need MinGW. Microsoft Visual C is retarded and will not work.

  • Download and install the development libraries for
  • libbz2 (should be availble from mingw's packaging system)
  • zlib (same as above)
  • libmxml
  • Build and install libmodplug from source (http://sourceforge.net/projects/modplug-xmms/)
  • Build and install libdarnit from source (make && make install)

When shipping your game you need to include the following dll files:

  • libdarnit.dll
  • libbz2.dll
  • libmodplug-1.dll
  • libgcc_s_dw2-1.dll
  • libstdc++-6.dll

There's also a static library for windows now, meaning you won't have any DLL's to ship with your binary. To link your game to it, you also need to link with

  • winmm.lib
  • opengl32.lib
  • ws2_32.lib
  • libbz2.lib
  • libmodplug.lib
  • stdc++
  • gdi32.lib
  • shlwapi.lib

MacOS X

Not supported atm, check back later.

Base of any libdarnit project

#include <darnit/darnit.h>

...

int main(int argc, char **argv) {
        if (!d_init("WindowTitle", "appname", "path/to/icon")) {
                /* Handle this, libdarnit failed to init */
                return -1;
        }
...
        for (;;) { /* Rendering loop */
                d_render_begin(); /* Must be called before you render anything */
                /* Render stuff */
                d_render_end(); /* Should be called before you run d_loop(). */
                d_loop(); /* You must call this once a frame. Flips buffers, caps FPS etc. */
        }
        
        d_quit(); /* Will do platform-specific deinitialization and exit your program */
        return 0;
}

Clone this wiki locally