[add] Created new subproject sjplayer with the sfml test.

This commit is contained in:
2019-10-05 00:00:00 +00:00
parent 84895c9454
commit 826f6d76eb
5 changed files with 61 additions and 0 deletions

9
sjplayer/dub.json Normal file
View File

@@ -0,0 +1,9 @@
{
"name": "sjplayer",
"targetPath": ".bin",
"dependencies": {
"gl4d": {"path": "../thirdparty/gl4d"}
}
}

47
sjplayer/test.d Executable file
View File

@@ -0,0 +1,47 @@
#!/usr/bin/env dub
/+ dub.json:
{
"name": "sjplayer",
"dependencies": {
"sjscript": {"path": "../sjscript"},
"derelict-sfml2": "~>4.0.0-beta.2"
},
"lflags-posix": ["-L../thirdparty/dsfml/lib"],
"lflags-windows": ["/LIBPATH:..\\thirdparty\\dsfml\\lib\\"]
} +/
import std;
import derelict.sfml2.audio,
derelict.sfml2.system,
derelict.sfml2.window;
int main(string[] args) {
DerelictSFML2System.load();
DerelictSFML2Window.load();
DerelictSFML2Audio.load();
sfContextSettings specs;
specs.depthBits = 32;
specs.stencilBits = 32;
specs.antialiasingLevel = 1;
specs.majorVersion = 3;
specs.minorVersion = 3;
auto win = sfWindow_create(
sfVideoMode(600, 600), "sjplayer".toStringz, sfDefaultStyle, &specs);
scope(exit) sfWindow_destroy(win);
sfWindow_setActive(win, true);
auto running = true;
while (running) {
sfEvent e;
sfWindow_pollEvent(win, &e);
running = e.type != sfEvtClosed;
sfWindow_display(win);
}
return 0;
}