1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
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">
11 The Mesa
3D Graphics Library
14 <iframe src=
"contents.html"></iframe>
17 <h1>Development Notes
</h1>
21 <li><a href=
"#extensions">Adding Extensions
</a>
24 <h2 id=
"extensions">Adding Extensions
</h2>
27 To add a new GL extension to Mesa you have to do at least the following.
32 If
<code>glext.h
</code> doesn't define the extension, edit
33 <code>include/GL/gl.h
</code> and add code like this:
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 */
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.
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.
55 Add a new entry to the
<code>src/mesa/main/extensions_table.h
</code> file.
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
63 If the new extension adds new GL state, the functions in
64 <code>get.c
</code>,
<code>enable.c
</code> and
<code>attrib.c
</code>
65 will most likely require new code.
68 To determine if the new extension is active in the current context,
69 use the auto-generated
<code>_mesa_has_##name_str()
</code> function
70 defined in
<code>src/mesa/main/extensions.h
</code>.
73 The dispatch tests
<code>check_table.cpp
</code> and
74 <code>dispatch_sanity.cpp
</code> should be updated with details about
75 the new extensions functions. These tests are run using
76 <code>meson test
</code>.