### Build FFGL Solution with Visual Studio Source: https://github.com/resolume/ffgl/wiki/1.--Installation Instructions for building the FFGL solution using Visual Studio. This involves opening the `.sln` file, selecting 'Build Solution' from the menu (or pressing F7), and locating the compiled `.dll` file in the 'binaries\x64\Debug' directory. ```bash Open FFGL Plugin.sln in Visual Studio. Press F7 or go to Build > Build Solution. Compiled plugins (.dll) are found in binaries\x64\Debug. ``` -------------------------------- ### Clone FFGL Project Source: https://github.com/resolume/ffgl/wiki/1.--Installation This snippet shows how to clone the FFGL repository from GitHub using Git. Alternatively, users can download and unzip a master archive if they do not have Git installed. ```git git clone https://github.com/resolume/ffgl.git ``` -------------------------------- ### Recompile Plugin Workflow Source: https://github.com/resolume/ffgl/wiki/1.--Installation Describes an iterative workflow for developing and testing FFGL plugins. It involves recompiling the plugin, adding it to a Resolume composition, testing, removing it, and repeating the compile step without needing to restart Resolume each time, provided the plugin is not actively used in the composition. ```bash 1. Compile the plugin. 2. Open Resolume. 3. Add the plugin to the composition. 4. Test the plugin. 5. Remove the plugin from the composition. 6. Recompile the plugin. 7. Go to step 3. ``` -------------------------------- ### Configure Resolume for FFGL Plugins Source: https://github.com/resolume/ffgl/wiki/1.--Installation This section details how to make Resolume aware of newly compiled FFGL plugins. It involves accessing Resolume's preferences, navigating to the Video section, and adding the folder containing the plugin's `.dll` files. ```bash In Resolume, go to Arena/Avenue > Preferences (CTRL+,). Select the Video section. Click the '+' icon and select the folder containing your plugin .dll files. Restart Resolume to load the new plugin. ``` -------------------------------- ### Configure Resolume Plugin Directories Source: https://github.com/resolume/ffgl/wiki/4.-Convenience-tips Add the binaries folder to Resolume's video preferences to make newly compiled plugins available upon startup. This ensures that your compiled plugins are recognized by Resolume. ```APIDOC 1. Open Preferences -> Video 2. Add `\binaries\x64\Debug` to the list of FreeFrame Plugin Directories ``` -------------------------------- ### Windows FFGL Plugin Build Process Source: https://github.com/resolume/ffgl/blob/master/README.md Steps to duplicate, add, and build FFGL plugins within a Visual Studio 2017 environment for Resolume. ```text 1. Navigate to `/build/windows` and duplicate a `.vcxproj` and its corresponding `.vcxproj.filters` file. Rename them. 2. Open `FFGLPlugins.sln`. 3. Right-click the Solution in the solution explorer, then select Add > Existing Project and choose the new file. 4. Remove the original `.cpp` and `.h` source files from the newly added project (e.g., if you duplicated `Gradient.vcxproj`, remove `FFGLGradients.h` and `FFGLGradients.cpp`). 5. In Explorer, go to `/source/`, duplicate a plugin folder, and rename the files. Choose a plugin type (e.g., copy `AddSubtract` for an Effect plugin or `Gradients` for a Source plugin). 6. Add the new source files to the project by dragging them into Visual Studio onto your new project. 7. To build with Visual Studio's Build command (F5), right-click the project and select Set as Startup Project. Alternatively, right-click the project and select Build. 8. After building, find the resulting `.dll` file in `\binaries\x64\Debug`. Copy it to `/Documents/Resolume/Extra Effects`. ``` -------------------------------- ### Configure Visual Studio Debugging for Auto-Start Source: https://github.com/resolume/ffgl/wiki/4.-Convenience-tips Set up Visual Studio to automatically launch Resolume Arena after a successful compile. This allows for quick iteration by compiling and running your plugin with a single command (F5 or Cmd+R). ```APIDOC Windows: - Right click the project > properties > Debugging - Command: Fill with the path to Arena.exe (e.g., `C:\Program Files\Resolume Arena\Arena.exe`) - Working Directory: Fill with the program folder (e.g., `C:\Program Files\Resolume Arena\`) - Command Arguments: Add `--nosplash` to disable the splash screen. - Optional Command Arguments: Add `--debug-gl` and `--crash-on-gl-error` for OpenGL debugging. Mac: - Select your scheme, then click it again and select Edit scheme. - Run > Executable: Browse and select Arena.app. - Disable Debug executable. - Arguments tab > Arguments Passed On Launch: Add `--nosplash` to disable the splash screen. ``` -------------------------------- ### FFGL SDK CMake Installation Rules Source: https://github.com/resolume/ffgl/blob/master/CMakeLists.txt This snippet defines the installation rules for the FFGL SDK using CMake. It specifies where to install header files, the library itself, and the CMake configuration files necessary for other projects to find and use the SDK. ```cmake include(GNUInstallDirs) install( DIRECTORY source/lib/ffgl DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h" ) install( TARGETS ffgl-sdk EXPORT ffgl-sdk-targets DESTINATION ${CMAKE_INSTALL_LIBDIR} ) install( EXPORT ffgl-sdk-targets NAMESPACE ffgl:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ffgl-sdk ) include(CMakePackageConfigHelpers) write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/ffgl-sdk/ffgl-sdk-config-version.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) export( EXPORT ffgl-sdk-targets FILE "${CMAKE_CURRENT_BINARY_DIR}/ffgl-sdk/ffgl-sdk-targets.cmake" NAMESPACE ffgl:: ) configure_file(cmake/ffgl-sdk-config.cmake "${CMAKE_CURRENT_BINARY_DIR}/ffgl-sdk/ffgl-sdk-config-version.cmake" COPYONLY ) install( FILES cmake/ffgl-sdk-config.cmake "${CMAKE_CURRENT_BINARY_DIR}/ffgl-sdk/ffgl-sdk-config-version.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ffgl-sdk ) ``` -------------------------------- ### FFGL SDK Example Plugin Build Option Source: https://github.com/resolume/ffgl/blob/master/CMakeLists.txt This CMake snippet controls whether example FFGL plugins are built. The option `FFGL_BUILD_EXAMPLE_PLUGINS` is enabled by default if the FFGL SDK is being built as the main project, but disabled if it's included as a subproject in another build. ```cmake # are we building ffgl as the main repo, or is it included # into another project? set(FFGL_MASTER_PROJECT OFF) if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") set(FFGL_MASTER_PROJECT ON) endif() # should we build the example plugins? we do this by default # if building the project directly, but not when adding ffgl # to another project option(FFGL_BUILD_EXAMPLE_PLUGINS ${FFGL_MASTER_PROJECT} "Build the example FFGL plugins") if (${FFGL_BUILD_EXAMPLE_PLUGINS}) add_subdirectory(source/plugins) endif() ``` -------------------------------- ### FFGL Plugin Particles CMake Configuration Source: https://github.com/resolume/ffgl/blob/master/source/plugins/Particles/CMakeLists.txt Configures the FFGL plugin particles library using CMake. It defines the library, links dependencies, and sets up installation rules. ```cmake add_library(ffgl-plugin-particles STATIC) add_library(ffgl::plugin::particles ALIAS ffgl-plugin-particles) target_sources(ffgl-plugin-particles PRIVATE Constants.h Constants.cpp GLResources.h GLResources.cpp Particles.h Particles.cpp shaders/fsRender.h shaders/gsRender.h shaders/vsRender.h shaders/vsUpdate.h ) target_link_libraries(ffgl-plugin-particles PRIVATE ffgl::sdk) install( TARGETS ffgl-plugin-particles EXPORT ffgl--plugin-particles-targets DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### FFGL Plugin Add CMake Configuration Source: https://github.com/resolume/ffgl/blob/master/source/plugins/Add/CMakeLists.txt Defines the FFGL plugin 'add' as a static library, sets its sources, links it against the FFGL SDK, and configures installation. ```cmake add_library(ffgl-plugin-add STATIC) add_library(ffgl::plugin::add ALIAS ffgl-plugin-add) target_sources(ffgl-plugin-add PRIVATE Add.h Add.cpp) target_link_libraries(ffgl-plugin-add PRIVATE ffgl::sdk) install( TARGETS ffgl-plugin-add EXPORT ffgl-plugin-add-targets DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### FFGL Custom Thumbnails Plugin Build Configuration Source: https://github.com/resolume/ffgl/blob/master/source/plugins/CustomThumbnail/CMakeLists.txt This CMakeLists.txt configuration sets up the build for the FFGL custom thumbnails plugin. It defines static libraries, aliases, links necessary external libraries (PNG, ZLIB, FFGL SDK), and specifies installation directories. ```cmake add_library(ffgl-plugin-custom-thumbnails STATIC) add_library(ffgl::plugin::custom-thumbnails ALIAS ffgl-plugin-custom-thumbnails) target_sources(ffgl-plugin-custom-thumbnails PRIVATE CustomThumbnail.h CustomThumbnail.cpp PNGLoader.h PNGLoader.cpp Thumb.h ) find_package(PNG REQUIRED) find_package(ZLIB REQUIRED) target_link_libraries(ffgl-plugin-custom-thumbnails PRIVATE PNG::PNG) target_link_libraries(ffgl-plugin-custom-thumbnails PRIVATE ZLIB::ZLIB) target_link_libraries(ffgl-plugin-custom-thumbnails PRIVATE ffgl::sdk) target_link_libraries(ffgl-plugin-custom-thumbnails PRIVATE png_static) install( TARGETS ffgl-plugin-custom-thumbnails EXPORT ffgl--plugin-custom-thumbnails-targets DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### FFGL Plugin Events CMake Configuration Source: https://github.com/resolume/ffgl/blob/master/source/plugins/Events/CMakeLists.txt Configures the FFGL plugin events library using CMake. It defines a static library, creates an alias for it, specifies the source files, links against the FFGL SDK, and sets up installation rules. ```cmake add_library(ffgl-plugin-events STATIC) add_library(ffgl::plugin::events ALIAS ffgl-plugin-events) target_sources(ffgl-plugin-events PRIVATE FFGLEvents.h FFGLEvents.cpp) target_link_libraries(ffgl-plugin-events PRIVATE ffgl::sdk) install( TARGETS ffgl-plugin-events EXPORT ffgl--plugin-events-targets DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### macOS FFGL Plugin Compilation Source: https://github.com/resolume/ffgl/blob/master/README.md Steps to compile FFGL plugins on macOS using Xcode. This involves duplicating targets, configuring build settings, and managing project files to create a universal binary compatible with Resolume. ```bash # Navigate to the build directory cd /build/osx # Open the Xcode project open FFGLPlugins.xcodeproj # In Xcode: # 1. Duplicate an existing target (e.g., Gradients) and rename it for your new plugin. # 2. Remove old plugin-specific files from Build Phases > Compile Sources. # 3. Update Build Settings > Packaging > Info.plist to "FFGLPlugin-Info.plist". # 4. Remove the auto-generated "xx copy-Info.plist" from the Project Navigator. # 5. Duplicate a plugin folder in Finder (e.g., AddSubtract for Effect, Gradients for Source), rename files, and update PluginInfo struct. # 6. Drag the new folder into the Xcode project, adding it to your new target. # 7. Ensure no resources are in the Copy Bundle Resources phase. # 8. Manage Schemes: Rename the auto-created scheme (e.g., "Gradient copy") and select it. # 9. Compile the plugin (Cmd+B). # 10. Copy the resulting .bundle file from /binaries/debug to ~/Documents/Resolume/Extra Effects. ``` -------------------------------- ### CMake Build Configuration for FFGL Add Subtract Plugin Source: https://github.com/resolume/ffgl/blob/master/source/plugins/AddSubtract/CMakeLists.txt Configures the FFGL add-subtract plugin as a static library, creates an alias for it, specifies source files, and links it against the FFGL SDK. It also defines installation rules for the plugin. ```cmake add_library(ffgl-plugin-add-subtract STATIC) add_library(ffgl::plugin::add_subtract ALIAS ffgl-plugin-add-subtract) target_sources(ffgl-plugin-add-subtract PRIVATE AddSubtract.h AddSubtract.cpp) target_link_libraries(ffgl-plugin-add-subtract PRIVATE ffgl::sdk) install( TARGETS ffgl-plugin-add-subtract EXPORT ffgl--plugin-add-subtract-targets DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### CMake Configuration for FFGL Gradients Plugin Source: https://github.com/resolume/ffgl/blob/master/source/plugins/Gradients/CMakeLists.txt Configures the FFGL Gradients plugin using CMake. It defines the plugin as a static library, creates an alias for it, specifies the source files (header and implementation), and links it to the FFGL SDK. Finally, it sets up the installation rules for the plugin library. ```cmake add_library(ffgl-plugin-gradients STATIC) add_library(ffgl::plugin::gradients ALIAS ffgl-plugin-gradients) target_sources(ffgl-plugin-gradients PRIVATE FFGLGradients.h FFGLGradients.cpp) target_link_libraries(ffgl-plugin-gradients PRIVATE ffgl::sdk) install( TARGETS ffgl-plugin-gradients EXPORT ffgl--plugin-gradients-targets DESTINATION ${CMAKE_INSTALL_LIBDIR} ) ``` -------------------------------- ### Master Branch FFGL Changes Source: https://github.com/resolume/ffgl/blob/master/README.md Key changes introduced in the master branch of the FFGL repository since version 2.2. These include replacing glload with glew for OpenGL 4.6 support, implementing parameter display names, value change events, and dynamic option elements. ```cpp // Replaced glload by glew, enabling OpenGL 4.6 extensions. // Plugins may need to add deps/glew.props to their project's property pages. // Implemented parameter display names for UI overrides and dynamic changes via events. // Requires Resolume 7.4.0 and up. // Implemented value change events for plugins to update their own parameter values. // See the Events example for implementation. Requires Resolume 7.4.0 and up. // Implemented dynamic option elements for adding/removing/renaming options on the fly. // Requires Resolume 7.4.1 and up. ``` -------------------------------- ### SolidColor Plugin Implementation Source: https://github.com/resolume/ffgl/wiki/2.-Create-your-first-plugin Implements the SolidColor plugin for Resolume, setting a unique ID, name, fragment shader, and a color parameter. ```cpp #include "SolidColor.h" static PluginInstance p = Source::CreatePlugin< SolidColor >( { "SC01", // plugin unique ID "My SolidColor" // Plugin name } ); static const std::string fshader = R"( void main() { fragColor = vec4(color,1.0); } )"; SolidColor::SolidColor() { SetFragmentShader( fshader ); AddHueColorParam( "color" ); } SolidColor::~SolidColor() { } ``` -------------------------------- ### SolidColor Plugin Header Source: https://github.com/resolume/ffgl/wiki/2.-Create-your-first-plugin Defines the SolidColor class, inheriting from the FFGLSDK Source class, for a Resolume plugin. ```cpp #pragma once #include class SolidColor: public Source { public: SolidColor(); ~SolidColor(); }; ``` -------------------------------- ### FFGL SDK CMake Build Configuration Source: https://github.com/resolume/ffgl/blob/master/CMakeLists.txt This snippet details the core CMake configuration for building the FFGL SDK as a static library. It includes setting the project version, language, handling dependencies via vcpkg, defining include directories, and setting C++ standard features. ```cmake cmake_minimum_required(VERSION 3.15) project(FFGL-SDK VERSION 2.2 LANGUAGES CXX ) # resolve dependencies if using vcpkg if (EXISTS CACHE{VCPKG_MANIFEST_FILE}) vcpkg_acquire_dependencies() endif() add_library(ffgl-sdk STATIC source/lib/FFGLSDK.h source/lib/FFGLSDK.cpp ) add_library(ffgl::sdk ALIAS ffgl-sdk) set_target_properties(ffgl-sdk PROPERTIES EXPORT_NAME sdk) target_include_directories(ffgl-sdk PUBLIC $ $ ) target_compile_features(ffgl-sdk PUBLIC cxx_std_11) # we need glew (except on macOS) if (NOT APPLE) find_package(GLEW REQUIRED) target_link_libraries(ffgl-sdk PRIVATE GLEW::GLEW) endif() ``` -------------------------------- ### Debugging FFGL Plugins in Visual Studio Source: https://github.com/resolume/ffgl/wiki/3.-Get-to-know-the-framework-better Learn how to attach Visual Studio to a running FFGL application process to trigger breakpoints and inspect variables. Error messages for shader compilation failures are displayed in the 'Output' window. ```C++ if( !shader.Compile( vertexShaderCode, fragmentShaderCode ) ) { // Breakpoint here to catch shader compilation errors } ``` -------------------------------- ### Resolume Plugin Default Uniforms Source: https://github.com/resolume/ffgl/wiki/3.-Get-to-know-the-framework-better The Plugin class provides essential uniforms to shaders, including screen resolution, time, delta time, frame count, BPM, and phase. ```GLSL uniform vec2 resolution; // The screen resolution in pixel uniform float time; // The time in second since the application started uniform float deltaTime; // The time elapsed since the last render call uniform int frame; // The number of frame rendered since the beginning uniform float bpm; // The current bpm set in resolume uniform float phase; // The current phase position in a 4 beat represented as a float from 0 to 1 (0 is the first beat, 0.25 the second one, ect...) ``` -------------------------------- ### Resolume FFGL Add Plugin Source Source: https://github.com/resolume/ffgl/wiki/_Footer C++ source file for the 'Add' plugin in the Resolume FFGL project. This file likely contains the implementation of the plugin's functionality. ```C++ #include "../../source/plugins/Add/Add.h" ``` -------------------------------- ### Resolume FFGL Add Plugin Header Source: https://github.com/resolume/ffgl/wiki/_Footer C++ header file for the 'Add' plugin in the Resolume FFGL project. This file typically declares the plugin's interfaces, classes, and functions. ```C++ #pragma once // Placeholder for Add.h content ``` -------------------------------- ### Add Subdirectory Source: https://github.com/resolume/ffgl/blob/master/source/plugins/CMakeLists.txt Adds a subdirectory to the build process. This command is used to include additional modules or components within the project. ```cmake add_subdirectory(Add) add_subdirectory(AddSubtract) add_subdirectory(CustomThumbnail) add_subdirectory(Events) add_subdirectory(Gradients) add_subdirectory(Particles) ``` -------------------------------- ### Resolume Mixer Default Uniforms Source: https://github.com/resolume/ffgl/wiki/3.-Get-to-know-the-framework-better The Mixer class provides two input textures (textureDest and textureSrc) and corresponding UV coordinates (i_uv_dest and i_uv_src) for handling multiple texture inputs. ```GLSL uniform sampler2D textureDest; uniform sampler2D textureSrc; in vec2 i_uv_dest; in vec2 i_uv_src; ``` -------------------------------- ### Resolume Source Default Uniforms Source: https://github.com/resolume/ffgl/wiki/3.-Get-to-know-the-framework-better The Source class provides the input UV coordinates (i_uv) to the shader, representing the texture coordinates from the top-left to the bottom-right of the source. ```GLSL // A value going from (0,0) for the top left corner to (1,1) for the bottom one in vec2 i_uv; ``` -------------------------------- ### Resolume Effect Default Uniforms Source: https://github.com/resolume/ffgl/wiki/3.-Get-to-know-the-framework-better The Effect class provides input UV coordinates (i_uv) and the input texture (inputTexture) to the shader, allowing access to the current frame's pixel data. ```GLSL // A value going from (0,0) for the top left corner to (1,1) for the bottom one in vec2 i_uv; // A sampler2D representing the current frame as a texture. // You can access its value for the current pixel like thanks to the `texture()` function, example `texture( inputTexture, i_uv )` uniform sampler2D inputTexture; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.