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

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

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.dub
.bin
dub.selections.json
*.swp

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "thirdparty/dast"]
path = thirdparty/dast
url = https://gogs.enigmatical.work/kajironagi/dast.git
[submodule "thirdparty/gl4d"]
path = thirdparty/gl4d
url = https://gogs.enigmatical.work/kajironagi/gl4d.git

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;
}

1
thirdparty/gl4d vendored Submodule

@ -0,0 +1 @@
Subproject commit 51ad9270d58fd7cd64b494450dd447b39b21bb45