This commit is contained in:
Lily Oelbeck
2025-11-11 09:01:35 +01:00
parent e60fc751de
commit 4e9a57878b
2 changed files with 18 additions and 4 deletions

View File

@@ -0,0 +1,6 @@
# i am not yet sure what i want to do but i want to create some sort of windows on my own but the scope isnt clear yet
<p>
to compile the code use:
gcc main.c -o 01_simple_window -lX11
</p>

16
main.c
View File

@@ -1,6 +1,14 @@
#include <stdio.h> #include <X11/Xlib.h>
#include <unistd.h>
int main(void) { int main()
printf("Hello, World!\n"); {
return 0; Display* MainDisplay = XOpenDisplay(0);
Window RootWindow = XDefaultRootWindow(MainDisplay);
Window MainWindow = XCreateSimpleWindow(MainDisplay, RootWindow, 0, 0, 800, 600, 0, 0, 0x00aade87);
XMapWindow(MainDisplay, MainWindow);
XFlush(MainDisplay);
for(;;) { sleep(1); }
} }