Compare commits

...

3 Commits

Author SHA1 Message Date
Sebastien Bourdeauducq f28c0965ec add pocketfft 2023-08-23 19:57:01 +08:00
Sebastien Bourdeauducq b184b71169 simplify devShell 2023-08-23 19:56:50 +08:00
Sebastien Bourdeauducq 89cb0383e5 remove old comment 2023-08-23 19:52:34 +08:00
3 changed files with 11 additions and 7 deletions

View File

@ -4,7 +4,7 @@ SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui
SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_opengl3.cpp
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
CXXFLAGS = -std=c++14 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends
CXXFLAGS = -std=c++14 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I$(POCKETFFT_DIR)
CXXFLAGS += -g -Wall -Wformat -O2
LIBS = -L$(TINYALSA_DIR)/lib

View File

@ -7,6 +7,11 @@
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
imgui_dir = "${pkgs.imgui}/include/imgui";
pocketfft = pkgs.fetchgit {
url = "https://gitlab.mpcdf.mpg.de/mtr/pocketfft.git";
rev = "ecd78caa1c862e18fb1a55bcd4e30a05430b01f6";
hash = "sha256-xl7Tr1A1cqXhAL1Bljfk68R3AB1xOgkH15LHKxjYoSc=";
};
in rec {
packages.x86_64-linux.microsa = pkgs.stdenv.mkDerivation {
name = "microsa";
@ -15,6 +20,7 @@
propagatedBuildInputs = [ pkgs.wayland pkgs.glfw-wayland pkgs.libffi pkgs.alsa-lib ];
preBuild = ''
export IMGUI_DIR=${imgui_dir}
export POCKETFFT_DIR=${pocketfft}
'';
installPhase = ''
mkdir -p $out/bin
@ -23,11 +29,7 @@
};
devShell.x86_64-linux = pkgs.mkShell {
name = "microsa-dev-shell";
buildInputs = [
pkgs.gnumake
pkgs.gcc
] ++ packages.x86_64-linux.microsa.nativeBuildInputs
++ packages.x86_64-linux.microsa.propagatedBuildInputs;
buildInputs = packages.x86_64-linux.microsa.nativeBuildInputs ++ packages.x86_64-linux.microsa.propagatedBuildInputs;
shellHook = packages.x86_64-linux.microsa.preBuild;
};
defaultPackage.x86_64-linux = packages.x86_64-linux.microsa;

View File

@ -14,6 +14,9 @@
#include <alsa/asoundlib.h>
#include <pocketfft_hdronly.h>
static std::atomic<bool> terminate_dsp;
static snd_pcm_t* pcm;
@ -186,7 +189,6 @@ int main(int argc, char* argv[])
ImGui::End();
ImGui::PopStyleVar(1);
// Rendering
ImGui::Render();
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
int display_w, display_h;