Skip to content

Instantly share code, notes, and snippets.

@nongio
nongio / meson_options.txt
Created November 11, 2021 07:33
meson option for cairo with EGL support and surface backend: OpenGL ES 2.0
# Cairo font backends
option('fontconfig', type : 'feature', value : 'auto')
option('freetype', type : 'feature', value : 'auto')
# Cairo surface backends
option('cogl', type : 'feature', value : 'disabled')
option('directfb', type : 'feature', value : 'disabled')
option('gl-backend', type : 'combo', value : 'glesv2',
# FIXME: https://github.com/mesonbuild/meson/issues/4566
choices : ['auto', 'gl', 'glesv2', 'glesv3', 'disabled'])
@nongio
nongio / main.c
Last active October 1, 2021 18:46
A very ugly Wayland EGL Cairo-gl example
// https://gist.github.com/Miouyouyou/ca15af1c7f2696f66b0e013058f110b4
// https://gist.github.com/nikp123/bebe2d2dc9a8287efa9ba0a5b38ffab4
#include <wayland-client-core.h>
#include <wayland-client.h>
#include <wayland-server.h>
#include <wayland-client-protocol.h>
#include <wayland-egl.h> // Wayland EGL MUST be included before EGL headers
#include "xdg-shell-client-protocol.h"
pdftk infile.pdf burst output $tmpdir/page_%03d.pdf
page=0
imagetype="png"
for file in $tmpdir/*.pdf
do
image=$file.$imagetype
convert -density $density -depth $depth $file $image
rm $file
page=`expr $page + 1`