Compare commits

..

No commits in common. "10ad2be8bfcffa478ede35f56ac3d2ef7c89ae89" and "74f2de81e8d550331fdb99fd8480d6430847c820" have entirely different histories.

9 changed files with 6 additions and 101 deletions

View File

@ -102,7 +102,7 @@ jobs:
ANDROID_NDK_HOME: ${{steps.setup_ndk.outputs.ndk-path}}
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
#run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} --overlay-ports=vcpkg/ports libsodium opus libvpx libpng libjpeg-turbo
run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo freetype
run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo
# vcpkg scripts root /usr/local/share/vcpkg/scripts
- name: Configure CMake
@ -163,7 +163,7 @@ jobs:
- name: Install Dependencies
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static freetype:x64-windows-static
run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static
# setup vs env
- uses: ilammy/msvc-dev-cmd@v1
@ -231,7 +231,7 @@ jobs:
- name: Install Dependencies
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static freetype:x64-windows-static
run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static
# setup vs env

View File

@ -80,7 +80,7 @@ jobs:
env:
ANDROID_NDK_HOME: ${{steps.setup_ndk.outputs.ndk-path}}
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo freetype
run: vcpkg install --triplet ${{matrix.platform.vcpkg_toolkit}} libsodium opus libvpx libpng libjpeg-turbo
# vcpkg scripts root /usr/local/share/vcpkg/scripts
- name: Configure CMake
@ -148,7 +148,7 @@ jobs:
- name: Install Dependencies
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static freetype:x64-windows-static
run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static
# setup vs env
- uses: ilammy/msvc-dev-cmd@v1

View File

@ -17,8 +17,6 @@ add_subdirectory(./solanaceae_toxcore)
add_subdirectory(./solanaceae_tox)
add_subdirectory(./sdl)
add_subdirectory(./freetype)
add_subdirectory(./plutosvg)
add_subdirectory(./imgui)
add_subdirectory(./implot)

View File

@ -1,29 +0,0 @@
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
include(FetchContent)
if (NOT TARGET Freetype::Freetype)
find_package(Freetype 2.12 CONFIG GLOBAL QUIET)
if (NOT TARGET Freetype::Freetype)
find_package(Freetype 2.12 GLOBAL QUIET)
endif()
#if (NOT TARGET Freetype::Freetype)
# find_package(PkgConfig)
# if (PKG_CONFIG_FOUND)
# pkg_check_modules(freetype_PKG IMPORTED_TARGET freetype)
# if (TARGET PkgConfig::freetype_PKG)
# add_library(Freetype::Freetype ALIAS PkgConfig::freetype_PKG)
# endif()
# endif()
#endif()
if (TARGET Freetype::Freetype)
message(STATUS "found freetype")
else()
message(STATUS "freetype not found")
endif()
endif()

View File

@ -21,22 +21,6 @@ add_library(imgui
target_compile_definitions(imgui PUBLIC IMGUI_USE_WCHAR32)
target_compile_features(imgui PUBLIC cxx_std_11)
if (TARGET Freetype::Freetype)
message(STATUS "Freetype detected, enabling support in imgui")
target_sources(imgui PUBLIC
imgui/misc/freetype/imgui_freetype.h
imgui/misc/freetype/imgui_freetype.cpp
)
target_link_libraries(imgui PUBLIC Freetype::Freetype) # public in case of static
target_compile_definitions(imgui PUBLIC IMGUI_ENABLE_FREETYPE)
if (TARGET plutosvg::plutosvg)
message(STATUS "plutosvg detected, enabling support in imgui")
target_link_libraries(imgui PUBLIC plutosvg::plutosvg) # public in case of static
target_compile_definitions(imgui PUBLIC IMGUI_ENABLE_FREETYPE_PLUTOSVG)
endif()
endif()
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/imgui") # im sad

View File

@ -1,16 +0,0 @@
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
include(FetchContent)
#makes no sense without freetype
if (NOT TARGET plutosvg::plutosvg AND TARGET Freetype::Freetype)
set(PLUTOSVG_ENABLE_FREETYPE ON CACHE INTERNAL "")
set(PLUTOSVG_BUILD_EXAMPLES OFF CACHE INTERNAL "")
FetchContent_Declare(plutosvg
GIT_REPOSITORY https://github.com/sammycage/plutosvg.git
GIT_TAG v0.0.6
FIND_PACKAGE_ARGS # for the future
)
FetchContent_MakeAvailable(plutosvg)
endif()

20
flake.lock generated
View File

@ -68,32 +68,12 @@
"type": "github"
}
},
"plutosvg": {
"flake": false,
"locked": {
"lastModified": 1740306654,
"narHash": "sha256-radjL0bP+JPDk7FQ/qSOIxlokhwQ78fO52/S5V6rAmk=",
"ref": "refs/tags/v0.0.6",
"rev": "c5388fa96feca1f1376a3d0485d5e35159452707",
"revCount": 111,
"submodules": true,
"type": "git",
"url": "https://github.com/sammycage/plutosvg"
},
"original": {
"ref": "refs/tags/v0.0.6",
"submodules": true,
"type": "git",
"url": "https://github.com/sammycage/plutosvg"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"implot": "implot",
"nixpkgs": "nixpkgs",
"nlohmann-json": "nlohmann-json",
"plutosvg": "plutosvg",
"sdl3": "sdl3",
"sdl3_image": "sdl3_image"
}

View File

@ -20,17 +20,13 @@
url = "github:libsdl-org/SDL_image/4ff27afa450eabd2a827e49ed86fab9e3bf826c5";
flake = false;
};
plutosvg = {
url = "git+https://github.com/sammycage/plutosvg?submodules=1&ref=refs/tags/v0.0.6";
flake = false;
};
implot = {
url = "github:epezent/implot/193b9d8f92c4a437e84182b171f1ae266e72321f";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, nlohmann-json, sdl3, sdl3_image, plutosvg, implot }:
outputs = { self, nixpkgs, flake-utils, nlohmann-json, sdl3, sdl3_image, implot }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
@ -89,8 +85,6 @@
libsodium
libopus
libvpx
freetype
] ++ self.packages.${system}.default.dlopenBuildInputs;
cmakeFlags = [
@ -108,7 +102,6 @@
"-DFETCHCONTENT_SOURCE_DIR_SDL3=${sdl3}"
"-DFETCHCONTENT_SOURCE_DIR_SDL3_IMAGE=${sdl3_image}"
"-DSDLIMAGE_JXL=ON"
"-DFETCHCONTENT_SOURCE_DIR_PLUTOSVG=${plutosvg}" # not in pkgs
"-DFETCHCONTENT_SOURCE_DIR_IMPLOT=${implot}" # could use pkgs.implot.src for outdated version
];

View File

@ -7,7 +7,6 @@
#include <nlohmann/json.hpp>
#include <imgui/imgui.h>
#include <imgui/misc/freetype/imgui_freetype.h>
#include <imgui/misc/cpp/imgui_stdlib.h>
#include <cctype>
@ -106,10 +105,6 @@ StartScreen::StartScreen(const std::vector<std::string_view>& args, SDL_Renderer
fontcfg.OversampleH = 2;
fontcfg.OversampleV = 1;
fontcfg.MergeMode = false;
#if defined(IMGUI_ENABLE_FREETYPE) && defined(IMGUI_ENABLE_FREETYPE_PLUTOSVG)
std::cout << "Font: enabling freetype color loading\n";
fontcfg.FontBuilderFlags |= ImGuiFreeTypeBuilderFlags_LoadColor;
#endif
for (const auto [font_path, should_load] : _conf.entries_bool("ImGuiFonts", "fonts")) {
if (!should_load) {