From 95531208bf941f05fd1d3c63abcb403b637a4316 Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Mon, 20 Jul 2020 23:17:24 -0500 Subject: new file: Makefile new file: color new file: color.c --- Makefile | 4 ++++ color | Bin 0 -> 16880 bytes color.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 Makefile create mode 100755 color create mode 100644 color.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..44479c0 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +make: + gcc color.c -lX11 -o color +debug: + gcc color.c -lX11 -o color -ggdb diff --git a/color b/color new file mode 100755 index 0000000..3731412 Binary files /dev/null and b/color differ diff --git a/color.c b/color.c new file mode 100644 index 0000000..827e02c --- /dev/null +++ b/color.c @@ -0,0 +1,37 @@ +#include +#include +#include +#include +#include + +#define START_COLOR 0xffffff + +int main() { + Display *display; + Window window; + int screen; + + + if((display = XOpenDisplay(NULL)) == NULL) { + printf("There was an error opening the screen: %s\n", strerror(errno)); + exit(errno); + } + + screen = DefaultScreen(display); + + window = XCreateSimpleWindow( + display, + RootWindow(display, screen), + 10, 10, + 1000, 1000, + 0, + BlackPixel(display, screen), + WhitePixel(display, screen)); + + XMapWindow(display, screen); + XFlush(display); + + + +} + -- cgit v1.2.3