-
Notifications
You must be signed in to change notification settings - Fork 14
/
mlx.1
93 lines (79 loc) · 2.36 KB
/
mlx.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
.TH MiniLibX 3 "September 19, 2002"
.SH NAME
MiniLibX - Simple X-Window Interface Library for students
.SH SYNOPSYS
#include <mlx.h>
.nf
.I void *
.fi
.B mlx_init
();
.SH DESCRIPTION
MiniLibX is an easy way to create graphical software,
without any X-Window programming knowledge. It provides
simple window creation, a drawing tool, image and basic events
management.
.SH X-WINDOW CONCEPT
X-Window is a network-oriented graphical system for Unix.
It is based on two main parts:
.br
On one side, your software wants to draw something on the screen and/or
get keyboard & mouse entries.
.br
On the other side, the X-Server manages the screen, keyboard and mouse
(It is often refered to as a "display").
.br
A network connection must be established between these two entities to send
drawing orders (from the software to the X-Server), and keyboard/mouse
events (from the X-Server to the software).
.SH INCLUDE FILE
.B mlx.h
should be included for a correct use of the MiniLibX API.
It only contains function prototypes, no structure is needed.
.SH LIBRARY FUNCTIONS
.P
First of all, you need to initialize the connection
between your software and the display.
Once this connection is established, you'll be able to
use other MiniLibX functions to send the X-Server messages,
like "I want to draw a yellow pixel in this window" or "did the
user hit a key?".
.P
The
.B mlx_init
function will create this connection. No parameters are needed, ant it will
return a
.I "void *"
identifier, used for further calls to the library routines.
.P
All other MiniLibX functions are described in the following man pages:
.TP 20
.B mlx_new_window
: manage windows
.TP 20
.B mlx_pixel_put
: draw inside window
.TP 20
.B mlx_new_image
: manipulate images
.TP 20
.B mlx_loop
: handle keyboard or mouse events
.SH LINKING MiniLibX
To use MiniLibX functions, you'll need to link
your software with several libraries, including the MiniLibX library itself.
To do this, simply add the following arguments at linking time:
.B -lmlx -lXext -lX11
You may also need to specify the path to these libraries, using
the
.B -L
flag.
.SH RETURN VALUES
If
.B mlx_init()
fails to set up the connection to the X server, it will return NULL, otherwise
a non-null pointer is returned as a connection identifier.
.SH SEE ALSO
mlx_new_window(3), mlx_pixel_put(3), mlx_new_image(3), mlx_loop(3)
.SH AUTHOR
Copyright ol@ - 2002-2014 - Olivier Crouzet