diff --git a/flake.lock b/flake.lock index 0a7f498..784d153 100644 --- a/flake.lock +++ b/flake.lock @@ -16,25 +16,6 @@ "type": "github" } }, - "bgfx": { - "flake": false, - "locked": { - "lastModified": 1709469363, - "narHash": "sha256-2YC2ZkbUUgCHHtxXJv6Oyf+84TRPSbxk1AAodJRPmnw=", - "ref": "main", - "rev": "032b0a322a0e3372f72d288f511231ae82908f07", - "revCount": 33, - "submodules": true, - "type": "git", - "url": "https://github.com/JustEnoughMod/bgfx.meson" - }, - "original": { - "ref": "main", - "submodules": true, - "type": "git", - "url": "https://github.com/JustEnoughMod/bgfx.meson" - } - }, "dylib": { "flake": false, "locked": { @@ -178,7 +159,6 @@ "root": { "inputs": { "JustEnoughMod": "JustEnoughMod", - "bgfx": "bgfx", "dylib": "dylib", "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks" diff --git a/flake.nix b/flake.nix index 71e3565..21b0b71 100644 --- a/flake.nix +++ b/flake.nix @@ -2,13 +2,6 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; - bgfx = { - url = "https://github.com/JustEnoughMod/bgfx.meson"; - ref = "main"; - flake = false; - type = "git"; - submodules = true; - }; dylib = { url = "github:JustEnoughMod/dylib.meson"; flake = false; @@ -19,7 +12,7 @@ }; }; - outputs = { self, nixpkgs, pre-commit-hooks, bgfx, dylib, JustEnoughMod }: + outputs = { self, nixpkgs, pre-commit-hooks, dylib, JustEnoughMod }: let supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; @@ -34,7 +27,7 @@ in { overlays = forAllSystems (_: { - default = import ./overlay.nix { inherit bgfx dylib JustEnoughMod; }; + default = import ./overlay.nix { inherit dylib JustEnoughMod; }; }); devShells = forAllSystems (system: { @@ -49,7 +42,7 @@ nativeBuildInputs buildInputs; LD_LIBRARY_PATH = pkgs.${system}.lib.makeLibraryPath - pkgs.${system}.JustEnoughModCore.buildInputs; + pkgs.${system}.JustEnoughModCore.libPath; }; }); diff --git a/overlay.nix b/overlay.nix index d652c7e..8b928ca 100644 --- a/overlay.nix +++ b/overlay.nix @@ -1,4 +1,4 @@ -{ bgfx, dylib, JustEnoughMod, ... }: +{ dylib, JustEnoughMod, ... }: final: _: { JustEnoughModCore = with final; clangStdenv.mkDerivation { @@ -12,38 +12,27 @@ final: _: { nativeBuildInputs = [ clang-tools pkg-config meson ninja makeWrapper doxygen graphviz ]; + buildInputs = [ SDL2 spdlog + wayland libGL + vulkan-headers vulkan-loader - wayland - wayland-protocols - wayland-scanner - libxkbcommon - xorg.libX11 - xorg.libICE - xorg.libXi - xorg.libXScrnSaver - xorg.libXcursor - xorg.libXinerama - xorg.libXext - xorg.libXrandr - xorg.libXxf86vm + vulkan-validation-layers ]; + libPath = [ SDL2 spdlog wayland libGL vulkan-loader ]; + preConfigure = '' mkdir -p subprojects - chmod 777 -R subprojects cp -r ${JustEnoughMod} subprojects/JustEnoughMod - chmod 777 -R subprojects - cp -r ${bgfx} subprojects/JustEnoughMod/subprojects/bgfx cp -r ${dylib} subprojects/JustEnoughMod/subprojects/dylib - chmod 777 -R subprojects ''; @@ -56,9 +45,7 @@ final: _: { cp libJustEnoughModCore.so $out/bin/Plugins wrapProgram $out/bin/JustEnoughMod \ - --prefix LD_LIBRARY_PATH : ${ - lib.makeLibraryPath [ libGL vulkan-loader ] - } + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath libPath} ''; }; } diff --git a/src/CorePlugin.cpp b/src/CorePlugin.cpp index fb07ad8..e6723b3 100644 --- a/src/CorePlugin.cpp +++ b/src/CorePlugin.cpp @@ -16,30 +16,9 @@ class CorePlugin : public Plugin { #endif } - void init() override { - bgfx::setDebug(BGFX_DEBUG_TEXT); - bgfx::setDebug(BGFX_DEBUG_STATS); - } - - void update() override { - bgfx::dbgTextClear(); - - const bgfx::Stats *stats = bgfx::getStats(); + void init() override {} - bgfx::dbgTextPrintf( - 0, 1, 0x0f, - "Color can be changed with ANSI \x1b[9;me\x1b[10;ms\x1b[11;mc\x1b[12;ma\x1b[13;mp\x1b[14;me\x1b[0m code too."); - - bgfx::dbgTextPrintf( - 80, 1, 0x0f, - "\x1b[;0m \x1b[;1m \x1b[; 2m \x1b[; 3m \x1b[; 4m \x1b[; 5m \x1b[; 6m \x1b[; 7m \x1b[0m"); - bgfx::dbgTextPrintf( - 80, 2, 0x0f, - "\x1b[;8m \x1b[;9m \x1b[;10m \x1b[;11m \x1b[;12m \x1b[;13m \x1b[;14m \x1b[;15m \x1b[0m"); - - bgfx::dbgTextPrintf(0, 2, 0x0f, "Backbuffer %dW x %dH in pixels, debug text %dW x %dH in characters.", - stats->width, stats->height, stats->textWidth, stats->textHeight); - } + void update() override {} }; JEM_PLUGIN_DEF(CorePlugin) diff --git a/subprojects/JustEnoughMod b/subprojects/JustEnoughMod index d7afbfd..1db6ffd 160000 --- a/subprojects/JustEnoughMod +++ b/subprojects/JustEnoughMod @@ -1 +1 @@ -Subproject commit d7afbfd636cf2b288afc6a6c5150674bd32480b1 +Subproject commit 1db6ffd46c2e5cbef7e30aa495524c18f4aed49f