Chromium Embedded Framework with OpenGL Core or SDL2

Chromium Embedded Framework's cefsimple Off-Screen Rendering

I needed to use a modifed version of cefsimple using either SDL or OpenGL Core. I tried these three GitHub repos:

But they are outdated (more than > 4 years), the CEF API changed and when I compiled they crash by forking indefinitively the application until my Linux fell down. So they are not safe to be used! I tried to update fixes, so here is the repo.

It's working on my Linux 64-bits Debian 11 and CEF 96.0.14 downloaded at https://cef-builds.spotifycdn.com/index.html

Before compiling cefsimple, you need some libs and packages from CEF inside the two folders cefsimple_sdl and cefsimple_opengl.

Setup

Firstly, let name some folders. This will shorter code in this document. Adapt the CEF version to your operating system with the desired version according to https://cef-builds.spotifycdn.com/index.html

TMP=/tmp
CEF_LINK=https://cef-builds.spotifycdn.com/cef_binary_96.0.14%2Bg28ba5c8%2Bchromium-96.0.4664.55_linux64.tar.bz2
CEF=$TMP/cef_binary_96.0.14+g28ba5c8+chromium-96.0.4664.55_linux64
CEF_TARBALL=$CEF.tar.bz2
CEFSIMPLE_SDL=$CEF/tests/cefsimple_sdl
CEFSIMPLE_GL=$CEF/tests/cefsimple_opengl

Download and decompress it inside a temporary folder:

wget $CEF_LINK
tar jxvf $CEF_TARBALL

Git clone this repo inside the cef folder:

cd $CEF
git clone https://github.com/Lecrapouille/OffScreenCEF.git --depth=1

Compile CEF (needs some minutes, not hours):

mkdir $CEF/build
cd $CEF/build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j$(nproc)

You can use -DCMAKE_BUILD_TYPE=Release instead but just avoid mixing debug and release symbols. Now we have to copy needed elements for compiling cefsimple_sdl and cefsimple_opengl:

cp -v $CEF/Debug/libcef.so $CEF/build/libcef_dll_wrapper/libcef_dll_wrapper.a $CEFSIMPLE_SDL

(cd $CEF/build/tests/cefsimple/Debug/
 cp -v icudtl.dat resources.pak chrome_100_percent.pak chrome_200_percent.pak v8_context_snapshot.bin $CEFSIMPLE_SDL
)

mkdir -p $CEFSIMPLE_SDL/locales
cp -v $CEF/build/tests/cefsimple/Debug/locales/en-US.pak $CEFSIMPLE_SDL/locales

Do the same thing for $CEFSIMPLE_GL.

Compilation

cd $CEFSIMPLE_SDL && ./build.sh
cd $CEFSIMPLE_GL && ./build.sh

You have two binaries:

  • $CEFSIMPLE_SDL/cefsimple_sdl
  • $CEFSIMPLE_GL/cefsimple_opengl

These applications do not have command lines, you have to edit the code to give your desired page.

Important note

CefExecuteProcess shall be called before OpenGL/SDL2 context and using the command line of your application (int argc, char* argv[]). If not your system can freeze. Here is the function documentation (caf_app.h file):

   This function should be called from the application entry point function to
   execute a secondary process. It can be used to run secondary processes from
   the browser client executable (default behavior) or from a separate
   executable specified by the CefSettings.browser_subprocess_path value. If
   called for the browser process (identified by no "type" command-line value)
   it will return immediately with a value of -1. If called for a recognized
   secondary process it will block until the process should exit and then return
   the process exit code. The |application| parameter may be empty. The
   |windows_sandbox_info| parameter is only used on Windows and may be NULL (see
   cef_sandbox_win.h for details).

Demo

https://youtu.be/8xhxiDI4D5o

Owner
Quentin Quadrat
That is not dead which can eternal compile, And with strange aeons even C may die.
Quentin Quadrat
Similar Resources

Soundboard application made with SDL2

Soundboard application made with SDL2

Niilo22SoundBoard Soundboard application made with SDL2 How to run the program: Install dependencies. sudo apt install libsdl2-dev

Oct 4, 2022

CHIP-8 Emulator using C and SDL2

CHIP-8 Emulator using C and SDL2

CHIP-WALO Intro CHIP-8 is an interpreted programming language which was initially used in the late 1970s. It was made to allow more easily programed g

Nov 1, 2022

SDL2 port of Rise of the Triad

================ ROTT Port README ================ This is a port of Apogee's 3D action title Rise of the Triad, originally released in 1994. This p

Dec 19, 2022

A tiny evolution simulator, which uses SDL2 and is written in C

evosim Evosim is a small evolution simulator. Evosim uses the SDL2 library for graphics. The program can be compiled by simply running make in the evo

Nov 20, 2021

📽 A simple X11+SDL2 animated wallpaper setter and video player

📽 A simple X11+SDL2 animated wallpaper setter and video player

anipaper 📽 A simple X11+SDL2 animated wallpaper setter and video player Introduction Anipaper (ANImated Wallpaper) is a simple 'wallpaper setter' for

Dec 21, 2022

Multi OS Platform Wallpaper Engine using SDL2

MOWE MOWE is 'Multi OS Wallpaper Engine'. This is Wallpaper Engine for any OS like MacOSX, Windows, Linux. This Project use SDL, WinAPI, X11 API conte

Dec 26, 2021

MTEngineSDL is a SDL2+ImGui engine for macOS, Linux and MS Windows.

Hello and welcome to the MTEngineSDL! This is an application host framework for starting custom apps created using SDL2, ImGui and OpenGL. How to comp

Jan 10, 2022

A port of onscripter-20060724-insani-sdl2 to the Switch

Nintendo Switch Port of ONScripter A port of onscripter-20060724-insani-sdl2 to the Switch. I specifically made this to support running older NScripte

Nov 10, 2022

C++ open hierarchy RTTI framework for embedded projects

Open-hierarchy custom RTTI for C++17 and up with support for multiple inheritance and dynamic casting.

Dec 24, 2022
A Visual Studio extension containing a collection of tools to help contributing code to the Chromium project.

VsChromium VsChromium is a Visual Studio Extension containing a collection of tools useful for editing, navigating and debugging code. VsChromium was

Dec 30, 2022
Cross-platform sandbox RPG game written in C++ with OpenGL and SDL2.
Cross-platform sandbox RPG game written in C++ with OpenGL and SDL2.

Forradia test Forradia is a cross-platform sandbox survival/RPG game written in C++ with OpenGL and SDL2. The engine loads 3D models in Wavefront-form

Nov 9, 2022
a minimal C++, SDL2, OpenGL abstraction for general game and application development

hept the hept abstraction is a minimal lightweight layer above C++ and SDL dependencies: - SDL2 - C++17 or above - GLM example use: #include "hept.h"

Sep 18, 2022
Arduino core for GD32 devices, community developed, based on original GigaDevice's core
Arduino core for GD32 devices, community developed, based on original GigaDevice's core

GD32 Arduino Core (New) This is a Arduino core is based off of the original GigaDevice core that was provided by the company in early June 2021 (see h

Dec 24, 2022
A place to collaborate on code for the Embedded.fm book club. Currently reading "STM32 ARM Programming for Embedded Systems".

Welcome to the Book Club Code site! This is a place for the Embedded.fm book club to collaborate and learn together. Repo Structure Guide Top-level fo

Jul 21, 2022
Embedded Flutter runtime targeting Embedded Linux with Wayland

ivi-homescreen IVI Homescreen for Wayland Strongly Typed (C++) Lightweight Clang 11 Release Stripped = 151k GCC 9.3 Release Stripped = 168k Source run

Dec 13, 2022
Several GX2 test programs to compare it with OpenGL. (With additional GLFW+OpenGL implementation provided)

GX2-Tests Provided are GX2 test programs and samples for comparison with OpenGL and with additional GLFW+OpenGL implementation for test on PC. These s

Nov 15, 2021
Capstone disassembly/disassembler framework: Core + bindings.

Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings.

Jan 3, 2023
A distribution of the cFS that includes the cfe-eds-framework which includes NASA's core Flight Executive(cFE) and CCSDS Electronic Data Sheets(EDS) support.

core Flight System(cFS) Application Toolkit(cFSAT) - Beta Release A distribution of the cFS that includes the cfe-eds-framework which includes NASA's

Jul 3, 2022
GameBoy emulator with debugger written in C++ using Win32 and SDL2
GameBoy emulator with debugger written in C++ using Win32 and SDL2

脳(のう)腐(ふ) DMG-01 emulator written in modern C++ using Win32 API and SDL2. It is intended as a hobby project to sharpen my C++ skills. The emulator is

Sep 21, 2022