Advertisement
atm-irbis

exp

Jan 22nd, 2015
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.59 KB | None | 0 0
  1. import std.uuid;
  2. import std.file;
  3. import std.path;
  4. import std.string;
  5. ubyte[] sdlBytes = cast(ubyte[]) import("SDL2.dll");   // SDL2.dll contents
  6. void main(string[] args)
  7. {
  8.     auto uuid = randomUUID();
  9.     string uuid = randomUUID().toString();
  10.     string filename = format("SDL2-%s.dll", uuid);     // Making an unique file name.
  11.     string depacked = buildPath(tempDir(), filename);
  12.     std.file.write(depacked, sdlBytes);                // Writing the dynlib to a temporary file.
  13.     DerelictSDL2.load(depacked);                       // Use the depacked dynlib and load its symbols.
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement