moved examples

This commit is contained in:
bellard
2005-04-14 23:56:18 +00:00
parent 7baf968102
commit 02af482c32
5 changed files with 0 additions and 0 deletions

25
examples/ex4.c Executable file
View File

@ -0,0 +1,25 @@
#!./tcc -run -L/usr/X11R6/lib -lX11
#include <stdlib.h>
/* Yes, TCC can use X11 too ! */
#include <stdio.h>
#include <X11/Xlib.h>
int main(int argc, char **argv)
{
Display *display;
Screen *screen;
display = XOpenDisplay("");
if (!display) {
fprintf(stderr, "Could not open X11 display\n");
exit(1);
}
printf("X11 display opened.\n");
screen = XScreenOfDisplay(display, 0);
printf("width = %d\nheight = %d\ndepth = %d\n",
screen->width,
screen->height,
screen->root_depth);
XCloseDisplay(display);
return 0;
}