Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ on:
tags:
- '**' # matches every tag
jobs:
build-windows:
build:
env:
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_BINARY_SOURCES: clear;x-gha,readwrite
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -21,9 +20,11 @@ jobs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- run: pip install PyYAML requests
- run: sudo apt install libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules libglu1-mesa-dev
- name: cmake configure
run: |
$env:CMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
export CMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake -B build -S .
- name: cmake build
run: cmake --build build --config Release
85 changes: 35 additions & 50 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,58 +1,43 @@
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
set(VCPKG_OVERLAY_PORTS "${CMAKE_SOURCE_DIR}/overlays" CACHE INTERNAL "")
project(ffmpeg_node_editor LANGUAGES CXX)
project(ffmpeg_node_editor LANGUAGES C CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPORT_COMPILE_COMMANDS
ON
CACHE INTERNAL "")

find_package(absl CONFIG REQUIRED)
find_package(glfw3 REQUIRED)
find_package(imgui CONFIG REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(OpenGL REQUIRED)
find_package(re2 CONFIG REQUIRED)
find_package(Backward CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(tiny-process-library CONFIG REQUIRED)
find_package(unofficial-imgui-node-editor CONFIG REQUIRED)
find_package(unofficial-nativefiledialog CONFIG REQUIRED)

add_executable(ffmpeg_node_editor
src/backend.cpp
src/ffmpeg/filter_graph.cpp
src/ffmpeg/profile.cpp
src/ffmpeg/runner.cpp
src/file_utils.cpp
src/imgui_extras.cpp
src/main.cpp
src/node_editor.cpp
src/pref.cpp
)

target_include_directories(ffmpeg_node_editor PUBLIC "${CMAKE_SOURCE_DIR}/include")

target_link_libraries(ffmpeg_node_editor PRIVATE
${OPENGL_gl_LIBRARY}
absl::strings
glfw
imgui::imgui
nlohmann_json::nlohmann_json
re2::re2
spdlog::spdlog
tiny-process-library::tiny-process-library
unofficial::imgui-node-editor::imgui-node-editor
unofficial::nativefiledialog::nfd
)


find_package(nlohmann_json CONFIG REQUIRED)

# Import non vcpkg stuff
add_subdirectory(./third_party)

add_library(
core STATIC
src/ffmpeg/filter_graph.cpp
src/ffmpeg/profile.cpp
src/ffmpeg/runner.cpp
src/file_utils.cpp
src/imgui_extras.cpp
src/node_editor.cpp
src/pref.cpp
src/string_utils.cpp)

target_include_directories(core PUBLIC "${CMAKE_SOURCE_DIR}/include")
target_link_libraries(
core PUBLIC imgui spdlog::spdlog tinyfiledialogs nlohmann_json::nlohmann_json
IconFontCppHeaders subprocess)

# Main Executable
add_executable(ffmpeg_node_editor src/backend.cpp src/backend_glfw_opengl.cpp
src/backend_win32_d3d12.cpp src/main.cpp)
target_link_libraries(ffmpeg_node_editor PRIVATE core Backward::Interface)

# Setup Test, coverage and benchmarks
find_package(GTest CONFIG REQUIRED)

SET(TEST_SRCS
src/imgui_extras.cpp
src/imgui_extras_test.cpp
)

add_executable(tests ${TEST_SRCS})
target_include_directories(tests PUBLIC "${CMAKE_SOURCE_DIR}/include")
target_link_libraries(tests PRIVATE GTest::gtest GTest::gtest_main absl::strings imgui::imgui spdlog::spdlog)
add_executable(tests src/ffmpeg/runner_test.cpp src/imgui_extras_test.cpp
src/util_test.cpp)

target_link_libraries(tests PRIVATE GTest::gtest GTest::gtest_main core)
15 changes: 0 additions & 15 deletions imgui.ini

This file was deleted.

20 changes: 6 additions & 14 deletions include/backend.hpp
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
#pragma once

#include <GLFW/glfw3.h>
#include <absl/strings/string_view.h>
#include <imgui.h>

#include <string>
#include <vector>
#include <string_view>

#include "pref.hpp"

struct MenuItem {
absl::string_view root;
absl::string_view name;
std::string_view name;
int id;
ImGuiKey key = ImGuiKey_None;
bool keyCtrl = false, keyAlt = false, keyShift = false;
std::string shortcut;
};

class BackendWrapperGlfw3OpenGL3 {
// Data
std::string glsl_version;
GLFWwindow* window;
ImGuiContext* ctx;
std::vector<MenuItem> menu;

public:
namespace Window {
bool InitWindow(ImGuiConfigFlags flags, const Preference& pref);
void Setup();
void SetupMenuBar(const std::initializer_list<MenuItem>&);
void AddMenu(
std::string_view menuName, const std::initializer_list<MenuItem>&);
int DrawMenu();
bool IsNewFrameAvailable();
void Render(const ImVec4& clear_color);
void Shutdown();
};
}; // namespace Window
Loading
Loading