OSDN Git Service

minor updates
[android-x86/external-mesa.git] / docs / devinfo.html
1 <HTML>
2
3 <TITLE>Development Notes</TITLE>
4
5 <BODY text="#000000" bgcolor="#55bbff" link="#111188">
6
7 <H1>Development Notes</H1>
8
9
10 <H2>Adding Extentions</H2>
11
12 <p>
13 To add a new GL extension to Mesa you have to do the following.
14 <pre>
15    If glext.h doesn't define the extension, edit include/GL/gl.h and add:
16         - new enum tokens
17         - new API function entry points
18         - #define GL_EXT_the_extension_name 1
19
20    If adding a new API function (call it glNewFunctionEXT):
21         - insert glNewFunctionEXT()into src/apiext.h
22         - edit src/types.h and add NewFunction to the gl_api_table struct
23         - implement gl_NewFunction() in the appropriate src file
24         - hook gl_NewFunction() into pointers.c
25         - add display list support in dlist.c for save_NewFunction()
26         - add glNewFunctionEXT to gl_GetProcAddress() in extensions.c or
27           in the device driver's GetProcAddress() function if appropriate
28 </pre>
29 <p>
30 If adding new GL state be sure to update get.c and enable.c
31 </p>
32 <p>
33 In general, look for an extension similar to the new one that's already
34 implemented in Mesa and follow it by example.
35 </p>
36
37
38
39 <H2>Coding Style</H2>
40
41 <p>
42 Mesa's code style has changed over the years.  Here's the latest.
43 </p>
44
45 <p>
46 Comment your code!  It's extremely important that open-source code be
47 well documented.  Also, strive to write clean, easily understandable code.
48 </p>
49
50 <p>
51 3-space indentation
52 </p>
53
54 <p>
55 If you use tabs, set them to 8 columns
56 </p>
57
58 <p>
59 Brace example:
60 </p>
61 <pre>
62         if (condition) {
63            foo;
64         }
65         else {
66            bar;
67         }
68 </pre>
69
70 <p>
71 Here's the GNU indent command which will best approximate my preferred style:
72 </p>
73 <pre>
74         indent -br -i3 -npcs infile.c -o outfile.c
75 </pre>
76
77
78 <p>
79 Local variable name example:  localVarName (no underscores)
80 </p>
81
82 <p>
83 Constants and macros are ALL_UPPERCASE, with _ between words
84 </p>
85
86 <p>
87 Global vars not allowed.
88 </p>
89
90 <p>
91 Function name examples:
92 </p>
93 <pre>
94         glFooBar()       - a public GL entry point (in dispatch.c)
95         _mesa_FooBar()   - the internal immediate mode function
96         save_FooBar()    - retained mode (display list) function in dlist.c
97         foo_bar()        - a static (private) function
98         _mesa_foo_bar()  - an internal non-static Mesa function
99 </pre>
100
101
102 <H2>Writing a Device Driver</H2>
103
104 <p>
105 XXX to do
106 </p>
107
108
109
110 <H2>Making a New Mesa Release</H2>
111
112 <p>
113 These are the instructions for making a new Mesa release.
114 </p>
115
116 <p>
117 Prerequisites (later versions may work):
118 </p>
119 <ul>
120 <li>    autoconf 2.50
121 <li>    automake 1.4-p2
122 <li>    libtool 1.4
123 </ul>
124
125 <p>
126 Be sure to do a "cvs update -d ." in the Mesa directory to
127 get all the latest files.
128 </p>
129
130 <p>
131 Update the version strings in src/get.c and src/X/fakeglx.c to return
132 the new Mesa version number.
133 </p>
134
135 <p>
136 Create/edit the docs/RELNOTES-X-Y file to document what's new in the release.
137 Edit the docs/VERSIONS file too.
138 </p>
139
140 <p>
141 Edit Make-config and change the MESA_MAJOR and/or MESA_MINOR versions.
142 </p>
143
144 <p>
145 Edit the GNU configure stuff to change versions numbers as needed:
146 Update the version string (second argument) in the line
147 "AM_INIT_AUTOMAKE(Mesa, 3.3)" in the configure.in file.
148 </p>
149
150 <p>
151 Remove the leading `dnl' from the line "dnl AM_MAINTAINER_MODE".
152 </p>
153
154 <p>
155 Verify the version numbers near the top of configure.in
156 </p>
157
158 <p>
159 Run "fixam -f" to disable automatic dependency tracking.
160 </p>
161
162 <p>
163 Run the bootstrap script to generate the configure script.
164 </p>
165
166 <p>
167 Edit Makefile.X11 and verify DIRECTORY is set correctly.  The Mesa
168 sources must be in that directory (or there must be a symbolic link).
169 </p>
170
171 <p>
172 Edit Makefile.X11 and verify that LIB_NAME and DEMO_NAME are correct.
173 If it's a beta release, be sure the bump up the beta release number.
174 </p>
175
176 <p>
177 cp Makefile.X11 to Makefile so that the old-style Mesa makefiles
178 still work.  ./configure will overwrite it if that's what the user runs.
179 </p>
180
181 <p>
182 Make a symbolic link from $(DIRECTORY) to Mesa.  For example,
183 ln -s Mesa Mesa-3.3    This is needed in order to make a correct
184 tar file in the next step.
185 </p>
186
187 <p>
188 Make the distribution files.  From inside the Mesa directory:
189 <pre>
190         make -f Makefile.X11 lib_tar
191         make -f Makefile.X11 demo_tar
192         make -f Makefile.X11 lib_zip
193         make -f Makefile.X11 demo_zip
194 </pre>
195
196 <p>
197 Copy the distribution files to a temporary directory, unpack them,
198 compile everything, and run some demos to be sure everything works.
199 </p>
200
201 <p>
202 Upload the *.tar.gz and *.zip files to ftp.mesa3d.org
203 </p>
204
205 <p>
206 Update the web site.
207 </p>
208
209 <p>
210 Make an announcement on the mailing lists:
211 <em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>d</em><em>e</em><em>v</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>,
212 <em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>u</em><em>s</em><em>e</em><em>r</em><em>s</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
213 and
214 <em>m</em><em>e</em><em>s</em><em>a</em><em>3</em><em>d</em><em>-</em><em>a</em><em>n</em><em>n</em><em>o</em><em>u</em><em>n</em><em>c</em><em>e</em><em>@</em><em>l</em><em>i</em><em>s</em><em>t</em><em>s</em><em>.</em><em>s</em><em>f</em><em>.</em><em>n</em><em>e</em><em>t</em>
215 </p>
216
217
218 <H2>Autoconf info</H2>
219
220 <p>
221 In order to run the bootstrap script you'll need:
222 <p>
223 <pre>
224 autoconf 2.50
225 automake 1.4-p5
226 libtool 1.4
227 </pre>
228
229
230 </body>
231 </html>