readme.md 1.38 KB
Newer Older
Daniel Vogel's avatar
Daniel Vogel committed
1
2
3
4
5
6
# CS 349 X Windows and XLib Example Code


To make ("compile and link") an example, use the included makefile with 
the name of cpp file passed as a variable. For example, to make hello.cpp:

Daniel Vogel's avatar
Daniel Vogel committed
7
8
9
```bash
	make NAME="hello"
```
Daniel Vogel's avatar
Daniel Vogel committed
10
11
12

Then, to run:

Daniel Vogel's avatar
Daniel Vogel committed
13
14
15
```bash
    ./hello 
```
Daniel Vogel's avatar
Daniel Vogel committed
16
17
18

Or you can even compile, link, and run in one step:

Daniel Vogel's avatar
Daniel Vogel committed
19
20
21
```bash
    make run NAME="hello"
```
Daniel Vogel's avatar
Daniel Vogel committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61


## Examples


### Windowing Systems

    hello.cpp           Draws text in window, demos larger font choice.

    null.min.cpp        Creates and destroys a display (a good first test to see
                		if X Windows is working).

    openwindow.min.cpp  Opens a single blank window (minimal version)

	openwindow.cpp     	Opens a single blank window

### Drawing

	drawing.min.cpp	    Demos drawing and graphics context (minimal version)
       
    drawing.cpp     	Demos drawing functions and graphics contexts  

### Events

    eventloop.min.cpp   Demos events by displaying mouse motion events 
    					to console (minimal version)

    eventloop.cpp     	Demos events by drawing text at cursor location

    animation.cpp   	Demos animation using non-blocking
    					event loop.

    doublebuffer.cpp    Demos double buffering (using same 
    				    demo as animation.cpp)

    clipping.cpp        Demos clipping using a mouse controlled clipping
                        rectangle to reveal a pattern of random lines.