docs: add more more code-tags
[mesa.git] / docs / devinfo.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html lang="en">
3 <head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8">
5 <title>Development Notes</title>
6 <link rel="stylesheet" type="text/css" href="mesa.css">
7 </head>
8 <body>
9
10 <div class="header">
11 The Mesa 3D Graphics Library
12 </div>
13
14 <iframe src="contents.html"></iframe>
15 <div class="content">
16
17 <h1>Development Notes</h1>
18
19
20 <ul>
21 <li><a href="#extensions">Adding Extensions</a>
22 </ul>
23
24 <h2 id="extensions">Adding Extensions</h2>
25
26 <p>
27 To add a new GL extension to Mesa you have to do at least the following.
28 </p>
29
30 <ul>
31 <li>
32 If <code>glext.h</code> doesn't define the extension, edit
33 <code>include/GL/gl.h</code> and add code like this:
34 <pre>
35 #ifndef GL_EXT_the_extension_name
36 #define GL_EXT_the_extension_name 1
37 /* declare the new enum tokens */
38 /* prototype the new functions */
39 /* TYPEDEFS for the new functions */
40 #endif
41 </pre>
42 </li>
43 <li>
44 In the <code>src/mapi/glapi/gen/</code> directory, add the new extension
45 functions and enums to the <code>gl_API.xml</code> file.
46 Then, a bunch of source files must be regenerated by executing the
47 corresponding Python scripts.
48 </li>
49 <li>
50 Add a new entry to the <code>gl_extensions</code> struct in
51 <code>mtypes.h</code> if the extension requires driver capabilities not
52 already exposed by another extension.
53 </li>
54 <li>
55 Add a new entry to the <code>src/mesa/main/extensions_table.h</code> file.
56 </li>
57 <li>
58 From this point, the best way to proceed is to find another extension,
59 similar to the new one, that's already implemented in Mesa and use it
60 as an example.
61 </li>
62 <li>
63 If the new extension adds new GL state, the functions in get.c, enable.c
64 and attrib.c will most likely require new code.
65 </li>
66 <li>
67 To determine if the new extension is active in the current context,
68 use the auto-generated <code>_mesa_has_##name_str()</code> function
69 defined in <code>src/mesa/main/extensions.h</code>.
70 </li>
71 <li>
72 The dispatch tests check_table.cpp and <code>dispatch_sanity.cpp</code>
73 should be updated with details about the new extensions functions. These
74 tests are run using <code>meson test</code>.
75 </li>
76 </ul>
77
78
79
80
81 </div>
82 </body>
83 </html>