From fac93948b3cf1ef4aa89fabd457b15c826cb3174 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 14 Sep 2020 22:24:56 +0100 Subject: [PATCH] st/gui: Add STB image writing support --- src/xrt/state_trackers/gui/CMakeLists.txt | 2 ++ src/xrt/state_trackers/gui/gui_stb.c | 3 +++ src/xrt/state_trackers/gui/meson.build | 2 ++ 3 files changed, 7 insertions(+) create mode 100644 src/xrt/state_trackers/gui/gui_stb.c diff --git a/src/xrt/state_trackers/gui/CMakeLists.txt b/src/xrt/state_trackers/gui/CMakeLists.txt index e1642b526..c07ed9c90 100644 --- a/src/xrt/state_trackers/gui/CMakeLists.txt +++ b/src/xrt/state_trackers/gui/CMakeLists.txt @@ -16,6 +16,7 @@ set(GUI_SOURCE_FILES gui_scene_remote.c gui_scene_video.c gui_scene_tracking_overrides.c + gui_stb.c ../../../external/imgui/imgui/cimgui.cpp ../../../external/imgui/imgui/cimgui.h ../../../external/imgui/imgui/cimplot.cpp @@ -46,6 +47,7 @@ add_library(st_gui STATIC target_link_libraries(st_gui PRIVATE xrt-external-glad + xrt-external-stb aux_util aux_os ) diff --git a/src/xrt/state_trackers/gui/gui_stb.c b/src/xrt/state_trackers/gui/gui_stb.c new file mode 100644 index 000000000..e1b1583b4 --- /dev/null +++ b/src/xrt/state_trackers/gui/gui_stb.c @@ -0,0 +1,3 @@ + +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include "stb_image_write.h" diff --git a/src/xrt/state_trackers/gui/meson.build b/src/xrt/state_trackers/gui/meson.build index d7953c32d..5de806557 100644 --- a/src/xrt/state_trackers/gui/meson.build +++ b/src/xrt/state_trackers/gui/meson.build @@ -13,6 +13,7 @@ gui_sources = [ 'gui_scene_remote.c', 'gui_scene_video.c', 'gui_scene_tracking_overrides.c', + 'gui_stb.c', '../../../external/imgui/imgui/cimgui.cpp', '../../../external/imgui/imgui/cimgui.h', '../../../external/imgui/imgui/cimplot.cpp', @@ -49,6 +50,7 @@ lib_st_gui = static_library( glad_include, cjson_include, imgui_include, + stb_include, ], dependencies: gui_deps, )