diff --git a/README.md b/README.md index e69de29..d08bdcb 100644 --- a/README.md +++ b/README.md @@ -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 +

+to compile the code use: + +gcc main.c -o 01_simple_window -lX11 +

\ No newline at end of file diff --git a/main.c b/main.c index e1988a3..2c0d2b7 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,14 @@ -#include +#include +#include -int main(void) { - printf("Hello, World!\n"); - return 0; +int main() +{ + 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); } } \ No newline at end of file