new file: Makefile
new file: color new file: color.c
This commit is contained in:
commit
95531208bf
4
Makefile
Normal file
4
Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
make:
|
||||
gcc color.c -lX11 -o color
|
||||
debug:
|
||||
gcc color.c -lX11 -o color -ggdb
|
37
color.c
Normal file
37
color.c
Normal file
@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user