home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mesa5.zip / mesa5src.zip / Doc / Mesa / DEVINFO < prev    next >
Text File  |  2001-12-14  |  5KB  |  160 lines

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