diff --git a/.gitignore b/.gitignore index b65e425..29733bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .dub .bin +dub.selections.json *.swp diff --git a/.gitmodules b/.gitmodules index 29d7e1f..e4de406 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/sjplayer/dub.json b/sjplayer/dub.json new file mode 100644 index 0000000..5a24f13 --- /dev/null +++ b/sjplayer/dub.json @@ -0,0 +1,9 @@ +{ + "name": "sjplayer", + + "targetPath": ".bin", + + "dependencies": { + "gl4d": {"path": "../thirdparty/gl4d"} + } +} diff --git a/sjplayer/test.d b/sjplayer/test.d new file mode 100755 index 0000000..b0ff3bc --- /dev/null +++ b/sjplayer/test.d @@ -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; +} diff --git a/thirdparty/gl4d b/thirdparty/gl4d new file mode 160000 index 0000000..51ad927 --- /dev/null +++ b/thirdparty/gl4d @@ -0,0 +1 @@ +Subproject commit 51ad9270d58fd7cd64b494450dd447b39b21bb45