<commit_before>#include "driver-linux.h"

Window root;
GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24,GLX_DOUBLEBUFFER, None };
XVisualInfo *vi;
Colormap cmap;
XSetWindowAttributes swa;
GLXContext glc;

void init_graffiks_xorg(int window_width, int window_height, char *window_title,
        void (*init)(int *width, int *height),
        void (*update)(float time_step),
        void (*draw)(void),
        void (*finish)(void)) {

    display = XOpenDisplay(NULL);
    root = DefaultRootWindow(display);
    vi = glXChooseVisual(display, 0, att);

    cmap = XCreateColormap(display, root, vi->visual, AllocNone);

    swa.colormap = cmap;
    swa.event_mask = ExposureMask | KeyPressMask;

    win = XCreateWindow(display, root, 0, 0, window_width, window_height, 0, vi->depth, InputOutput, vi->visual, CWColormap | CWEventMask, &swa);

    XMapWindow(display, win);
<commit_msg>enable antialiasing on linux<commit_after>#include "driver-linux.h"

Window root;
GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24,GLX_DOUBLEBUFFER,GLX_SAMPLE_BUFFERS,1,GLX_SAMPLES,8,  None };
XVisualInfo *vi;
Colormap cmap;
XSetWindowAttributes swa;
GLXContext glc;

void init_graffiks_xorg(int window_width, int window_height, char *window_title,
        void (*init)(int *width, int *height),
        void (*update)(float time_step),
        void (*draw)(void),
        void (*finish)(void)) {

    display = XOpenDisplay(NULL);
    root = DefaultRootWindow(display);
    vi = glXChooseVisual(display, 0, att);

    cmap = XCreateColormap(display, root, vi->visual, AllocNone);

    swa.colormap = cmap;
    swa.event_mask = ExposureMask | KeyPressMask;

    win = XCreateWindow(display, root, 0, 0, window_width, window_height, 0, vi->depth, InputOutput, vi->visual, CWColormap | CWEventMask, &swa);

    XMapWindow(display, win);

{'fraction_non_alphanumeric': 0.12589729431253452, 'fraction_numerical': 0.007730535615681944, 'mean_word_length': 4.507598784194529, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4468365', 'n_tokens_mistral': 667, 'n_tokens_neox': 630, 'n_words': 145}