Commit 2710ed9b authored by PoroCYon's avatar PoroCYon
Browse files

remove non-packer stuff

parent 0a41877c
File deleted
all : main
shader.frag.min : shader.frag Makefile
cp shader.frag shader.frag.min
sed -i 's/m_origin/o/g' shader.frag.min
sed -i 's/m_direction/d/g' shader.frag.min
sed -i 's/m_point/k/g' shader.frag.min
sed -i 's/m_intersected/i/g' shader.frag.min
sed -i 's/m_color/c/g' shader.frag.min
sed -i 's/m_mat/m/g' shader.frag.min
sed -i 's/m_cumdist/y/g' shader.frag.min
sed -i 's/m_attenuation/l/g' shader.frag.min
sed -i 's/m_diffuse/o/g' shader.frag.min
sed -i 's/m_specular/d/g' shader.frag.min
sed -i 's/m_spec_exp/k/g' shader.frag.min
sed -i 's/m_reflectance/i/g' shader.frag.min
sed -i 's/m_transparency/c/g' shader.frag.min
sed -i 's/MAXDEPTH/1/g' shader.frag.min
sed -i 's/\bRay\b/Co/g' shader.frag.min
sed -i 's/\bMat\b/Cr/g' shader.frag.min
shader.h : shader.frag.min Makefile
mono ~/Downloads/shader_minifier.exe --preserve-externals shader.frag.min -o shader.h
main : main.c shader.h Makefile
gcc -o main main.c -lX11 -lGL -lcairo -lXrandr -Wl,--hash-style=gnu -no-pie -O1 -fno-tree-ch -std=gnu11 -nostartfiles -nostdlib
strip main
strip -R .note -R .comment -R .eh_frame -R .eh_frame_hdr -R .note.gnu.build-id main
#remove section header
truncate --size=-1072 main
#clear out useless bits
sed -i 's/_edata/\x00\x00\x00\x00\x00\x00/g' main;
sed -i 's/__bss_start/\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00/g' main;
sed -i 's/_end/\x00\x00\x00\x00/g' main;
#clear out parts referring to section header
#e_shoff
dd if=/dev/zero of=main bs=1 seek=40 count=8 conv=notrunc
#e_shentsize
dd if=/dev/zero of=main bs=1 seek=58 count=2 conv=notrunc
#e_shnum
dd if=/dev/zero of=main bs=1 seek=60 count=2 conv=notrunc
#e_shstrndx
dd if=/dev/zero of=main bs=1 seek=62 count=2 conv=notrunc
#put in my name do not steal
# printf 'blackle' | dd of=main bs=1 seek=8 count=7 conv=notrunc
wc -c main
main.gz : main Makefile
-rm main.gz
zopflikrzymod --gzip --i5000 --all --t8 main
wc -c main.gz
main.xz : main Makefile
-rm main.xz
lzma --format=lzma -9 --extreme --lzma1=preset=9,lc=1,lp=0,pb=0 --keep --stdout main > main.xz
wc -c main.xz
typedef int cairo_atomic_int_t;
struct _cairo_array {
unsigned int size;
unsigned int num_elements;
unsigned int element_size;
char *elements;
};
typedef struct _cairo_array cairo_array_t;
typedef struct _cairo_backend cairo_backend_t;
typedef struct _cairo_boxes_t cairo_boxes_t;
typedef struct _cairo_cache cairo_cache_t;
typedef struct _cairo_composite_rectangles cairo_composite_rectangles_t;
typedef struct _cairo_clip cairo_clip_t;
typedef struct _cairo_clip_path cairo_clip_path_t;
typedef struct _cairo_color cairo_color_t;
typedef struct _cairo_color_stop cairo_color_stop_t;
typedef struct _cairo_contour cairo_contour_t;
typedef struct _cairo_contour_chain cairo_contour_chain_t;
typedef struct _cairo_contour_iter cairo_contour_iter_t;
typedef struct _cairo_damage cairo_damage_t;
typedef struct _cairo_device_backend cairo_device_backend_t;
typedef struct _cairo_font_face_backend cairo_font_face_backend_t;
typedef struct _cairo_gstate cairo_gstate_t;
typedef struct _cairo_gstate_backend cairo_gstate_backend_t;
typedef struct _cairo_glyph_text_info cairo_glyph_text_info_t;
typedef struct _cairo_hash_entry cairo_hash_entry_t;
typedef struct _cairo_hash_table cairo_hash_table_t;
typedef struct _cairo_image_surface cairo_image_surface_t;
typedef struct _cairo_mime_data cairo_mime_data_t;
typedef struct _cairo_observer cairo_observer_t;
typedef struct _cairo_output_stream cairo_output_stream_t;
typedef struct _cairo_paginated_surface_backend cairo_paginated_surface_backend_t;
typedef struct _cairo_path_fixed cairo_path_fixed_t;
typedef struct _cairo_rectangle_int16 cairo_glyph_size_t;
typedef struct _cairo_scaled_font_subsets cairo_scaled_font_subsets_t;
typedef struct _cairo_solid_pattern cairo_solid_pattern_t;
typedef struct _cairo_surface_attributes cairo_surface_attributes_t;
typedef struct _cairo_surface_backend cairo_surface_backend_t;
typedef struct _cairo_surface_observer cairo_surface_observer_t;
typedef struct _cairo_surface_snapshot cairo_surface_snapshot_t;
typedef struct _cairo_surface_subsurface cairo_surface_subsurface_t;
typedef struct _cairo_surface_wrapper cairo_surface_wrapper_t;
typedef struct _cairo_traps cairo_traps_t;
typedef struct _cairo_tristrip cairo_tristrip_t;
typedef struct _cairo_unscaled_font_backend cairo_unscaled_font_backend_t;
typedef struct _cairo_xlib_screen_info cairo_xlib_screen_info_t;
typedef cairo_array_t cairo_user_data_array_t;
typedef struct _cairo_scaled_font_private cairo_scaled_font_private_t;
typedef struct _cairo_scaled_font_backend cairo_scaled_font_backend_t;
typedef struct _cairo_scaled_glyph cairo_scaled_glyph_t;
typedef struct _cairo_scaled_glyph_private cairo_scaled_glyph_private_t;
typedef struct cairo_compositor cairo_compositor_t;
typedef struct cairo_fallback_compositor cairo_fallback_compositor_t;
typedef struct cairo_mask_compositor cairo_mask_compositor_t;
typedef struct cairo_traps_compositor cairo_traps_compositor_t;
typedef struct cairo_spans_compositor cairo_spans_compositor_t;
typedef enum _cairo_backend_type {
CAIRO_TYPE_DEFAULT,
CAIRO_TYPE_SKIA,
} cairo_backend_type_t;
struct _cairo_backend {
cairo_backend_type_t type;
void (*destroy) (void *cr);
cairo_surface_t *(*get_original_target) (void *cr);
cairo_surface_t *(*get_current_target) (void *cr);
cairo_status_t (*save) (void *cr);
cairo_status_t (*restore) (void *cr);
cairo_status_t (*push_group) (void *cr, cairo_content_t content);
cairo_pattern_t *(*pop_group) (void *cr);
cairo_status_t (*set_source_rgba) (void *cr, double red, double green, double blue, double alpha);
cairo_status_t (*set_source_surface) (void *cr, cairo_surface_t *surface, double x, double y);
cairo_status_t (*set_source) (void *cr, cairo_pattern_t *source);
cairo_pattern_t *(*get_source) (void *cr);
cairo_status_t (*set_antialias) (void *cr, cairo_antialias_t antialias);
cairo_status_t (*set_dash) (void *cr, const double *dashes, int num_dashes, double offset);
cairo_status_t (*set_fill_rule) (void *cr, cairo_fill_rule_t fill_rule);
cairo_status_t (*set_line_cap) (void *cr, cairo_line_cap_t line_cap);
cairo_status_t (*set_line_join) (void *cr, cairo_line_join_t line_join);
cairo_status_t (*set_line_width) (void *cr, double line_width);
cairo_status_t (*set_miter_limit) (void *cr, double limit);
cairo_status_t (*set_opacity) (void *cr, double opacity);
cairo_status_t (*set_operator) (void *cr, cairo_operator_t op);
cairo_status_t (*set_tolerance) (void *cr, double tolerance);
cairo_antialias_t (*get_antialias) (void *cr);
void (*get_dash) (void *cr, double *dashes, int *num_dashes, double *offset);
cairo_fill_rule_t (*get_fill_rule) (void *cr);
cairo_line_cap_t (*get_line_cap) (void *cr);
cairo_line_join_t (*get_line_join) (void *cr);
double (*get_line_width) (void *cr);
double (*get_miter_limit) (void *cr);
double (*get_opacity) (void *cr);
cairo_operator_t (*get_operator) (void *cr);
double (*get_tolerance) (void *cr);
cairo_status_t (*translate) (void *cr, double tx, double ty);
cairo_status_t (*scale) (void *cr, double sx, double sy);
cairo_status_t (*rotate) (void *cr, double theta);
cairo_status_t (*transform) (void *cr, const cairo_matrix_t *matrix);
cairo_status_t (*set_matrix) (void *cr, const cairo_matrix_t *matrix);
cairo_status_t (*set_identity_matrix) (void *cr);
void (*get_matrix) (void *cr, cairo_matrix_t *matrix);
void (*user_to_device) (void *cr, double *x, double *y);
void (*user_to_device_distance) (void *cr, double *x, double *y);
void (*device_to_user) (void *cr, double *x, double *y);
void (*device_to_user_distance) (void *cr, double *x, double *y);
void (*user_to_backend) (void *cr, double *x, double *y);
void (*user_to_backend_distance) (void *cr, double *x, double *y);
void (*backend_to_user) (void *cr, double *x, double *y);
void (*backend_to_user_distance) (void *cr, double *x, double *y);
cairo_status_t (*new_path) (void *cr);
cairo_status_t (*new_sub_path) (void *cr);
cairo_status_t (*move_to) (void *cr, double x, double y);
cairo_status_t (*rel_move_to) (void *cr, double dx, double dy);
cairo_status_t (*line_to) (void *cr, double x, double y);
cairo_status_t (*rel_line_to) (void *cr, double dx, double dy);
cairo_status_t (*curve_to) (void *cr, double x1, double y1, double x2, double y2, double x3, double y3);
cairo_status_t (*rel_curve_to) (void *cr, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3);
cairo_status_t (*arc_to) (void *cr, double x1, double y1, double x2, double y2, double radius);
cairo_status_t (*rel_arc_to) (void *cr, double dx1, double dy1, double dx2, double dy2, double radius);
cairo_status_t (*close_path) (void *cr);
cairo_status_t (*arc) (void *cr, double xc, double yc, double radius, double angle1, double angle2, cairo_bool_t forward);
cairo_status_t (*rectangle) (void *cr, double x, double y, double width, double height);
void (*path_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
cairo_bool_t (*has_current_point) (void *cr);
cairo_bool_t (*get_current_point) (void *cr, double *x, double *y);
cairo_path_t *(*copy_path) (void *cr);
cairo_path_t *(*copy_path_flat) (void *cr);
cairo_status_t (*append_path) (void *cr, const cairo_path_t *path);
cairo_status_t (*stroke_to_path) (void *cr);
cairo_status_t (*clip) (void *cr);
cairo_status_t (*clip_preserve) (void *cr);
cairo_status_t (*in_clip) (void *cr, double x, double y, cairo_bool_t *inside);
cairo_status_t (*clip_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
cairo_status_t (*reset_clip) (void *cr);
cairo_rectangle_list_t *(*clip_copy_rectangle_list) (void *cr);
cairo_status_t (*paint) (void *cr);
cairo_status_t (*paint_with_alpha) (void *cr, double opacity);
cairo_status_t (*mask) (void *cr, cairo_pattern_t *pattern);
cairo_status_t (*stroke) (void *cr);
cairo_status_t (*stroke_preserve) (void *cr);
cairo_status_t (*in_stroke) (void *cr, double x, double y, cairo_bool_t *inside);
cairo_status_t (*stroke_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
cairo_status_t (*fill) (void *cr);
cairo_status_t (*fill_preserve) (void *cr);
cairo_status_t (*in_fill) (void *cr, double x, double y, cairo_bool_t *inside);
cairo_status_t (*fill_extents) (void *cr, double *x1, double *y1, double *x2, double *y2);
cairo_status_t (*set_font_face) (void *cr, cairo_font_face_t *font_face);
cairo_font_face_t *(*get_font_face) (void *cr);
cairo_status_t (*set_font_size) (void *cr, double size);
cairo_status_t (*set_font_matrix) (void *cr, const cairo_matrix_t *matrix);
void (*get_font_matrix) (void *cr, cairo_matrix_t *matrix);
cairo_status_t (*set_font_options) (void *cr, const cairo_font_options_t *options);
void (*get_font_options) (void *cr, cairo_font_options_t *options);
cairo_status_t (*set_scaled_font) (void *cr, cairo_scaled_font_t *scaled_font);
cairo_scaled_font_t *(*get_scaled_font) (void *cr);
cairo_status_t (*font_extents) (void *cr, cairo_font_extents_t *extents);
cairo_status_t (*glyphs) (void *cr,
const cairo_glyph_t *glyphs, int num_glyphs,
cairo_glyph_text_info_t *info);
cairo_status_t (*glyph_path) (void *cr,
const cairo_glyph_t *glyphs, int num_glyphs);
cairo_status_t (*glyph_extents) (void *cr,
const cairo_glyph_t *glyphs,
int num_glyphs,
cairo_text_extents_t *extents);
cairo_status_t (*copy_page) (void *cr);
cairo_status_t (*show_page) (void *cr);
};
typedef struct {
cairo_atomic_int_t ref_count;
} cairo_reference_count_t;
struct _cairo {
cairo_reference_count_t ref_count;
cairo_status_t status;
cairo_user_data_array_t user_data;
const cairo_backend_t *backend;
};
struct Ray
{
vec3 m_origin;
vec3 m_direction;
vec3 m_point;
bool m_intersected;
int m_mat;
vec3 m_color;
vec3 m_attenuation;
float m_cumdist;
};
struct Mat
{
vec3 m_diffuse;
vec3 m_reflectance;
vec3 m_transparency;
};
Mat mats[2] = Mat[2](
Mat(vec3(0.8, 0.2, 0.1), vec3(0.2), vec3(0.1)), //label / cap
Mat(vec3(1.0), vec3(0.8), vec3(0.7)) //bottle / grave
);
//choose good positions...
vec3 lightdirs[3] = vec3[3](
vec3(0.0, 0.5, -1.0),
vec3(1.0, -0.5, -1.0),
vec3(-1.0, -0.25, -1.0)
);
vec3 lightcols[3] = vec3[3](
vec3(1.0, 1.0, 0.1),
vec3(1.0, 0.1, 1.0),
vec3(0.1, 1.0, 1.0)
);
float smin( float a, float b, float k )
{
// if (k == 0.0) return min(a,b);
float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 );
return mix( b, a, h ) - k*h*(1.0-h);
}
float distanceToBottleCurve(vec2 point) {
float x = point.x*2.5;
return point.y-0.1*sin(x + 0.6) + 0.05*sin(2.0*x) + 0.04*sin(3.0*x);
}
float tombstone(vec3 point, float w, float l, float h, float s, float s2) {
vec3 ptabs = abs(point);
return -smin(smin(w - ptabs.x, h - ptabs.z, s2), l - ptabs.y, s);
}
float cylinder(vec3 point, float r, float h, float s) {
return -smin(-(length(point.xy) - r), -(abs(point.z) - h), s);
}
vec2 matUnion(vec2 a, vec2 b) {
return (a.x < b.x) ? a : b;
}
vec2 smatUnion(vec2 a, vec2 b, float k) {
return vec2(smin(a.x, b.x, k), matUnion(a, b).y);
}
vec2 bottle(vec3 point) {
//blackle were you raised in a barn? fix this shit!
float dist = length(point.xy);
float tops = abs(point.z-0.05) - 0.95;
float curve = distanceToBottleCurve(vec2(point.z, dist - 0.29));
curve += min(sin(atan(point.y/point.x)*16.0), 0.0)*0.001;
float shell = -smin(-tops, -curve, 0.2);
for (int i = 0; i < 3; i++) {
vec2 angle = vec2(cos(3.14/3.0*float(i)), sin(3.14/3.0*float(i)));
//note, make this a call to cylinder
float cut = length(vec2(dot(point.xy, angle), point.z) - vec2(dot(vec2(0.0), angle), 0.95)) - 0.06;
shell = -smin(-shell, cut, 0.1);
}
float lid = cylinder(point+vec3(0.0,0.0,0.89), 0.14, 0.10, 0.02);
lid += abs(sin(atan(point.y/point.x)*32.0))*0.0005 * (1.0 - clamp(abs(dist - 0.14)*32.0, 0.0, 1.0));
lid = min(lid, cylinder(point+vec3(0.0,0.0,0.77), 0.14, 0.02, 0.02));
float lip = cylinder(point+vec3(0.0,0.0,0.73), 0.15, 0.01, 0.01);
shell = min(lip, shell);
float label = cylinder(point*3.1 + vec3(0.0,0.0,-0.75), 1.05, 1.0, 0.1) / 2.9;
return smatUnion(smatUnion(
vec2(shell, 1.0),
vec2(label, 0.0), 0.02),
vec2(lid, 0.0), 0.02);
// return uni;
}
vec2 scene(vec3 point) {
// return bottle(p4b);
vec3 offset = point.x > 1.0
? vec3(2.0, 0.0, 0.0)
: (point.x < -1.0
? vec3(-2.0, 0.0, 0.0)
: vec3(0.0));
vec3 p = point - offset;
float wobble = cos(point.z)*cos(point.y*5.0)*cos(point.x*5.0)*0.01;
float grave = -smin(-p.z, tombstone(p, 0.6 + p.z*0.2, 1.2 + p.z*0.2, 0.75, 0.1, 0.1), 0.1);
float stone = tombstone(p + vec3(0.0, 1.5, 0.0), 0.5 - p.z*0.01, 0.12 - p.z*0.01, 1.2, 0.1, 0.5);
vec3 p4b = (p - vec3(0.0, 0.0, -0.25)).zxy;
// return bottle(p4b);
return matUnion(vec2(wobble + smin(stone, grave, 0.1), 1.0), bottle(p4b));
}
vec3 sceneGrad(vec3 point) {
float t = scene(point).x;
return normalize(vec3(
t - scene(point + vec3(0.001,0.0,0.0)).x,
t - scene(point + vec3(0.0,0.001,0.0)).x,
t - scene(point + vec3(0.0,0.0,0.001)).x));
}
Ray newRay(vec3 origin, vec3 direction, vec3 attenuation, float cumdist) {
// Create a default ray
return Ray(origin, direction, origin, false, -1, vec3(0.0), attenuation, cumdist);
}
void castRay(inout Ray ray) {
// Cast ray from origin into scene
float sgn = sign(scene(ray.m_origin).x);
for (int i = 0; i < 100; i++) {
float dist = length(ray.m_point - ray.m_origin) + ray.m_cumdist;
if (dist > 20.0) {
break;
}
vec2 smpl = scene(ray.m_point);
float res = smpl.x;
if (abs(res) < 0.0001) {
ray.m_intersected = true;
ray.m_mat = int(smpl.y);
ray.m_cumdist = dist;
break;
}
ray.m_point += res * ray.m_direction * sgn;
}
}
void phongShadeRay(inout Ray ray) {
if (ray.m_intersected) {
for (int i = 0; i < 3; i++) {
vec3 lightDirection = normalize(lightdirs[i]);
Mat mat = mats[ray.m_mat];
vec3 normal = -sceneGrad(ray.m_point);
vec3 reflected = reflect(lightDirection, normal);
float diffuse = abs(dot(lightDirection, normal));
float specular = pow(abs(dot(ray.m_direction, reflected)), 20.0);
vec3 diffuse_color = mat.m_diffuse;
if (ray.m_mat == 0) {
if (ray.m_point.x > 1.0) {
diffuse_color = diffuse_color.zyx;
} else if (ray.m_point.x < -1.0) {
diffuse_color = diffuse_color.zxy * 0.7;
}
}
//oh god blackle clean this up
ray.m_color += (diffuse_color * diffuse * (- mat.m_transparency + 1.0) + specular)*lightcols[i];
}
} else {
ray.m_color += 1.0-ray.m_direction*ray.m_direction;//vec3(pow(abs(dot(lightDirection, ray.m_direction)), 25.0))*lightcols[i];
}
}
void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
// Normalized pixel coordinates (from -1 to 1)
vec2 uv = (fragCoord/iResolution.xy)*2.0 - vec2(1.0,1.0);
uv.y *= iResolution.y/iResolution.x;
vec3 cameraOrigin = vec3(5.0);
vec3 cameraDirection = vec3(-1.41,-1.41,-1.41);
vec3 platePoint = (vec3(-0.71,0.71,0.0) * uv.x + vec3(0.41, 0.41, -0.82) * -uv.y);
Ray ray = newRay(cameraOrigin, normalize(platePoint + cameraDirection), vec3(1.0), 0.0);
castRay(ray);
phongShadeRay(ray);
fragColor = vec4(ray.m_color, 1.0);
}
\ No newline at end of file
#define GL_GLEXT_PROTOTYPES why
#include<stdio.h>
#include<stdbool.h>
#include<stdlib.h>
#include<stdint.h>
#include<X11/X.h>
#include<X11/Xlib.h>
#include<X11/extensions/Xrandr.h>
#include<GL/gl.h>
#include<GL/glx.h>
#include<GL/glu.h>
#include<cairo/cairo.h>
#include "cairo-private.h"
#include "shader.h"
// #define DEBUG true
#define CANVAS_WIDTH 1920
#define CANVAS_HEIGHT 1080
struct _textloc {
char* text;
char* font;
cairo_matrix_t matrix;
float origin_x;
float origin_y;
};
static unsigned char fbdata[4 * CANVAS_HEIGHT * CANVAS_WIDTH];
__attribute__((force_align_arg_pointer))
void _start() {
//initialize the window
Display* dpy = XOpenDisplay(NULL);
Window root = DefaultRootWindow(dpy);
int num_sizes;
XRRScreenSize* sizes = XRRSizes(dpy, 0, &num_sizes);
for (int i = 0; i < num_sizes; i++) {
if (sizes[i].width == 1920 && sizes[i].height == 1080) {
XRRScreenConfiguration* conf = XRRGetScreenInfo(dpy, root);
XRRSetScreenConfig(dpy, conf, root, i, RR_Rotate_0, CurrentTime);
break;
}
}
GLint att[] = { GLX_RGBA, None };
XVisualInfo* vi = glXChooseVisual(dpy, 0, att);
//I really hate this and I wish this call was unneeded. it feels useless
Colormap cmap = XCreateColormap(dpy, root, vi->visual, AllocNone);
//hide cursor
// static char csr_bits[] = {0x00};
XColor xcolor;
Pixmap csr= XCreatePixmap(dpy,root,1,1,1);
Cursor cursor= XCreatePixmapCursor(dpy,csr,csr,&xcolor,&xcolor,1,1);
//this enables things like events, fullscreen, and sets the invisible cursor
XSetWindowAttributes swa;
swa.colormap = cmap;
swa.override_redirect = 1;
swa.event_mask = ExposureMask | KeyPressMask;
swa.cursor = cursor;
Window win = XCreateWindow(dpy, root, 0, 0, CANVAS_WIDTH, CANVAS_HEIGHT, 0, vi->depth, InputOutput, vi->visual, CWColormap | CWEventMask | CWOverrideRedirect | CWCursor, &swa);
// XStoreName(dpy, win, "POLYETHYLENE CENOTAPH");
//this actually opens the window
XMapWindow(dpy, win);
//now we can do opengl calls!!!!
GLXContext glc = glXCreateContext(dpy, vi, NULL, 1);
#ifdef DEBUG
if (glc == NULL) {
return;
}
#endif
glXMakeCurrent(dpy, win, glc);
//clear to black and use glfinish to make sure it propagates to the screen before we start shader compilation
// glViewport(0,0, CANVAS_WIDTH, CANVAS_HEIGHT);
// typedef void (*voidWithNoParams)();
// voidWithNoParams glClearColorArbitrary = (voidWithNoParams)glClearColor;
// (*glClearColorArbitrary)();
// glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
// glFinish();
//oh yeah grab the keyboard
XGrabKeyboard(dpy, win, true, GrabModeAsync, GrabModeAsync, CurrentTime);
//initialize the render with some text
cairo_surface_t* cairoSurf = cairo_image_surface_create_for_data(fbdata, CAIRO_FORMAT_ARGB32, CANVAS_WIDTH, CANVAS_HEIGHT, 4 * CANVAS_WIDTH);
cairo_t* cairoCtx = cairo_create(cairoSurf);
// cairo_set_font_matrix(cairoCtx, &matrix);
// printf("xx: %f, xy: %f, yy: %f, yx: %f, x0: %f, y0: %f\n", matrix.xx, matrix.xy, matrix.yy, matrix.yx, matrix.x0, matrix.y0);
const static struct _textloc texts[9] = {
{
.text = "rip lol",
.font = "FreeSerif",
.matrix = {.xx = 50, .xy = -10, .yy = -50, .yx = 21, .x0 = 0, .y0 = 0},
.origin_x = 190,
.origin_y = 550,
},
{
.text = "you were",
.font = "FreeSerif",
.matrix = {.xx = 35, .xy = -6, .yy = -35, .yx = 16, .x0 = 0, .y0 = 0},
.origin_x = 642,
.origin_y = 780,
},
{
.text = "so tastey",
.font = "FreeSerif",
.matrix = {.xx = 35, .xy = -6, .yy = -35, .yx = 16, .x0 = 0, .y0 = 0},
.origin_x = 647,
.origin_y = 750,
},
{
.text = "how do i",
.font = "FreeSans",
.matrix = {.xx = 25, .xy = 0, .yy = -25, .yx = 0, .x0 = 0, .y0 = 0},
.origin_x = 985,
.origin_y = 975,
},
{
.text = "rotate text",
.font = "FreeSans",
.matrix = {.xx = 25, .xy = 0, .yy = -25, .yx = 0,