source: EcnlProtoTool/trunk/tcc-0.9.26/examples/ex4.c@ 279

Last change on this file since 279 was 279, checked in by coas-nagasima, 7 years ago

ファイルを追加、更新。

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-csrc
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
8int 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.