The sample is deprecated. Please, rely on this repo instead.
Quick start examples for integrating Banuba SDK on Desktop in C++ apps
-
Get the latest Banuba SDK archive for MacOS/Windows and the client token. Please fill out our form at form at banuba.com website, or contact us via info@banuba.com.
-
Copy
bnb_sdk.tar.gz/mac(for Mac OS) orbnb_sdk.zip/binwithbnb_sdk.zip/include(for Windows) intoOEP-desktop/bnb_sdkdir. -
Windows only: copy contents of
bnb_sdk.zip/resourcesintoOEP-desktop/resources. -
Copy and Paste your client token into the appropriate section of [
OEP-desktop/main.cpp][main.cpp#L15] -
Copy
effectsfrom release archive intoOEP-desktop/resources. Configure effect in the appropriate section ofOEP-desktop/main.cpp, e.g.effects/test_BGTheeffectsfolder should be located in theOEP-desktop/resourcesfolder. More effects can be found here -
Generate project files by executing the following commands:
cd %path_to_repository% git submodule update --init --recursive md build cd build cmake -A Win32 ..
cd %path_to_repository% git submodule update --init --recursive md build cd build cmake -A x64 ..
cd %path_to_repository% git submodule update --init --recursive mkdir build cd build cmake -G Xcode ..
-
The previous step will generate a Xcode project for macOS and a Visual Studio project for Windows. Open the viewer_standalone project in an appropriate IDE on your platform.
-
Select target
examplein Xcode or set theexampleproject as Startup in Visual Studio. -
Run build.
- oep - is a submodule of the offscreen effect player
- libraries
- glad - OpenGL loader
- renderer - used only to demonstrate how to work with offscreen_effect_player. Draws received frames to the specified GLFW window
- utils - wrapper for GLFW
- main.cpp - contains the main function implementation, demonstrating basic pipeline for frame processing to apply effect offscreen
- effect_player.cpp, effect_player.hpp - contains the custom implementation of the effect_player interface with using cpp api
- render_context.cpp, render_context.hpp - contains the custom implementation of the render_context interface with using GLFW
- camera_utils.cpp, camera_utils.hpp - contains a method that helps convert bnb::full_image_t type to OEP pixel_buffer type
-
Open
OEP-desktop/main.cpp -
On line 45 find:
oep->load_effect("effects/Afro");
-
Write the effect name that you want to run. For example: ("effects/your_effect_name")
Note: The effect must be in OEP-desktop/resources/effect.
For the integration of the Offscreen Effect player into your application, it is necessary to copy the OEP folder and implement interfaces for effect_player and render_context, but if your application is based on the GLFW library and using bnb_effect_player CPP API, you can just reuse the current implementation.