blob: 3cebf5f36db006ec50191c975030a7d1fd104f8d [file] [log] [blame]
Brian Paul0b27ace2003-03-08 17:38:57 +00001<HTML>
2
3<TITLE>Development Notes</TITLE>
4
Brian Paul36da0452005-01-20 03:55:10 +00005<link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<BODY>
Brian Paul0b27ace2003-03-08 17:38:57 +00008
9<H1>Development Notes</H1>
10
11
12<H2>Adding Extentions</H2>
13
14<p>
Brian Paul51830612004-08-17 14:08:59 +000015To add a new GL extension to Mesa you have to do at least the following.
Brian Paul0b27ace2003-03-08 17:38:57 +000016
Brian Paul51830612004-08-17 14:08:59 +000017<ul>
18<li>
19 If glext.h doesn't define the extension, edit include/GL/gl.h and add
20 code like this:
21 <pre>
22 #ifndef GL_EXT_the_extension_name
23 #define GL_EXT_the_extension_name 1
24 /* declare the new enum tokens */
25 /* prototype the new functions */
26 /* TYPEDEFS for the new functions */
27 #endif
28 </pre>
29</li>
30<li>
31 In the src/mesa/glapi/ directory, add the new extension functions and
32 enums to the gl_API.xml file.
33 Then, a bunch of source files must be regenerated by executing the
34 corresponding Python scripts.
35</li>
36<li>
Brian Paulbb086292006-09-21 22:53:15 +000037 Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
38</li>
39<li>
40 Update the <code>extensions.c</code> file.
41</li>
42<li>
43 From this point, the best way to proceed is to find another extension,
44 similar to the new one, that's already implemented in Mesa and use it
45 as an example.
Brian Paul51830612004-08-17 14:08:59 +000046</li>
47<li>
Brian Paul65b79052004-11-22 17:49:15 +000048 If the new extension adds new GL state, the functions in get.c, enable.c
Brian Paul51830612004-08-17 14:08:59 +000049 and attrib.c will most likely require new code.
50</li>
51</ul>
Brian Paul0b27ace2003-03-08 17:38:57 +000052
53
54
55<H2>Coding Style</H2>
56
57<p>
58Mesa's code style has changed over the years. Here's the latest.
59</p>
60
61<p>
62Comment your code! It's extremely important that open-source code be
63well documented. Also, strive to write clean, easily understandable code.
64</p>
65
66<p>
673-space indentation
68</p>
69
70<p>
71If you use tabs, set them to 8 columns
72</p>
73
74<p>
75Brace example:
76</p>
77<pre>
78 if (condition) {
79 foo;
80 }
81 else {
82 bar;
83 }
84</pre>
85
86<p>
87Here's the GNU indent command which will best approximate my preferred style:
88</p>
89<pre>
Brian Paule3f41ce2006-03-31 23:10:21 +000090 indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
Brian Paul0b27ace2003-03-08 17:38:57 +000091</pre>
92
93
94<p>
95Local variable name example: localVarName (no underscores)
96</p>
97
98<p>
99Constants and macros are ALL_UPPERCASE, with _ between words
100</p>
101
102<p>
Brian Paul65b79052004-11-22 17:49:15 +0000103Global variables are not allowed.
Brian Paul0b27ace2003-03-08 17:38:57 +0000104</p>
105
106<p>
107Function name examples:
108</p>
109<pre>
110 glFooBar() - a public GL entry point (in dispatch.c)
111 _mesa_FooBar() - the internal immediate mode function
112 save_FooBar() - retained mode (display list) function in dlist.c
113 foo_bar() - a static (private) function
114 _mesa_foo_bar() - an internal non-static Mesa function
115</pre>
116
117
Brian Paul0b27ace2003-03-08 17:38:57 +0000118<H2>Making a New Mesa Release</H2>
119
120<p>
121These are the instructions for making a new Mesa release.
122</p>
123
Brian Paul65b79052004-11-22 17:49:15 +0000124<H3>Get latest source files</H3>
Brian Paul0b27ace2003-03-08 17:38:57 +0000125<p>
Brian Paul65b79052004-11-22 17:49:15 +0000126Use "cvs update -dAP " to get the latest Mesa files from CVS.
Brian Paul0b27ace2003-03-08 17:38:57 +0000127</p>
128
Brian Paul0b27ace2003-03-08 17:38:57 +0000129
Brian Paul65b79052004-11-22 17:49:15 +0000130<H3>Verify and update version info</H3>
Brian Paul0b27ace2003-03-08 17:38:57 +0000131<p>
Brian Paul68155872003-06-01 16:28:00 +0000132Create/edit the docs/RELNOTES-X.Y file to document what's new in the release.
Brian Paul65b79052004-11-22 17:49:15 +0000133Add the new RELNOTES-X.Y file to <a href="relnotes.html">relnotes.html</a>.
Brian Paul9cef3ef2004-10-02 15:43:14 +0000134Update the docs/VERSIONS file too.
Brian Paul0b27ace2003-03-08 17:38:57 +0000135</p>
136
137<p>
Dan Nicholson73f6f7e2007-12-30 08:48:10 -0800138Edit the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in
Dan Nicholson00994ac2008-04-30 15:06:00 -0700139configs/default.
Brian Paul0b27ace2003-03-08 17:38:57 +0000140</p>
141
142<p>
Dan Nicholson00994ac2008-04-30 15:06:00 -0700143Make sure the values in src/mesa/main/version.h are correct.
Brian Paul65b79052004-11-22 17:49:15 +0000144</p>
145
146<p>
Brian Paul9cef3ef2004-10-02 15:43:14 +0000147Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and
148DEMO_NAME are correct.
Brian Paul0b27ace2003-03-08 17:38:57 +0000149</p>
150
151<p>
Brian Paule3f41ce2006-03-31 23:10:21 +0000152Update the docs/news.html file and docs/download.html files.
Brian Paul65b79052004-11-22 17:49:15 +0000153</p>
154
155<p>
156Check in all updates to CVS.
157</p>
158
159<p>
160Tag the CVS files with the release name (in the form <b>mesa_X_Y</b>).
161</p>
162
163
164<H3>Make the tarballs</H3>
165<p>
Brian Paul9cef3ef2004-10-02 15:43:14 +0000166Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
Brian Paul65b79052004-11-22 17:49:15 +0000167ln -s Mesa Mesa-6.3
168This is needed in order to make a correct tar file in the next step.
Brian Paul0b27ace2003-03-08 17:38:57 +0000169</p>
170
171<p>
172Make the distribution files. From inside the Mesa directory:
173<pre>
Brian Paul9cef3ef2004-10-02 15:43:14 +0000174 make tarballs
Brian Paul0b27ace2003-03-08 17:38:57 +0000175</pre>
176
177<p>
Brian Paul65b79052004-11-22 17:49:15 +0000178After the tarballs are created, the md5 checksums for the files will
179be computed.
180Add them to the docs/news.html file.
181</p>
182
183<p>
Brian Paul0b27ace2003-03-08 17:38:57 +0000184Copy the distribution files to a temporary directory, unpack them,
185compile everything, and run some demos to be sure everything works.
186</p>
187
Brian Paul65b79052004-11-22 17:49:15 +0000188<H3>Update the website and announce the release</H3>
Brian Paul0b27ace2003-03-08 17:38:57 +0000189<p>
Brian Paul65b79052004-11-22 17:49:15 +0000190Follow the directions on SourceForge for creating a new "release" and
191uploading the tarballs.
Brian Paul0b27ace2003-03-08 17:38:57 +0000192</p>
193
194<p>
Brian Paul65b79052004-11-22 17:49:15 +0000195Update the web site by copying the docs/ directory's files to
196/home/users/b/br/brianp/mesa-www/htdocs/
Brian Paul0b27ace2003-03-08 17:38:57 +0000197</p>
198
199<p>
Brian Paulefe56712003-03-19 19:15:28 +0000200Make an announcement on the mailing lists:
201<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>,
202<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>
203and
204<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>
Brian Paul0b27ace2003-03-08 17:38:57 +0000205</p>
206
207
Brian Paul0b27ace2003-03-08 17:38:57 +0000208
209</body>
210</html>