Skip to content

Instantly share code, notes, and snippets.

@ebachard
ebachard / playwav.c
Last active August 24, 2021 12:05 — forked from armornick/playwav.c
Play a sound with SDL2 (no SDL_Mixer)
#include <stdlib.h>
#include <math.h>
#include <SDL2/SDL.h>
#define DEFAULT_AUDIO_PATH "audiofile.wav"
struct AudioSpecUserdata_t {
char* issued;
char* file;
Uint32 event_count;
@ebachard
ebachard / imgui1.60_warnings.diff
Created February 16, 2018 14:15
A try to fix two similar warnings with the WIP ImGui
diff --git a/imgui.cpp b/imgui.cpp
index b72cc38..85fc037 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -4890,7 +4892,12 @@ void ImGui::ClosePopup(ImGuiID id)
if (!IsPopupOpen(id))
return;
ImGuiContext& g = *GImGui;
- ClosePopupToLevel(g.OpenPopupStack.Size - 1);
+ unsigned int aSize = 0;
@ebachard
ebachard / gist:826435854d59e1abea65b2ee2eb41a50
Created February 10, 2018 10:36
Some fixes for debian-webcam project (only Linux) MIT License, Eric Bachard 2018
index 03da20b..21cfd72 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ INCLUDES += -I./inc
LIBS = -L/usr/lib/x86_64-linux-gnu
LIBS += -lboost_regex
LIBS += -lboost_system -lboost_thread
-LIBS += -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_video -lopencv_videostab
+LIBS += $(shell pkg-config --cflags --libs opencv)
LIBS += -lavcodec \
@ebachard
ebachard / gist:3ed2b0720830b56edee341547ba29fed
Created February 10, 2018 10:11
A little fix for arionik/libavi MIT license / Eric Bachard 2018
diff --git a/Makefile b/Makefile
index 233952d..00c3949 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ ifeq ($(findstring darwin, $(TARGET)), darwin)
else
ifeq ($(findstring linux, $(TARGET)), linux)
OS=linux
+ OS_CXXFLAGS = -DLinux
CFLAGS += -fPIC -fno-strict-aliasing -Wno-multichar
@ebachard
ebachard / fishGUI2.diff
Created January 17, 2018 22:14
Some little fixes for Linux build
diff --git a/ThirdParty/glew/glew.pc b/ThirdParty/glew/glew.pc
index 5ac9b26..5f500fe 100644
--- a/ThirdParty/glew/glew.pc
+++ b/ThirdParty/glew/glew.pc
@@ -1,11 +1,11 @@
-prefix=C:/Program Files/FishGUI
+prefix=/usr/local
exec_prefix=${prefix}
-libdir=C:/Program Files/FishGUI/lib
+libdir=/usr/local/lib