readme.md 1.81 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


## 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  
Daniel Vogel's avatar
Daniel Vogel committed
43
44
45
46
47
    
    displaylist         Demos Displayable class and display list technique
    
    clipping.cpp        Demos clipping using a mouse controlled clipping
                        rectangle to reveal a pattern of random lines.
Daniel Vogel's avatar
Daniel Vogel committed
48
49
50
51
52
53
54
55

### 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

Daniel Vogel's avatar
Daniel Vogel committed
56
57
    animation.cpp   	Demos animation with using non-blocking
    					event loop to bounce ball around.
Daniel Vogel's avatar
Daniel Vogel committed
58
59
60

    doublebuffer.cpp    Demos double buffering (using same 
    				    demo as animation.cpp)
Daniel Vogel's avatar
Daniel Vogel committed
61
62
63
64
65
66
    				    
### Extras (not covered in lecture)

    multiwindow         Opens and draws into two windows 
                        (see command line usage when running)

Daniel Vogel's avatar
Daniel Vogel committed
67
68
    xeyesball           More complicated animation, event handling, and 
                        drawing.
Daniel Vogel's avatar
Daniel Vogel committed
69

Daniel Vogel's avatar
Daniel Vogel committed
70
    xeyesballdb         xeyesball with double buffering
Daniel Vogel's avatar
Daniel Vogel committed
71

Daniel Vogel's avatar
Daniel Vogel committed
72
73
74
75