files
kolibrios/programs/develop/ktcc/source/examples/ex4.c
Andrew 42e77931bf
Some checks failed
Build system / Check kernel codestyle (pull_request) Successful in 25s
Build system / Build (pull_request) Failing after 27s
develop/ktcc: Post-SVN tidy
- Move source code from `trunk` into program root directory.
- Update build files.
2025-05-24 11:48:18 +01:00

27 lines
615 B
C

#!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11
#include <stdlib.h>
#include <stdio.h>
#include <X11/Xlib.h>
/* Yes, TCC can use X11 too ! */
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;
}