Last change
on this file since 371 was 321, checked in by coas-nagasima, 7 years ago |
文字コードを設定
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
615 bytes
|
Line | |
---|
1 | #!/usr/local/bin/tcc -run -L/usr/X11R6/lib -lX11
|
---|
2 | #include <stdlib.h>
|
---|
3 | #include <stdio.h>
|
---|
4 | #include <X11/Xlib.h>
|
---|
5 |
|
---|
6 | /* Yes, TCC can use X11 too ! */
|
---|
7 |
|
---|
8 | int main(int argc, char **argv)
|
---|
9 | {
|
---|
10 | Display *display;
|
---|
11 | Screen *screen;
|
---|
12 |
|
---|
13 | display = XOpenDisplay("");
|
---|
14 | if (!display) {
|
---|
15 | fprintf(stderr, "Could not open X11 display\n");
|
---|
16 | exit(1);
|
---|
17 | }
|
---|
18 | printf("X11 display opened.\n");
|
---|
19 | screen = XScreenOfDisplay(display, 0);
|
---|
20 | printf("width = %d\nheight = %d\ndepth = %d\n",
|
---|
21 | screen->width,
|
---|
22 | screen->height,
|
---|
23 | screen->root_depth);
|
---|
24 | XCloseDisplay(display);
|
---|
25 | return 0;
|
---|
26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.