Clone of mesa.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <HTML>
  2. <TITLE>Development Notes</TITLE>
  3. <link rel="stylesheet" type="text/css" href="mesa.css"></head>
  4. <BODY>
  5. <H1>Development Notes</H1>
  6. <H2>Adding Extentions</H2>
  7. <p>
  8. To add a new GL extension to Mesa you have to do at least the following.
  9. <ul>
  10. <li>
  11. If glext.h doesn't define the extension, edit include/GL/gl.h and add
  12. code like this:
  13. <pre>
  14. #ifndef GL_EXT_the_extension_name
  15. #define GL_EXT_the_extension_name 1
  16. /* declare the new enum tokens */
  17. /* prototype the new functions */
  18. /* TYPEDEFS for the new functions */
  19. #endif
  20. </pre>
  21. </li>
  22. <li>
  23. In the src/mesa/glapi/ directory, add the new extension functions and
  24. enums to the gl_API.xml file.
  25. Then, a bunch of source files must be regenerated by executing the
  26. corresponding Python scripts.
  27. </li>
  28. <li>
  29. Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
  30. </li>
  31. <li>
  32. Update the <code>extensions.c</code> file.
  33. </li>
  34. <li>
  35. From this point, the best way to proceed is to find another extension,
  36. similar to the new one, that's already implemented in Mesa and use it
  37. as an example.
  38. </li>
  39. <li>
  40. If the new extension adds new GL state, the functions in get.c, enable.c
  41. and attrib.c will most likely require new code.
  42. </li>
  43. </ul>
  44. <H2>Coding Style</H2>
  45. <p>
  46. Mesa's code style has changed over the years. Here's the latest.
  47. </p>
  48. <p>
  49. Comment your code! It's extremely important that open-source code be
  50. well documented. Also, strive to write clean, easily understandable code.
  51. </p>
  52. <p>
  53. 3-space indentation
  54. </p>
  55. <p>
  56. If you use tabs, set them to 8 columns
  57. </p>
  58. <p>
  59. Brace example:
  60. </p>
  61. <pre>
  62. if (condition) {
  63. foo;
  64. }
  65. else {
  66. bar;
  67. }
  68. </pre>
  69. <p>
  70. Here's the GNU indent command which will best approximate my preferred style:
  71. </p>
  72. <pre>
  73. indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
  74. </pre>
  75. <p>
  76. Local variable name example: localVarName (no underscores)
  77. </p>
  78. <p>
  79. Constants and macros are ALL_UPPERCASE, with _ between words
  80. </p>
  81. <p>
  82. Global variables are not allowed.
  83. </p>
  84. <p>
  85. Function name examples:
  86. </p>
  87. <pre>
  88. glFooBar() - a public GL entry point (in dispatch.c)
  89. _mesa_FooBar() - the internal immediate mode function
  90. save_FooBar() - retained mode (display list) function in dlist.c
  91. foo_bar() - a static (private) function
  92. _mesa_foo_bar() - an internal non-static Mesa function
  93. </pre>
  94. <H2>Making a New Mesa Release</H2>
  95. <p>
  96. These are the instructions for making a new Mesa release.
  97. </p>
  98. <H3>Get latest source files</H3>
  99. <p>
  100. Use "cvs update -dAP " to get the latest Mesa files from CVS.
  101. </p>
  102. <H3>Verify and update version info</H3>
  103. <p>
  104. Create/edit the docs/RELNOTES-X.Y file to document what's new in the release.
  105. Add the new RELNOTES-X.Y file to <a href="relnotes.html">relnotes.html</a>.
  106. Update the docs/VERSIONS file too.
  107. </p>
  108. <p>
  109. Edit the MESA_MAJOR, MESA_MINOR and MESA_TINY version numbers in
  110. configs/default.
  111. </p>
  112. <p>
  113. Make sure the values in src/mesa/main/version.h are correct.
  114. </p>
  115. <p>
  116. Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and
  117. DEMO_NAME are correct.
  118. </p>
  119. <p>
  120. Update the docs/news.html file and docs/download.html files.
  121. </p>
  122. <p>
  123. Check in all updates to CVS.
  124. </p>
  125. <p>
  126. Tag the CVS files with the release name (in the form <b>mesa_X_Y</b>).
  127. </p>
  128. <H3>Make the tarballs</H3>
  129. <p>
  130. Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
  131. ln -s Mesa Mesa-6.3
  132. This is needed in order to make a correct tar file in the next step.
  133. </p>
  134. <p>
  135. Make the distribution files. From inside the Mesa directory:
  136. <pre>
  137. make tarballs
  138. </pre>
  139. <p>
  140. After the tarballs are created, the md5 checksums for the files will
  141. be computed.
  142. Add them to the docs/news.html file.
  143. </p>
  144. <p>
  145. Copy the distribution files to a temporary directory, unpack them,
  146. compile everything, and run some demos to be sure everything works.
  147. </p>
  148. <H3>Update the website and announce the release</H3>
  149. <p>
  150. Follow the directions on SourceForge for creating a new "release" and
  151. uploading the tarballs.
  152. </p>
  153. <p>
  154. Update the web site by copying the docs/ directory's files to
  155. /home/users/b/br/brianp/mesa-www/htdocs/
  156. </p>
  157. <p>
  158. Make an announcement on the mailing lists:
  159. <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>,
  160. <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>
  161. and
  162. <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>
  163. </p>
  164. </body>
  165. </html>