some updated info about adding new extensions

This commit is contained in:
Brian Paul
2004-08-17 14:08:59 +00:00
parent 6f3cc6a522
commit 51830613a9

View File

@@ -10,29 +10,39 @@
<H2>Adding Extentions</H2> <H2>Adding Extentions</H2>
<p> <p>
To add a new GL extension to Mesa you have to do the following. To add a new GL extension to Mesa you have to do at least the following.
<pre>
If glext.h doesn't define the extension, edit include/GL/gl.h and add:
- new enum tokens
- new API function entry points
- #define GL_EXT_the_extension_name 1
If adding a new API function (call it glNewFunctionEXT): <ul>
- insert glNewFunctionEXT()into src/apiext.h <li>
- edit src/types.h and add NewFunction to the gl_api_table struct If glext.h doesn't define the extension, edit include/GL/gl.h and add
- implement gl_NewFunction() in the appropriate src file code like this:
- hook gl_NewFunction() into pointers.c <pre>
- add display list support in dlist.c for save_NewFunction() #ifndef GL_EXT_the_extension_name
- add glNewFunctionEXT to gl_GetProcAddress() in extensions.c or #define GL_EXT_the_extension_name 1
in the device driver's GetProcAddress() function if appropriate /* declare the new enum tokens */
</pre> /* prototype the new functions */
<p> /* TYPEDEFS for the new functions */
If adding new GL state be sure to update get.c and enable.c #endif
</p> </pre>
<p> </li>
In general, look for an extension similar to the new one that's already <li>
implemented in Mesa and follow it by example. In the src/mesa/glapi/ directory, add the new extension functions and
</p> enums to the gl_API.xml file.
Then, a bunch of source files must be regenerated by executing the
corresponding Python scripts.
</li>
<li>
Find an existing extension that's similar to the new one and search
the sources for code related to that extension.
Implement new code as needed.
In general, new state variables will be added to mtypes.h. If the
extension is rather large, try to implement it in a new source file.
</li>
<li>
If hew extension adds new GL state, the functions in get.c, enable.c
and attrib.c will most likely require new code.
</li>
</ul>