Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std.uuid;
- import std.file;
- import std.path;
- import std.string;
- ubyte[] sdlBytes = cast(ubyte[]) import("SDL2.dll"); // SDL2.dll contents
- void main(string[] args)
- {
- auto uuid = randomUUID();
- string uuid = randomUUID().toString();
- string filename = format("SDL2-%s.dll", uuid); // Making an unique file name.
- string depacked = buildPath(tempDir(), filename);
- std.file.write(depacked, sdlBytes); // Writing the dynlib to a temporary file.
- DerelictSDL2.load(depacked); // Use the depacked dynlib and load its symbols.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement