summaryrefslogtreecommitdiff
path: root/zig-x11/window.c
blob: fb7a9e7638bf8ddb25d7c637160434d7799d64d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// This is here just for reference. It is not required for this example.

#include <X11/Xlib.h>
#include <unistd.h>

int main() {
    Display *MainDisplay = XOpenDisplay(0);
    Window RootWindow = XDefaultRootWindow(MainDisplay);

    Window MainWindow = XCreateSimpleWindow(MainDisplay, RootWindow, 0, 0, 800, 600, 0, 0, 0xFF0000);
    XMapWindow(MainDisplay, MainWindow);
    XFlush(MainDisplay);

    for (;;) {
        sleep(1);
    }
}