Clone of mesa.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

devinfo.html 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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 at least the following.
  8. <ul>
  9. <li>
  10. If glext.h doesn't define the extension, edit include/GL/gl.h and add
  11. code like this:
  12. <pre>
  13. #ifndef GL_EXT_the_extension_name
  14. #define GL_EXT_the_extension_name 1
  15. /* declare the new enum tokens */
  16. /* prototype the new functions */
  17. /* TYPEDEFS for the new functions */
  18. #endif
  19. </pre>
  20. </li>
  21. <li>
  22. In the src/mesa/glapi/ directory, add the new extension functions and
  23. enums to the gl_API.xml file.
  24. Then, a bunch of source files must be regenerated by executing the
  25. corresponding Python scripts.
  26. </li>
  27. <li>
  28. Find an existing extension that's similar to the new one and search
  29. the sources for code related to that extension.
  30. Implement new code as needed.
  31. In general, new state variables will be added to mtypes.h. If the
  32. extension is rather large, try to implement it in a new source file.
  33. </li>
  34. <li>
  35. If hew extension adds new GL state, the functions in get.c, enable.c
  36. and attrib.c will most likely require new code.
  37. </li>
  38. </ul>
  39. <H2>Coding Style</H2>
  40. <p>
  41. Mesa's code style has changed over the years. Here's the latest.
  42. </p>
  43. <p>
  44. Comment your code! It's extremely important that open-source code be
  45. well documented. Also, strive to write clean, easily understandable code.
  46. </p>
  47. <p>
  48. 3-space indentation
  49. </p>
  50. <p>
  51. If you use tabs, set them to 8 columns
  52. </p>
  53. <p>
  54. Brace example:
  55. </p>
  56. <pre>
  57. if (condition) {
  58. foo;
  59. }
  60. else {
  61. bar;
  62. }
  63. </pre>
  64. <p>
  65. Here's the GNU indent command which will best approximate my preferred style:
  66. </p>
  67. <pre>
  68. indent -br -i3 -npcs infile.c -o outfile.c
  69. </pre>
  70. <p>
  71. Local variable name example: localVarName (no underscores)
  72. </p>
  73. <p>
  74. Constants and macros are ALL_UPPERCASE, with _ between words
  75. </p>
  76. <p>
  77. Global vars not allowed.
  78. </p>
  79. <p>
  80. Function name examples:
  81. </p>
  82. <pre>
  83. glFooBar() - a public GL entry point (in dispatch.c)
  84. _mesa_FooBar() - the internal immediate mode function
  85. save_FooBar() - retained mode (display list) function in dlist.c
  86. foo_bar() - a static (private) function
  87. _mesa_foo_bar() - an internal non-static Mesa function
  88. </pre>
  89. <H2>Writing a Device Driver</H2>
  90. <p>
  91. XXX to do
  92. </p>
  93. <H2>Making a New Mesa Release</H2>
  94. <p>
  95. These are the instructions for making a new Mesa release.
  96. </p>
  97. <p>
  98. Be sure to do a "cvs update -d ." in the Mesa directory to
  99. get all the latest files.
  100. </p>
  101. <p>
  102. Update the version definitions in src/mesa/main/version.h
  103. </p>
  104. <p>
  105. Create/edit the docs/RELNOTES-X.Y file to document what's new in the release.
  106. Update the docs/VERSIONS file too.
  107. </p>
  108. <p>
  109. Edit configs/default and change the MESA_MAJOR, MESA_MINOR and MESA_TINY
  110. version numbers.
  111. </p>
  112. <p>
  113. Edit the top-level Makefile and verify that DIRECTORY, LIB_NAME and
  114. DEMO_NAME are correct.
  115. </p>
  116. <p>
  117. Make a symbolic link from $(DIRECTORY) to 'Mesa'. For example,
  118. ln -s Mesa Mesa-6.3 This is needed in order to make a correct
  119. tar file in the next step.
  120. </p>
  121. <p>
  122. Make the distribution files. From inside the Mesa directory:
  123. <pre>
  124. make tarballs
  125. </pre>
  126. <p>
  127. Copy the distribution files to a temporary directory, unpack them,
  128. compile everything, and run some demos to be sure everything works.
  129. </p>
  130. <p>
  131. Upload the *.tar.gz and *.zip files to ftp.mesa3d.org
  132. </p>
  133. <p>
  134. Update the web site.
  135. </p>
  136. <p>
  137. Make an announcement on the mailing lists:
  138. <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>,
  139. <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>
  140. and
  141. <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>
  142. </p>
  143. </body>
  144. </html>