Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

devinfo.html 5.2KB

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