Compare commits

...

347 Commits

Author SHA1 Message Date
Brian Paul
5febd0ce8b disable some features to make work on IRIX 2000-04-24 16:06:05 +00:00
Brian Paul
3d2264b2ce removed extra / 2000-04-24 15:29:02 +00:00
Brian Paul
486565f88a updated for 3.2 final release 2000-04-24 14:47:45 +00:00
Brian Paul
0931339ea8 updated for 3.2 final relase 2000-04-24 14:47:11 +00:00
Brian Paul
7fbad8f406 removed beta from version string 2000-04-24 12:42:37 +00:00
Brian Paul
3382e6e359 removed beta from version string 2000-04-24 12:33:24 +00:00
Brian Paul
96cefd6d02 added Loki smooth/flat tri bug 2000-04-20 00:25:08 +00:00
Keith Whitwell
8033ed691e Always use smooth shaded triangles, emulating flat ones by emitting
vertices with identical color values.
2000-04-19 23:56:08 +00:00
Keith Whitwell
59aa79ea5e fix andreas' clipping problem 2000-04-17 17:35:47 +00:00
Brian Paul
5478ccec45 Loki's RGB/BGR bug fix 2000-04-15 04:54:03 +00:00
Brian Paul
ba31a93ae5 Loki's bug fixes 2000-04-15 04:53:08 +00:00
Brian Paul
3c5265bf69 re-enabled persp_textured_triangle 2000-04-15 04:51:51 +00:00
Brian Paul
9c7494fc0c silenced some warnings 2000-04-15 03:18:44 +00:00
Brian Paul
9e077508f9 applied Bernd's changes to useBGR code 2000-04-14 21:40:46 +00:00
Brian Paul
95b0d3528a applied Keith's fix for the Loki ice bug 2000-04-13 14:53:35 +00:00
Brian Paul
dcd4ea4746 added clipping to depth span read functions 2000-04-11 20:41:31 +00:00
Brian Paul
e01205dd9e added clipping to span reading 2000-04-11 20:40:44 +00:00
Brian Paul
198ed1fe93 added clipping bug fix 2000-04-10 22:13:39 +00:00
Brian Paul
5c2f9bc2de added 24bpp clear bug fix 2000-04-07 14:13:10 +00:00
Holger Waechtler
e4fb0285f2 added CONCAT macro in NASM/MASM section 2000-04-06 21:59:24 +00:00
Brian Paul
573ab9c964 initial check-in 2000-04-06 02:34:31 +00:00
Brian Paul
37f4e1fe40 print fbiRev if MESA_FX_INFO defined 2000-04-06 00:11:11 +00:00
Brian Paul
4f4a6b4a4f pulled in the RGB vs BGR setup code from Mesa 3.3 2000-04-06 00:08:18 +00:00
Brian Paul
884aa6efd8 added version number 2000-04-04 23:28:00 +00:00
Brian Paul
ceb817650f added 3.2 final bug fixes 2000-04-04 16:01:33 +00:00
Brian Paul
19ac63ce20 updated for Mesa 3.2 2000-04-04 15:13:41 +00:00
Brian Paul
1b4c728f77 added 3.2 final info 2000-04-04 00:54:53 +00:00
Brian Paul
140809c588 Ugh! Mesa 3.2, not 3.3 2000-04-04 00:52:28 +00:00
Brian Paul
e6df48f9a6 updated copyright date/version 2000-04-04 00:51:41 +00:00
Brian Paul
31bcf75ce1 use bcopy on FreeBSD 2000-04-04 00:50:28 +00:00
Brian Paul
9818daae60 added gluCheckExtension() 2000-03-31 20:07:56 +00:00
Brian Paul
5ade8ed0b4 added missing glEnd() call (Tim Beckmann) 2000-03-27 15:47:08 +00:00
Brian Paul
1b539ed613 exclude CVS dirs from tar file 2000-03-23 00:14:28 +00:00
Brian Paul
905ad56487 changed version string to Mesa 3.2 beta 1 2000-03-23 00:13:22 +00:00
Brian Paul
a16ebe76c9 added -O2 / -O3 info 2000-03-23 00:12:41 +00:00
Brian Paul
96563ae75f replaced -O2 with -O3 for some gcc configs 2000-03-23 00:12:13 +00:00
Brian Paul
11769b9737 updates for Mesa 3.2 2000-03-22 23:50:13 +00:00
Brian Paul
474363af47 minor tweaks 2000-03-22 23:48:43 +00:00
Brian Paul
99189ad4fb added instructions to build widgets-sgi 2000-03-22 23:48:00 +00:00
Brian Paul
361fc66e36 fixed Cygwin patch typos 2000-03-22 16:01:36 +00:00
Brian Paul
0b616332f7 added list of Keith's bug fixes 2000-03-21 16:39:55 +00:00
Brian Paul
4f030d12ad patched for Cygwin (Sven Panne) 2000-03-20 17:54:44 +00:00
Brian Paul
792837dafd minor Glide tweak 2000-03-18 23:40:53 +00:00
Brian Paul
8c77d45b06 updated for Mesa 3.2 2000-03-18 23:39:58 +00:00
Brian Paul
660f6dec37 colors were computed incorrectly (Hans Nelles) 2000-03-18 01:14:01 +00:00
Brian Paul
14e7ab2c4f removed some printf's 2000-03-11 23:28:37 +00:00
Brian Paul
089f713f0d glPopAttrib() now calls Driver's ClearColor, ClearIndex and ColorMask functions 2000-03-10 22:11:15 +00:00
Brian Paul
53f81339a4 fixed off-by-one errors in matrix stack setup/cleanup 2000-03-06 16:59:26 +00:00
Brian Paul
2cf228e93d minor reformatting 2000-03-01 20:43:41 +00:00
Brian Paul
4e8ee6840a test for GL 1.2 2000-03-01 03:36:35 +00:00
Brian Paul
5144d47c54 added glXCopyContext mask item 2000-02-29 23:01:44 +00:00
Brian Paul
3eaed2527a added proxy texture targets to GetColorTableParameter (Steven Fuller) 2000-02-28 20:40:18 +00:00
Brian Paul
353bd24876 added GL_BGR and GL_BGRA support 2000-02-28 14:51:39 +00:00
Brian Paul
473d64f9cc patched for NetBSD support (Allen Briggs), Watcom stuff added from 3.3 2000-02-27 18:11:47 +00:00
Brian Paul
c21598fb0d added mipmap lambda item 2000-02-27 16:17:12 +00:00
Brian Paul
287abc7aa0 fixed bug when using display lists 2000-02-25 23:24:28 +00:00
Brian Paul
e6e732c64d changed glXCopyContext()'s mask to unsigned long 2000-02-23 23:05:07 +00:00
Brian Paul
61cca3827f test that RenderMode == GL_RENDER in gl_direct_DrawPixels 2000-02-22 18:10:43 +00:00
Brian Paul
88406455f5 initial check-in 2000-02-22 17:56:56 +00:00
Brian Paul
fb67681366 added 24bpp bug fix item 2000-02-22 17:32:53 +00:00
Brian Paul
ead75d4894 fixed 24bpp pixel addressing bug 2000-02-22 17:22:42 +00:00
Brian Paul
bd4ba2b85d disabled an fprintf in FX_grSstQueryHardware() 2000-02-22 01:15:48 +00:00
Brian Paul
998839109e added off-by-one matrix stack size bug 2000-02-21 22:51:57 +00:00
Brian Paul
a23d3cc054 fixed off by one error in matrix stack depths (Eero Pajarre) 2000-02-21 22:49:24 +00:00
Brian Paul
803d5a12ab clean-up in gl_windowpos() 2000-02-21 16:31:55 +00:00
Brian Paul
462144c0f0 added GL_SRC_ALPHA_SATURATE bug fix 2000-02-21 15:00:12 +00:00
Brian Paul
a780e6f228 fixed GL_SRC_ALPHA_SATURATE bug 2000-02-21 14:59:41 +00:00
Brian Paul
7feab37f8a changed MESA_MINOR to 2, updated linux-elf-debug config 2000-02-18 15:48:39 +00:00
Brian Paul
091834064c update fog near/far bug fix 2000-02-16 23:33:08 +00:00
Brian Paul
9275c62963 added bug fix for glDeleteTextures() 2000-02-12 02:00:46 +00:00
Brian Paul
7166ff0412 fixed reference count but in DeleteTextures() 2000-02-12 01:59:10 +00:00
Brian Paul
bf69170dff added MESA_FX_NO_SIGNALS env var (Michael Vance) 2000-02-12 01:42:45 +00:00
Brian Paul
3c6dd8791c updated with MESA_FX_NO_SIGNALS info 2000-02-12 01:35:30 +00:00
Brian Paul
69bc4e01b8 include float.h on alpha 2000-02-11 23:37:01 +00:00
Brian Paul
b2d3b2dbe0 added GLCALLBACKPCAST for Cygnus (Sven Panne) 2000-02-10 17:21:30 +00:00
Brian Paul
c508641aec added OpenStep files to LIB_FILES 2000-02-10 15:57:03 +00:00
Brian Paul
f008070ad5 changed version to 1.2 Mesa 3.2 2000-02-09 18:59:56 +00:00
Brian Paul
c562884268 updated version info to 3.2 2000-02-09 18:53:54 +00:00
Brian Paul
992795f4c9 added a few missing ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH() calls 2000-02-08 01:48:07 +00:00
Brian Paul
d21f13cb05 added missing glGet cases for GL_EXT_compiled_vertex_array 2000-02-06 03:10:45 +00:00
Brian Paul
f1b26953e8 added glDrawRangeElements() bug fix 2000-02-05 02:10:48 +00:00
Brian Paul
216244bed8 disabled locked arrays in glDrawRangeElements() 2000-02-05 02:05:21 +00:00
Brian Paul
b85c3afc01 added GL_EXT_compiled_vertex_array bug fix 2000-02-05 01:54:20 +00:00
Brian Paul
e4ee3cc9d1 GL_ARRAY_ELEMENT_LOCK_FIRST/COUNT_SGI changed to _EXT suffix 2000-02-05 01:52:23 +00:00
Brian Paul
03d7215604 added check for IntegerAccumScaler > 0 in GL_RETURN case 2000-02-02 21:53:59 +00:00
Brian Paul
82e6fe5e36 changed > to >= 2000-02-02 17:32:15 +00:00
Brian Paul
dde5788a44 limit Drift to [0, 1] 2000-02-02 01:08:09 +00:00
tanner
8038f3747d include conf.h 2000-01-31 22:10:39 +00:00
Holger Waechtler
0df95816c5 Added prefetchw. 2000-01-27 20:06:14 +00:00
Brian Paul
3692626805 updated version string to Mesa 3.2 2000-01-27 16:43:00 +00:00
Brian Paul
b31d01d4a7 updated RGB2BGR function 2000-01-25 20:21:10 +00:00
Brian Paul
ba8ef5917e added info about assembly language optimizations 2000-01-25 17:18:46 +00:00
Brian Paul
f5d0252282 updated version info 2000-01-25 17:03:05 +00:00
Brian Paul
83386c0f7b fixed VB->IndexPtr==NULL bug (Richard Guenther) 2000-01-25 16:49:15 +00:00
Brian Paul
5e8aa8e5d9 replaced HashLookup() with _mesa_HashLookup() 2000-01-24 23:49:29 +00:00
Brian Paul
f008ed46d1 prefixed hash functions with _mesa_ 2000-01-24 16:20:17 +00:00
Brian Paul
7b5a65ce28 added #ifdef SVGA, work-around asm code problem 2000-01-23 17:48:12 +00:00
Brian Paul
4f4b93d8ae added new SVGA driver files 2000-01-23 17:47:00 +00:00
Josh Vanderhoof
81f97580cc prevent spaces in fp register names 2000-01-23 05:44:46 +00:00
Josh Vanderhoof
8de719530c no brackets for nasm indirect jumps 2000-01-23 05:07:13 +00:00
Brian Paul
f0040ae8f5 added updated SVGA driver info 2000-01-22 20:10:57 +00:00
Brian Paul
ec2425c3b6 removed unused vars 2000-01-22 20:06:20 +00:00
Brian Paul
aedc01c850 added copyright info, misc clean-up 2000-01-22 20:05:28 +00:00
Brian Paul
93c528a6d5 initial check-in 2000-01-22 20:05:09 +00:00
Brian Paul
443d666b9a updated for Mesa 3.2 2000-01-22 19:57:23 +00:00
Brian Paul
d794378dbc initial check-in 2000-01-22 19:56:20 +00:00
Brian Paul
76dad53903 added front/back glCopyPixels bug fix 2000-01-22 19:48:23 +00:00
Gareth Hughes
e5f8d98410 Fixed internal scanbeam intersection side-effects. When an internal
intersection is found, it essentially reverses the two bounds with
intersecting edges above the point of intersection.  This needs to be
taken into account when inserting vertices from these bounds,
otherwise they will be added to the wrong end of the output contours.
Quite an easy fix, really.

Still cleaning up redundant code in the clipping functions, left over
from the original Vatti/GPC algorithms.  Will do some more thorough
testing of the fix with the programs that have had problems reported,
and finish cleaning up the clipping code.
2000-01-19 04:57:27 +00:00
Brian Paul
7f8fed5711 added missing tokens item to 3.2 bug fixes 2000-01-17 18:17:41 +00:00
Brian Paul
5ed6197b0a added missing POINT/LINE RANGE/GRANULARITY tokens 2000-01-17 18:04:33 +00:00
Brian Paul
609524894a added selection mode bug fix 2000-01-17 15:36:47 +00:00
Brian Paul
553adbb0c2 Z values were wrong in selection mode (Holger Waechtler) 2000-01-17 15:36:06 +00:00
Brian Paul
361afca6a4 synchronized with DRI tree / Daryll's latest changes 2000-01-15 19:17:24 +00:00
Brian Paul
4c6a2f6a33 updated for Mesa 3.2 2000-01-14 16:26:42 +00:00
Brian Paul
717ec19e30 initial check-in 2000-01-14 16:16:40 +00:00
Brian Paul
411fb983f7 updated for Mesa 3.2 2000-01-14 16:15:32 +00:00
Brian Paul
5dbe3d9c98 another fix for gluPartialDisk() in GL_LINE mode 2000-01-11 22:01:49 +00:00
Brian Paul
fea067dce8 added two more bug fixes for 3.2 2000-01-11 17:27:32 +00:00
Brian Paul
1cfc846bf3 fixed missing slice problem in gluPartialDisk() 2000-01-11 17:23:18 +00:00
Brian Paul
dfa45b9f26 added amesa.h to tar file list 2000-01-08 11:13:10 +00:00
Brian Paul
6f602ed44d added glHintPGI note for 3.2 bug fixes 2000-01-07 08:38:08 +00:00
Brian Paul
34bf1dd293 added glHintPGI() 2000-01-07 08:37:34 +00:00
Brian Paul
9a7584b062 minor clean-up in _mesa_unpack_ubyte_color_span() 2000-01-05 09:18:35 +00:00
Brian Paul
d6dfb94059 added 3.2 bug fixes 2000-01-05 06:57:54 +00:00
Brian Paul
b9ee2850cf start search at 1 in HashFindFreeKeyBlock() 2000-01-04 08:15:26 +00:00
Brian Paul
4183bf524d added missing glColorTableParameter defines 2000-01-04 08:08:28 +00:00
Keith Whitwell
1721f447c6 Fixed bug in gl_extension_enable, allow drivers to turn on ext_texenv_add 1999-12-21 17:22:39 +00:00
Keith Whitwell
46ef216f7f patches from daryll 1999-12-19 12:05:54 +00:00
Brian Paul
a171741d65 more tweaking of tar file list 1999-12-16 08:59:57 +00:00
Brian Paul
320c2cdb0f added a cast to malloc call 1999-12-16 08:53:51 +00:00
Brian Paul
9ed70db8ea just include Makefile.X11 1999-12-15 13:05:13 +00:00
Brian Paul
acbb8cb9dd initial check-in 1999-12-15 13:04:55 +00:00
Brian Paul
7889a93ff7 made a few globals static 1999-12-15 13:01:44 +00:00
Brian Paul
970a551795 moved #define to column 0 1999-12-15 13:00:24 +00:00
Brian Paul
d7eae31275 replaced 0 with 0.0 in sin, cos calls 1999-12-15 12:59:29 +00:00
Brian Paul
b0294cbbfe added Win32 and MacOS files to tar file list 1999-12-14 20:54:24 +00:00
Brian Paul
e2ff9be0b6 disable diagnostic printf 1999-12-14 20:51:33 +00:00
Brian Paul
16283fea40 removed bad call to fxMultipassBlend 1999-12-14 19:47:25 +00:00
Brian Paul
82ba9449e1 print messages with new message() function 1999-12-14 16:23:57 +00:00
Brian Paul
2377ea9c66 added reference to INSTALL file 1999-12-14 15:12:52 +00:00
Brian Paul
ac3593ada5 changes for 3.1 1999-12-14 07:18:57 +00:00
Brian Paul
d6dd996e56 minor 3.1 changes 1999-12-14 07:17:42 +00:00
Brian Paul
cee556daea updates for 3.1 final release 1999-12-14 07:15:38 +00:00
Brian Paul
313f225a2e removed beta from version string 1999-12-13 21:58:42 +00:00
Brian Paul
95d565b64c removed beta designation 1999-12-13 21:56:18 +00:00
Brian Paul
32ea1fdc7e applied Daryll's patches 1999-12-13 21:53:01 +00:00
Keith Whitwell
8d52ee9ae1 Added logicOp driver callback 1999-12-12 18:30:47 +00:00
Brian Paul
9a07202f5e added glXUseXFont() bugfix 1999-12-12 17:55:45 +00:00
Brian Paul
0f953d69e5 removed unneeded code in gluBuild1DMipmaps() 1999-12-12 17:23:33 +00:00
Brian Paul
b3a1034c05 bitmaps were vertically shifted by one pixel 1999-12-12 17:03:07 +00:00
Brian Paul
8956d5131d added default cases to switches to silence compiler warnings 1999-12-12 15:50:44 +00:00
Brian Paul
428cf99956 added GLX_ARB_get_proc_address to extension list 1999-12-11 09:20:03 +00:00
Brian Paul
1e5dab20fd applied patch from Ralph Giles 1999-12-10 15:54:09 +00:00
Brian Paul
aa5251d170 removed GLX_EXT_get_proc_address 1999-12-10 14:55:38 +00:00
Brian Paul
607add71d9 patches from Daryll 1999-12-10 14:21:08 +00:00
Brian Paul
074710629d added GLX_ARB_get_proc_address 1999-12-10 14:10:02 +00:00
Brian Paul
7f0b5dd69c added glXGetProcAddressARB() 1999-12-10 13:45:39 +00:00
Brian Paul
09b83c889b many functions added to gl_get_proc_address() 1999-12-10 13:45:08 +00:00
Brian Paul
9c416c235b added GLX_ARB_get_proc_address 1999-12-10 13:44:31 +00:00
Jouk Jansen
6ce3f22ae9 Committing in .
Updating compilation on VMS

 Modified Files:
  Tag: mesa_3_2_dev
 	Mesa/src-glu/descrip.mms Mesa/src-glu/gluP.h
 ----------------------------------------------------------------------
1999-12-06 05:24:36 +00:00
Gareth Hughes
32093ccc86 Removed axis-aligned plane projection stuff. I received a patch that
did this a while ago and was playing around with it, but I think it's
better to have a robust plane projection mechanism - after all, we can
be given a non-axis-aligned plane normal through gluTessNormal().
1999-12-05 17:01:17 +00:00
Gareth Hughes
d5ff1d782b Fixed contour orientation issues, so clockwise input contours will be
tessellated correctly.  Fixed text3d screensaver bugs associated with
contour orientation.

There is still a bug in the contour stacking calculations, which
causes letters like 'B' to have the inner loops oriented the wrong way
due to them being classified as outside the outer loop.  This should
be relatively straight forward to fix (see O'Rourke 1992).
1999-12-05 02:04:30 +00:00
Brian Paul
2ed8894aca Clearing stencil buffer now observes the stencil write mask
Optimized gl_depth_stencil_span/pixels() functions
1999-12-04 21:15:31 +00:00
Brian Paul
33cd8a5490 minor stencil-related changes 1999-12-04 21:13:44 +00:00
Brian Paul
dd25e9852a added glCopyPixels bug fix 1999-12-03 18:49:05 +00:00
Brian Paul
05df9bb6e0 added WM_SYSKEYDOWN case in __wglMonitor() (Eero Pajarre) 1999-12-02 15:21:04 +00:00
Gareth Hughes
a335bf404f Fixed bug in tessellatin for xlockmore's text3d screensaver. The
external maximums weren't being handled correctly.

Output contours seem to be oriented incorrectly, as they appear as
solidly-filled areas.
1999-12-02 06:18:25 +00:00
Brian Paul
783a67260a gl_BindTexture was broken when target==GL_TEXTURE_3D 1999-12-01 21:07:26 +00:00
Keith Whitwell
e99e126479 check ctx before dereferencing it 1999-12-01 12:45:42 +00:00
Keith Whitwell
98fce32683 Normal, stipple and varray bug fixes 1999-12-01 12:18:47 +00:00
Brian Paul
9493e540f9 fxInitPixelTables() change for Voodoo 1/2 vs 3 1999-12-01 01:10:42 +00:00
Brian Paul
7138d38cc1 print debug info in gl_make_current() if MESA_INFO env var set 1999-11-30 20:31:57 +00:00
Gareth Hughes
9e7f0e1f7c Fixed errors associated with Win32 build warnings. 1999-11-29 18:16:11 +00:00
Brian Paul
52345bfa1e removed Mesa-isms 1999-11-27 01:40:09 +00:00
Brian Paul
93070bceca updated for 3.1 1999-11-27 01:39:50 +00:00
Brian Paul
5b90676fc7 added a few prototypes for BeOS/g++ 1999-11-27 01:37:17 +00:00
Brian Paul
92ad030cb7 added a cast to silence a g++ warning 1999-11-27 01:35:42 +00:00
Brian Paul
9afe0e4278 generate Z values when fog enabled (Andree Borrmann) 1999-11-26 16:28:03 +00:00
Keith Whitwell
3e63be01d1 allow drivers to request fog coordinates 1999-11-25 16:51:24 +00:00
Brian Paul
c73eedbe96 bumped version to 3.1 1999-11-24 18:39:17 +00:00
Brian Paul
8c54c4d9f7 bumped version to 3.1, updated copyright 1999-11-24 18:38:52 +00:00
Keith Whitwell
33817940c4 another typo 1999-11-23 21:13:55 +00:00
Miklos Fazekas
7ec2e161ac Glide3 now uses the same layout as Glide2. 1999-11-23 18:29:53 +00:00
Brian Paul
fc2e8cd0d0 fixed new cut/paste error in FX_grSstWinOpen() call 1999-11-23 13:30:15 +00:00
Brian Paul
a3ea9edfda removed GL_EXT_get_proc_address from ext strings 1999-11-22 22:19:50 +00:00
Brian Paul
7fa9891de2 removed GLU_EXT_get_proc_address from ext string 1999-11-22 22:18:13 +00:00
Brian Paul
ddd9410a67 potential bug fix and clean-up in gl_ShadeModel() 1999-11-22 19:01:39 +00:00
Brian Paul
532dde3e99 fixed shade model bug (A.Borrmann) 1999-11-22 18:26:51 +00:00
Brian Paul
2a6f393fa7 added pragma 4615 (Eero), added copyright 1999-11-22 14:05:15 +00:00
Brian Paul
2d1b9e0402 removed redundant fxCloseHardware() decl 1999-11-22 14:01:35 +00:00
Brian Paul
19c878467f removed reference to GL_EXT_texture_env_add 1999-11-22 13:54:02 +00:00
Miklos Fazekas
1041d573ff Fixed FXMESA_USE_ARGB. 1999-11-21 05:52:10 +00:00
Miklos Fazekas
fda834160b Created the correct pixel table with:FXMESA_USE_ARGB. 1999-11-21 05:38:26 +00:00
Miklos Fazekas
7d35435bb6 Added gl_extension_is_enabled. 1999-11-20 13:13:50 +00:00
Gareth Hughes
5c191a62bc Fixed exterior intersection point insertion. Removed flag from vertex
left over from previous clipping algorithms.  Self-intersecting
contours are now tessellated correctly.
1999-11-20 02:37:20 +00:00
Brian Paul
eca3b6e47e replace encounteed with encountered 1999-11-19 21:22:07 +00:00
Miklos Fazekas
aa0a8624fb Removed #ifdef form inside a macro call. 1999-11-19 15:40:47 +00:00
Miklos Fazekas
f16a627115 Added GL_ADD. 1999-11-19 15:31:05 +00:00
Miklos Fazekas
1d39975c4e Added gl_extension_is_enabled. 1999-11-19 15:29:51 +00:00
Keith Whitwell
62d5f4c73e fixes for andree's drawarrays problems 1999-11-19 00:00:09 +00:00
Brian Paul
d42cd99c66 two fixes in gl_DrawArrays (Andree Borrman) 1999-11-18 23:54:25 +00:00
Brian Paul
03ef882735 fixed FX_grSstControl(), now returns FxBool 1999-11-18 19:31:08 +00:00
Brian Paul
19d0fcafb3 removed unused fxTMNewTMFreeNode decl 1999-11-18 19:30:27 +00:00
Brian Paul
cc6e92ff49 merge from 3.3 branch of Daryll's X server changes 1999-11-18 19:18:44 +00:00
Brian Paul
463c2b6b77 test visinfo, not vishandle in save_glx_visual (Wolfram Gloger) 1999-11-18 15:16:03 +00:00
Brian Paul
09c133e16f fixed some glitches (Eero Pajarre) 1999-11-17 21:21:29 +00:00
Brian Paul
bb1d3c1ad1 new PixelTo[RGB] lookup tables for pixel readback 1999-11-16 19:47:47 +00:00
Brian Paul
cabb6a91cd also remove .lo .la and .libs/ 1999-11-16 15:25:50 +00:00
Gareth Hughes
c76ac6b644 Added combine callback. Converted vertices from ints to floats. 1999-11-16 11:09:09 +00:00
Gareth Hughes
6842075a09 Fixed some vertex insertion bugs. Added boundary intersection
handling, although it is still slightly broken.  Horizontal edges need
to make it into the AET table, I think.  This will fix book/tess at
least, and possibly book/tesswind as well.
1999-11-16 11:07:22 +00:00
Brian Paul
b1da189fe5 removed unused finished: label 1999-11-15 22:21:18 +00:00
Brian Paul
9b635315be fixed several texture state update bugs found with objbug.c program 1999-11-15 22:17:44 +00:00
Gareth Hughes
702baf4cd3 Added scanbeam polygon clipping for intersection handling and boolean
operations.  Lots of other bug fixes and code cleanups.
1999-11-15 21:21:31 +00:00
Gareth Hughes
b27ee886e4 Added new tessellation polygon clipping file tess_clip.c 1999-11-15 21:15:43 +00:00
Josh Vanderhoof
276465cec6 fixed SSE bugs 1999-11-13 02:34:02 +00:00
Brian Paul
5428538d65 added 3.1 final section 1999-11-12 15:45:45 +00:00
Brian Paul
ab5d4d6233 added glxdpyinfo 1999-11-12 15:43:25 +00:00
Brian Paul
2450ce124b initial check-in 1999-11-12 15:43:12 +00:00
Brian Paul
cf22eb77a7 added some braces to silence gcc warnings 1999-11-12 00:13:33 +00:00
Brian Paul
569802cdb1 added missing braces in array initializations 1999-11-11 15:05:27 +00:00
Brian Paul
37ff9433c0 added missing braces in array initializations 1999-11-11 14:37:24 +00:00
sio
3d993b7dee Added missing GLAPIENTRY to glConvolution* and glCopy* 1999-11-11 14:11:16 +00:00
Jouk Jansen
d1aeac8d1d version 3.3 update 1999-11-11 09:57:57 +00:00
Jouk Jansen
86d36643de tess_macro.h included 1999-11-11 09:55:39 +00:00
Kendall Bennett
a73119234c . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility
with the IBM VisualAge C++ compiler. Eventually some more code will be
   needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall)
   for the IBM compilers, however we currently build using our own header files
   that already handle this.

 . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility
   with the IBM VisualAge C++ compiler in src-glu.

 . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles
   with 0 warnings now.

 . tess_hash.c: line 244 - Why is this function stubbed out? I removed the
   code with a #if 0 to avoid a compiler warning, but it looks dangerous.
1999-11-11 03:21:43 +00:00
Brian Paul
cb5ecb883e initial changes for Mesa 3.3 1999-11-11 01:28:16 +00:00
Brian Paul
fbd8f212c3 first big check-in of new Mesa 3.3 code 1999-11-11 01:22:25 +00:00
Keith Whitwell
06ac59281b fix for colormaterial 1999-11-10 06:29:44 +00:00
Keith Whitwell
6adfc6bd9e use glClientActiveTexture in interleaved setup 1999-11-09 17:26:15 +00:00
Keith Whitwell
6a9f16edae more fixes for glDrawArrays 1999-11-09 17:00:25 +00:00
Keith Whitwell
20f6c10b41 second try at drawarrays fix 1999-11-09 10:12:34 +00:00
Keith Whitwell
e43a3aa293 fix for (some of?) the vertex array problems 1999-11-09 09:18:40 +00:00
Brian Paul
f6a79d045c fixed typo: replaced |= with != in conditional 1999-11-09 07:59:54 +00:00
Brian Paul
0822c1050e replace GLint with GLsizei in a gluScaleImage, gluBuild1/2DMipmaps() 1999-11-09 06:16:59 +00:00
Brian Paul
c00c0b323f header includes clean-up (Daryll) 1999-11-08 15:29:43 +00:00
Brian Paul
99f16d01dd changes to silence MSVC warnings 1999-11-08 15:28:08 +00:00
Brian Paul
19f90e35ff flush pb after each line segment - for conformance 1999-11-08 14:36:32 +00:00
Brian Paul
327c69127c clean-up of header includes (Daryll) 1999-11-08 07:36:43 +00:00
Gareth Hughes
787250cc01 Added filename, line number output for debugging messages. 1999-11-05 20:36:55 +00:00
Ted Jump
f7190d4b1f turned off 'conditional expression is constant' warning for win32 1999-11-05 18:20:31 +00:00
Brian Paul
94acb57278 removed printf's 1999-11-05 08:12:46 +00:00
Brian Paul
17407de73a added xfont demo 1999-11-05 08:01:17 +00:00
Brian Paul
f1b45ca254 new xfont demo 1999-11-05 08:00:49 +00:00
Brian Paul
5b37c32274 clean-up to reduce MSVC warnings 1999-11-05 06:43:10 +00:00
Keith Whitwell
30990a65f8 Fix for glerror on compilation of list containing gldrawelements calls 1999-11-04 19:42:28 +00:00
Gareth Hughes
486e1f982e Major winding rule updates, especially stacked contour support.
Improved debugging output that can be altered with an environment
variable instead of hard coded at compile time.  Fixed bug in vertex
sorting function, so vertices are now indexed correctly (left to right).
1999-11-04 04:07:57 +00:00
Gareth Hughes
eb459c6070 Updated demo for new GLU 1.3 tessellation. Added optimized rendering
by saving the output of the tessellation into display lists.
1999-11-04 04:00:42 +00:00
Gareth Hughes
64e10feb25 Changed ($MAKE) to $(MAKE) to allow real-clean to work correctly. 1999-11-04 03:57:28 +00:00
Miklos Fazekas
6bc96bfebe Added glColorTable, etc. 1999-11-04 00:43:09 +00:00
Brian Paul
5b6677da16 include assert.h with rest of system headers 1999-11-03 19:27:41 +00:00
Josh Vanderhoof
0dd75e2884 swap operand order for Intel style REGOFF 1999-11-03 18:50:44 +00:00
Brian Paul
b09a4cd913 added another fast-path in _mesa_unpack_ubyte_color_spa(), more comments 1999-11-03 18:24:05 +00:00
Brian Paul
c3f0a511a7 new texture image processing 1999-11-03 17:27:05 +00:00
Brian Paul
d51b2c99d5 new texture image, cleaned-up code 1999-11-02 15:09:04 +00:00
Brian Paul
306b3b02b7 added linux-glide-debug config 1999-11-02 10:11:44 +00:00
Brian Paul
03d96a0ce2 fixed a typo in a comment 1999-10-31 08:34:47 +00:00
Ted Jump
38136ec3dd Changed over to maximal warnings on Win32 builds. 1999-10-30 18:39:06 +00:00
Ted Jump
364b56a20e Added checking for FXMESA_USE_ARGB to disable pixel reformatting when not appropriate 1999-10-30 18:34:48 +00:00
Brian Paul
12cc2bfff7 pixel pack/unpack ImageHeight and SkipImages was not initialized 1999-10-30 08:22:45 +00:00
Brian Paul
3c14ec9b55 added a few more scale/bias/lookup functions (for future use) 1999-10-30 08:20:57 +00:00
Brian Paul
8de4a38777 minor changes to Usage() function 1999-10-28 18:23:29 +00:00
Brian Paul
0144a50f04 removed -lm from link command 1999-10-27 10:09:53 +00:00
Brian Paul
be12aecc59 added -lm to XLIBS for all configs 1999-10-27 10:09:27 +00:00
Brian Paul
4a867fcbf5 disabled glXGetProcAddress code 1999-10-27 09:50:10 +00:00
Brian Paul
38a811057d disabled gluGetProcAddressEXT 1999-10-27 09:47:41 +00:00
Brian Paul
d865227d21 removed cvs history logs and old comments 1999-10-27 09:46:07 +00:00
Brian Paul
782ca03d6d removed glXGetProcAddressEXT 1999-10-27 09:44:10 +00:00
Brian Paul
c7af1b0b94 removed gluGetProcAddressEXT() 1999-10-27 09:43:48 +00:00
Brian Paul
9a19ccb578 better texture matrix, better end-cap reflections on cylinder 1999-10-26 17:08:31 +00:00
Brian Paul
98b607b57d fixed stupid error in GL_RGA case in gl_pack_rgba_span() 1999-10-26 09:21:04 +00:00
Brian Paul
20cdbc068e more comments, removed unneeded glDepthFunc call 1999-10-23 08:12:23 +00:00
Brian Paul
83435611c8 added gloss demo 1999-10-22 20:35:17 +00:00
Brian Paul
bb1119fd44 initial rev 1999-10-22 20:34:57 +00:00
Brian Paul
64b7da799f fixed byteswapping bug in gl_pack_rgba_span() 1999-10-22 12:49:52 +00:00
Brian Paul
3428162e27 added optimized GL_RGB, GL_UNSIGNED_BYTE case to gl_pack_rgba_span) 1999-10-22 10:59:15 +00:00
Brian Paul
e261963104 removed revision history info 1999-10-22 10:47:58 +00:00
Brian Paul
a6f09fa880 define GLUAPI, GLAPIENTRY and GLCALLBACK to nothing if not using Mesa's gl.h 1999-10-22 10:47:01 +00:00
Brian Paul
a460e65028 minor clean-up of linux-elf-debug target 1999-10-22 10:46:06 +00:00
Brian Paul
64a79b2f3a applied Jonn Carmack's patch for faster glTexSubImage2D() in Quake 1999-10-22 10:43:35 +00:00
Brian Paul
d13c0a90c7 added f key to toggle front/back drawing 1999-10-21 22:13:58 +00:00
Brian Paul
ac12609099 added -info command line option 1999-10-21 16:39:06 +00:00
Brian Paul
bc937424f1 updated some comments/docs 1999-10-21 12:46:27 +00:00
Brian Paul
5393bb3830 silenced some uninitialized var warnings 1999-10-21 12:45:53 +00:00
Brian Paul
fc811e2bfd silenced ininitialized var warnings 1999-10-21 12:45:03 +00:00
Brian Paul
88737eeedc silenced uninitialized variable warnings 1999-10-21 12:26:21 +00:00
Ted Jump
b19ba7827c Added pragma to disable warning about unk pragmas for MSVC5 1999-10-21 06:04:20 +00:00
Brian Paul
2fb055d891 clean-up of optimized GL_RETURN code 1999-10-20 22:39:16 +00:00
Brian Paul
34c7c1838a fixed divTable precision problem in GL_RETURN case 1999-10-20 22:32:02 +00:00
Brian Paul
2c318aad9d enable lighting even if no light sources are turned on 1999-10-20 22:16:45 +00:00
Holger Waechtler
456935a65e added X86/vertex.S and X86/vertex_3dnow.S to ASM_SOURCES 1999-10-20 11:45:39 +00:00
Ted Jump
3f17dfb8ba Minor patches to cleanup some compiler warnings in MSVC 1999-10-20 06:56:40 +00:00
Brian Paul
d53573daf7 fixed a number of error-test bugs 1999-10-19 20:36:20 +00:00
Brian Paul
bc41b08073 more image type error checking in draw_stencil_pixels() 1999-10-19 20:33:57 +00:00
Brian Paul
f3f9b77324 clean-up in gl_LightModelfv() 1999-10-19 20:32:40 +00:00
Brian Paul
351752caff added more format/type error checking code 1999-10-19 20:31:08 +00:00
Keith Whitwell
d471473b58 Changes to reduce the memory footprint of display lists 1999-10-19 18:37:02 +00:00
Brian Paul
52880f85b5 GL_MAX_ELEMENTS_VERTICES/INDICES enums had wrong values 1999-10-17 23:24:49 +00:00
Brian Paul
91baaa3d5a negative offsets to TexSubImage w/ texture borders caused memory corruption 1999-10-17 23:24:16 +00:00
Brian Paul
1e083c8c17 added glGet cases for vertex array enable state 1999-10-17 22:36:35 +00:00
Brian Paul
c782c911e9 more ARB_imaging colortable functions 1999-10-17 21:42:32 +00:00
Brian Paul
053f2020ca added missing GL_ARB_imaging color table functions 1999-10-17 20:18:15 +00:00
Miklos Fazekas
b9d8c77ca6 Fixed a MacOS specific compile error. 1999-10-16 12:53:37 +00:00
Miklos Fazekas
bc95b2f07e Added glGetMinmax 1999-10-16 12:52:56 +00:00
Brian Paul
d95e2eb1a8 removed GL_EXT_get_proc_address 1999-10-16 11:32:15 +00:00
Brian Paul
b80429e49e removed GL_EXT_get_proc_address 1999-10-16 11:27:02 +00:00
Brian Paul
c6dddaa692 added sco5 config 1999-10-15 22:00:07 +00:00
Brian Paul
251ba69ffc replaced glGetMinMax() with glGetMinmax() 1999-10-15 21:59:23 +00:00
Brian Paul
42f252fc06 fixed an RGB vs CI bug in overlay visual selection 1999-10-14 18:47:37 +00:00
Gareth Hughes
3df50407a3 Added point_contour_test, taken from O'Rourke 1998. 1999-10-14 07:44:41 +00:00
Ted Jump
56a5f8820f Fixed parameter type for notify function pointer parameter to gl_extensions_add 1999-10-13 22:09:09 +00:00
Gareth Hughes
6450917496 Removed CVS logs from files, as they were getting rather large. 1999-10-13 19:12:25 +00:00
Gareth Hughes
206abd9039 Added edge flag callback support. 1999-10-13 19:01:56 +00:00
Brian Paul
80af3614d8 now using MALLOC, CALLOC, FREE, etc macros 1999-10-13 18:49:47 +00:00
Brian Paul
bd5cdaf444 removed GL_ prefix from memory macros 1999-10-13 18:42:49 +00:00
Brian Paul
1a3b8ffe01 use texture objects now 1999-10-13 12:02:13 +00:00
Gareth Hughes
f80d0b2f61 Fixed delete_all_contours memory deallocation. 1999-10-12 21:26:06 +00:00
Gareth Hughes
2e4fce138c Updated memory allocation to allow new macros to be used. 1999-10-12 18:49:28 +00:00
Gareth Hughes
21a257d25b Renamed GLUtesselator user data pointer to avoid confusion. 1999-10-11 17:53:09 +00:00
Gareth Hughes
dbecc01c6e Correctly initialized GLUtesselator user data pointer. 1999-10-11 17:48:53 +00:00
Gareth Hughes
4aaafa6265 Allow debugging output capture under Win32. This seems really
broken to me, but that's Windows for you...
1999-10-11 17:28:05 +00:00
Gareth Hughes
c30627a5af Updated debugging output. I'm going to change it all to something
much more like the GLX project.  This was a set of macros left over
from a research project I'd done, and I like the GLX logging more.
1999-10-11 17:26:48 +00:00
Jouk Jansen
cd555f456b Repaired definition of GL_CALLOC_STRUC 1999-10-11 04:22:57 +00:00
Jouk Jansen
0b6c775f1c #include <stdlib.h> 1999-10-11 04:20:55 +00:00
Jouk Jansen
4fbb2c6279 #include <assert.h> 1999-10-11 04:20:25 +00:00
Jouk Jansen
0279e2bc3a misc -> glmisc 1999-10-11 04:17:50 +00:00
Brian Paul
567a1de666 now using GL_MALLOC, GL_FREE 1999-10-10 13:04:17 +00:00
Brian Paul
60a249d009 now using GL_MALLOC, GL_FREE 1999-10-10 12:51:29 +00:00
Brian Paul
375853e867 fixed dumb typo 1999-10-10 12:49:36 +00:00
Brian Paul
826e66a21f now using GL_MALLOC, GL_FREE 1999-10-10 12:40:54 +00:00
Brian Paul
d77fa30761 added memory macros 1999-10-10 12:39:04 +00:00
Josh Vanderhoof
73d03344f4 no underscore prefix for freebsd >= 3 (Simon Walton) 1999-10-09 23:20:23 +00:00
Brian Paul
6e6d4c66bd texture units now share default texture objects 1999-10-09 20:17:07 +00:00
Brian Paul
7ec8d588ab fixed reference count bug in save_TexImage3DEXT() 1999-10-09 10:01:46 +00:00
Keith Whitwell
f8b3fc5454 fixed voodoo initialization 1999-10-08 11:07:54 +00:00
Keith Whitwell
485f040741 Fixed includes & added a few hooks for the DRI. 1999-10-08 09:27:09 +00:00
Miklos Fazekas
a7313e045d Added PARB support. 1999-10-05 19:51:15 +00:00
Miklos Fazekas
3af541c541 Added gl_ext_multitexture_ADD suport. 1999-10-05 19:50:45 +00:00
Miklos Fazekas
37290c844c Added packed ARGB support. 1999-10-05 19:49:41 +00:00
Miklos Fazekas
1076e7cd21 Packed RGBA support. 1999-10-05 19:26:54 +00:00
Miklos Fazekas
6a659315cd Packed RGB support. 1999-10-05 19:00:11 +00:00
Miklos Fazekas
2ed47d29c6 Added support for GL_ext_texture_add 1999-10-05 18:48:49 +00:00
Miklos Fazekas
d598ca05e1 Minor cleanup. 1999-10-05 18:40:17 +00:00
Jouk Jansen
08a454c7af Added tess_winding.c for compilation 1999-10-04 05:26:46 +00:00
Gareth Hughes
dcf11bdb93 Fixed overflow bug in combineCallback. 1999-10-03 01:00:33 +00:00
Gareth Hughes
63fee8b3be Added tessellation winding rule support. Misc bug fixes. 1999-10-03 00:56:07 +00:00
Gareth Hughes
45b95f048d Added tessellation winding rule files. 1999-10-03 00:53:38 +00:00
Keith Whitwell
69cfdb2fcb more hooks for mga driver, including an immediate fastpath 1999-09-30 11:18:21 +00:00
180 changed files with 20372 additions and 8284 deletions

View File

@@ -1,13 +1,13 @@
# $Id: Make-config,v 1.5 1999/09/15 17:02:06 brianp Exp $
# $Id: Make-config,v 1.10.2.3 2000/03/23 00:12:13 brianp Exp $
MESA_MAJOR=3
MESA_MINOR=1
MESA_MINOR=2
MESA_TINY=0
VERSION=$(MESA_MAJOR).$(MESA_MINOR)
# Mesa 3-D graphics library
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
# Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@@ -67,7 +67,7 @@ aix:
"CC = cc" \
"CFLAGS = -O -DAIXV3" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
aix-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -78,7 +78,7 @@ aix-sl:
"CC = cc" \
"CFLAGS = -O -DAIXV3" \
"MAKELIB = ../bin/mklib.aix" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
# Make-config additions for the Amiga 3000 UX
# Carlyn Voss Iuzzolino 5/8/95:
@@ -96,7 +96,7 @@ amix:
"CC = cc" \
"CFLAGS =" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11 -lsocket -lnsl "
"XLIBS = -lX11 -lsocket -lnsl -lm"
beos-r4:
$(MAKE) -f Makefile.BeOS-R4 targets \
@@ -118,7 +118,7 @@ bsdos:
"CC = gcc" \
"CFLAGS = -I/usr/X11/include -O2" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11/lib -lX11 -lipc"
"XLIBS = -L/usr/X11/lib -lX11 -lipc -lm"
bsdos4:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -129,7 +129,7 @@ bsdos4:
"CC = gcc" \
"CFLAGS = -I/usr/X11/include -O2 -fPIC" \
"MAKELIB = ../bin/mklib.bsdos4" \
"XLIBS = -L/usr/X11/lib -lX11 -lipc"
"XLIBS = -L/usr/X11/lib -lX11 -lipc -lm"
cygnus:
$(MAKE) -f Makefile.cygnus $(MFLAGS) -f Makefile.X11 targets \
@@ -174,7 +174,7 @@ dgux:
"CC = gcc" \
"CFLAGS = -O" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11"
"XLIBS = -lX11 -lm"
freebsd:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -185,7 +185,7 @@ freebsd:
"CC = gcc" \
"CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DSHM -DHZ=100" \
"MAKELIB = ../bin/mklib.freebsd" \
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
freebsd-386:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -196,7 +196,7 @@ freebsd-386:
"CC = gcc" \
"CFLAGS = -O3 -ffast-math -fPIC -pedantic -I/usr/X11R6/include -DSHM -DHZ=100 -DUSE_X86_ASM -DFREEBSD" \
"MAKELIB = ../bin/mklib.freebsd" \
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11" \
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
gcc:
@@ -208,7 +208,7 @@ gcc:
"CC = gcc" \
"CFLAGS = -pedantic -O2" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11"
"XLIBS = -lX11 -lm"
hpux9:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -219,7 +219,7 @@ hpux9:
"CC = cc" \
"CFLAGS = +O3 -Aa -D_HPUX_SOURCE -I/usr/include/X11R5 -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm"
hpux9-gcc:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -230,7 +230,7 @@ hpux9-gcc:
"CC = gcc" \
"CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R5 -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm"
hpux9-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -241,7 +241,7 @@ hpux9-sl:
"CC = cc" \
"CFLAGS = +z +O3 +Olibcalls +ESlit -Aa +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DSHM" \
"MAKELIB = ../bin/mklib.hpux" \
"XLIBS = -L/usr/lib/X11R5 -s -Wl,+s,-B,nonfatal,-B,immediate -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/lib/X11R5 -s -Wl,+s,-B,nonfatal,-B,immediate -lXext -lXmu -lXi -lX11 -lm"
hpux9-gcc-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -252,7 +252,7 @@ hpux9-gcc-sl:
"CC = gcc" \
"CFLAGS = -fPIC -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R5 -DSHM" \
"MAKELIB = ../bin/mklib.hpux" \
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm"
hpux10:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -263,7 +263,7 @@ hpux10:
"CC = cc" \
"CFLAGS = +O3 +DAportable -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
hpux10-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -274,7 +274,7 @@ hpux10-sl:
"CC = cc" \
"CFLAGS = +z -Ae +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DSHM" \
"MAKELIB = ../bin/mklib.hpux" \
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
hpux10-gcc:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -285,7 +285,7 @@ hpux10-gcc:
"CC = gcc" \
"CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
hpux10-gcc-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -296,7 +296,7 @@ hpux10-gcc-sl:
"CC = gcc" \
"CFLAGS = -fPIC -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DSHM" \
"MAKELIB = ../bin/mklib.hpux" \
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
# For IRIX 4: don't use -fullwarn because it causes too much garbage
@@ -309,7 +309,7 @@ irix4:
"CC = cc" \
"CFLAGS = -O2 -ansi -prototypes -DSHM" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -lXext -lXmu -lXi -lX11"
"XLIBS = -lXext -lXmu -lXi -lX11 -lm"
# On IRIX 5.3 -sopt causes a problem in drawpixels.c so we don't use it
irix5:
@@ -321,7 +321,7 @@ irix5:
"CC = cc" \
"CFLAGS = -O2 -ansi -fullwarn -DSHM -DNO_CONST" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
# On IRIX 5.2+gcc
irix5-gcc:
@@ -333,7 +333,7 @@ irix5-gcc:
"CC = gcc" \
"CFLAGS = -O2 -pedantic -DSHM" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
# IRIX 5 using Dynamic Shared Objects (DSO)
irix5-dso:
@@ -345,7 +345,7 @@ irix5-dso:
"CC = cc" \
"CFLAGS = -O2 -ansi -fullwarn -DSHM -DNO_CONST" \
"MAKELIB = ../bin/mklib.irix5" \
"XLIBS = -rpath ../lib -lX11 -lXmu -lXi"
"XLIBS = -rpath ../lib -lX11 -lXmu -lXi -lm"
irix6-o32:
pmake $(MFLAGS) -f Makefile.X11 targets \
@@ -356,7 +356,7 @@ irix6-o32:
"CC = cc" \
"CFLAGS = -32 -mips2 -O2 -ansi -DSHM -DNO_CONST" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
irix6-o32-dso:
pmake $(MFLAGS) -f Makefile.X11 targets \
@@ -367,7 +367,7 @@ irix6-o32-dso:
"CC = cc" \
"CFLAGS = -32 -mips2 -O2 -ansi -DSHM -DNO_CONST" \
"MAKELIB = ../bin/mklib.irix6-32" \
"XLIBS = -rpath ../lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -rpath ../lib -lX11 -lXext -lXmu -lXi -lm"
# For IRIX 6: -woff:
# 1209 - controlling expression is constant
@@ -381,7 +381,7 @@ irix6-n32:
"CC = cc" \
"CFLAGS = -n32 -mips3 -O3 -ansi -woff 1209,1521" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
irix6-n32-dso:
pmake $(MFLAGS) -f Makefile.X11 targets \
@@ -393,7 +393,7 @@ irix6-n32-dso:
"CC = cc" \
"CFLAGS = -n32 -mips3 -O3 -ansi -DSHM -woff 1185,1521" \
"MAKELIB = ../bin/mklib.irix6-n32" \
"XLIBS = -rpath ../lib32 -lX11 -lXmu -lXi -lfpe"
"XLIBS = -rpath ../lib32 -lX11 -lXmu -lXi -lfpe -lm"
irix6-gcc-n32-sl:
make $(MFLAGS) -f Makefile.X11 targets \
@@ -405,7 +405,7 @@ irix6-gcc-n32-sl:
"CC = gcc" \
"CFLAGS = -mabi=n32 -mips3 -O3 -DSHM" \
"MAKELIB = ../bin/mklib.irix6-n32" \
"XLIBS = -rpath ../lib32 -lX11 -lXmu -lXi"
"XLIBS = -rpath ../lib32 -lX11 -lXmu -lXi -lm"
# For IRIX 6-64: -woff:
# 1068 - integer conversion resulted in a change of sign
@@ -425,7 +425,7 @@ irix6-64:
"CC = cc" \
"CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DSHM" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
irix6-64-dso:
pmake $(MFLAGS) -f Makefile.X11 targets \
@@ -437,7 +437,7 @@ irix6-64-dso:
"CC = cc" \
"CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DSHM" \
"MAKELIB = ../bin/mklib.irix6-64" \
"XLIBS = -rpath ../lib64 -lX11 -lXmu -lXi"
"XLIBS = -rpath ../lib64 -lX11 -lXmu -lXi -lm"
# May want to try these CFLAGS for better performance under Linux and GCC:
# -fPIC -O2 -ansi -pedantic -mieee-fp -DSHM -funroll-loops
@@ -451,9 +451,9 @@ linux:
"GLUT_LIB = libglut.a" \
"GLW_LIB = libGLw.a" \
"CC = gcc" \
"CFLAGS = -O2 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -I/usr/X11R6/include" \
"CFLAGS = -O3 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -I/usr/X11R6/include" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
# One Linux user reports having to use these XLIBS:
# -lMrm -lXmu -lXi -lXt -lXext -lXmu -lXi -lSM -lICE -lX11
@@ -467,7 +467,7 @@ linux-elf:
"CC = gcc" \
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -I/usr/X11R6/include" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
linux-glide:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -488,10 +488,10 @@ linux-386:
"GLUT_LIB = libglut.a" \
"GLW_LIB = libGLw.a" \
"CC = gcc" \
"CFLAGS = -O2 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DUSE_X86_ASM -I/usr/X11R6/include" \
"CFLAGS = -O3 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DUSE_X86_ASM -I/usr/X11R6/include" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-386-elf:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -503,7 +503,7 @@ linux-386-elf:
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DUSE_X86_ASM -I/usr/X11R6/include" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-386-glide:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -515,7 +515,7 @@ linux-386-glide:
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DSHM -DFX -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-386-glide-mits:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -527,7 +527,7 @@ linux-386-glide-mits:
"CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX -D_REENTRANT -DMITS -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm -lpthread" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-386-opt-V2-glide:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -539,7 +539,7 @@ linux-386-opt-V2-glide:
"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX -DFX_V2 -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include"\
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm -lpthread" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-386-opt-glide:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -551,7 +551,7 @@ linux-386-opt-glide:
"CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DFX -DUSE_X86_ASM -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -L/usr/local/glide/lib -lglide2x -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-3dnow:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -562,14 +562,14 @@ linux-3dnow:
"CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \
"CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -I/usr/X11R6/include" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S \
X86/mmx_blend.S \
X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \
X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \
X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \
X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \
X86/3dnow_norm_raw.S"
X86/3dnow_norm_raw.S X86/vertex.S X86/vertex_3dnow.S"
linux-3dnow-glide:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -587,7 +587,7 @@ linux-3dnow-glide:
X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \
X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \
X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \
X86/3dnow_norm_raw.S \
X86/3dnow_norm_raw.S X86/vertex.S X86/vertex_3dnow.S \
FX/X86/fx_3dnow_fastpath.S"
@@ -600,8 +600,9 @@ linux-386-pthread-shared-glide:
"CC = gcc" \
"CFLAGS = -O3 -fPIC -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS -DFX -I/usr/include/glide -I/usr/local/glide/include" \
"MAKELIB = ../mklib.glide" \
"XLIBS = -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread" \
"ASM_SOURCES = asm_386.S"
"XLIBS = -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S \
X86/mmx_blend.S X86/vertex.S"
# Contributed by Uwe_Maurer@t-online.de
linux-ggi:
@@ -613,7 +614,7 @@ linux-ggi:
"CC = gcc" \
"CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DGGI -DCDECL=" \
"MAKELIB = ../bin/mklib.ggi" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lggi"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lggi -lm"
# Contributed by Emmanuel marty core@ggi-project.org
linux-386-ggi:
@@ -625,8 +626,8 @@ linux-386-ggi:
"CC = gcc" \
"CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DUSE_X86_ASM -DGGI -DCDECL=" \
"MAKELIB = ../bin/mklib.ggi" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lggi" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lggi -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
# Linux on Alpha (based on email from John Ferguson ferguson@viz.tamu.edu)
linux-alpha:
@@ -636,9 +637,9 @@ linux-alpha:
"GLUT_LIB = libglut.so" \
"GLW_LIB = libGLw.a" \
"CC = gcc" \
"CFLAGS = -O2 -mieee -pedantic -L/usr/X11R6/lib -D_XOPEN_SOURCE -DSHM" \
"CFLAGS = -O3 -mieee -pedantic -L/usr/X11R6/lib -D_XOPEN_SOURCE -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11R6/lib -lX11"
"XLIBS = -L/usr/X11R6/lib -lX11 -lm"
linux-alpha-elf:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -649,7 +650,7 @@ linux-alpha-elf:
"CC = gcc" \
"CFLAGS = -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DSHM" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXi -lm"
# Not tested, but should be okay on any RedHat-based linux for PowerPC machines
# If your linux supports shared libraries, you might want to build with the
@@ -665,7 +666,7 @@ linux-ppc:
"CC = gcc" \
"CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
# -O5 and -fexpensive-optimizations causes a compiler crash for Linux PPC R4
linux-ppc-so:
@@ -677,7 +678,7 @@ linux-ppc-so:
"CC = gcc" \
"CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
# Contributed by John Stone
linux-386-pthread:
@@ -686,10 +687,10 @@ linux-386-pthread:
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
"CC = gcc" \
"CFLAGS = -O2 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R\6/include -DSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS" \
"CFLAGS = -O3 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R\6/include -DSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread" \
"ASM_SOURCES = asm_386.S"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
# Contributed by John Gotts
linux-386-pthread-shared:
@@ -700,8 +701,8 @@ linux-386-pthread-shared:
"CC = gcc" \
"CFLAGS = -O3 -fPIC -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/us\r/X11R6/include -DSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread" \
"ASM_SOURCES = asm_386.S"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-sparc:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -712,7 +713,7 @@ linux-sparc:
"CC = gcc" \
"CFLAGS = -pedantic -funroll-loops -O3 -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXt -lSM -lICE -lXmu -lXi"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXt -lSM -lICE -lXmu -lXi -lm"
# Replace -mv8 with -mcypress, -msupersparc or -msparclite as appropriate.
linux-sparc5-elf:
@@ -722,9 +723,9 @@ linux-sparc5-elf:
"GLUT_LIB = libglut.so" \
"GLW_LIB = libGLw.so" \
"CC = gcc" \
"CFLAGS = -mv8 -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
"CFLAGS = -mv8 -O3 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
# 32-bit Sparc ELF userland, on UltraSparc
linux-sparc-ultra:
@@ -734,9 +735,9 @@ linux-sparc-ultra:
"GLUT_LIB = libglut.so" \
"GLW_LIB = libGLw.so" \
"CC = gcc" \
"CFLAGS = -mv8 -O2 -mtune=ultrasparc -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
"CFLAGS = -mv8 -O3 -mtune=ultrasparc -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm"
# May want to add these CFLAGS for better performance under LynxOS and GCC:
# -fPIC -O2 -ansi -pedantic -mieee-fp -DSHM -funroll-loops
@@ -752,7 +753,7 @@ lynxos:
"CC = gcc" \
"CFLAGS = -O2 -ansi -pedantic -funroll-loops -ffast-math -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11/lib -lXext -lXi -lXmu -lX11 -lbsd"
"XLIBS = -L/usr/X11/lib -lXext -lXi -lXmu -lX11 -lbsd -lm"
machten-2.2:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -763,7 +764,7 @@ machten-2.2:
"CC = gcc" \
"CFLAGS = -DTENON -D__MACHTEN__ -fstrength-reduce -m68881 -O2" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -L/usr/lib/X11 -lX11"
"XLIBS = -L/usr/lib/X11 -lX11 -lm"
machten-4.0:
$(MAKE) targets \
@@ -774,7 +775,7 @@ machten-4.0:
"CC = gcc" \
"CFLAGS = -DTENON -D__MACHTEN__ -fstrength-reduce -O2" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -L/usr/X11R5/lib -lX11"
"XLIBS = -L/usr/X11R5/lib -lX11 -lm"
mklinux:
$(MAKE) targets \
@@ -785,7 +786,7 @@ mklinux:
"CC = gcc" \
"CFLAGS = -pedantic -O2" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lmoto -L/usr/X11/lib -lXmu -lX11"
"XLIBS = -lmoto -L/usr/X11/lib -lXmu -lX11 -lm"
netbsd:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -794,9 +795,9 @@ netbsd:
"GLUT_LIB = libglut.so" \
"GLW_LIB = libGLw.so" \
"CC = gcc" \
"CFLAGS = -O2 -fPIC -DSHM -I/usr/X11R6/include -DHZ=100" \
"CFLAGS = -O3 -fPIC -DSHM -I/usr/X11R6/include -DHZ=100" \
"MAKELIB = ../bin/mklib.netbsd" \
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11"
"XLIBS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm"
next:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -816,7 +817,7 @@ openbsd:
"CC = cc" \
"CFLAGS = -O2 -fPIC -I/usr/X11R6/include -DSHM -DHZ=100" \
"MAKELIB = ../bin/mklib.openbsd" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXi -lm"
openstep:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -845,8 +846,8 @@ os2-x11:
"CC = gcc" \
"CFLAGS = -Zmt -O3 -m486 -funroll-loops -Wall -Wno-unused -ansi -pedantic -ffast-math -DUSE_X86_ASM -D_SVID_SOURCE -D_BSD_SOURCE -I$(X11ROOT)/XFree86/include" \
"MAKELIB = ..\\bin\\mklib-emx.cmd " \
"XLIBS = -Zmt -Zcrtdll -Zexe -L$(X11ROOT)/XFree86/lib -lXt -lX11" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"XLIBS = -Zmt -Zcrtdll -Zexe -L$(X11ROOT)/XFree86/lib -lXt -lX11 -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
osf1:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -857,7 +858,7 @@ osf1:
"CC = cc" \
"CFLAGS = -O2 -std1 -ieee_with_no_inexact -DSHM -DNO_CONST" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
osf1-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -868,7 +869,7 @@ osf1-sl:
"CC = cc" \
"CFLAGS = -O2 -std1 -ieee_with_no_inexact -DSHM -DNO_CONST" \
"MAKELIB = ../bin/mklib.osf1" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
pgi-cygnus:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -879,7 +880,7 @@ pgi-cygnus:
"CC = pgcc" \
"CFLAGS = -fast -cyglibs -Munix -I. -DWIN32 -D__WIN32__ -D_WINDOWS " \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11"
"XLIBS = -lX11 -lm"
pgi-mingw32:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -890,7 +891,7 @@ pgi-mingw32:
"CC = pgcc" \
"CFLAGS = -fast -msvcrt -Munix -I. -DWIN32 -D__WIN32__ -D_WINDOWS " \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11"
"XLIBS = -lX11 -lm"
# QNX V4 & Watcom Compiler
qnx:
@@ -902,7 +903,7 @@ qnx:
"CC = cc" \
"CFLAGS = -O" \
"MAKELIB = ../bin/mklib.qnx" \
"XLIBS = -L/usr/X11/lib -lX11"
"XLIBS = -L/usr/X11/lib -lX11 -lm"
sco:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -913,10 +914,21 @@ sco:
"CC = gcc" \
"CFLAGS = -pedantic -O2 -mieee-fp" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11/lib -lX11"
"XLIBS = -L/usr/X11/lib -lX11 -lm"
sco5:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
"GLW_LIB = libGLw.a" \
"CC = gcc" \
"CFLAGS = -pedantic -O2 -mieee-fp" \
"MAKELIB = ../mklib.ar-ruv" \
"XLIBS = -lXm -lXt -lX11 -lXmu -lXext -lsocket -lx -lm"
solaris-x86:
$(MAKE) targets \
$(MAKE) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
@@ -924,10 +936,10 @@ solaris-x86:
"CC = cc" \
"CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DSHM" \
"MAKELIB = ../bin/mklib.solaris" \
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
solaris-x86-gcc:
$(MAKE) targets \
$(MAKE) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
@@ -935,7 +947,7 @@ solaris-x86-gcc:
"CC = gcc" \
"CFLAGS = -O3 -m486 -fPIC -I/usr/openwin/include -DSHM" \
"MAKELIB = ../bin/mklib.solaris" \
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos4:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -946,7 +958,7 @@ sunos4:
"CC = acc" \
"CFLAGS = -O -DSHM -DSUNOS4" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
sunos4-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -957,7 +969,7 @@ sunos4-sl:
"CC = acc" \
"CFLAGS = -Kpic -O -I/usr/include/X11R5 -DSHM -DSUNOS4" \
"MAKELIB = ld -assert pure-text -o" \
"XLIBS = -L/usr/lib/X11R5 -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/lib/X11R5 -lX11 -lXext -lXmu -lXi -lm"
sunos4-gcc:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -968,7 +980,7 @@ sunos4-gcc:
"CC = gcc" \
"CFLAGS = -O3 -DSHM -DSUNOS4 -I/usr/openwin/include" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos4-gcc-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -979,7 +991,7 @@ sunos4-gcc-sl:
"CC = gcc" \
"CFLAGS = -fPIC -O3 -I/usr/openwin/include -I/usr/include/X11R5 -I/usr/include/X11R5 -DSHM -DSUNOS4 -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.sunos4" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos4-gcc-x11r6-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -990,7 +1002,7 @@ sunos4-gcc-x11r6-sl:
"CC = gcc" \
"CFLAGS = -fPIC -O3 -I/usr/X11R6.3/include -DSHM -DSUNOS4 -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.sunos4" \
"XLIBS = -L/usr/X11R6.3/lib/X11 -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/X11R6.3/lib/X11 -lX11 -lXext -lXmu -lXi -lm"
sunos5:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1001,7 +1013,7 @@ sunos5:
"CC = cc" \
"CFLAGS = -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos5-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1012,7 +1024,7 @@ sunos5-sl:
"CC = cc" \
"CFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.sunos5" \
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos5-ultra:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1023,7 +1035,7 @@ sunos5-ultra:
"CC = cc" \
"CFLAGS = -Xa -fast -xO5 -xtarget=ultra -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos5-ultra-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1034,7 +1046,7 @@ sunos5-ultra-sl:
"CC = cc" \
"CFLAGS = -KPIC -Xa -fast -xO5 -xtarget=ultra -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.sunos5" \
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos5-gcc:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1045,7 +1057,7 @@ sunos5-gcc:
"CC = gcc" \
"CFLAGS = -O3 -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos5-gcc-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1056,7 +1068,7 @@ sunos5-gcc-sl:
"CC = gcc" \
"CFLAGS = -fPIC -O3 -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.sunos5" \
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
sunos5-x11r6-gcc-sl:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1067,7 +1079,7 @@ sunos5-x11r6-gcc-sl:
"CC = gcc" \
"CFLAGS = -fPIC -O3 -DSHM -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.sunos5" \
"XLIBS = -lSM -lICE -lX11 -lXext -lXmu -lXi -lnsl -lsocket"
"XLIBS = -lSM -lICE -lX11 -lXext -lXmu -lXi -lnsl -lsocket -lm"
# Contributed by John Stone
sunos5-pthread:
@@ -1078,7 +1090,7 @@ sunos5-pthread:
"CC = cc" \
"CFLAGS = -mt -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4\_BUG -DTHREADS -DPTHREADS" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lpthread"
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lpthread -lm"
# Contributed by John Stone
sunos5-thread:
@@ -1089,7 +1101,7 @@ sunos5-thread:
"CC = cc" \
"CFLAGS = -mt -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DSHM -DSOLARIS_2_4\_BUG -DTHREADS -DSOLARIS_THREADS" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lthread"
"XLIBS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lthread -lm"
# Contributed by John Stone
sunos5-gcc-thread:
@@ -1100,7 +1112,7 @@ sunos5-gcc-thread:
"CC = gcc" \
"CFLAGS = -O3 -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG -D_REENTRANT -DTHREADS -DSOLARIS_THR\EADS" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lthread"
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lthread -lm"
# Contributed by John Stone
sunos5-gcc-pthread:
@@ -1111,7 +1123,7 @@ sunos5-gcc-pthread:
"CC = gcc" \
"CFLAGS = -O3 -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG -D_REENTRANT -DTHREADS -DPTHREADS" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lpthread"
"XLIBS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lpthread -lm"
# from Ron Metoyer (metoyer@iexist.flw.lucent.com)
sunSolaris-CC:
@@ -1123,7 +1135,7 @@ sunSolaris-CC:
"CC = CC" \
"CFLAGS = -O -I/usr/openwin/include -DSHM -DSOLARIS_2_4_BUG" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi"
"XLIBS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm"
#This config doesn't work, Ultrix C compiler isn't ANSI compliant
ultrix:
@@ -1135,7 +1147,7 @@ ultrix:
"CC = cc" \
"CFLAGS = -O -Dconst=/**/" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lXmu -lX11 -lXi"
"XLIBS = -lXmu -lX11 -lXi -lm"
ultrix-gcc:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1146,7 +1158,7 @@ ultrix-gcc:
"CC = gcc" \
"CFLAGS = -pedantic -O2" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lXmu -lX11 -lXi"
"XLIBS = -lXmu -lX11 -lXi -lm"
# tested on Cray C90 running UNICOS 8.0.4
unicos:
@@ -1158,7 +1170,7 @@ unicos:
"CC = cc" \
"CFLAGS =" \
"MAKELIB = ../bin/mklib/ar-rcv" \
"XLIBS = -lX11 -lXext -lXmu -lXi"
"XLIBS = -lX11 -lXext -lXmu -lXi -lm"
unixware:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1169,7 +1181,7 @@ unixware:
"CC = cc" \
"CFLAGS = -O -I/usr/X/include -DSHM" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11 -lXext -lXmu -lXi -lsocket -lnsl"
"XLIBS = -lX11 -lXext -lXmu -lXi -lsocket -lnsl -lm"
unixware-shared:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1180,7 +1192,7 @@ unixware-shared:
"CC = cc" \
"CFLAGS = -O -I/usr/X/include -KPIC,inline -DSHM" \
"MAKELIB = ../bin/mklib.solaris" \
"XLIBS = -lX11 -lXext -lXmu -lXi -lsocket -lnsl"
"XLIBS = -lX11 -lXext -lXmu -lXi -lsocket -lnsl -lm"
uwin:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1190,7 +1202,7 @@ uwin:
"CC = gcc" \
"CFLAGS = -pedantic -O2 -I/usr/X11/include " \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/X11/lib -lX11"
"XLIBS = -L/usr/X11/lib -lX11 -lm"
vistra:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
@@ -1201,7 +1213,7 @@ vistra:
"CC = gcc" \
"CFLAGS = -pedantic -O2" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -lX11 -lsocket -lnsl -lgen"
"XLIBS = -lX11 -lsocket -lnsl -lgen -lm"
# for debugging on IRIX 5.x systems
@@ -1220,7 +1232,7 @@ irix-debug:
"CC = cc" \
"CFLAGS = -g -n32 -ansi -fullwarn -DSHM -DDEBUG -woff 1209,1210,1506,1521,3496" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -rpath ../lib32 -lX11 -lXext -lXmu -lXi -lfpe -lXext -lXmu -lXi"
"XLIBS = -rpath ../lib32 -lX11 -lXext -lXmu -lXi -lfpe -lXext -lXmu -lXi -lm"
DEBUG:
pmake $(MFLAGS) -f Makefile.X11 targets \
@@ -1231,7 +1243,7 @@ DEBUG:
"CC = cc" \
"CFLAGS = -g -ansi -prototypes -fullwarn -DSHM -DDEBUG" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"XLIBS = -lX11 -lXext -lXmu -lXi -lfpe"
"XLIBS = -lX11 -lXext -lXmu -lXi -lfpe -lm"
# for debugging on Linux systems
linux-debug:
@@ -1243,10 +1255,22 @@ linux-debug:
"CC = gcc" \
"CFLAGS = -g -ansi -pedantic -Wall -DSHM -DDEBUG -DSVGA -DFX -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM_not -I/usr/include/glide -I/usr/local/glide/include" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/local/glide/lib -lglide2x -ltexus -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"XLIBS = -L/usr/local/glide/lib -lglide2x -ltexus -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-elf-debug:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.so" \
"GLU_LIB = libGLU.so" \
"GLUT_LIB = libglut.so" \
"GLW_LIB = libGLw.so" \
"CC = gcc" \
"CFLAGS = -g -ansi -pedantic -Wall -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DSHM -DDEBUG -DSVGA -DFX -I/usr/X11R6/include -I/usr/include/glide" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga -lm -lvga -L/usr/local/lib -L/usr/local/glide/lib -lglide2x" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
linux-glide-debug:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.so" \
"GLU_LIB = libGLU.so" \
@@ -1255,8 +1279,8 @@ linux-elf-debug:
"CC = gcc" \
"CFLAGS = -g -ansi -pedantic -Wall -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DFX -DDEBUG -I/usr/local/glide/include -I/usr/include/glide" \
"MAKELIB = ../bin/mklib.linux" \
"XLIBS = -L/usr/local/glide/lib -lglide2x -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga -L/usr/local/glide/lib -lglide2x -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S"
"XLIBS = -L/usr/local/glide/lib -lglide2x -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lvga -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S X86/vertex.S"
# for profiling on Linux systems
linux-prof:
@@ -1268,11 +1292,12 @@ linux-prof:
"CC = gcc" \
"CFLAGS = -O2 -pg -ansi -pedantic -Wall -DSHM -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -I/usr/include/glide -I/usr/local/glide/include" \
"MAKELIB = ../bin/mklib.ar-ruv" \
"XLIBS = -L/usr/local/glide/lib -lglide2x -L/usr/X11/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE" \
"XLIBS = -L/usr/local/glide/lib -lglide2x -L/usr/X11/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \
"ASM_SOURCES = X86/x86a.S X86/common_x86asm.S \
X86/mmx_blend.S \
X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \
X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \
X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \
X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \
X86/3dnow_norm_raw.S"
X86/3dnow_norm_raw.S X86/vertex.S X86/vertex_3dnow.S \
FX/X86/fx_3dnow_fastpath.S"

View File

@@ -1,9 +1,9 @@
# $Id: Makefile.X11,v 1.9 1999/09/20 21:06:57 keithw Exp $
# $Id: Makefile.X11,v 1.12.2.9 2000/04/24 14:47:11 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
# Version: 3.2
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
# Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@@ -104,6 +104,7 @@ default:
@echo " make pgi-mingw32 for mingW32 with Portland Group, Inc. compiler"
@echo " make qnx for QNX V4 systems with Watcom compiler"
@echo " make sco for SCO Unix systems with ODT"
@echo " make sco5 for SCO 5.0.5 OpenServer Unix"
@echo " make solaris-x86 for PCs with Solaris"
@echo " make solaris-x86-gcc for PCs with Solaris using GCC"
@echo " make sunos4 for Suns with SunOS 4.x"
@@ -139,7 +140,7 @@ aix aix-sl amix bsdos bsdos4 dgux freebsd freebsd-386 gcc \
hpux9 hpux9-sl hpux9-gcc hpux9-gcc-sl \
hpux10 hpux10-sl hpux10-gcc hpux10-gcc-sl \
irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \
linux linux-debug linux-prof linux-elf linux-elf-debug \
linux linux-debug linux-prof linux-elf linux-elf-debug linux-glide-debug \
linux-glide linux-386-glide linux-386-opt-glide \
linux-386-opt-V2-glide \
linux-386 linux-386-elf \
@@ -151,7 +152,7 @@ linux-sparc \
linux-sparc5-elf \
linux-sparc-ultra \
lynxos machten-2.2 machten-4.0 \
mklinux netbsd osf1 osf1-sl openbsd qnx sco \
mklinux netbsd osf1 osf1-sl openbsd qnx sco sco5 \
solaris-x86 solaris-x86-gcc sunSolaris-CC \
sunos4 sunos4-sl sunos4-gcc sunos4-gcc-sl sunos4-gcc-x11r6-sl \
sunos5 sunos5-sl sunos5-ultra sunos5-ultra-sl sunos5-gcc sunos5-gcc-sl \
@@ -168,6 +169,7 @@ sunos5-x11r6-gcc-sl ultrix-gcc unicos unixware uwin vistra:
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug:
@@ -182,6 +184,7 @@ irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug:
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
irix6-64 irix6-64-dso:
@@ -196,6 +199,7 @@ irix6-64 irix6-64-dso:
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
amiwin:
@@ -224,9 +228,10 @@ cygnus cygnus-linux:
touch src-glu/depend
cd src ; $(MAKE) -f Makefile.X11 $@
cd src-glu ; $(MAKE) -f Makefile.X11 $@
cd src-glut ; $(MAKE) -f Makefile.X11 $@
cd demos ; $(MAKE) -f Makefile.X11 $@
if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
macintosh:
@echo "See the README file for Macintosh intallation information"
@@ -271,6 +276,7 @@ linux-ggi linux-386-ggi:
if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
# if you change GGI_DEST please change it in ggimesa.conf, too.
DESTDIR=/usr/local
@@ -308,108 +314,111 @@ realclean: clean
cd xdemos && $(MAKE) -f Makefile.X11 realclean || true
cd book && $(MAKE) -f Makefile.X11 realclean || true
cd samples && $(MAKE) -f Makefile.X11 realclean || true
cd ggi/demos && ($MAKE) -f Makefile.X11 realclean || true
cd ggi/demos && $(MAKE) -f Makefile.X11 realclean || true
cd src/GGI/default && $(MAKE) -f Makefile.X11 realclean || true
DIRECTORY = Mesa-3.1
LIB_NAME = MesaLib-3.1beta3
DEMO_NAME = MesaDemos-3.1beta3
DIRECTORY = Mesa-3.2
LIB_NAME = MesaLib-3.2
DEMO_NAME = MesaDemos-3.2
LIB_FILES = \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/Make-config \
$(DIRECTORY)/acconfig.h \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/conf.h.in \
$(DIRECTORY)/config.guess \
$(DIRECTORY)/config.sub \
$(DIRECTORY)/configure \
$(DIRECTORY)/configure.in \
$(DIRECTORY)/install-sh \
$(DIRECTORY)/ltconfig \
$(DIRECTORY)/ltmain.sh \
$(DIRECTORY)/missing \
$(DIRECTORY)/mkinstalldirs \
$(DIRECTORY)/stamp-h.in \
$(DIRECTORY)/configure \
$(DIRECTORY)/docs/CONFIG \
$(DIRECTORY)/docs/CONFORM \
$(DIRECTORY)/docs/COPYING \
$(DIRECTORY)/docs/COPYRIGHT \
$(DIRECTORY)/docs/DEVINFO \
$(DIRECTORY)/docs/IAFA-PACKAGE \
$(DIRECTORY)/docs/INSTALL \
$(DIRECTORY)/docs/INSTALL.GNU \
$(DIRECTORY)/docs/README \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES \
$(DIRECTORY)/docs/VERSIONS \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/bin/README \
$(DIRECTORY)/bin/mklib* \
$(DIRECTORY)/*.BAT \
$(DIRECTORY)/*.bat \
$(DIRECTORY)/descrip.mms \
$(DIRECTORY)/mms-config \
$(DIRECTORY)/xlib.opt \
$(DIRECTORY)/STARTUP.MK \
$(DIRECTORY)/mesawin32.mak \
$(DIRECTORY)/Names.win \
$(DIRECTORY)/win32-openstep.sh \
$(DIRECTORY)/*.dja \
$(DIRECTORY)/include/GL/Makefile.in \
$(DIRECTORY)/include/GL/Makefile.am \
$(DIRECTORY)/include/GL/dosmesa.h \
$(DIRECTORY)/include/GL/foomesa.h \
$(DIRECTORY)/include/GL/fxmesa.h \
$(DIRECTORY)/include/GL/ggimesa.h \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
$(DIRECTORY)/include/GL/glu.h \
$(DIRECTORY)/include/GL/glu_mangle.h \
$(DIRECTORY)/include/GL/glx.h \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/mglmesa.h \
$(DIRECTORY)/include/GL/osmesa.h \
$(DIRECTORY)/include/GL/svgamesa.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/GL/xmesa.h \
$(DIRECTORY)/include/GL/xmesa_x.h \
$(DIRECTORY)/include/GL/xmesa_xf86.h \
$(DIRECTORY)/include/GLView.h \
$(DIRECTORY)/include/Makefile.in \
$(DIRECTORY)/include/Makefile.am \
$(DIRECTORY)/src/Makefile* \
$(DIRECTORY)/src/descrip.mms \
$(DIRECTORY)/src/mms_depend \
$(DIRECTORY)/src/mesa.conf \
$(DIRECTORY)/src/*.def \
$(DIRECTORY)/src/depend \
$(DIRECTORY)/src/*.[chS] \
$(DIRECTORY)/src/Allegro/*.[ch] \
$(DIRECTORY)/src/BeOS/*.cpp \
$(DIRECTORY)/src/D3D/*.cpp \
$(DIRECTORY)/src/D3D/*.CPP \
$(DIRECTORY)/src/D3D/*.h \
$(DIRECTORY)/src/D3D/*.H \
$(DIRECTORY)/src/D3D/*.c \
$(DIRECTORY)/src/D3D/*.C \
$(DIRECTORY)/src/D3D/MAKEFILE \
$(DIRECTORY)/src/D3D/*bat \
$(DIRECTORY)/src/D3D/*DEF \
$(DIRECTORY)/src/DOS/DEPEND.DOS \
$(DIRECTORY)/src/DOS/*.c \
$(DIRECTORY)/src/FX/Makefile.am \
$(DIRECTORY)/src/FX/Makefile.in \
$(DIRECTORY)/src/FX/*.[ch] \
$(DIRECTORY)/src/FX/*.def \
$(DIRECTORY)/src/FX/X86/Makefile.am \
$(DIRECTORY)/src/FX/X86/Makefile.in \
$(DIRECTORY)/src/FX/X86/*.[Shc] \
$(DIRECTORY)/Makefile* \
$(DIRECTORY)/Make-config \
$(DIRECTORY)/acconfig.h \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
$(DIRECTORY)/conf.h.in \
$(DIRECTORY)/config.guess \
$(DIRECTORY)/config.sub \
$(DIRECTORY)/configure \
$(DIRECTORY)/configure.in \
$(DIRECTORY)/install-sh \
$(DIRECTORY)/ltconfig \
$(DIRECTORY)/ltmain.sh \
$(DIRECTORY)/missing \
$(DIRECTORY)/mkinstalldirs \
$(DIRECTORY)/stamp-h.in \
$(DIRECTORY)/configure \
$(DIRECTORY)/docs/CONFIG \
$(DIRECTORY)/docs/CONFORM \
$(DIRECTORY)/docs/COPYING \
$(DIRECTORY)/docs/COPYRIGHT \
$(DIRECTORY)/docs/DEVINFO \
$(DIRECTORY)/docs/IAFA-PACKAGE \
$(DIRECTORY)/docs/INSTALL \
$(DIRECTORY)/docs/INSTALL.GNU \
$(DIRECTORY)/docs/README \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES* \
$(DIRECTORY)/docs/VERSIONS \
$(DIRECTORY)/docs/*.spec \
$(DIRECTORY)/bin/README \
$(DIRECTORY)/bin/mklib* \
$(DIRECTORY)/*.BAT \
$(DIRECTORY)/*.bat \
$(DIRECTORY)/descrip.mms \
$(DIRECTORY)/mms-config \
$(DIRECTORY)/xlib.opt \
$(DIRECTORY)/STARTUP.MK \
$(DIRECTORY)/mesawin32.mak \
$(DIRECTORY)/Names.win \
$(DIRECTORY)/win32-openstep.sh \
$(DIRECTORY)/Makefile.dja \
$(DIRECTORY)/common.dja \
$(DIRECTORY)/include/GL/Makefile.in \
$(DIRECTORY)/include/GL/Makefile.am \
$(DIRECTORY)/include/GL/amesa.h \
$(DIRECTORY)/include/GL/dosmesa.h \
$(DIRECTORY)/include/GL/foomesa.h \
$(DIRECTORY)/include/GL/fxmesa.h \
$(DIRECTORY)/include/GL/ggimesa.h \
$(DIRECTORY)/include/GL/gl.h \
$(DIRECTORY)/include/GL/gl_mangle.h \
$(DIRECTORY)/include/GL/glu.h \
$(DIRECTORY)/include/GL/glu_mangle.h \
$(DIRECTORY)/include/GL/glx.h \
$(DIRECTORY)/include/GL/glx_mangle.h \
$(DIRECTORY)/include/GL/mesa_wgl.h \
$(DIRECTORY)/include/GL/mglmesa.h \
$(DIRECTORY)/include/GL/osmesa.h \
$(DIRECTORY)/include/GL/svgamesa.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/include/GL/xmesa.h \
$(DIRECTORY)/include/GL/xmesa_x.h \
$(DIRECTORY)/include/GL/xmesa_xf86.h \
$(DIRECTORY)/include/GLView.h \
$(DIRECTORY)/include/Makefile.in \
$(DIRECTORY)/include/Makefile.am \
$(DIRECTORY)/src/Makefile* \
$(DIRECTORY)/src/descrip.mms \
$(DIRECTORY)/src/mms_depend \
$(DIRECTORY)/src/mesa.conf \
$(DIRECTORY)/src/*.def \
$(DIRECTORY)/src/depend \
$(DIRECTORY)/src/*.[chS] \
$(DIRECTORY)/src/Allegro/*.[ch] \
$(DIRECTORY)/src/BeOS/*.cpp \
$(DIRECTORY)/src/D3D/*.cpp \
$(DIRECTORY)/src/D3D/*.CPP \
$(DIRECTORY)/src/D3D/*.h \
$(DIRECTORY)/src/D3D/*.H \
$(DIRECTORY)/src/D3D/*.c \
$(DIRECTORY)/src/D3D/*.C \
$(DIRECTORY)/src/D3D/MAKEFILE \
$(DIRECTORY)/src/D3D/*bat \
$(DIRECTORY)/src/D3D/*DEF \
$(DIRECTORY)/src/DOS/DEPEND.DOS \
$(DIRECTORY)/src/DOS/*.c \
$(DIRECTORY)/src/FX/Makefile.am \
$(DIRECTORY)/src/FX/Makefile.in \
$(DIRECTORY)/src/FX/*.[ch] \
$(DIRECTORY)/src/FX/*.def \
$(DIRECTORY)/src/FX/X86/Makefile.am \
$(DIRECTORY)/src/FX/X86/Makefile.in \
$(DIRECTORY)/src/FX/X86/*.[Shc] \
$(DIRECTORY)/src/GGI/Makefile.am \
$(DIRECTORY)/src/GGI/Makefile.in \
$(DIRECTORY)/src/GGI/*.[ch] \
@@ -429,55 +438,68 @@ LIB_FILES = \
$(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.am \
$(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.in \
$(DIRECTORY)/src/GGI/include/ggi/mesa/*.h \
$(DIRECTORY)/src/KNOWN_BUGS \
$(DIRECTORY)/src/MGL/*.[ch] \
$(DIRECTORY)/src/MGL/*.txt \
$(DIRECTORY)/src/OSmesa/Makefile.am \
$(DIRECTORY)/src/OSmesa/Makefile.in \
$(DIRECTORY)/src/OSmesa/*.[ch] \
$(DIRECTORY)/src/S3/*.[ch] \
$(DIRECTORY)/src/S3/*.def \
$(DIRECTORY)/src/S3/*.mak \
$(DIRECTORY)/src/S3/*.rc \
$(DIRECTORY)/src/SVGA/Makefile.am \
$(DIRECTORY)/src/SVGA/Makefile.in \
$(DIRECTORY)/src/SVGA/*.[ch] \
$(DIRECTORY)/src/Windows/*.[ch] \
$(DIRECTORY)/src/Windows/*.def \
$(DIRECTORY)/src/X/Makefile.am \
$(DIRECTORY)/src/X/Makefile.in \
$(DIRECTORY)/src/X/*.[ch] \
$(DIRECTORY)/src/X86/*.[ch] \
$(DIRECTORY)/src/X86/Makefile.am \
$(DIRECTORY)/src/X86/Makefile.in \
$(DIRECTORY)/src/X86/*.m4 \
$(DIRECTORY)/src/X86/*.S \
$(DIRECTORY)/src/*.dja \
$(DIRECTORY)/src-glu/README[12] \
$(DIRECTORY)/src-glu/Makefile* \
$(DIRECTORY)/src-glu/descrip.mms \
$(DIRECTORY)/src-glu/mms_depend \
$(DIRECTORY)/src-glu/*.def \
$(DIRECTORY)/src-glu/*.dja \
$(DIRECTORY)/src-glu/depend \
$(DIRECTORY)/src-glu/*.[ch] \
$(DIRECTORY)/widgets-mesa \
$(DIRECTORY)/widgets-sgi \
$(DIRECTORY)/util/README \
$(DIRECTORY)/util/Makefile.am \
$(DIRECTORY)/util/Makefile.in \
$(DIRECTORY)/util/*.[ch] \
$(DIRECTORY)/util/sampleMakefile \
$(DIRECTORY)/BeOS/Makefile \
$(DIRECTORY)/BeOS/*.cpp
# old stuff
# $(DIRECTORY)/Win32 \
# $(DIRECTORY)/win32
# $(DIRECTORY)/OpenStep \
#
#
$(DIRECTORY)/src/KNOWN_BUGS \
$(DIRECTORY)/src/MGL/*.[ch] \
$(DIRECTORY)/src/MGL/*.txt \
$(DIRECTORY)/src/OSmesa/Makefile.am \
$(DIRECTORY)/src/OSmesa/Makefile.in \
$(DIRECTORY)/src/OSmesa/*.[ch] \
$(DIRECTORY)/src/S3/*.[ch] \
$(DIRECTORY)/src/S3/*.def \
$(DIRECTORY)/src/S3/*.mak \
$(DIRECTORY)/src/S3/*.rc \
$(DIRECTORY)/src/SVGA/Makefile.am \
$(DIRECTORY)/src/SVGA/Makefile.in \
$(DIRECTORY)/src/SVGA/*.[ch] \
$(DIRECTORY)/src/Windows/*.[ch] \
$(DIRECTORY)/src/Windows/*.def \
$(DIRECTORY)/src/X/Makefile.am \
$(DIRECTORY)/src/X/Makefile.in \
$(DIRECTORY)/src/X/*.[ch] \
$(DIRECTORY)/src/X86/*.[ch] \
$(DIRECTORY)/src/X86/Makefile.am \
$(DIRECTORY)/src/X86/Makefile.in \
$(DIRECTORY)/src/X86/*.m4 \
$(DIRECTORY)/src/X86/*.S \
$(DIRECTORY)/src/*.dja \
$(DIRECTORY)/src-glu/README[12] \
$(DIRECTORY)/src-glu/Makefile* \
$(DIRECTORY)/src-glu/descrip.mms \
$(DIRECTORY)/src-glu/mms_depend \
$(DIRECTORY)/src-glu/*.def \
$(DIRECTORY)/src-glu/*.dja \
$(DIRECTORY)/src-glu/depend \
$(DIRECTORY)/src-glu/*.[ch] \
$(DIRECTORY)/widgets-mesa \
$(DIRECTORY)/widgets-sgi \
$(DIRECTORY)/util/README \
$(DIRECTORY)/util/Makefile.am \
$(DIRECTORY)/util/Makefile.in \
$(DIRECTORY)/util/*.[ch] \
$(DIRECTORY)/util/sampleMakefile \
$(DIRECTORY)/BeOS/Makefile \
$(DIRECTORY)/BeOS/*.cpp \
$(DIRECTORY)/WIN32/NMAKE.MAK \
$(DIRECTORY)/WIN32/NMAKE.MIF \
$(DIRECTORY)/WIN32/RES/*rc \
$(DIRECTORY)/WIN32/RES/*def \
$(DIRECTORY)/WIN32/RULES/lib.* \
$(DIRECTORY)/WIN32/RULES/progs.* \
$(DIRECTORY)/macos/README \
$(DIRECTORY)/macos/gli_api/*.h \
$(DIRECTORY)/macos/include-mac/*.h \
$(DIRECTORY)/macos/libraries/*.stub \
$(DIRECTORY)/macos/libraries/*Stub \
$(DIRECTORY)/macos/projects/*.mcp \
$(DIRECTORY)/macos/projects/*.exp \
$(DIRECTORY)/macos/projects/*.h \
$(DIRECTORY)/macos/resources/*.c \
$(DIRECTORY)/macos/resources/*.r \
$(DIRECTORY)/macos/resources/*.rsrc \
$(DIRECTORY)/macos/src-agl/*.exp \
$(DIRECTORY)/macos/src-agl/*.[ch] \
$(DIRECTORY)/macos/src-gli/*.[ch] \
$(DIRECTORY)/OpenStep \
DEMO_FILES = \
@@ -516,13 +538,13 @@ DEMO_FILES = \
lib_tar:
cd .. ; \
tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \
tar --exclude CVS -c -v -f $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.gz $(DIRECTORY)
demo_tar:
cd .. ; \
tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) ; \
tar --exclude CVS -c -v -f $(DEMO_NAME).tar $(DEMO_FILES) ; \
gzip $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.gz $(DIRECTORY)

View File

@@ -16,11 +16,11 @@ Status
Version
$Id: MESA_resize_buffers.spec,v 1.1 1999/07/20 00:30:41 brianp Exp $
$Id: MESA_resize_buffers.spec,v 1.1.2.1 2000/04/04 23:28:00 brianp Exp $
Number
XXX none assigned
196
Dependencies

View File

@@ -16,11 +16,11 @@ Status
Version
$Id: MESA_window_pos.spec,v 1.1 1999/07/20 00:30:41 brianp Exp $
$Id: MESA_window_pos.spec,v 1.1.2.1 2000/04/04 23:28:00 brianp Exp $
Number
XXX non assigned
197
Dependencies

View File

@@ -1,13 +1,8 @@
3Dfx Glide device driver for Mesa 3.1
3Dfx Glide device driver for Mesa 3.2
(see below for FAQ)
This software is distributed under the terms of the GNU Library
General Public License, see the LICENSE file for details.
What do you need ?
------------------
@@ -327,6 +322,11 @@ The Mesa/Voodoo Environment Variables:
export MESA_FX_INFO=1
you will get some useful statistic.
- If you define the env. var. MESA_FX_NO_SIGNALS:
export MESA_FX_NO_SIGNALS=1
Mesa/FX will not install atexit() or signal() handlers.
Know BUGS and Problems:
-----------------------
@@ -541,9 +541,7 @@ No because the Linux Glide doesn't (yet) support the Voodoo Rush.
a binary copy of the Mesa in order to make the software
working out of the box ?
Yes, you have simply to include some informations about authors
and where the library sources are available (check the LICENSE
file for more informations about the GNU GPL).
Yes.
11. Which is the best make target for compiling the Mesa for

View File

@@ -28,7 +28,7 @@ working. No optimizations have been made at this time.
Compiling
Simply cd to the Mesa-3.x directory and type "make beos-r4".
In the Mesa-3.x directory type "make -f Makefile.X11 beos-r4".
When it finishes the libMesaGL.so and libMesaGLU.so libraries for
BeOS will be in the Mesa-3.x/lib/ directory.
@@ -99,4 +99,4 @@ of February, 1999.
----------------------------------------------------------------------
$Id: README.BEOS,v 1.5 1999/03/03 02:34:04 brianp Exp $
$Id: README.BEOS,v 1.5.6.1 1999/11/27 01:39:50 brianp Exp $

View File

@@ -1,120 +1,50 @@
August 30, 1998 -- Paul Garceau (pgarceau@teleport.com)
August 30, 1998 -- Paul Garceau
Updated January 13, 2000 -- Paul Garceau (pgarceau@teleport.com)
DISCLAIMER: I make this extension to the Mesa 3-D Graphics Library as a service
DISCLAIMER: I make this port of the Mesa 3-D Graphics Library as a service
to the general public. I can, in no way support or make any guarantee that the
EGCS-Mingw32 build or any Gnu-Win32 build will work for your system. The
associated packages and batch files I have included as part of the EGCS-Mingw32
extension are provided "As-is" with out any guarantee of support or functionality
from the author of this EGCS-Mingw32 native windows port of the Mesa 3-D Graphics
Library.
build will work for your system.
The associated packages and batch files I have included as part of the GCC-2.95.2/Mingw32 extension are provided "As-is" with out any guarantee of support or functionality from this author.
Feel free to modify or change things as you see fit, just remember that
I can't support any modifications you might want to make to the files which I
have included OR the lgpl protected Mesa 3-D Graphics Library.
I recommend using GCC-2.95.2/Mingw32 which is available at Mumit Khans' ftp site:
EGCS-Mingw32 Beta 3.08 Archive Manifest:
mingw32.bat
src/makefile.nt4
src/wmesa.c
src-glu/makefile.nt4
(ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/)
###############
This build has been tested under WinNT4/SP6. Win9x and WinNT5 remain untested by me. I have not tested any of the demos included with Mesa3d.
Greetings,
I recommend using the GCC-2.95.2/Mingw32.
In order to build the Mingw32 set of Mesa 3-D Graphics Library for Beta3.08
it will be necessary for you to use the Dos or Command Prompt that is available
on most of the i86 based MS Windows machines. Also, I believe that this build
will run on Win95, Win98, WinNT4 and WinNT5.
I haven't tested Win95/98 or WinNT5. This build was generated under
WinNT4 with SP3 installed.
This has not been tested under any systems outside of
a WinNT4 Workstation with EGCS-Mingw32 toolchain, v.1.0.2 installed.
EGCS-Mingw32 uses a variation of gcc to handle its build. The Mesa 3-D
Graphics Library build that I have generated is based, in small part, on the
Cygwin32 build and associated makefiles that Stephane Rehel (rehel@worldnet.fr)
defined back in 1997. The EGCS-Mingw32 toolchain is capable of generating
native windows code and, as of the date of this readme, can be obtained from:
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/egcs-mingw32-102.html
ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2
Much thanks to the combined efforts of Mumit Khan, Jan-Jaap Vanderhagen
and Colin Peters for making it possible for the EGCS-Mingw32 toolchain to exist.
and Colin Peters for making it possible for the Mingw32 toolchain to exist. Also, thanks go out to Stephane Rehel for the work that was completed on the Cygwin build.
Installing EGCS-Mingw32 Build Revisions:
Installing GCC-2.95.2/Mingw32 Build:
To install the makefile and source revisions incorporated with this build
of the Mesa 3-D Graphics Library, you'll have to use a version of winzip. I am
in the process of finding a suitable Win32 compatible tar executable so that if
you don't have winzip, you can still decompress the files into their respective
folders/directories.
a) Open the file archive (either tar.gz or .zip extensions)
a) Move the mingw32.zip file to the top level of the hard drive on your
system.
b) Decide the directory you want to move the archived files to.
b) Copy all of the Beta 3.08 src/windows files to the src/ directory.
d) Extract the files from the archive.
e) Edit the mingw32.bat file to accomodate your choice of directory structure.
b) Open the Winzip file
c) Verify that the files will be properly extracted.
d) Extract the files with the Winzip "Overwrite" and "Use Folder Names"
options enabled.
The zip file directory structure extraction defaults to the top level of
the hard drive where the mingw32.zip file exists unless otherwise instructed by
you.
The version of wmesa.c included with the mingw32 archive needs to replace
the current version of the Beta 3.08 wmesa.c file in order for the egcs-mingw32
build to work. This is because the original Win32 stuff assumes that the glut
utilities are to be installed. The Glut utilities are not part of the
egcs-mingw32 build for Beta 3.08.
Build Considerations:
In order to get the build to work, I needed to create a special makefile
for each library which the Mesa 3-D Graphics Library requires since there is no
comparable make-config/config on a native windows platform.
Since I was only creating a few of the possible libraries for
Mesa (gl, glu), I only created the new make files in their respective libraries
src, src-glu). For libMesaaux.a. you will find a makefile for it in the
src-aux directory. libMesatk.a and libglut.a were not ported.
The build itself is a .bat based build and uses Gnu Make,Version 3.76.1 to
process the makefiles noted above. The build must be run from the directory
where the mingw32.bat file is. You can get the binary version of Make 3.76.1
from Jan-Jaap van der Heijden's site in Germany:
http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/download.html
It was necessary to modify some source code, specifically the source code
in the src-glu directory. I needed to modify nurbs.c, quadric.c and tess.c in
order to get them to work using the EGCS-Mingw32 toolchain.
The original EGCS-Mingw32 Toolchain, is available from:
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/egcs-mingw32-102.html
%mesaroot%: This is your root directory (Mesa-3.2)
%mesasrc%: This is the Mesa-3.2 src directory (Mesa-3.2\src)
%mesalib%: This is where the build will put libGL.a and libGLU.a
Running the Build:
Ok, now that we've got the basics out of the way, follows is all you need
to do in order to build the EGCS-Mingw32 version of libMesaGL.a and libMesaGLU.a:
Open your Command Prompt/Dos prompt.
Go to your Mesa-3.0 beta 'root' directory.
This is the same directory that the Mesa mingw32.zip file was
originally stored in if you've installed the Mesa-3.0 beta 3-D
Graphics Library source as outlined in the "readme" file included
with the Mesa-3.0 beta distribution.
Open your Command Prompt or MS-DOS prompt.
Go to your Mesa-3.2 'root' directory
At the command line type: mingw32
mingw32 is the .bat file that actually does the build.
That's all there is to it.
Enjoy!

View File

@@ -1,9 +1,7 @@
Mesa 3.0 MITS Information
This software is distributed under the terms of the GNU Library
General Public License, see the LICENSE file for details.
[The MITS code hasn't been update for Mesa 3.1 and may no longer work]
This document is a preliminary introduction to help you get

View File

@@ -1,33 +1,54 @@
Mesa 3.0 Unix/X11 Information
Mesa 3.2 Unix/X11 Information
Installation
============
To compile the library, first type 'make' alone to see the list of system
configurations currently supported. If you see your configuration on the
list, type 'make <config>'. Most popular Unix/X workstations are currently
supported.
There are two ways to compile Mesa on Unix/X11 systems:
1. The old way:
First type 'make' alone to see the list of system
configurations currently supported. If you see your configuration on the
list, type 'make <config>'. Most popular Unix/X workstations are currently
supported.
If your system configuration is not listed by 'make', you'll have to modify
the top-level Makefile and Make-config files. There are instructions in
each file.
2. The new way:
Type './configure' and then 'make'. This uses GNU autoconfig.
See docs/INSTALL for more details.
The top-level makefile will execute the makefiles in a number of sub-
directories. When finished, the Mesa libraries will be in the Mesa-2.6/lib/
directories. When finished, the Mesa libraries will be in the Mesa-3.2/lib/
directory. A few GLUT demos in the demos/ directory should be ready to run.
If you also downloaded and unpacked the demos there should be executables
in the "xdemos/", "samples/", and "book/" directories for you to try out.
If you only want to compile the contents of one subdirectory you can 'cd'
to that directory and type 'make <config>' there.
If your system configuration is not listed by 'make', you'll have to modify
the top-level Makefile and Make-config files. There are instructions in
each file.
If you have compilation problems you should try to fix them and return the
patches to the author.
Notes on assembly language optimizations:
When using the old-style Makefiles, you can specify a configuration
that uses X86 assembly language optimizations (linux-3dnow for example).
The detection of MMX, 3DNow!, PIII/SSE, etc capability is done at
runtime. That means you can compile Mesa for 3DNow! optimizations
even if you don't have an AMD CPU.
However, your Linux binutils and assembler must understand the
special instructions in order to compile them. If you have
compilation problems, try upgrading your binutils.
Header and library files:
After you've compiled Mesa and tried the demos I recommend the following
procedure for "installing" Mesa.
@@ -120,7 +141,7 @@ Xt/Motif Widgets:
Togl:
Togl is an OpenGL/Mesa widget for Tcl/Tk.
See http://www.ssec.wisc.edu/~brianp/Togl.html for more information.
See http://togl.sourceforge.net for more information.
@@ -239,6 +260,7 @@ Extensions:
The following OpenGL GLX extensions are currently implemented:
GLX_EXT_visual_info - GLX visual and transparent pixel extension
GLX_EXT_visual_rating - GLX visual caveats
For detailed information about the extensions see www.opengl.org
@@ -301,4 +323,4 @@ Summary of X-related environment variables:
----------------------------------------------------------------------
$Id: README.X11,v 3.3 1999/09/15 16:39:01 brianp Exp $
$Id: README.X11,v 3.3.2.4 2000/04/04 15:13:41 brianp Exp $

146
docs/RELNOTES-3.1 Normal file
View File

@@ -0,0 +1,146 @@
Mesa 3.1 release notes
PLEASE READ!!!!
New copyright
-------------
Mesa 3.1 will be distributed under an XFree86-style copyright instead
of the GNU LGPL.
New directories
---------------
All documentation files are now in the docs/ directory.
All shell scripts are now in the bin/ directory.
New library names
-----------------
Formerly, the main Mesa library was named libMesaGL.so (or libMesaGL.a)
and the GLU library was named libMesaGLU.so (or libMesaGLU.a).
Now, the main library is named libGL.so (or libGL.a) and the GLU library
is named libGLU.so (or libGLU.a).
The change allows Mesa to be more easily substituted for OpenGL.
Specifically, the linker/loader on some Unix-like systems won't
allow libMesaGL.so to be used instead of libGL.so if the application
was linked with the former.
Warning: if you have another OpenGL implementation installed on your
system (i.e. you have another OpenGL libGL.so) you'll have to be
carefull about which library (OpenGL or Mesa) you link against. Be
aware of -L linker flags and the value of the LD_LIBRARY_PATH environment
variable.
New library versioning
----------------------
Previously, the Mesa GL library was named libMesaGL.so.3.0
To better support Linux/OpenGL standards, the Mesa GL library is now
named libGL.so.1.2.030100 This indicates version 1.2 of the OpenGL spec
and Mesa implementation 3.1.0
In the long term this will allow better interoperability with other
OpenGL implementations, especially on Linux. In the short term,
OpenGL apps may have to be relinked to use the new library naming.
New makefiles
-------------
The old Makefiles found in the various directories have been renamed
to Makefile.X11 in order to prevent filename collisions with autoconfig-
generated Makefiles.
The top-level Makefile simply includes Makefile.X11
If your top-level Makefile get's overwritten/destroyed you can restore
it by copying Makefile.X11 to Makefile
New extensions
--------------
GL_EXT_stencil_wrap
Implements two new stencil operations: GL_INCR_WRAP_EXT and
GL_DECR_WRAP_EXT which allow stencil increment and decrement
without clamping.
GL_INGR_blend_func_separate
Allows specification of blend factors for RGB and Alpha independently.
(INGR = Intergraph)
GL_ARB_multitexture
Multiple simultaneous textures. (ARB = Architecture Review Board)
GL_NV_texgen_reflection
nVidia texgen extension for better reflection mapping.
GL_PGI_misc_hints
Assorted transformation hints.
GL_EXT_compiled_vertex_array
Compiled vertex arrays.
GL_EXT_clip_volume_hint
Allows one to disable clip volume (frustum) testing.
Extensions removed
------------------
GL_EXT_multitexture - obsolete in favor of GL_ARB_multitexture
Config file
-----------
By default, /etc/mesa.conf will be read when Mesa starts. This
file controls default hints, enable/disable of extensions, and
more. See the CONFIG file for documentation.
Optimizations
-------------
Keith Whitwell has contributed significant optimizations to Mesa's
vertex transformation code. Basically, the whole transformation
stage of Mesa has been rewritten.
It's impossible to give a speedup factor. You'll just have to
try your app and see how it performs.
Device Driver changes
---------------------
A bunch of new device driver functions have been added. See src/dd.h
Keith Harrison contributed many of them. I've been planning on adding
a bunch of functions like these to make writing hardware drivers easier.
More such function will probably be added in the near future.
Miscellaneous
-------------
util/glstate.c has some handy functions for debugging. Basically, it
offers a simple function for printing GL state variables. It's not
finished yet. There's a LOT more GLenum records to be added (see the
code). Anyone want to help?
----------------------------------------------------------------------
$Id: RELNOTES-3.1,v 1.1.2.1 2000/02/22 17:56:56 brianp Exp $

12
docs/RELNOTES-3.2 Normal file
View File

@@ -0,0 +1,12 @@
Mesa 3.2 release notes
PLEASE READ!!!!
Mesa 3.2 is a stabilization of the Mesa 3.1 release. No new features
have been added. For a list of bug fixes please read the VERSIONS file.
----------------------------------------------------------------------
$Id: RELNOTES-3.2,v 1.1.2.1 2000/04/06 02:34:31 brianp Exp $

View File

@@ -1,4 +1,4 @@
$Id: VERSIONS,v 1.13 1999/09/19 20:09:00 tanner Exp $
$Id: VERSIONS,v 1.13.2.34 2000/04/24 14:47:45 brianp Exp $
Mesa Version History
@@ -659,3 +659,66 @@ Mesa Version History
- New library numbering: libGL.so.1.2.310
- New subdirectories: docs/ and bin/
- New Makefile-system (autoconf,automake,libtool)
3.1 final December 14, 1999
New:
- added demos/gloss.c
- added xdemos/glxdpyinfo.c
- added GLX_ARB_get_proc_address extension
Bug fixes:
- several vertex array bug fixes
- overlapping glCopyPixels with pixel zooming now works
- glXUseXFont() bitmaps were vertically shifted by one pixel
3.2 beta 1 March 23, 2000
Bug fixes:
- mixed drawing of lines and bitmaps sometimes had wrong colors
- added missing glHintPGI() function
- fixed a polygon culling bug
- fixed bugs in gluPartialDisk()
- Z values in selection mode were wrong
- added missing tokens:
GL_SMOOTH_POINT_SIZE_RANGE
GL_SMOOTH_POINT_SIZE_GRANULARITY
GL_SMOOTH_LINE_WIDTH_RANGE
GL_SMOOTH_LINE_WIDTH_GRANULARITY
GL_ALIASED_POINT_SIZE_RANGE
GL_ALIASED_LINE_WIDTH_RANGE
- fixed glCopyPixels when copying from back to front buffer
- GL_EXT_compiled_vertex_array tokens had _SGI suffix instead of _EXT
- glDrawRangeElements(GL_LINES, 0, 1, 2, type, indices) was broken
- glDeleteTextures() didn't decrement reference count correctly
- GL_SRCA_ALPHA_SATURATE blend mode didn't work correctly
- Actual depth of transformation matrix stacks was off by one
- 24bpp visuals didn't address pixels correctly
- mipmap level of detail (lambda) calculation simplified, more accurate
- 101691 - Polygon clipping and GL_LINE
- 101928 - Polygon clipping and GL_LINE (same fix as above)
- 101808 - Non-glVertexArrays tristrip bug
- 101971 - find_last_3f on Dec OSF (worked around)
- 102369 - segv on dec osf (possibly a duplicate of the above)
- 102893 - orientations of modelview cause segfault
New:
- updated SVGA Linux driver
- added the MESA_FX_NO_SIGNALS env var, see docs/README.3DFX
- build libGLw.a (Xt/OpenGL drawing area widget) library by default
- changed -O2 to -O3 for a number of gcc configs
Changes:
- glXCopyContext's mask parameter is now unsigned long, per GLX spec
3.2 final April 24, 2000
Bug fixes:
- fixed memcpy bugs in span.c
- fixed missing glEnd problem in demos/tessdemo.c
- fixed bug when clearing 24bpp Ximages
- fixed clipping problem found in Unreal Tournament
- fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2
- fixed Loki's 3dfx RGB vs BGR bug
- fixed Loki's 3dfx smooth/flat shading bug in SoF
Changes:
- updated docs/README file
- use bcopy() optimizations on FreeBSD
- re-enabled the optimized persp_textured_triangle() function

View File

@@ -1,10 +1,10 @@
/* $Id: amesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: amesa.h,v 1.1.1.1.2.1 2000/02/09 18:53:54 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.2
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,25 +25,17 @@
*/
/*
* $Log: amesa.h,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 1.1 1999/03/16 01:24:13 brianp
* initial check-in
*
*/
/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */
#ifndef AMESA_H
#define AMESA_H
#define AMESA_MAJOR_VERSION 3
#define AMESA_MINOR_VERSION 2
typedef struct amesa_visual *AMesaVisual;
typedef struct amesa_buffer *AMesaBuffer;
typedef struct amesa_context *AMesaContext;

View File

@@ -1,40 +1,27 @@
/* $Id: fxmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: fxmesa.h,v 1.1.1.1.2.2 2000/02/09 18:53:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Copyright (C) 1995-1999 Brian Paul
* Version: 3.2
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* $Log: fxmesa.h,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.2 1999/01/03 02:46:31 brianp
* now using GLAPI and GLAPIENTRY keywords (Ted Jump)
*
* Revision 3.1 1998/04/01 03:00:28 brianp
* updated for v0.24 of 3Dfx/Glide driver
*
* Revision 3.0 1998/02/20 05:04:45 brianp
* initial rev
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
@@ -58,7 +45,7 @@ extern "C" {
#define FXMESA_MAJOR_VERSION 3
#define FXMESA_MINOR_VERSION 0
#define FXMESA_MINOR_VERSION 2
/*

View File

@@ -1,8 +1,8 @@
/* $Id: ggimesa.h,v 1.2 1999/08/23 22:34:08 jtaylor Exp $ */
/* $Id: ggimesa.h,v 1.2.2.1 2000/02/09 18:53:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.2
* Copyright (C) 1995-1998 Brian Paul
* Copyright (C) 1998 Uwe Maurer
*
@@ -22,23 +22,14 @@
*/
/*
* $Log: ggimesa.h,v $
* Revision 1.2 1999/08/23 22:34:08 jtaylor
* Misc small cleanups
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 1.2 1998/09/29 01:46:40 brianp
* applied Emmanuel Marty's patches for latest GGI
*
*/
#ifndef GGIMESA_H
#define GGIMESA_H
#define GGIMESA_MAJOR_VERSION 3
#define GGIMESA_MINOR_VERSION 2
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -1,10 +1,10 @@
/* $Id: gl.h,v 1.8 1999/09/19 02:03:18 tjump Exp $ */
/* $Id: gl.h,v 1.17.2.6 2000/03/20 17:54:44 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.2
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,8 +25,6 @@
*/
#ifndef GL_H
#define GL_H
@@ -50,11 +48,17 @@
#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
# pragma warning( disable : 4068 ) /* unknown pragma */
# pragma warning( disable : 4710 ) /* function 'foo' not inlined */
# pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
# pragma warning( disable : 4127 ) /* conditional expression is constant */
# if defined(MESA_MINWARN)
# pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
# pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
# pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
# pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
# endif
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# define WGLAPI __declspec(dllexport)
@@ -66,26 +70,31 @@
# define WGLAPI __declspec(dllimport)
# endif /* _STATIC_MESA support */
# define GLAPIENTRY __stdcall
# define GLAPIENTRYP __stdcall *
# define GLCALLBACK __stdcall
# define GLCALLBACKP __stdcall *
#if defined(__CYGWIN32__)
# define GLCALLBACKPCAST *
#else
# define GLCALLBACKPCAST __stdcall *
#endif
# define GLWINAPI __stdcall
# define GLWINAPIV __cdecl
#else
/* non-Windows compilation */
# define GLAPI extern
# define GLAPIENTRY
# define GLAPIENTRYP *
# define GLCALLBACK
# define GLCALLBACKP *
# define GLCALLBACKPCAST *
# define GLWINAPI
# define GLWINAPIV
#endif /* WIN32 / CYGWIN32 bracket */
/* compatability guard so we don't need to change client code */
#if defined(_WIN32) && !defined(_WINDEF_) && !defined(OPENSTEP)
# if !defined(MESA_MINWARN)
# pragma message( "note: WINDOWS.H not included, providing Mesa definition of CALLBACK macro" )
# pragma message( "----: and PROC typedef. If you receive compiler warnings about either ")
# pragma message( "----: being multiply defined you should include WINDOWS.H priot to gl/gl.h" )
# endif
#if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
# define CALLBACK GLCALLBACK
typedef int (GLAPIENTRY *PROC)();
typedef void *HGLRC;
@@ -93,14 +102,10 @@ typedef void *HDC;
typedef unsigned long COLORREF;
#endif
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(OPENSTEP)
# if !defined(MESA_MINWARN)
# pragma message( "note: WINDOWS.H not included, providing Mesa definition of wgl functions" )
# pragma message( "----: and macros. If you receive compiler warnings about any being multiply ")
# pragma message( "----: defined you should include WINDOWS.H priot to gl/gl.h" )
# endif
#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
# define WGL_FONT_LINES 0
# define WGL_FONT_POLYGONS 1
#ifndef _GNU_H_WINDOWS32_FUNCTIONS
# ifdef UNICODE
# define wglUseFontBitmaps wglUseFontBitmapsW
# define wglUseFontOutlines wglUseFontOutlinesW
@@ -108,13 +113,13 @@ typedef unsigned long COLORREF;
# define wglUseFontBitmaps wglUseFontBitmapsA
# define wglUseFontOutlines wglUseFontOutlinesA
# endif /* !UNICODE */
#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
#include <gl/mesa_wgl.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -135,7 +140,7 @@ extern "C" {
#define MESA
#define MESA_MAJOR_VERSION 3
#define MESA_MINOR_VERSION 1
#define MESA_MINOR_VERSION 2
#define GL_VERSION_1_1 1
@@ -860,8 +865,8 @@ typedef enum {
/* OpenGL 1.2 */
GL_RESCALE_NORMAL = 0x803A,
GL_CLAMP_TO_EDGE = 0x812F,
GL_MAX_ELEMENTS_VERTICES = 0xF0E8,
GL_MAX_ELEMENTS_INDICES = 0xF0E9,
GL_MAX_ELEMENTS_VERTICES = 0x80E8,
GL_MAX_ELEMENTS_INDICES = 0x80E9,
GL_BGR = 0x80E0,
GL_BGRA = 0x80E1,
GL_UNSIGNED_BYTE_3_3_2 = 0x8032,
@@ -883,6 +888,12 @@ typedef enum {
GL_TEXTURE_MAX_LOD = 0x813B,
GL_TEXTURE_BASE_LEVEL = 0x813C,
GL_TEXTURE_MAX_LEVEL = 0x813D,
GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12,
GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13,
GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22,
GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23,
GL_ALIASED_POINT_SIZE_RANGE = 0x846D,
GL_ALIASED_LINE_WIDTH_RANGE = 0x846E,
/* GL_ARB_multitexture */
GL_TEXTURE0_ARB = 0x84C0,
@@ -941,7 +952,6 @@ typedef enum {
GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD,
GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE,
GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF,
/* GL_EXT_convolution and GL_HP_convolution_border_modes */
GL_CONVOLUTION_1D = 0x8010,
GL_CONVOLUTION_2D = 0x8011,
@@ -966,7 +976,6 @@ typedef enum {
GL_CONSTANT_BORDER = 0x8151,
GL_REPLICATE_BORDER = 0x8153,
GL_CONVOLUTION_BORDER_COLOR = 0x8154,
/* GL_SGI_color_matrix */
GL_COLOR_MATRIX = 0x80B1,
GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2,
@@ -979,7 +988,6 @@ typedef enum {
GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9,
GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA,
GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB,
/* GL_EXT_histogram */
GL_HISTOGRAM = 0x8024,
GL_PROXY_HISTOGRAM = 0x8025,
@@ -995,6 +1003,14 @@ typedef enum {
GL_MINMAX_FORMAT = 0x802F,
GL_MINMAX_SINK = 0x8030,
GL_TABLE_TOO_LARGE = 0x8031,
/* GL_EXT_blend_color, GL_EXT_blend_minmax */
GL_BLEND_EQUATION = 0x8009,
GL_MIN = 0x8007,
GL_MAX = 0x8008,
GL_FUNC_ADD = 0x8006,
GL_FUNC_SUBTRACT = 0x800A,
GL_FUNC_REVERSE_SUBTRACT = 0x800B,
GL_BLEND_COLOR = 0x8005,
/* GL_NV_texgen_reflection (nVidia) */
GL_NORMAL_MAP_NV = 0x8511,
@@ -1024,8 +1040,8 @@ typedef enum {
GL_NATIVE_GRAPHICS_HANDLE_PGI = 107010,
/* GL_EXT_compiled_vertex_array */
GL_ARRAY_ELEMENT_LOCK_FIRST_SGI = 0x81A8,
GL_ARRAY_ELEMENT_LOCK_COUNT_SGI = 0x81A9,
GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8,
GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9,
/* GL_EXT_clip_volume_hint */
GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0
@@ -2082,6 +2098,36 @@ GLAPI void GLAPIENTRY glCopyTexSubImage3D( GLenum target, GLint level,
/* 1.2 imaging extension functions */
GLAPI void GLAPIENTRY glColorTable( GLenum target, GLenum internalformat,
GLsizei width, GLenum format,
GLenum type, const GLvoid *table );
GLAPI void GLAPIENTRY glColorSubTable( GLenum target,
GLsizei start, GLsizei count,
GLenum format, GLenum type,
const GLvoid *data );
GLAPI void GLAPIENTRY glColorTableParameteriv(GLenum target, GLenum pname,
const GLint *params);
GLAPI void GLAPIENTRY glColorTableParameterfv(GLenum target, GLenum pname,
const GLfloat *params);
GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width );
GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width );
GLAPI void GLAPIENTRY glGetColorTable( GLenum target, GLenum format,
GLenum type, GLvoid *table );
GLAPI void GLAPIENTRY glGetColorTableParameterfv( GLenum target, GLenum pname,
GLfloat *params );
GLAPI void GLAPIENTRY glGetColorTableParameteriv( GLenum target, GLenum pname,
GLint *params );
GLAPI void GLAPIENTRY glBlendEquation( GLenum mode );
GLAPI void GLAPIENTRY glBlendColor( GLclampf red, GLclampf green,
@@ -2107,7 +2153,7 @@ GLAPI void GLAPIENTRY glMinmax( GLenum target, GLenum internalformat,
GLAPI void GLAPIENTRY glResetMinmax( GLenum target );
GLAPI void GLAPIENTRY glGetMinMax( GLenum target, GLboolean reset,
GLAPI void GLAPIENTRY glGetMinmax( GLenum target, GLboolean reset,
GLenum format, GLenum types,
GLvoid *values );
@@ -2160,12 +2206,6 @@ GLAPI void GLAPIENTRY glSeparableFilter2D( GLenum target,
GLAPI void GLAPIENTRY glGetSeparableFilter( GLenum target, GLenum format,
GLenum type, GLvoid *row, GLvoid *column, GLvoid *span );
GLAPI void GLAPIENTRY glCopyColorSubTable( GLenum target, GLsizei start,
GLint x, GLint y, GLsizei width );
GLAPI void GLAPIENTRY glCopyColorTable( GLenum target, GLenum internalformat,
GLint x, GLint y, GLsizei width );
/* GL_EXT_compiled_vertex_array */
@@ -2173,18 +2213,10 @@ GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count );
GLAPI void GLAPIENTRY glUnlockArraysEXT( void );
/*
* GL_EXT_get_proc_address
*
* XXX this is a preliminary extension. It may change! Use at your
* own risk! Do not release code which uses this extension yet!
* If you want to try it out, #define GL_EXT_get_proc_address before
* #include <GL/gl.h>
*/
#define GL_EXT_get_proc_address 1
#ifdef GL_EXT_get_proc_address
GLAPI void (GLAPIENTRY *glGetProcAddressEXT(const GLubyte *procName))();
#endif
/* GL_PGI_misc_hints */
GLAPI void GLAPIENTRY glHintPGI(GLenum target, GLint mode);
#if defined(__BEOS__) || defined(__QUICKDRAW__)
#pragma export off

View File

@@ -1,8 +1,8 @@
/* $Id: gl_mangle.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: gl_mangle.h,v 1.3.2.1 2000/01/04 08:08:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.2
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
@@ -344,6 +344,7 @@
#define glGetMapdv mglGetMapdv
#define glGetMapfv mglGetMapfv
#define glGetMapiv mglGetMapiv
#define glGetMinmax mglGetMinmax
#define glEvalCoord1d mglEvalCoord1d
#define glEvalCoord1f mglEvalCoord1f
#define glEvalCoord1dv mglEvalCoord1dv
@@ -394,12 +395,18 @@
#define glTexImage3DEXT mglTexImage3DEXT
#define glTexSubImage3DEXT mglTexSubImage3DEXT
#define glCopyTexSubImage3DEXT mglCopyTexSubImage3DEXT
#define glColorTable mglColorTable
#define glColorTableParameteriv mglColorTableParameteriv
#define glColorTableParameterfv mglColorTableParameterfv
#define glColorSubTable mglColorSubTable
#define glGetColorTable mglGetColorTable
#define glGetColorTableParameteriv mglGetColorTableParameteriv
#define glGetColorTableParameterfv mglGetColorTableParameterfv
#define glColorTableEXT mglColorTableEXT
#define glColorSubTableEXT mglColorSubTableEXT
#define glGetColorTableEXT mglGetColorTableEXT
#define glGetColorTableParameterfvEXT mglGetColorTableParameterfvEXT
#define glGetColorTableParameterivEXT mglGetColorTableParameterivEXT
#define glGetMinMax mglGetMinMax
#define glMultiTexCoord1dSGIS mglMultiTexCoord1dSGIS
#define glMultiTexCoord1dvSGIS mglMultiTexCoord1dvSGIS
#define glMultiTexCoord1fSGIS mglMultiTexCoord1fSGIS
@@ -508,6 +515,7 @@
#define glGetHistogramParameteriv mglGetHistogramParameteriv
#define glMinmax mglMinmax
#define glResetMinmax mglResetMinmax
#define glGetMinmax mglGetMinmax
#define glGetMinmaxParameterfv mglGetMinmaxParameterfv
#define glGetMinmaxParameteriv mglGetMinmaxParameteriv
#define glConvolutionFilter1D mglConvolutionFilter1D

View File

@@ -1,9 +1,9 @@
/* $Id: glu.h,v 1.10 1999/09/19 10:04:01 tjump Exp $ */
/* $Id: glu.h,v 1.14.2.1 2000/03/31 20:07:56 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Copyright (C) 1995-1999 Brian Paul
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,61 +21,6 @@
*/
/*
* $Log: glu.h,v $
* Revision 1.10 1999/09/19 10:04:01 tjump
* Changed name 'glGetProcAddressEXT' to 'gluGetProcAddressEXT'
*
* Revision 1.8 1999/09/17 12:21:36 brianp
* glGetProcAddressEXT changes to accomodate Win32 and non-Win32
*
* Revision 1.7 1999/09/17 02:44:19 tjump
* I changed the xxxGetProcAddressEXT function declarations to be more
* MSVC friendly. Brianp - could you verify that they describe and operate
* as intended on Linux/ETC platforms?
*
* Revision 1.6 1999/09/16 16:54:22 brianp
* GLU_EXT_get_proc_address clean-up
*
* Revision 1.5 1999/09/14 03:23:08 gareth
* Fixed GLUtriangulatorObj again (spelling).
*
* Revision 1.4 1999/09/14 01:32:58 gareth
* Fixed definition of GLUtriangluatorObj for 1.3 tessellator.
*
* Revision 1.3 1999/09/11 11:34:21 brianp
* added GLU_EXT_get_proc_address
*
* Revision 1.2 1999/09/10 02:08:18 gareth
* Added GLU 1.3 tessellation (except winding rule code).
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.6 1999/02/14 03:39:45 brianp
* updated for BeOS R4
*
* Revision 3.5 1999/01/03 03:02:55 brianp
* now using GLAPI and GLAPIENTRY keywords, misc Windows changes (Ted Jump)
*
* Revision 3.4 1998/12/01 02:34:27 brianp
* applied Mark Kilgard's patches from November 30, 1998
*
* Revision 3.3 1998/11/17 01:14:02 brianp
* minor changes for OpenStep compilation (pete@ohm.york.ac.uk)
*
* Revision 3.2 1998/07/26 01:36:27 brianp
* changes for Windows compilation per Ted Jump
*
* Revision 3.1 1998/06/23 00:33:08 brianp
* added some WIN32 APIENTRY, CALLBACK stuff (Eric Lassauge)
*
* Revision 3.0 1998/02/20 05:06:01 brianp
* initial rev
*
*/
#ifndef GLU_H
#define GLU_H
@@ -112,6 +57,18 @@ extern "C" {
#endif
#endif
#ifndef GLUAPI
#define GLUAPI
#endif
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#ifndef GLCALLBACK
#define GLCALLBACK
#endif
#define GLU_VERSION_1_1 1
#define GLU_VERSION_1_2 1
@@ -333,17 +290,17 @@ GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode );
*/
GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format,
GLint widthin, GLint heightin,
GLsizei widthin, GLsizei heightin,
GLenum typein, const void *datain,
GLint widthout, GLint heightout,
GLsizei widthout, GLsizei heightout,
GLenum typeout, void *dataout );
GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
GLint width, GLenum format,
GLsizei width, GLenum format,
GLenum type, const void *data );
GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
GLint width, GLint height,
GLsizei width, GLsizei height,
GLenum format,
GLenum type, const void *data );
@@ -507,16 +464,14 @@ GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name );
/*
* GLU_EXT_get_proc_address extension
*
* GLU 1.3 functions
*
*/
/*
* WARNING: this extension is not finalized yet! Do not release code
* which uses this extension yet! It may change!
*/
#define GLU_EXT_get_proc_address 1
#ifdef GLU_EXT_get_proc_address
GLUAPI void (GLAPIENTRY *gluGetProcAddressEXT(const GLubyte *procName))();
#endif
GLUAPI GLboolean GLAPIENTRY
gluCheckExtension( const char *extName, const GLubyte *extString );
#if defined(__BEOS__) || defined(__QUICKDRAW__)

View File

@@ -108,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int);
and redifinition of Windows system defs, also removes requirement of
pretty much any standard windows header from this file */
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
# define GLUTAPIENTRY __stdcall
#else
# define GLUTAPIENTRY
@@ -153,25 +153,41 @@ typedef unsigned long COLORREF;
# endif /* !UNICODE */
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
GLUTAPI int GLUTAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
GLUTAPI HGLRC GLUTAPIENTRY wglCreateContext(HDC);
GLUTAPI HGLRC GLUTAPIENTRY wglCreateLayerContext(HDC, int);
GLUTAPI int GLUTAPIENTRY wglDeleteContext(HGLRC);
GLUTAPI HGLRC GLUTAPIENTRY wglGetCurrentContext(void);
GLUTAPI HDC GLUTAPIENTRY wglGetCurrentDC(void);
GLUTAPI PROC GLUTAPIENTRY wglGetProcAddress(char*);
GLUTAPI int GLUTAPIENTRY wglMakeCurrent(HDC, HGLRC);
GLUTAPI int GLUTAPIENTRY wglShareLists(HGLRC, HGLRC);
GLUTAPI int GLUTAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
GLUTAPI int GLUTAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
GLUTAPI int GLUTAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
GLUTAPI int GLUTAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
GLUTAPI int GLUTAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
GLUTAPI int GLUTAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
GLUTAPI int GLUTAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
GLUTAPI int GLUTAPIENTRY wglRealizeLayerPalette(HDC, int, int);
GLUTAPI int GLUTAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
GLUTAPI int GLUTAPIENTRY SwapBuffers(HDC);
# pragma warning( push )
# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
# define WGLAPI __declspec(dllimport)
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
# undef WGLAPI
# pragma warning( pop )
#endif
#else /* _WIN32 not defined */
@@ -723,7 +739,6 @@ GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
#ifdef __cplusplus
}
#endif
#if 0

View File

@@ -1,10 +1,10 @@
/* $Id: glx.h,v 1.3 1999/09/16 15:52:51 brianp Exp $ */
/* $Id: glx.h,v 1.5.2.3 2000/02/23 23:05:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.2
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,50 +25,11 @@
*/
/*
* $Log: glx.h,v $
* Revision 1.3 1999/09/16 15:52:51 brianp
* added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress
*
* Revision 1.2 1999/09/11 11:33:45 brianp
* added GLX_EXT_get_proc_address
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.3 1999/02/14 03:39:09 brianp
* new copyright
*
* Revision 3.2 1998/06/18 03:44:00 brianp
* replaced "uint" with "unsigned int"
*
* Revision 3.1 1998/06/01 00:00:17 brianp
* added GLX_SGI_video_sync extension
*
* Revision 3.0 1998/02/20 05:06:01 brianp
* initial rev
*
*/
#ifndef GLX_H
#define GLX_H
/*
* A pseudo-GLX implementation to allow GLX-based OpenGL programs to
* work with Mesa.
*
* Notes:
* 1. If the visual passed to glXGetConfig was not one returned by
* glXChooseVisual then the GLX_RGBA and GLX_DOUBLEBUFFER queries
* will always return True and the GLX_DEPTH_SIZE query will always
* return non-zero.
* 2. The glXIsDirect() function always returns True.
*/
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "GL/gl.h"
@@ -161,12 +122,12 @@ enum _GLX_CONFIGS {
* Compile-time extension tests
*/
#define GLX_EXT_visual_info 1
#define GLX_EXT_get_proc_address 1
#define GLX_MESA_pixmap_colormap 1
#define GLX_MESA_release_buffers 1
#define GLX_MESA_copy_sub_buffer 1
#define GLX_MESA_set_3dfx_mode 1
#define GLX_SGI_video_sync 1
#define GLX_ARB_get_proc_address 1
@@ -195,7 +156,7 @@ extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
GLXContext ctx);
extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
GLuint mask );
unsigned long mask );
extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
@@ -234,13 +195,6 @@ extern const char *glXGetClientString( Display *dpy, int name );
/* GLX_EXT_get_proc_address */
/* WARNING: this extension is not finalized yet! Do not release code
* which uses this extension yet! It may change!
*/
extern void (*glXGetProcAddressEXT(const GLubyte *procName))();
/* GLX_MESA_pixmap_colormap */
extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
Pixmap pixmap, Colormap cmap );
@@ -265,6 +219,10 @@ extern int glXWaitVideoSyncSGI(int divisor, int remainder,
unsigned int *count);
/* GLX_ARB_get_proc_address */
extern void (*glXGetProcAddressARB(const GLubyte *procName))();
#ifdef __cplusplus
}

View File

@@ -1,8 +1,48 @@
/* $Id: mesa_wgl.h,v 1.2.2.2 1999/11/22 14:05:15 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* prototypes for the Mesa WGL functions */
/* relocated here so that I could make GLUT get them properly */
#ifndef GL_H
#ifndef _mesa_wgl_h_
#define _mesa_wgl_h_
#include <gl/gl.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _MSC_VER
# pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/
# pragma warning( push )
# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
#endif
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
@@ -14,7 +54,6 @@ WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
@@ -31,3 +70,19 @@ WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, un
WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
WGLAPI int GLAPIENTRY SwapBuffers(HDC);
WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
#ifdef _MSC_VER
# pragma warning( pop )
#endif
#ifdef __cplusplus
}
#endif
#endif /* _mesa_wgl_h_ */

View File

@@ -1,10 +1,10 @@
/* $Id: osmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: osmesa.h,v 1.1.1.1.2.2 2000/02/09 18:53:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.2
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,26 +25,6 @@
*/
/*
* $Log: osmesa.h,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 1.4 1999/02/14 03:39:09 brianp
* new copyright
*
* Revision 1.3 1999/01/03 02:52:30 brianp
* now using GLAPI and GLAPIENTRY keywords (Ted Jump)
*
* Revision 1.2 1998/07/26 01:33:51 brianp
* added WINGDIAPI and APIENTRY keywords per Ted Jump
*
* Revision 1.1 1998/02/13 03:17:50 brianp
* Initial revision
*
*/
/*
* Mesa Off-Screen rendering interface.
*
@@ -86,7 +66,7 @@ extern "C" {
#define OSMESA_MAJOR_VERSION 3
#define OSMESA_MINOR_VERSION 0
#define OSMESA_MINOR_VERSION 2

View File

@@ -1,9 +1,9 @@
/* $Id: svgamesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: svgamesa.h,v 1.1.1.1.2.2 2000/01/22 19:58:02 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.0
* Copyright (C) 1995-1998 Brian Paul
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,18 +21,6 @@
*/
/*
* $Log: svgamesa.h,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.0 1998/02/20 05:07:24 brianp
* initial rev
*
*/
/*
* SVGA/Mesa interface for Linux.
*/
@@ -65,7 +53,7 @@
#define SVGAMESA_MAJOR_VERSION 3
#define SVGAMESA_MINOR_VERSION 0
#define SVGAMESA_MINOR_VERSION 2
#ifdef __cplusplus
@@ -87,16 +75,21 @@ typedef struct svgamesa_context *SVGAMesaContext;
/*
* doubleBuffer flag new in version 2.4
*/
extern int SVGAMesaInit( int GraphMode );
extern int SVGAMesaClose( void );
extern SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer );
extern void SVGAMesaDestroyContext( SVGAMesaContext ctx );
extern void SVGAMesaMakeCurrent( SVGAMesaContext ctx );
extern SVGAMesaContext SVGAMesaGetCurrentContext( void );
extern void SVGAMesaSwapBuffers( void );
extern void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue);
extern SVGAMesaContext SVGAMesaGetCurrentContext( void );
#ifdef __cplusplus
}

View File

@@ -1,10 +1,10 @@
/* $Id: xmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: xmesa.h,v 1.1.1.1.2.3 2000/02/09 18:53:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.2
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,23 +25,6 @@
*/
/*
* $Log: xmesa.h,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 1.3 1999/02/24 22:43:27 jens
* Name changes to get XMesa to compile standalone inside XFree86
*
* Revision 1.2 1999/02/14 03:39:09 brianp
* new copyright
*
* Revision 1.1 1998/02/13 03:17:32 brianp
* Initial revision
*
*/
/*
* Mesa/X11 interface. This header file serves as the documentation for
* the Mesa/X11 interface functions.
@@ -96,6 +79,9 @@ extern "C" {
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "xmesa_x.h"
#ifdef GLX_DIRECT_RENDERING
#include "dri_mesa.h"
#endif
#endif
#include "GL/gl.h"
@@ -106,7 +92,7 @@ extern struct Library *XLibBase;
#define XMESA_MAJOR_VERSION 3
#define XMESA_MINOR_VERSION 0
#define XMESA_MINOR_VERSION 2
@@ -131,7 +117,17 @@ typedef struct xmesa_visual *XMesaVisual;
typedef struct xmesa_buffer *XMesaBuffer;
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
/*
* Initialize the XMesa driver.
*/
extern GLboolean XMesaInitDriver( __DRIscreenPrivate *driScrnPriv );
/*
* Reset the XMesa driver when the X server resets.
*/
extern void XMesaResetDriver( __DRIscreenPrivate *driScrnPriv );
#endif
/*
@@ -179,7 +175,11 @@ extern void XMesaDestroyVisual( XMesaVisual v );
* Return: an XMesaContext or NULL if error.
*/
extern XMesaContext XMesaCreateContext( XMesaVisual v,
XMesaContext share_list );
XMesaContext share_list
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
, __DRIcontextPrivate *driContextPriv
#endif
);
/*
@@ -192,7 +192,12 @@ extern void XMesaDestroyContext( XMesaContext c );
* Create an XMesaBuffer from an X window.
*/
extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v,
XMesaWindow w );
XMesaWindow w
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
, __DRIdrawablePrivate *driDrawPriv
#endif
);
/*
@@ -200,7 +205,12 @@ extern XMesaBuffer XMesaCreateWindowBuffer( XMesaVisual v,
*/
extern XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v,
XMesaPixmap p,
XMesaColormap cmap );
XMesaColormap cmap
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
, __DRIdrawablePrivate *driDrawPriv
#endif
);
/*

View File

@@ -30,7 +30,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Authors:
* Kevin E. Martin <kevin@precisioninsight.com>
*
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.1 1999/08/19 00:55:40 jtg Exp $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_xf86.h,v 1.1.1.1.2.1 1999/12/13 21:54:19 brianp Exp $
*/
#ifndef _XMESA_XF86_H_
@@ -52,29 +52,29 @@ typedef DDXPointRec XMesaPoint;
typedef xColorItem XMesaColor;
#define XMesaSetGeneric(__d,__gc,__val,__mask) \
{ \
do { \
CARD32 __v[1]; \
(void) __d; \
__v[0] = __val; \
dixChangeGC(NullClient, __gc, __mask, __v, NULL); \
}
} while (0)
#define XMesaSetGenericPtr(__d,__gc,__pval,__mask) \
{ \
do { \
ChangeGCVal __v[1]; \
(void) __d; \
__v[0].ptr = __pval; \
dixChangeGC(NullClient, __gc, __mask, NULL, __v); \
}
} while (0)
#define XMesaSetDashes(__d,__gc,__do,__dl,__n) \
{ \
do { \
(void) __d; \
SetDashes(__gc, __do, __n, (unsigned char *)__dl); \
}
} while (0)
#define XMesaSetLineAttributes(__d,__gc,__lw,__ls,__cs,__js) \
{ \
do { \
CARD32 __v[4]; \
(void) __d; \
__v[0] = __lw; \
@@ -84,7 +84,7 @@ typedef xColorItem XMesaColor;
dixChangeGC(NullClient, __gc, \
GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle, \
__v, NULL); \
}
} while (0)
#define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground)
#define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground)
@@ -96,24 +96,24 @@ typedef xColorItem XMesaColor;
#define XMesaSetStipple(d,gc,v) XMesaSetGenericPtr(d,gc,v,GCStipple)
#define XMesaDrawPoint(__d,__b,__gc,__x,__y) \
{ \
do { \
XMesaPoint __p[1]; \
(void) __d; \
__p[0].x = __x; \
__p[0].y = __y; \
ValidateGC(__b, __gc); \
(*gc->ops->PolyPoint)(__b, __gc, CoordModeOrigin, 1, __p); \
}
} while (0)
#define XMesaDrawPoints(__d,__b,__gc,__p,__n,__m) \
{ \
do { \
(void) __d; \
ValidateGC(__b, __gc); \
(*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \
}
} while (0)
#define XMesaDrawLine(__d,__b,__gc,__x0,__y0,__x1,__y1) \
{ \
do { \
XMesaPoint __p[2]; \
(void) __d; \
ValidateGC(__b, __gc); \
@@ -122,10 +122,10 @@ typedef xColorItem XMesaColor;
__p[1].x = __x1; \
__p[1].y = __y1; \
(*__gc->ops->Polylines)(__b, __gc, CoordModeOrigin, 2, __p); \
}
} while (0)
#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \
{ \
do { \
xRectangle __r[1]; \
(void) __d; \
ValidateGC(__b, __gc); \
@@ -134,10 +134,10 @@ typedef xColorItem XMesaColor;
__r[0].width = __w; \
__r[0].height = __h; \
(*__gc->ops->PolyFillRect)(__b, __gc, 1, __r); \
}
} while (0)
#define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \
{ \
do { \
/* Assumes: Images are always in ZPixmap format */ \
(void) __d; \
if (__sx || __sy) /* The non-trivial case */ \
@@ -146,22 +146,22 @@ typedef xColorItem XMesaColor;
(*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \
__x, __y, __w, __h, 0, ZPixmap, \
((XMesaImage *)(__i))->data); \
}
} while (0)
#define XMesaCopyArea(__d,__sb,__db,__gc,__sx,__sy,__w,__h,__x,__y) \
{ \
do { \
(void) __d; \
ValidateGC(__db, __gc); \
(*__gc->ops->CopyArea)((DrawablePtr)__sb, __db, __gc, \
__sx, __sy, __w, __h, __x, __y); \
}
} while (0)
#define XMesaFillPolygon(__d,__b,__gc,__p,__n,__s,__m) \
{ \
do { \
(void) __d; \
ValidateGC(__b, __gc); \
(*__gc->ops->FillPolygon)(__b, __gc, __s, __m, __n, __p); \
}
} while (0)
/* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */
#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \
@@ -170,10 +170,10 @@ typedef xColorItem XMesaColor;
(*__d->DestroyPixmap)(__b)
#define XMesaFreeGC(__d,__gc) \
{ \
do { \
(void) __d; \
FreeScratchGC(__gc); \
}
} while (0)
#define GET_COLORMAP_SIZE(__v) __v->visinfo->ColormapEntries
#define GET_REDMASK(__v) __v->visinfo->redMask

View File

@@ -1,52 +1,13 @@
# $Id: Makefile.BeOS-R4,v 1.2 1999/09/17 00:07:26 brianp Exp $
# $Id: Makefile.BeOS-R4,v 1.3 1999/10/22 20:36:38 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
# Copyright (C) 1995-1999 Brian Paul
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Makefile for GLUT-based demo programs for BeOS R4
# $Log: Makefile.BeOS-R4,v $
# Revision 1.2 1999/09/17 00:07:26 brianp
# link with -lGLU -lGL instead of -lMesaGLU -lMesaGL
#
# Revision 1.1.1.1 1999/08/19 00:55:40 jtg
# Imported sources
#
# Revision 1.5 1999/06/22 12:50:11 brianp
# removed multitex demo
#
# Revision 1.4 1999/02/03 03:57:26 brianp
# replace multiext with multiarb
#
# Revision 1.3 1999/02/02 04:47:45 brianp
# removed glutfx from targets
#
# Revision 1.2 1999/02/02 04:46:23 brianp
# removed tessdemo from targets
#
# Revision 1.1 1999/02/02 04:43:27 brianp
# Initial revision
#
##### MACROS #####
INCDIR = ../include
@@ -56,7 +17,7 @@ GL_LIBS = -L$(LIBDIR) -L/boot/home/config/lib -Xlinker -rpath $(LIBDIR) -lbe -lg
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
PROGS = bounce clearspd drawpix gamma gears glinfo isosurf \
PROGS = bounce clearspd drawpix gamma gears glinfo gloss isosurf \
morph3d multiarb osdemo paltex pointblast reflect \
renormal spectex stex3d texcyl texobj trispd winpos

View File

@@ -1,8 +1,8 @@
# $Id: Makefile.X11,v 1.1 1999/08/19 00:55:40 jtg Exp $
# $Id: Makefile.X11,v 1.3.2.1 2000/04/24 15:29:02 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
# Copyright (C) 1995-1998 Brian Paul
# Version: 3.2
# Copyright (C) 1995-2000 Brian Paul
# Makefile for GLUT-based demo programs for Unix/X11
@@ -13,11 +13,11 @@
INCDIR = ../include
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL -lm $(XLIBS)
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL $(XLIBS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
PROGS = bounce clearspd drawpix gamma gears glinfo glutfx isosurf \
PROGS = bounce clearspd drawpix gamma gears glinfo gloss glutfx isosurf \
morph3d multiarb osdemo paltex pointblast reflect \
renormal spectex stex3d tessdemo texcyl texobj trispd winpos

View File

@@ -1,37 +1,13 @@
# Makefile for demo programs
# Stephane Rehel (rehel@worldnet.fr) April 13 1997
# $Id: Makefile.cygnus,v 1.2 1999/10/22 20:37:23 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.0
# Copyright (C) 1995-1998 Brian Paul
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Version: 3.1
# Copyright (C) 1995-1999 Brian Paul
# $Id: Makefile.cygnus,v 1.1 1999/08/19 00:55:40 jtg Exp $
# Makefile for demo programs for cygnus
# Stephane Rehel (rehel@worldnet.fr) April 13 1997
# $Log: Makefile.cygnus,v $
# Revision 1.1 1999/08/19 00:55:40 jtg
# Initial revision
#
# Revision 3.1 1999/06/22 12:50:29 brianp
# removed multitex demo
#
# Revision 3.0 1998/06/10 02:55:51 brianp
# initial revision
#
##### MACROS #####
@@ -43,7 +19,7 @@ GL_LIBS = -L$(LIBDIR) -lglut -lMesaGLU -lMesaGL -lm $(WLIBS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
PROGS = clearspd drawpix gamma gears glinfo glutfx isosurf \
PROGS = clearspd drawpix gamma gears glinfo glutfx gloss isosurf \
morph3d multiext osdemo paltex pointblast reflect \
renormal spectex stex3d tessdemo texcyl texobj trispd winpos

View File

@@ -1,4 +1,4 @@
/* $Id: drawpix.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: drawpix.c,v 1.3 1999/10/28 18:23:29 brianp Exp $ */
/*
* glDrawPixels demo/test/benchmark
@@ -8,8 +8,14 @@
/*
* $Log: drawpix.c,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
* Revision 1.3 1999/10/28 18:23:29 brianp
* minor changes to Usage() function
*
* Revision 1.2 1999/10/21 22:13:58 brianp
* added f key to toggle front/back drawing
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.3 1999/03/28 18:18:33 brianp
* minor clean-up
@@ -44,6 +50,7 @@ static int SkipPixels, SkipRows;
static int DrawWidth, DrawHeight;
static int Scissor = 0;
static float Xzoom, Yzoom;
static GLboolean DrawFront = GL_FALSE;
@@ -82,7 +89,8 @@ static void Display( void )
glDisable(GL_SCISSOR_TEST);
glutSwapBuffers();
if (!DrawFront)
glutSwapBuffers();
}
@@ -100,6 +108,11 @@ static void Benchmark( void )
if (Scissor)
glEnable(GL_SCISSOR_TEST);
if (DrawFront)
glDrawBuffer(GL_FRONT);
else
glDrawBuffer(GL_BACK);
/* Run timing test */
draws = 0;
startTime = glutGet(GLUT_ELAPSED_TIME);
@@ -187,6 +200,14 @@ static void Key( unsigned char key, int x, int y )
case 'b':
Benchmark();
break;
case 'f':
DrawFront = !DrawFront;
if (DrawFront)
glDrawBuffer(GL_FRONT);
else
glDrawBuffer(GL_BACK);
printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK");
break;
case 27:
exit(0);
break;
@@ -258,20 +279,27 @@ static void Init( GLboolean ciMode )
static void Usage(void)
{
printf("Keys:\n");
printf(" SPACE Reset\n");
printf(" SPACE Reset Parameters\n");
printf(" Up/Down Move image up/down\n");
printf(" Left/Right Move image left/right\n");
printf(" w Decrease glDrawPixels width\n");
printf(" W Increase glDrawPixels width\n");
printf(" h Decrease glDrawPixels height\n");
printf(" H Increase glDrawPixels height\n");
printf(" p Decrease GL_UNPACK_SKIP_PIXELS\n");
printf(" P Increase GL_UNPACK_SKIP_PIXELS\n");
printf(" r Decrease GL_UNPACK_SKIP_ROWS\n");
printf(" R Increase GL_UNPACK_SKIP_ROWS\n");
printf(" x Decrease X-axis PixelZoom\n");
printf(" X Increase X-axis PixelZoom\n");
printf(" y Decrease Y-axis PixelZoom\n");
printf(" Y Increase Y-axis PixelZoom\n");
printf(" w Decrease glDrawPixels width*\n");
printf(" W Increase glDrawPixels width*\n");
printf(" h Decrease glDrawPixels height*\n");
printf(" H Increase glDrawPixels height*\n");
printf(" p Decrease GL_UNPACK_SKIP_PIXELS*\n");
printf(" P Increase GL_UNPACK_SKIP_PIXELS*\n");
printf(" r Decrease GL_UNPACK_SKIP_ROWS*\n");
printf(" R Increase GL_UNPACK_SKIP_ROWS*\n");
printf(" s Toggle GL_SCISSOR_TEST\n");
printf(" f Toggle front/back buffer drawing\n");
printf(" b Benchmark test\n");
printf(" ESC Exit\n");
printf("* Warning: no limits are imposed on these parameters so it's\n");
printf(" possible to cause a segfault if you go too far.\n");
}

View File

@@ -1,5 +1,5 @@
/* $Id: gamma.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: gamma.c,v 1.1.1.1.2.1 2000/03/18 01:14:01 brianp Exp $ */
/* Draw test patterns to help determine correct gamma value for a display.
When the intensities of the inner squares nearly match the intensities
@@ -25,8 +25,14 @@
/*
* $Log: gamma.c,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
* Revision 1.1.1.1.2.1 2000/03/18 01:14:01 brianp
* colors were computed incorrectly (Hans Nelles)
*
* Revision 1.2 2000/03/18 01:13:29 brianp
* colors were computed incorrectly (Hans Nelles)
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.1 1999/06/19 01:35:38 brianp
* merged in Kai Schuetz's RGB changes
@@ -130,8 +136,9 @@ gamma_ramp(GLfloat yoffs, GLfloat r, GLfloat g, GLfloat b)
for(d = 1; d < 4; d++) { /* increasing density from 25% to 75% */
GLfloat xcoord = (-1.0 + d*0.4);
GLfloat t = d * 0.25;
glColor3f(r*d / 5.0, g*d / 5.0, b*d / 5.0); /* draw outer rect */
glColor3f(r*t, g*t, b*t); /* draw outer rect */
glRectf(xcoord, yoffs, xcoord+0.4, yoffs + 0.5);
glColor3f(0.0, 0.0, 0.0); /* "clear" inner rect */

View File

@@ -1,8 +1,12 @@
/* $Id: gears.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: gears.c,v 1.2 1999/10/21 16:39:06 brianp Exp $ */
/*
* 3-D gear wheels. This program is in the public domain.
*
* Command line options:
* -info print GL implementation information
*
*
* Brian Paul
*/
@@ -10,8 +14,11 @@
/*
* $Log: gears.c,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
* Revision 1.2 1999/10/21 16:39:06 brianp
* added -info command line option
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.2 1999/06/03 17:07:36 brianp
* an extra quad was being drawn in front and back faces
@@ -28,6 +35,7 @@
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/glut.h>
#ifndef M_PI
@@ -287,7 +295,7 @@ reshape(int width, int height)
}
static void
init(void)
init(int argc, char *argv[])
{
static GLfloat pos[4] =
{5.0, 5.0, 10.0, 0.0};
@@ -324,6 +332,13 @@ init(void)
glEndList();
glEnable(GL_NORMALIZE);
if (argc > 1 && strcmp(argv[1], "-info")==0) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
}
void
@@ -343,7 +358,7 @@ int main(int argc, char *argv[])
glutInitWindowPosition(0, 0);
glutInitWindowSize(300, 300);
glutCreateWindow("Gears");
init();
init(argc, argv);
glutDisplayFunc(draw);
glutReshapeFunc(reshape);

373
progs/demos/gloss.c Normal file
View File

@@ -0,0 +1,373 @@
/* $Id: gloss.c,v 1.3 1999/10/26 17:08:31 brianp Exp $ */
/*
* Specular reflection demo. The specular highlight is modulated by
* a sphere-mapped texture. The result is a high-gloss surface.
* NOTE: you really need hardware acceleration for this.
* Also note, this technique can't be implemented with multi-texture
* and separate specular color interpolation because there's no way
* to indicate that the second texture unit (the reflection map)
* should modulate the specular color and not the base color.
* A future multi-texture extension could fix that.
*
* Command line options:
* -info print GL implementation information
*
*
* Brian Paul October 22, 1999 This program is in the public domain.
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
#define SPECULAR_TEXTURE_FILE "../images/reflect.rgb"
#define BASE_TEXTURE_FILE "../images/tile.rgb"
/* Menu items */
#define DO_SPEC_TEXTURE 1
#define OBJECT 2
#define ANIMATE 3
#define QUIT 100
static GLuint CylinderObj = 0;
static GLuint TeapotObj = 0;
static GLuint Object = 0;
static GLboolean Animate = GL_TRUE;
static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
static GLfloat DXrot = 1.0, DYrot = 2.5;
static GLfloat Black[4] = { 0, 0, 0, 0 };
static GLfloat White[4] = { 1, 1, 1, 1 };
static GLfloat Diffuse[4] = { .3, .3, 1.0, 1.0 }; /* blue */
static GLfloat Shininess = 15;
static GLuint BaseTexture, SpecularTexture;
static GLboolean DoSpecTexture = GL_TRUE;
/* performance info */
static GLint T0 = 0;
static GLint Frames = 0;
static void Idle( void )
{
if (Animate) {
Xrot += DXrot;
Yrot += DYrot;
glutPostRedisplay();
}
}
static void Display( void )
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glPushMatrix();
glRotatef(Xrot, 1.0, 0.0, 0.0);
glRotatef(Yrot, 0.0, 1.0, 0.0);
glRotatef(Zrot, 0.0, 0.0, 1.0);
/* First pass: diffuse lighting with base texture */
glMaterialfv(GL_FRONT, GL_DIFFUSE, Diffuse);
glMaterialfv(GL_FRONT, GL_SPECULAR, Black);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, BaseTexture);
glCallList(Object);
/* Second pass: specular lighting with reflection texture */
glBlendFunc(GL_ONE, GL_ONE); /* add */
glEnable(GL_BLEND);
glDepthFunc(GL_LEQUAL);
glMaterialfv(GL_FRONT, GL_DIFFUSE, Black);
glMaterialfv(GL_FRONT, GL_SPECULAR, White);
if (DoSpecTexture) {
glBindTexture(GL_TEXTURE_2D, SpecularTexture);
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
}
else {
glDisable(GL_TEXTURE_2D);
}
glCallList(Object);
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_BLEND);
glPopMatrix();
glutSwapBuffers();
if (Animate) {
GLint t = glutGet(GLUT_ELAPSED_TIME);
Frames++;
if (t - T0 >= 5000) {
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %g seconds = %g FPS\n", Frames, seconds, fps);
T0 = t;
Frames = 0;
}
}
}
static void Reshape( int width, int height )
{
GLfloat h = 30.0;
GLfloat w = h * width / height;
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glFrustum( -w, w, -h, h, 150.0, 500.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -380.0 );
}
static void ToggleAnimate(void)
{
Animate = !Animate;
if (Animate) {
glutIdleFunc( Idle );
T0 = glutGet(GLUT_ELAPSED_TIME);
Frames = 0;
}
else {
glutIdleFunc( NULL );
}
}
static void ModeMenu(int entry)
{
if (entry==ANIMATE) {
ToggleAnimate();
}
else if (entry==DO_SPEC_TEXTURE) {
DoSpecTexture = !DoSpecTexture;
}
else if (entry==OBJECT) {
if (Object == TeapotObj)
Object = CylinderObj;
else
Object = TeapotObj;
}
else if (entry==QUIT) {
exit(0);
}
glutPostRedisplay();
}
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 's':
Shininess--;
if (Shininess < 0.0)
Shininess = 0.0;
glMaterialf(GL_FRONT, GL_SHININESS, Shininess);
printf("Shininess = %g\n", Shininess);
break;
case 'S':
Shininess++;
if (Shininess > 128.0)
Shininess = 128.0;
glMaterialf(GL_FRONT, GL_SHININESS, Shininess);
printf("Shininess = %g\n", Shininess);
break;
case ' ':
ToggleAnimate();
break;
case 27:
exit(0);
break;
}
glutPostRedisplay();
}
static void SpecialKey( int key, int x, int y )
{
float step = 3.0;
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
Xrot += step;
break;
case GLUT_KEY_DOWN:
Xrot -= step;
break;
case GLUT_KEY_LEFT:
Yrot += step;
break;
case GLUT_KEY_RIGHT:
Yrot -= step;
break;
}
glutPostRedisplay();
}
static void Init( int argc, char *argv[] )
{
/* Cylinder object */
{
static GLfloat height = 100.0;
static GLfloat radius = 40.0;
static GLint slices = 24; /* pie slices around Z axis */
static GLint stacks = 10; /* subdivisions along length of cylinder */
static GLint rings = 4; /* rings in the end disks */
GLUquadricObj *q = gluNewQuadric();
assert(q);
gluQuadricTexture(q, GL_TRUE);
CylinderObj = glGenLists(1);
glNewList(CylinderObj, GL_COMPILE);
glPushMatrix();
glTranslatef(0.0, 0.0, -0.5 * height);
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glScalef(8.0, 4.0, 2.0);
glMatrixMode(GL_MODELVIEW);
/* cylinder */
gluQuadricNormals(q, GL_SMOOTH);
gluQuadricTexture(q, GL_TRUE);
gluCylinder(q, radius, radius, height, slices, stacks);
/* end cap */
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glScalef(3.0, 3.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glTranslatef(0.0, 0.0, height);
gluDisk(q, 0.0, radius, slices, rings);
/* other end cap */
glTranslatef(0.0, 0.0, -height);
gluQuadricOrientation(q, GLU_INSIDE);
gluDisk(q, 0.0, radius, slices, rings);
glPopMatrix();
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glEndList();
gluDeleteQuadric(q);
}
/* Teapot */
{
TeapotObj = glGenLists(1);
glNewList(TeapotObj, GL_COMPILE);
glFrontFace(GL_CW);
glutSolidTeapot(40.0);
glFrontFace(GL_CCW);
glEndList();
}
/* show cylinder by default */
Object = CylinderObj;
/* lighting */
glEnable(GL_LIGHTING);
{
GLfloat pos[4] = { 3, 3, 3, 1 };
glLightfv(GL_LIGHT0, GL_AMBIENT, Black);
glLightfv(GL_LIGHT0, GL_DIFFUSE, White);
glLightfv(GL_LIGHT0, GL_SPECULAR, White);
glLightfv(GL_LIGHT0, GL_POSITION, pos);
glEnable(GL_LIGHT0);
glMaterialfv(GL_FRONT, GL_AMBIENT, Black);
glMaterialf(GL_FRONT, GL_SHININESS, Shininess);
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
}
/* Base texture */
glGenTextures(1, &BaseTexture);
glBindTexture(GL_TEXTURE_2D, BaseTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
if (!LoadRGBMipmaps(BASE_TEXTURE_FILE, GL_RGB)) {
printf("Error: couldn't load texture image file %s\n", BASE_TEXTURE_FILE);
exit(1);
}
/* Specular texture */
glGenTextures(1, &SpecularTexture);
glBindTexture(GL_TEXTURE_2D, SpecularTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
if (!LoadRGBMipmaps(SPECULAR_TEXTURE_FILE, GL_RGB)) {
printf("Error: couldn't load texture image file %s\n", SPECULAR_TEXTURE_FILE);
exit(1);
}
/* misc */
glEnable(GL_CULL_FACE);
glEnable(GL_TEXTURE_2D);
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
if (argc > 1 && strcmp(argv[1], "-info")==0) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
}
int main( int argc, char *argv[] )
{
glutInit( &argc, argv );
glutInitWindowSize( 500, 500 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0] );
Init(argc, argv);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
glutIdleFunc( Idle );
glutCreateMenu(ModeMenu);
glutAddMenuEntry("Toggle Highlight", DO_SPEC_TEXTURE);
glutAddMenuEntry("Toggle Object", OBJECT);
glutAddMenuEntry("Toggle Animate", ANIMATE);
glutAddMenuEntry("Quit", QUIT);
glutAttachMenu(GLUT_RIGHT_BUTTON);
glutMainLoop();
return 0;
}

View File

@@ -1,8 +1,11 @@
/* $Id: isosurf.c,v 1.3 1999/09/08 22:14:31 brianp Exp $ */
/* $Id: isosurf.c,v 1.4 1999/10/21 16:39:06 brianp Exp $ */
/*
* Display an isosurface of 3-D wind speed volume.
*
* Command line options:
* -info print GL implementation information
*
* Brian Paul This file in public domain.
*/
@@ -24,6 +27,9 @@
/*
* $Log: isosurf.c,v $
* Revision 1.4 1999/10/21 16:39:06 brianp
* added -info command line option
*
* Revision 1.3 1999/09/08 22:14:31 brianp
* minor changes. always call compactify_arrays()
*
@@ -49,6 +55,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "GL/glut.h"
@@ -109,6 +116,8 @@ static GLboolean doubleBuffer = GL_TRUE;
static GLdouble plane[4] = {1.0, 0.0, -1.0, 0.0};
static GLuint surf1;
static GLboolean PrintInfo = GL_FALSE;
/* forward decl */
int BuildList( int mode );
@@ -147,7 +156,7 @@ struct data_idx {
#define COMPARE_FUNC( AXIS ) \
int compare_axis_##AXIS( const void *a, const void *b ) \
static int compare_axis_##AXIS( const void *a, const void *b ) \
{ \
float t = ( (*(struct data_idx *)a).data[AXIS] - \
(*(struct data_idx *)b).data[AXIS] ); \
@@ -644,7 +653,7 @@ static void ModeMenu(int m)
static void Init(void)
static void Init(int argc, char *argv[])
{
GLfloat fogColor[4] = {0.5,1.0,0.5,1.0};
@@ -698,6 +707,13 @@ static void Init(void)
NO_MATERIALS|
NO_FOG|
GLVERTEX);
if (PrintInfo) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
}
@@ -808,6 +824,9 @@ static GLint Args(int argc, char **argv)
else if (strcmp(argv[i], "-db") == 0) {
doubleBuffer = GL_TRUE;
}
else if (strcmp(argv[i], "-info") == 0) {
PrintInfo = GL_TRUE;
}
else {
printf("%s (Bad option).\n", argv[i]);
return QUIT;
@@ -855,7 +874,7 @@ int main(int argc, char **argv)
allowed &= ~COMPILED;
}
Init();
Init(argc, argv);
ModeMenu(arg_mode);
glutCreateMenu(ModeMenu);

View File

@@ -1,7 +1,10 @@
/* $Id: morph3d.c,v 1.2 1999/09/17 12:27:01 brianp Exp $ */
/* $Id: morph3d.c,v 1.2.2.1 1999/12/15 13:00:24 brianp Exp $ */
/*
* $Log: morph3d.c,v $
* Revision 1.2.2.1 1999/12/15 13:00:24 brianp
* moved #define to column 0
*
* Revision 1.2 1999/09/17 12:27:01 brianp
* silenced some warnings
*
@@ -498,7 +501,7 @@ static void draw_dodeca( void )
{
GLuint list;
#define TAU ((SQRT5+1)/2)
#define TAU ((SQRT5+1)/2)
list = glGenLists( 1 );
glNewList( list, GL_COMPILE );

View File

@@ -1,14 +1,31 @@
/* $Id: multiarb.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: multiarb.c,v 1.3.2.2 2000/02/02 17:32:15 brianp Exp $ */
/*
* GL_ARB_multitexture demo
*
* Command line options:
* -info print GL implementation information
*
*
* Brian Paul November 1998 This program is in the public domain.
*/
/*
* $Log: multiarb.c,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
* Revision 1.3.2.2 2000/02/02 17:32:15 brianp
* changed > to >=
*
* Revision 1.3.2.1 2000/02/02 01:08:09 brianp
* limit Drift to [0, 1]
*
* Revision 1.3 1999/10/21 16:40:32 brianp
* added -info command line option
*
* Revision 1.2 1999/10/13 12:02:13 brianp
* use texture objects now
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 1.3 1999/03/28 18:20:49 brianp
* minor clean-up
@@ -50,6 +67,8 @@ static void Idle( void )
{
if (Animate) {
Drift += 0.05;
if (Drift >= 1.0)
Drift = 0.0;
#ifdef GL_ARB_multitexture
glActiveTextureARB(GL_TEXTURE0_ARB);
@@ -221,18 +240,21 @@ static void SpecialKey( int key, int x, int y )
}
static void Init( void )
static void Init( int argc, char *argv[] )
{
GLuint texObj[2];
const char *exten = (const char *) glGetString(GL_EXTENSIONS);
if (!strstr(exten, "GL_ARB_multitexture")) {
printf("Sorry, GL_ARB_multitexture not supported by this renderer.\n");
exit(1);
}
/* setup texture env 0 */
#ifdef GL_ARB_multitexture
glActiveTextureARB(GL_TEXTURE0_ARB);
#endif
/* allocate two texture objects */
glGenTextures(2, texObj);
/* setup texture obj 0 */
glBindTexture(GL_TEXTURE_2D, texObj[0]);
#ifdef LINEAR_FILTER
/* linear filtering looks much nicer but is much slower for Mesa */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -252,10 +274,8 @@ static void Init( void )
}
/* setup texture env 1 */
#ifdef GL_ARB_multitexture
glActiveTextureARB(GL_TEXTURE1_ARB);
#endif
/* setup texture obj 1 */
glBindTexture(GL_TEXTURE_2D, texObj[1]);
#ifdef LINEAR_FILTER
/* linear filtering looks much nicer but is much slower for Mesa */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@@ -272,10 +292,26 @@ static void Init( void )
exit(1);
}
/* now bind the texture objects to the respective texture units */
#ifdef GL_ARB_multitexture
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D, texObj[0]);
glActiveTextureARB(GL_TEXTURE1_ARB);
glBindTexture(GL_TEXTURE_2D, texObj[1]);
#endif
glShadeModel(GL_FLAT);
glClearColor(0.3, 0.3, 0.4, 1.0);
ModeMenu(TEXBOTH);
if (argc > 1 && strcmp(argv[1], "-info")==0) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
}
@@ -286,7 +322,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
Init();
Init( argc, argv );
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );

View File

@@ -1,13 +1,17 @@
/* $Id: paltex.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: paltex.c,v 1.2 1999/11/02 15:09:04 brianp Exp $ */
/*
* Paletted texture demo. Written by Brian Paul. This file in public domain.
* Paletted texture demo. Written by Brian Paul.
* This program is in the public domain.
*/
/*
* $Log: paltex.c,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
* Revision 1.2 1999/11/02 15:09:04 brianp
* new texture image, cleaned-up code
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.1 1999/03/28 18:20:49 brianp
* minor clean-up
@@ -42,10 +46,10 @@ static void Display( void )
glRotatef(Rot, 0, 0, 1);
glBegin(GL_POLYGON);
glTexCoord2f(0, 1); glVertex2f(-1, -1);
glTexCoord2f(1, 1); glVertex2f( 1, -1);
glTexCoord2f(1, 0); glVertex2f( 1, 1);
glTexCoord2f(0, 0); glVertex2f(-1, 1);
glTexCoord2f(0, 1); glVertex2f(-1, -0.5);
glTexCoord2f(1, 1); glVertex2f( 1, -0.5);
glTexCoord2f(1, 0); glVertex2f( 1, 0.5);
glTexCoord2f(0, 0); glVertex2f(-1, 0.5);
glEnd();
glPopMatrix();
@@ -62,7 +66,7 @@ static void Reshape( int width, int height )
glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glTranslatef( 0.0, 0.0, -15.0 );
glTranslatef( 0.0, 0.0, -7.0 );
}
@@ -79,37 +83,20 @@ static void Key( unsigned char key, int x, int y )
}
static void SpecialKey( int key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case GLUT_KEY_UP:
break;
case GLUT_KEY_DOWN:
break;
case GLUT_KEY_LEFT:
break;
case GLUT_KEY_RIGHT:
break;
}
glutPostRedisplay();
}
static void Init( void )
{
GLubyte texture[8][8] = { /* PT = Paletted Texture! */
{ 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 100, 100, 100, 0, 180, 180, 180},
{ 0, 100, 0, 100, 0, 0, 180, 0},
{ 0, 100, 0, 100, 0, 0, 180, 0},
{ 0, 100, 100, 100, 0, 0, 180, 0},
{ 0, 100, 0, 0, 0, 0, 180, 0},
{ 0, 100, 0, 0, 0, 0, 180, 0},
{ 0, 100, 255, 0, 0, 0, 180, 250},
};
#define HEIGHT 8
#define WIDTH 32
static char texture[HEIGHT][WIDTH] = {
" ",
" MMM EEEE SSS AAA ",
" M M M E S S A A ",
" M M M EEEE SS A A ",
" M M M E SS AAAAA ",
" M M E S S A A ",
" M M EEEE SSS A A ",
" "
};
GLubyte table[256][4];
int i;
@@ -118,17 +105,31 @@ static void Init( void )
exit(0);
}
/* put some wacky colors into the texture palette */
for (i=0;i<256;i++) {
table[i][0] = i;
table[i][1] = 0;
table[i][2] = 127 + i / 2;
table[i][3] = 255;
}
/* load the color table for each texel-index */
table[' '][0] = 50;
table[' '][1] = 50;
table[' '][2] = 50;
table[' '][3] = 50;
table['M'][0] = 255;
table['M'][1] = 0;
table['M'][2] = 0;
table['M'][3] = 0;
table['E'][0] = 0;
table['E'][1] = 255;
table['E'][2] = 0;
table['E'][3] = 0;
table['S'][0] = 40;
table['S'][1] = 40;
table['S'][2] = 255;
table['S'][3] = 0;
table['A'][0] = 255;
table['A'][1] = 255;
table['A'][2] = 0;
table['A'][3] = 0;
#ifdef GL_EXT_paletted_texture
#if defined(GL_EXT_shared_texture_palette) && defined(SHARED_PALETTE)
#if defined(GL_EXT_shared_texture_palette) && defined(USE_SHARED_PALETTE)
printf("Using shared palette\n");
glColorTableEXT(GL_SHARED_TEXTURE_PALETTE_EXT, /* target */
GL_RGBA, /* internal format */
@@ -149,7 +150,7 @@ static void Init( void )
glTexImage2D(GL_TEXTURE_2D, /* target */
0, /* level */
GL_COLOR_INDEX8_EXT, /* internal format */
8, 8, /* width, height */
WIDTH, HEIGHT, /* width, height */
0, /* border */
GL_COLOR_INDEX, /* texture format */
GL_UNSIGNED_BYTE, /* texture type */
@@ -177,7 +178,6 @@ int main( int argc, char *argv[] )
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
glutDisplayFunc( Display );
glutIdleFunc( Idle );

View File

@@ -1,4 +1,4 @@
/* $Id: stex3d.c,v 1.2 1999/09/17 12:27:01 brianp Exp $ */
/* $Id: stex3d.c,v 1.2.2.1 1999/12/16 08:53:51 brianp Exp $ */
/*-----------------------------
* stex3d.c GL example of the mesa 3d-texture extention to simulate procedural
@@ -17,6 +17,9 @@
/*
* $Log: stex3d.c,v $
* Revision 1.2.2.1 1999/12/16 08:53:51 brianp
* added a cast to malloc call
*
* Revision 1.2 1999/09/17 12:27:01 brianp
* silenced some warnings
*
@@ -230,7 +233,7 @@ void create3Dtexture()
int tmp;
printf("creating 3d textures...\n");
voxels = (unsigned char *) malloc((4*tex_width*tex_height*tex_depth));
voxels = (unsigned char *) malloc((size_t) (4*tex_width*tex_height*tex_depth));
vp=voxels;
for (i=0;i<tex_width;i++){
vec[0]=i;

View File

@@ -1,41 +1,8 @@
/* $Id: tessdemo.c,v 1.2 1999/09/19 20:09:00 tanner Exp $ */
/* $Id: tessdemo.c,v 1.3.2.2 2000/03/27 15:47:08 brianp Exp $ */
/*
* A demo of the GLU polygon tesselation functions written by Bogdan Sikorski.
* This demo isn't built by the Makefile because it needs GLUT. After you've
* installed GLUT you can try this demo.
* Here's the command for IRIX, for example:
cc -g -ansi -prototypes -fullwarn -float -I../include -DSHM tess_demo.c -L../lib -lglut -lMesaGLU -lMesaGL -lm -lX11 -lXext -lXmu -lfpe -lXext -o tess_demo
*/
/*
* $Log: tessdemo.c,v $
* Revision 1.2 1999/09/19 20:09:00 tanner
*
* lots of autoconf updates
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.5 1999/03/28 18:24:37 brianp
* minor clean-up
*
* Revision 3.4 1999/02/14 03:37:07 brianp
* fixed callback problem
*
* Revision 3.3 1998/07/26 01:25:26 brianp
* removed include of gl.h and glu.h
*
* Revision 3.2 1998/06/29 02:37:30 brianp
* minor changes for Windows (Ted Jump)
*
* Revision 3.1 1998/06/09 01:53:49 brianp
* main() should return an int
*
* Revision 3.0 1998/02/14 18:42:29 brianp
* initial rev
*
* Updated for GLU 1.3 tessellation by Gareth Hughes <garethh@bell-labs.com>
*/
@@ -44,29 +11,9 @@
#include <stdlib.h>
#include <string.h>
#define MAX_POINTS 200
#define MAX_CONTOURS 50
int menu;
typedef enum{ QUIT, TESSELATE, CLEAR } menu_entries;
typedef enum{ DEFINE, TESSELATED } mode_type;
struct
{
GLint p[MAX_POINTS][2];
GLuint point_cnt;
} contours[MAX_CONTOURS];
GLuint contour_cnt;
GLsizei width,height;
mode_type mode;
struct
{
GLsizei no;
GLfloat color[3];
GLint p[3][2];
GLclampf p_color[3][3];
} triangle;
#define MAX_POINTS 256
#define MAX_CONTOURS 32
#define MAX_TRIANGLES 256
#ifndef GLCALLBACK
#ifdef CALLBACK
@@ -76,368 +23,515 @@ struct
#endif
#endif
typedef enum{ QUIT, TESSELATE, CLEAR } menu_entries;
typedef enum{ DEFINE, TESSELATED } mode_type;
void GLCALLBACK my_error(GLenum err)
static GLsizei width, height;
static GLuint contour_cnt;
static GLuint triangle_cnt;
static mode_type mode;
static int menu;
static GLuint list_start;
static GLfloat edge_color[3];
static struct
{
int len,i;
char const *str;
GLfloat p[MAX_POINTS][2];
GLuint point_cnt;
} contours[MAX_CONTOURS];
glColor3f(0.9,0.9,0.9);
glRasterPos2i(5,5);
str=(const char *)gluErrorString(err);
len=strlen(str);
for(i=0;i<len;i++)
glutBitmapCharacter(GLUT_BITMAP_9_BY_15,str[i]);
static struct
{
GLsizei no;
GLfloat p[3][2];
GLclampf color[3][3];
} triangles[MAX_TRIANGLES];
void GLCALLBACK error_callback( GLenum err )
{
int len, i;
char const *str;
glColor3f( 0.9, 0.9, 0.9 );
glRasterPos2i( 5, 5 );
str = (const char *) gluErrorString( err );
len = strlen( str );
for ( i = 0 ; i < len ; i++ ) {
glutBitmapCharacter( GLUT_BITMAP_9_BY_15, str[i] );
}
}
void GLCALLBACK begin_callback(GLenum mode)
void GLCALLBACK begin_callback( GLenum mode )
{
triangle.no=0;
/* Allow multiple triangles to be output inside the begin/end pair. */
triangle_cnt = 0;
triangles[triangle_cnt].no = 0;
}
void GLCALLBACK edge_callback(GLenum flag)
void GLCALLBACK edge_callback( GLenum flag )
{
if(flag==GL_TRUE)
{
triangle.color[0]=1.0;
triangle.color[1]=1.0;
triangle.color[2]=0.5;
}
else
{
triangle.color[0]=1.0;
triangle.color[1]=0.0;
triangle.color[2]=0.0;
}
/* Persist the edge flag across triangles. */
if ( flag == GL_TRUE )
{
edge_color[0] = 1.0;
edge_color[1] = 1.0;
edge_color[2] = 0.5;
}
else
{
edge_color[0] = 1.0;
edge_color[1] = 0.0;
edge_color[2] = 0.0;
}
}
void GLCALLBACK end_callback()
{
glBegin(GL_LINES);
glColor3f(triangle.p_color[0][0],triangle.p_color[0][1],
triangle.p_color[0][2]);
glVertex2i(triangle.p[0][0],triangle.p[0][1]);
glVertex2i(triangle.p[1][0],triangle.p[1][1]);
glColor3f(triangle.p_color[1][0],triangle.p_color[1][1],
triangle.p_color[1][2]);
glVertex2i(triangle.p[1][0],triangle.p[1][1]);
glVertex2i(triangle.p[2][0],triangle.p[2][1]);
glColor3f(triangle.p_color[2][0],triangle.p_color[2][1],
triangle.p_color[2][2]);
glVertex2i(triangle.p[2][0],triangle.p[2][1]);
glVertex2i(triangle.p[0][0],triangle.p[0][1]);
glEnd();
GLint i;
glBegin( GL_LINES );
/* Output the three edges of each triangle as lines colored
according to their edge flag. */
for ( i = 0 ; i < triangle_cnt ; i++ )
{
glColor3f( triangles[i].color[0][0],
triangles[i].color[0][1],
triangles[i].color[0][2] );
glVertex2f( triangles[i].p[0][0], triangles[i].p[0][1] );
glVertex2f( triangles[i].p[1][0], triangles[i].p[1][1] );
glColor3f( triangles[i].color[1][0],
triangles[i].color[1][1],
triangles[i].color[1][2] );
glVertex2f( triangles[i].p[1][0], triangles[i].p[1][1] );
glVertex2f( triangles[i].p[2][0], triangles[i].p[2][1] );
glColor3f( triangles[i].color[2][0],
triangles[i].color[2][1],
triangles[i].color[2][2] );
glVertex2f( triangles[i].p[2][0], triangles[i].p[2][1] );
glVertex2f( triangles[i].p[0][0], triangles[i].p[0][1] );
}
glEnd();
}
void GLCALLBACK vertex_callback(void *data)
void GLCALLBACK vertex_callback( void *data )
{
GLsizei no;
GLint *p;
GLsizei no;
GLfloat *p;
p=(GLint *)data;
no=triangle.no;
triangle.p[no][0]=p[0];
triangle.p[no][1]=p[1];
triangle.p_color[no][0]=triangle.color[0];
triangle.p_color[no][1]=triangle.color[1];
triangle.p_color[no][2]=triangle.color[2];
++(triangle.no);
p = (GLfloat *) data;
no = triangles[triangle_cnt].no;
triangles[triangle_cnt].p[no][0] = p[0];
triangles[triangle_cnt].p[no][1] = p[1];
triangles[triangle_cnt].color[no][0] = edge_color[0];
triangles[triangle_cnt].color[no][1] = edge_color[1];
triangles[triangle_cnt].color[no][2] = edge_color[2];
/* After every three vertices, initialize the next triangle. */
if ( ++(triangles[triangle_cnt].no) == 3 )
{
triangle_cnt++;
triangles[triangle_cnt].no = 0;
}
}
void set_screen_wh(GLsizei w, GLsizei h)
void GLCALLBACK combine_callback( GLdouble coords[3],
GLdouble *vertex_data[4],
GLfloat weight[4], void **data )
{
width=w;
height=h;
GLfloat *vertex;
int i;
vertex = (GLfloat *) malloc( 2 * sizeof(GLfloat) );
vertex[0] = (GLfloat) coords[0];
vertex[1] = (GLfloat) coords[1];
*data = vertex;
}
void tesse(void)
{
GLUtesselator *tobj;
GLdouble data[3];
GLuint i,j,point_cnt;
tobj=gluNewTess();
if(tobj!=NULL)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f (0.7, 0.7, 0.0);
gluTessCallback(tobj,GLU_BEGIN,glBegin);
gluTessCallback(tobj,GLU_END,glEnd);
gluTessCallback(tobj,GLU_ERROR,my_error);
gluTessCallback(tobj,GLU_VERTEX,glVertex2iv);
gluBeginPolygon(tobj);
for(j=0;j<=contour_cnt;j++)
{
point_cnt=contours[j].point_cnt;
gluNextContour(tobj,GLU_UNKNOWN);
for(i=0;i<point_cnt;i++)
{
data[0]=(GLdouble)(contours[j].p[i][0]);
data[1]=(GLdouble)(contours[j].p[i][1]);
data[2]=0.0;
gluTessVertex(tobj,data,contours[j].p[i]);
}
}
gluEndPolygon(tobj);
glLineWidth(2.0);
gluTessCallback(tobj,GLU_BEGIN,begin_callback);
gluTessCallback(tobj,GLU_END,end_callback);
gluTessCallback(tobj,GLU_VERTEX,vertex_callback);
gluTessCallback(tobj,GLU_EDGE_FLAG,edge_callback);
gluBeginPolygon(tobj);
for(j=0;j<=contour_cnt;j++)
{
point_cnt=contours[j].point_cnt;
gluNextContour(tobj,GLU_UNKNOWN);
for(i=0;i<point_cnt;i++)
{
data[0]=(GLdouble)(contours[j].p[i][0]);
data[1]=(GLdouble)(contours[j].p[i][1]);
data[2]=0.0;
gluTessVertex(tobj,data,contours[j].p[i]);
}
}
gluEndPolygon(tobj);
gluDeleteTess(tobj);
glutMouseFunc(NULL);
glColor3f (1.0, 1.0, 0.0);
glLineWidth(1.0);
mode=TESSELATED;
}
void set_screen_wh( GLsizei w, GLsizei h )
{
width = w;
height = h;
}
void left_down(int x1,int y1)
void tesse( void )
{
GLint P[2];
GLuint point_cnt;
GLUtesselator *tobj;
GLdouble data[3];
GLuint i, j, point_cnt;
/* translate GLUT into GL coordinates */
P[0]=x1;
P[1]=height-y1;
point_cnt=contours[contour_cnt].point_cnt;
contours[contour_cnt].p[point_cnt][0]=P[0];
contours[contour_cnt].p[point_cnt][1]=P[1];
glBegin(GL_LINES);
if(point_cnt)
{
glVertex2iv(contours[contour_cnt].p[point_cnt-1]);
glVertex2iv(P);
}
else
{
glVertex2iv(P);
glVertex2iv(P);
}
glEnd();
glFinish();
++(contours[contour_cnt].point_cnt);
list_start = glGenLists( 2 );
tobj = gluNewTess();
if ( tobj != NULL )
{
gluTessCallback( tobj, GLU_TESS_BEGIN, glBegin );
gluTessCallback( tobj, GLU_TESS_VERTEX, glVertex2fv );
gluTessCallback( tobj, GLU_TESS_END, glEnd );
gluTessCallback( tobj, GLU_TESS_ERROR, error_callback );
gluTessCallback( tobj, GLU_TESS_COMBINE, combine_callback );
glNewList( list_start, GL_COMPILE );
gluBeginPolygon( tobj );
for ( j = 0 ; j <= contour_cnt ; j++ )
{
point_cnt = contours[j].point_cnt;
gluNextContour( tobj, GLU_UNKNOWN );
for ( i = 0 ; i < point_cnt ; i++ )
{
data[0] = (GLdouble)( contours[j].p[i][0] );
data[1] = (GLdouble)( contours[j].p[i][1] );
data[2] = 0.0;
gluTessVertex( tobj, data, contours[j].p[i] );
}
}
gluEndPolygon( tobj );
glEndList();
gluTessCallback( tobj, GLU_TESS_BEGIN, begin_callback );
gluTessCallback( tobj, GLU_TESS_VERTEX, vertex_callback );
gluTessCallback( tobj, GLU_TESS_END, end_callback );
gluTessCallback( tobj, GLU_TESS_EDGE_FLAG, edge_callback );
glNewList( list_start + 1, GL_COMPILE );
gluBeginPolygon( tobj );
for ( j = 0 ; j <= contour_cnt ; j++ )
{
point_cnt = contours[j].point_cnt;
gluNextContour( tobj, GLU_UNKNOWN );
for ( i = 0 ; i < point_cnt ; i++ )
{
data[0] = (GLdouble)( contours[j].p[i][0] );
data[1] = (GLdouble)( contours[j].p[i][1] );
data[2] = 0.0;
gluTessVertex( tobj, data, contours[j].p[i] );
}
}
gluEndPolygon( tobj );
glEndList();
gluDeleteTess( tobj );
glutMouseFunc( NULL );
mode = TESSELATED;
}
}
void middle_down(int x1, int y1)
void left_down( int x1, int y1 )
{
GLuint point_cnt;
(void) x1;
(void) y1;
GLfloat P[2];
GLuint point_cnt;
point_cnt=contours[contour_cnt].point_cnt;
if(point_cnt>2)
{
glBegin(GL_LINES);
glVertex2iv(contours[contour_cnt].p[0]);
glVertex2iv(contours[contour_cnt].p[point_cnt-1]);
contours[contour_cnt].p[point_cnt][0]= -1;
glEnd();
glFinish();
contour_cnt++;
contours[contour_cnt].point_cnt=0;
}
/* translate GLUT into GL coordinates */
P[0] = x1;
P[1] = height - y1;
point_cnt = contours[contour_cnt].point_cnt;
contours[contour_cnt].p[point_cnt][0] = P[0];
contours[contour_cnt].p[point_cnt][1] = P[1];
glBegin( GL_LINES );
if ( point_cnt )
{
glVertex2fv( contours[contour_cnt].p[point_cnt-1] );
glVertex2fv( P );
}
else
{
glVertex2fv( P );
glVertex2fv( P );
}
glEnd();
glFinish();
contours[contour_cnt].point_cnt++;
}
void mouse_clicked(int button,int state,int x,int y)
void middle_down( int x1, int y1 )
{
x-= x%10;
y-= y%10;
switch(button)
{
case GLUT_LEFT_BUTTON:
if(state==GLUT_DOWN)
left_down(x,y);
break;
case GLUT_MIDDLE_BUTTON:
if(state==GLUT_DOWN)
middle_down(x,y);
break;
}
GLuint point_cnt;
(void) x1;
(void) y1;
point_cnt = contours[contour_cnt].point_cnt;
if ( point_cnt > 2 )
{
glBegin( GL_LINES );
glVertex2fv( contours[contour_cnt].p[0] );
glVertex2fv( contours[contour_cnt].p[point_cnt-1] );
contours[contour_cnt].p[point_cnt][0] = -1;
glEnd();
glFinish();
contour_cnt++;
contours[contour_cnt].point_cnt = 0;
}
}
void display(void)
void mouse_clicked( int button, int state, int x, int y )
{
GLuint i,j;
GLuint point_cnt;
x -= x%10;
y -= y%10;
glClear(GL_COLOR_BUFFER_BIT);
switch(mode)
{
case DEFINE:
/* draw grid */
glColor3f (0.6,0.5,0.5);
glBegin(GL_LINES);
for(i=0;i<width;i+=10)
for(j=0;j<height;j+=10)
{
glVertex2i(0,j);
glVertex2i(width,j);
glVertex2i(i,height);
glVertex2i(i,0);
}
glColor3f (1.0, 1.0, 0.0);
for(i=0;i<=contour_cnt;i++)
{
point_cnt=contours[i].point_cnt;
glBegin(GL_LINES);
switch(point_cnt)
{
case 0:
break;
case 1:
glVertex2iv(contours[i].p[0]);
glVertex2iv(contours[i].p[0]);
break;
case 2:
glVertex2iv(contours[i].p[0]);
glVertex2iv(contours[i].p[1]);
break;
default:
--point_cnt;
for(j=0;j<point_cnt;j++)
{
glVertex2iv(contours[i].p[j]);
glVertex2iv(contours[i].p[j+1]);
}
if(contours[i].p[j+1][0]== -1)
{
glVertex2iv(contours[i].p[0]);
glVertex2iv(contours[i].p[j]);
}
break;
}
glEnd();
}
glFinish();
break;
case TESSELATED:
/* draw lines */
tesse();
break;
}
switch ( button )
{
case GLUT_LEFT_BUTTON:
if ( state == GLUT_DOWN ) {
left_down( x, y );
}
break;
case GLUT_MIDDLE_BUTTON:
if ( state == GLUT_DOWN ) {
middle_down( x, y );
}
break;
}
}
glColor3f (1.0, 1.0, 0.0);
void display( void )
{
GLuint i,j;
GLuint point_cnt;
glClear( GL_COLOR_BUFFER_BIT );
switch ( mode )
{
case DEFINE:
/* draw grid */
glColor3f( 0.6, 0.5, 0.5 );
glBegin( GL_LINES );
for ( i = 0 ; i < width ; i += 10 )
{
for ( j = 0 ; j < height ; j += 10 )
{
glVertex2i( 0, j );
glVertex2i( width, j );
glVertex2i( i, height );
glVertex2i( i, 0 );
}
}
glEnd();
glColor3f( 1.0, 1.0, 0.0 );
for ( i = 0 ; i <= contour_cnt ; i++ )
{
point_cnt = contours[i].point_cnt;
glBegin( GL_LINES );
switch ( point_cnt )
{
case 0:
break;
case 1:
glVertex2fv( contours[i].p[0] );
glVertex2fv( contours[i].p[0] );
break;
case 2:
glVertex2fv( contours[i].p[0] );
glVertex2fv( contours[i].p[1] );
break;
default:
--point_cnt;
for ( j = 0 ; j < point_cnt ; j++ )
{
glVertex2fv( contours[i].p[j] );
glVertex2fv( contours[i].p[j+1] );
}
if ( contours[i].p[j+1][0] == -1 )
{
glVertex2fv( contours[i].p[0] );
glVertex2fv( contours[i].p[j] );
}
break;
}
glEnd();
}
glFinish();
break;
case TESSELATED:
/* draw triangles */
glColor3f( 0.7, 0.7, 0.0 );
glCallList( list_start );
glLineWidth( 2.0 );
glCallList( list_start + 1 );
glLineWidth( 1.0 );
glFlush();
break;
}
glColor3f( 1.0, 1.0, 0.0 );
}
void clear( void )
{
contour_cnt=0;
contours[0].point_cnt=0;
glutMouseFunc(mouse_clicked);
mode=DEFINE;
display();
contour_cnt = 0;
contours[0].point_cnt = 0;
triangle_cnt = 0;
glutMouseFunc( mouse_clicked );
mode = DEFINE;
glDeleteLists( list_start, 2 );
list_start = 0;
}
void quit( void )
{
exit(0);
exit( 0 );
}
void menu_selected(int entry)
void menu_selected( int entry )
{
switch(entry)
{
case CLEAR:
clear();
break;
case TESSELATE:
tesse();
break;
case QUIT:
quit();
break;
}
switch ( entry )
{
case CLEAR:
clear();
break;
case TESSELATE:
tesse();
break;
case QUIT:
quit();
break;
}
glutPostRedisplay();
}
void key_pressed(unsigned char key,int x,int y)
void key_pressed( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch(key)
{
case 't':
case 'T':
tesse();
glFinish();
break;
case 'q':
case 'Q':
quit();
break;
case 'c':
case 'C':
clear();
break;
}
(void) x;
(void) y;
switch ( key )
{
case 'c':
case 'C':
clear();
break;
case 't':
case 'T':
tesse();
break;
case 'q':
case 'Q':
quit();
break;
}
glutPostRedisplay();
}
void myinit (void)
void myinit( void )
{
/* clear background to gray */
glClearColor (0.4, 0.4, 0.4, 0.0);
glShadeModel (GL_FLAT);
/* clear background to gray */
glClearColor( 0.4, 0.4, 0.4, 0.0 );
glShadeModel( GL_FLAT );
glPolygonMode( GL_FRONT, GL_FILL );
menu=glutCreateMenu(menu_selected);
glutAddMenuEntry("clear",CLEAR);
glutAddMenuEntry("tesselate",TESSELATE);
glutAddMenuEntry("quit",QUIT);
glutAttachMenu(GLUT_RIGHT_BUTTON);
glutMouseFunc(mouse_clicked);
glutKeyboardFunc(key_pressed);
contour_cnt=0;
glPolygonMode(GL_FRONT,GL_FILL);
mode=DEFINE;
menu = glutCreateMenu( menu_selected );
glutAddMenuEntry( "clear", CLEAR );
glutAddMenuEntry( "tesselate", TESSELATE );
glutAddMenuEntry( "quit", QUIT );
glutAttachMenu( GLUT_RIGHT_BUTTON );
glutMouseFunc( mouse_clicked );
glutKeyboardFunc( key_pressed );
contour_cnt = 0;
mode = DEFINE;
}
static void reshape(GLsizei w, GLsizei h)
static void reshape( GLsizei w, GLsizei h )
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, (GLdouble)w, 0.0, (GLdouble)h, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
set_screen_wh(w,h);
glViewport( 0, 0, w, h );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( 0.0, (GLdouble)w, 0.0, (GLdouble)h, -1.0, 1.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
set_screen_wh( w, h );
}
static void usage( void )
{
printf("Use left mouse button to place vertices.\n");
printf("Press middle mouse button when done.\n");
printf("Select tesselate from the pop-up menu.\n");
printf( "Use left mouse button to place vertices.\n" );
printf( "Press middle mouse button when done.\n" );
printf( "Select tesselate from the pop-up menu.\n" );
}
/* Main Loop
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
/*
* Main Loop
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
int main( int argc, char **argv )
{
usage();
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (400, 400);
glutCreateWindow (argv[0]);
myinit ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMainLoop();
return 0;
usage();
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_SINGLE | GLUT_RGB );
glutInitWindowSize( 400, 400 );
glutCreateWindow( argv[0] );
myinit();
glutDisplayFunc( display );
glutReshapeFunc( reshape );
glutMainLoop();
return 0;
}

View File

@@ -1,14 +1,22 @@
/* $Id: texcyl.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: texcyl.c,v 1.2 1999/10/21 16:39:06 brianp Exp $ */
/*
* Textured cylinder demo: lighting, texturing, reflection mapping.
*
* Command line options:
* -info print GL implementation information
*
*
* Brian Paul May 1997 This program is in the public domain.
*/
/*
* $Log: texcyl.c,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
* Revision 1.2 1999/10/21 16:39:06 brianp
* added -info command line option
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.3 1999/03/28 18:24:37 brianp
* minor clean-up
@@ -171,7 +179,7 @@ static void SpecialKey( int key, int x, int y )
}
static void Init( void )
static void Init( int argc, char *argv[] )
{
GLUquadricObj *q = gluNewQuadric();
CylinderObj = glGenLists(1);
@@ -226,6 +234,13 @@ static void Init( void )
glEnable(GL_CULL_FACE); /* don't need Z testing for convex objects */
SetMode(LIT);
if (argc > 1 && strcmp(argv[1], "-info")==0) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
}
@@ -238,7 +253,7 @@ int main( int argc, char *argv[] )
glutCreateWindow(argv[0] );
Init();
Init(argc, argv);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );

View File

@@ -1,4 +1,4 @@
/* $Id: texobj.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: texobj.c,v 1.1.1.1.2.2 2000/03/01 03:36:35 brianp Exp $ */
/*
* Example of using the 1.1 texture object functions.
@@ -10,8 +10,14 @@
/*
* $Log: texobj.c,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
* Revision 1.1.1.1.2.2 2000/03/01 03:36:35 brianp
* test for GL 1.2
*
* Revision 1.1.1.1.2.1 2000/02/25 23:24:28 brianp
* fixed bug when using display lists
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* Revision 3.1 1999/03/28 18:24:37 brianp
* minor clean-up
@@ -34,7 +40,7 @@ static GLfloat Angle = 0.0f;
static GLboolean HaveTexObj = GL_FALSE;
#if defined(GL_VERSION_1_1)
#if defined(GL_VERSION_1_1) || defined(GL_VERSION_1_2)
# define TEXTURE_OBJECT 1
#elif defined(GL_EXT_texture_object)
# define TEXTURE_OBJECT 1
@@ -84,7 +90,7 @@ static void draw( void )
#endif
}
else {
glCallList( TexObj[0] );
glCallList( TexObj[1] );
}
glBegin( GL_POLYGON );
glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 );
@@ -272,7 +278,8 @@ int main( int argc, char *argv[] )
char *exten = (char *) glGetString( GL_EXTENSIONS );
char *version = (char *) glGetString( GL_VERSION );
if ( strstr( exten, "GL_EXT_texture_object" )
|| strncmp( version, "1.1", 3 )==0 ) {
|| strncmp( version, "1.1", 3 )==0
|| strncmp( version, "1.2", 3 )==0 ) {
HaveTexObj = GL_TRUE;
}
}

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.1 1999/08/19 00:55:40 jtg Exp $
# $Id: Makefile.X11,v 1.2 1999/10/27 10:09:53 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -12,7 +12,7 @@
INCDIR = ../include
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL -lm $(XLIBS)
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL $(XLIBS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)

View File

@@ -1,13 +1,13 @@
/*
* Copyright (c) 1993-1997, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies and that both the copyright notice
* and this permission notice appear in supporting documentation, and that
* and this permission notice appear in supporting documentation, and that
* the name of Silicon Graphics, Inc. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission.
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
@@ -21,8 +21,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
*
* US Government Users Restricted Rights
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
@@ -45,7 +45,7 @@
* Note the exterior rectangle is drawn with its vertices
* in counter-clockwise order, but its interior clockwise.
* Note the combineCallback is needed for the self-intersecting
* star. Also note that removing the TessProperty for the
* star. Also note that removing the TessProperty for the
* star will make the interior unshaded (WINDING_ODD).
*/
#include <GL/glut.h>
@@ -102,7 +102,7 @@ void CALLBACK vertexCallback(GLvoid *vertex)
* but weight[4] may be used to average color, normal, or texture
* coordinate data. In this program, color is weighted.
*/
void CALLBACK combineCallback(GLdouble coords[3],
void CALLBACK combineCallback(GLdouble coords[3],
GLdouble *vertex_data[4],
GLfloat weight[4], GLdouble **dataOut )
{
@@ -114,47 +114,47 @@ void CALLBACK combineCallback(GLdouble coords[3],
vertex[0] = coords[0];
vertex[1] = coords[1];
vertex[2] = coords[2];
for (i = 3; i < 7; i++)
vertex[i] = weight[0] * vertex_data[0][i]
for (i = 3; i < 6; i++)
vertex[i] = weight[0] * vertex_data[0][i]
+ weight[1] * vertex_data[1][i]
+ weight[2] * vertex_data[2][i]
+ weight[2] * vertex_data[2][i]
+ weight[3] * vertex_data[3][i];
*dataOut = vertex;
}
void init (void)
void init (void)
{
GLUtesselator *tobj;
GLdouble rect[4][3] = {50.0, 50.0, 0.0,
200.0, 50.0, 0.0,
200.0, 200.0, 0.0,
50.0, 200.0, 0.0};
GLdouble tri[3][3] = {75.0, 75.0, 0.0,
125.0, 175.0, 0.0,
175.0, 75.0, 0.0};
GLdouble star[5][6] = {250.0, 50.0, 0.0, 1.0, 0.0, 1.0,
325.0, 200.0, 0.0, 1.0, 1.0, 0.0,
400.0, 50.0, 0.0, 0.0, 1.0, 1.0,
250.0, 150.0, 0.0, 1.0, 0.0, 0.0,
400.0, 150.0, 0.0, 0.0, 1.0, 0.0};
GLdouble rect[4][3] = {{50.0, 50.0, 0.0},
{200.0, 50.0, 0.0},
{200.0, 200.0, 0.0},
{50.0, 200.0, 0.0}};
GLdouble tri[3][3] = {{75.0, 75.0, 0.0},
{125.0, 175.0, 0.0},
{175.0, 75.0, 0.0}};
GLdouble star[5][6] = {{250.0, 50.0, 0.0, 1.0, 0.0, 1.0},
{325.0, 200.0, 0.0, 1.0, 1.0, 0.0},
{400.0, 50.0, 0.0, 0.0, 1.0, 1.0},
{250.0, 150.0, 0.0, 1.0, 0.0, 0.0},
{400.0, 150.0, 0.0, 0.0, 1.0, 0.0}};
glClearColor(0.0, 0.0, 0.0, 0.0);
startList = glGenLists(2);
tobj = gluNewTess();
gluTessCallback(tobj, GLU_TESS_VERTEX,
gluTessCallback(tobj, GLU_TESS_VERTEX,
(GLvoid (CALLBACK*) ()) &glVertex3dv);
gluTessCallback(tobj, GLU_TESS_BEGIN,
gluTessCallback(tobj, GLU_TESS_BEGIN,
(GLvoid (CALLBACK*) ()) &beginCallback);
gluTessCallback(tobj, GLU_TESS_END,
gluTessCallback(tobj, GLU_TESS_END,
(GLvoid (CALLBACK*) ()) &endCallback);
gluTessCallback(tobj, GLU_TESS_ERROR,
gluTessCallback(tobj, GLU_TESS_ERROR,
(GLvoid (CALLBACK*) ()) &errorCallback);
/* rectangle with triangular hole inside */
glNewList(startList, GL_COMPILE);
glShadeModel(GL_FLAT);
glShadeModel(GL_FLAT);
gluTessBeginPolygon(tobj, NULL);
gluTessBeginContour(tobj);
gluTessVertex(tobj, rect[0], rect[0]);
@@ -170,20 +170,20 @@ void init (void)
gluTessEndPolygon(tobj);
glEndList();
gluTessCallback(tobj, GLU_TESS_VERTEX,
gluTessCallback(tobj, GLU_TESS_VERTEX,
(GLvoid (CALLBACK*) ()) &vertexCallback);
gluTessCallback(tobj, GLU_TESS_BEGIN,
gluTessCallback(tobj, GLU_TESS_BEGIN,
(GLvoid (CALLBACK*) ()) &beginCallback);
gluTessCallback(tobj, GLU_TESS_END,
gluTessCallback(tobj, GLU_TESS_END,
(GLvoid (CALLBACK*) ()) &endCallback);
gluTessCallback(tobj, GLU_TESS_ERROR,
gluTessCallback(tobj, GLU_TESS_ERROR,
(GLvoid (CALLBACK*) ()) &errorCallback);
gluTessCallback(tobj, GLU_TESS_COMBINE,
gluTessCallback(tobj, GLU_TESS_COMBINE,
(GLvoid (CALLBACK*) ()) &combineCallback);
/* smooth shaded, self-intersecting star */
glNewList(startList + 1, GL_COMPILE);
glShadeModel(GL_SMOOTH);
glShadeModel(GL_SMOOTH);
gluTessProperty(tobj, GLU_TESS_WINDING_RULE,
GLU_TESS_WINDING_POSITIVE);
gluTessBeginPolygon(tobj, NULL);
@@ -228,7 +228,7 @@ int main(int argc, char** argv)
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop();
return 0;
return 0;
}
#else

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.1 1999/08/19 00:55:41 jtg Exp $
# $Id: Makefile.X11,v 1.2 1999/10/27 10:09:53 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -14,7 +14,7 @@
INCDIR = ../include
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL -lm $(XLIBS)
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL $(XLIBS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)

View File

@@ -1,4 +1,4 @@
/* $Id: logo.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */
/* $Id: logo.c,v 1.1.1.1.2.1 1999/12/15 13:01:44 brianp Exp $ */
/*
* Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
@@ -108,16 +108,16 @@ GLubyte *image = checkImage;
GLint imageHeight = CHECKIMAGEHEIGHT;
GLint imageWidth = CHECKIMAGEWIDTH;
float decal[] = {
static float decal[] = {
GL_DECAL,
};
float modulate[] = {
static float modulate[] = {
GL_MODULATE,
};
float repeat[] = {
static float repeat[] = {
GL_REPEAT,
};
float nearest[] = {
static float nearest[] = {
GL_NEAREST,
};

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.2 1999/09/16 16:41:03 brianp Exp $
# $Id: Makefile.X11,v 1.4.2.1 1999/11/12 15:43:25 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -12,11 +12,11 @@
INCDIR = ../include
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL -lm $(XLIBS)
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL $(XLIBS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
PROGS = glxdemo glxpixmap offset xdemo glxinfo
PROGS = glxdemo glxpixmap offset xdemo glxinfo xfont glxdpyinfo

1094
progs/xdemos/glxdpyinfo.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,148 +1,207 @@
/* $Id: xfont.c,v 1.3 1999/11/05 08:12:46 brianp Exp $ */
/*
* (c) Copyright 1993, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies and that both the copyright notice
* and this permission notice appear in supporting documentation, and that
* the name of Silicon Graphics, Inc. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
* Mesa 3-D graphics library
*
* US Government Users Restricted Rights
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
* clause at DFARS 252.227-7013 and/or in similar or successor
* clauses in the FAR or the DOD or NASA FAR Supplement.
* Unpublished-- rights reserved under the copyright laws of the
* United States. Contractor/manufacturer is Silicon Graphics,
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
*
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* xfont.c
* Draws some text in a bitmapped font. Uses glBitmap()
* and other pixel routines. Also demonstrates use of
* display lists.
* Example of using glXUseXFont().
* 5 November 1999
* Brian Paul
*/
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glx.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "glaux.h"
GLuint base;
void makeRasterFont(void)
static const char *ProgramName = "xfont";
static const char *FontName = "fixed";
static GLuint FontBase = 0;
static void redraw( Display *dpy, Window w )
{
static const char *text = "This is glXUseXFont()";
glClear( GL_COLOR_BUFFER_BIT );
/* triangle */
glColor3f( 0.2, 0.2, 1.0 );
glBegin(GL_TRIANGLES);
glVertex2f( 0, 0.8 );
glVertex2f( -0.8, -0.7 );
glVertex2f( 0.8, -0.7 );
glEnd();
/* text */
glColor3f( 1, 1, 1 );
glRasterPos2f(-0.8, 0);
glListBase(FontBase);
glCallLists(strlen(text), GL_UNSIGNED_BYTE, (GLubyte *) text);
glXSwapBuffers( dpy, w );
}
static void resize( unsigned int width, unsigned int height )
{
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho( -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 );
}
static void setup_font( Display *dpy )
{
XFontStruct *fontInfo;
Font id;
unsigned int first, last;
Display *xdisplay;
xdisplay = auxXDisplay ();
fontInfo = XLoadQueryFont(xdisplay,
"-adobe-helvetica-medium-r-normal--17-120-100-100-p-88-iso8859-1");
if (fontInfo == NULL) {
printf ("no font found\n");
exit (0);
fontInfo = XLoadQueryFont(dpy, FontName);
if (!fontInfo) {
printf("Error: font %s not found\n", FontName);
exit(0);
}
id = fontInfo->fid;
first = fontInfo->min_char_or_byte2;
last = fontInfo->max_char_or_byte2;
base = glGenLists((GLuint) last+1);
if (base == 0) {
printf ("out of display lists\n");
exit (0);
FontBase = glGenLists((GLuint) last + 1);
if (!FontBase) {
printf("Error: unable to allocate display lists\n");
exit(0);
}
glXUseXFont(id, first, last-first+1, base+first);
/* *height = fontInfo->ascent + fontInfo->descent;
*width = fontInfo->max_bounds.width; */
glXUseXFont(id, first, last - first + 1, FontBase + first);
}
void printString(char *s)
static Window make_rgb_db_window( Display *dpy, int xpos, int ypos,
unsigned int width, unsigned int height )
{
glPushAttrib (GL_LIST_BIT);
glListBase(base);
glCallLists(strlen(s), GL_UNSIGNED_BYTE, (GLubyte *)s);
glPopAttrib ();
int attrib[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
None };
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
GLXContext ctx;
XVisualInfo *visinfo;
scrnum = DefaultScreen( dpy );
root = RootWindow( dpy, scrnum );
visinfo = glXChooseVisual( dpy, scrnum, attrib );
if (!visinfo) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");
exit(1);
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr );
{
XSizeHints sizehints;
sizehints.x = xpos;
sizehints.y = ypos;
sizehints.width = width;
sizehints.height = height;
sizehints.flags = USSize | USPosition;
XSetNormalHints(dpy, win, &sizehints);
XSetStandardProperties(dpy, win, ProgramName, ProgramName,
None, (char **)NULL, 0, &sizehints);
}
ctx = glXCreateContext( dpy, visinfo, NULL, True );
glXMakeCurrent( dpy, win, ctx );
return win;
}
void myinit (void)
static void event_loop( Display *dpy )
{
makeRasterFont ();
glShadeModel (GL_FLAT);
XEvent event;
while (1) {
XNextEvent( dpy, &event );
switch (event.type) {
case Expose:
redraw( dpy, event.xany.window );
break;
case ConfigureNotify:
resize( event.xconfigure.width, event.xconfigure.height );
break;
case KeyPress:
exit(0);
default:
; /* no-op */
}
}
}
void display(void)
int main( int argc, char *argv[] )
{
GLfloat white[3] = { 1.0, 1.0, 1.0 };
int i, j;
char teststring[33];
Display *dpy;
Window win;
glClear(GL_COLOR_BUFFER_BIT);
glColor3fv(white);
for (i = 32; i < 127; i += 32) {
glRasterPos2i(20, 200 - 18*(GLint) i/32);
for (j = 0; j < 32; j++)
teststring[j] = (char) (i+j);
teststring[32] = 0;
printString(teststring);
}
glRasterPos2i(20, 100);
printString("The quick brown fox jumps");
glRasterPos2i(20, 82);
printString("over a lazy dog.");
glFlush ();
dpy = XOpenDisplay(NULL);
win = make_rgb_db_window( dpy, 0, 0, 300, 300 );
setup_font( dpy );
glShadeModel( GL_FLAT );
glClearColor( 0.5, 0.5, 1.0, 1.0 );
XMapWindow( dpy, win );
event_loop( dpy );
return 0;
}
void myReshape(int w, int h)
{
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho (0.0, (GLfloat) w, 0.0, (GLfloat) h, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
/* Main Loop
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
{
auxInitDisplayMode (AUX_SINGLE | AUX_RGB);
auxInitPosition (0, 0, 500, 500);
if (!auxInitWindow (argv[0]))
auxQuit();
auxReshapeFunc (myReshape);
myinit ();
auxMainLoop(display);
return 0;
}

View File

@@ -29,7 +29,8 @@ INCDIR = ../include
LIBDIR = ../lib
SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \
tess_winding.c tess_clip.c
OBJECTS = $(SOURCES:.c=.o)

View File

@@ -19,9 +19,15 @@
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# $Id: Makefile.BeOS-R4,v 1.4 1999/09/17 00:06:57 brianp Exp $
# $Id: Makefile.BeOS-R4,v 1.5.2.1 1999/11/15 21:15:43 gareth Exp $
# $Log: Makefile.BeOS-R4,v $
# Revision 1.5.2.1 1999/11/15 21:15:43 gareth
# Added new tessellation polygon clipping file tess_clip.c
#
# Revision 1.5 1999/10/03 00:53:38 gareth
# Added tessellation winding rule files.
#
# Revision 1.4 1999/09/17 00:06:57 brianp
# version symbol changes
#
@@ -55,7 +61,8 @@ INCDIR = ../include
LIBDIR = ../lib
SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \
tess_winding.c tess_clip.c
OBJECTS = $(SOURCES:.c=.o)

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.5 1999/09/17 12:06:56 brianp Exp $
# $Id: Makefile.X11,v 1.6.2.1 1999/11/15 21:15:43 gareth Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -19,7 +19,8 @@ INCDIR = ../include
LIBDIR = ../lib
SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \
tess_winding.c tess_clip.c
OBJECTS = $(SOURCES:.c=.o)

64
src/glu/mesa/Makefile.m32 Normal file
View File

@@ -0,0 +1,64 @@
# Makefile for GLU for GCC-2.95.2/Mingw32 contributed by
# Paul Garceau <pgarceau@teleport.com>
# Mesa 3-D graphics library
# Version: 3.2
# Copyright (C) 1995-1999 Brian Paul
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
MESA_MAJOR=3
MESA_MINOR=2
MESA_TINY=0
VERSION=$(MESA_MAJOR).$(MESA_MINOR)
CFLAGS = -I. -DWIN32 -D__WIN32__ -D_WINDOWS \
-O2 -funroll-loops \
-fexpensive-optimizations -fomit-frame-pointer -ffast-math \
-malign-loops=2 -malign-jumps=2 -malign-functions=2 \
-mwindows
CC = gcc
MAKELIB = ar ru
GLU_LIB = libGLU.a
##### MACROS #####
VPATH = RCS
INCDIR = ../include
LIBDIR = ../lib
SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \
tess_winding.c tess_clip.c
OBJECTS = $(SOURCES:.c=.o)
##### RULES #####
.c.o:
$(CC) -c -I$(INCDIR) $(CFLAGS) $<
##### TARGETS #####
# Make the library:
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
$(MAKELIB) $(GLU_LIB) $(MAJOR) $(MINOR) $(TINY) $(OBJECTS)

View File

@@ -15,11 +15,12 @@ LIBDIR = [-.lib]
CFLAGS = /include=$(INCDIR)/define=(FBIND=1)
SOURCES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c \
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c
project.c quadric.c tess.c tess_fist.c tess_hash.c tess_heap.c \
tess_winding.c tess_clip.c
OBJECTS =glu.obj,mipmap.obj,nurbs.obj,nurbscrv.obj,nurbssrf.obj,nurbsutl.obj,\
project.obj,quadric.obj,tess.obj,tess_fist.obj,tess_hash.obj,\
tess_heap.obj
tess_heap.obj,tess_winding.obj,tess_clip.obj

View File

@@ -1,9 +1,9 @@
/* $Id: glu.c,v 1.15 1999/09/19 02:03:19 tjump Exp $ */
/* $Id: glu.c,v 1.16.2.5 2000/04/24 12:33:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Copyright (C) 1995-1999 Brian Paul
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,96 +21,6 @@
*/
/*
* $Log: glu.c,v $
* Revision 1.15 1999/09/19 02:03:19 tjump
* More Win32 build compliance fixups
*
* Revision 1.14 1999/09/17 12:21:53 brianp
* glGetProcAddressEXT changes to accomodate Win32 and non-Win32
*
* Revision 1.13 1999/09/17 03:17:18 tjump
* Patch error fixup
*
* Revision 1.12 1999/09/17 03:07:28 tjump
* Win32 build req't updates
*
* Revision 1.11 1999/09/17 01:00:38 brianp
* fixed typo
*
* Revision 1.10 1999/09/17 00:06:14 brianp
* gluGetProcAddressEXT change for C++ / BeOS
*
* Revision 1.9 1999/09/16 22:37:56 brianp
* added some casts in gluGetProcAddressEXT()
*
* Revision 1.8 1999/09/16 16:53:28 brianp
* clean-up of GLU_EXT_get_proc_address
*
* Revision 1.7 1999/09/14 00:11:40 brianp
* added gluCheckExtension()
*
* Revision 1.6 1999/09/13 14:31:32 joukj
*
* strcmp needs the string.h
*
* Revision 1.5 1999/09/11 12:04:54 brianp
* added 1.2 function to gluGetProcAddressEXT()
*
* Revision 1.4 1999/09/11 11:36:26 brianp
* added GLU_EXT_get_proc_address
*
* Revision 1.3 1999/09/10 04:32:10 gareth
* Fixed triangle output, recovery process termination.
*
* Revision 1.2 1999/09/10 02:03:31 gareth
* Added GLU 1.3 tessellation (except winding rule code).
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.13 1999/03/31 19:07:28 brianp
* added GL_EXT_abgr to extensions
*
* Revision 1.12 1999/02/06 06:12:41 brianp
* updated version string to 3.1
*
* Revision 1.11 1999/01/03 03:23:15 brianp
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
*
* Revision 1.10 1998/04/22 00:35:50 brianp
* changed version to 3.0
*
* Revision 1.9 1997/12/09 03:03:32 brianp
* changed version to 2.6
*
* Revision 1.8 1997/10/04 01:30:20 brianp
* changed version to 2.5
*
* Revision 1.7 1997/08/13 01:25:21 brianp
* changed version string to 2.4
*
* Revision 1.6 1997/07/24 01:28:44 brianp
* changed precompiled header symbol from PCH to PC_HEADER
*
* Revision 1.5 1997/07/13 22:59:11 brianp
* added const to viewport parameter of gluPickMatrix()
*
* Revision 1.4 1997/05/28 02:29:38 brianp
* added support for precompiled headers (PCH), inserted APIENTRY keyword
*
* Revision 1.3 1997/04/12 16:19:02 brianp
* changed version to 2.3
*
* Revision 1.2 1997/03/11 00:58:34 brianp
* changed version to 2.2
*
* Revision 1.1 1996/09/27 01:19:39 brianp
* Initial revision
*
*/
#ifdef PC_HEADER
#include "all.h"
#else
@@ -301,7 +211,7 @@ const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode )
"unconnected trim curves",
"unknown knot error",
"negative vertex count encountered",
"negative byte-stride encounteed",
"negative byte-stride encountered",
"unknown type descriptor",
"null control array or knot vector",
"duplicate point on pwlcurve"
@@ -364,8 +274,8 @@ const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode )
const GLubyte* GLAPIENTRY gluGetString( GLenum name )
{
static char *extensions = "GL_EXT_abgr GLU_EXT_get_proc_address";
static char *version = "1.2 Mesa 3.1";
static char *extensions = "GL_EXT_abgr";
static char *version = "1.2 Mesa 3.2";
switch (name) {
case GLU_EXTENSIONS:
@@ -379,7 +289,7 @@ const GLubyte* GLAPIENTRY gluGetString( GLenum name )
#ifdef GLU_EXT_get_proc_address
#if 0 /* gluGetProcAddressEXT not finalized yet! */
#ifdef __cplusplus
/* for BeOS R4.5 */

View File

@@ -1,4 +1,4 @@
/* $Id: gluP.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: gluP.h,v 1.1.1.1.2.1 1999/12/06 05:24:36 joukj Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,19 @@
/*
* $Log: gluP.h,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
* Revision 1.1.1.1.2.1 1999/12/06 05:24:36 joukj
*
* Committing in .
*
* Updating compilation on VMS
*
* Modified Files:
* Tag: mesa_3_2_dev
* Mesa/src-glu/descrip.mms Mesa/src-glu/gluP.h
* ----------------------------------------------------------------------
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.4 1999/01/03 03:23:15 brianp
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
@@ -55,6 +66,7 @@
#include "GL/gl.h"
#include "GL/glu.h"
#include <string.h>
#ifndef MESA
/* If we're using the real OpenGL header files... */

View File

@@ -1,9 +1,9 @@
/* $Id: mipmap.c,v 1.2 1999/09/14 00:30:28 brianp Exp $ */
/* $Id: mipmap.c,v 1.3.2.2 2000/02/28 14:51:39 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Copyright (C) 1995-1999 Brian Paul
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,56 +21,6 @@
*/
/*
* $Log: mipmap.c,v $
* Revision 1.2 1999/09/14 00:30:28 brianp
* fixed pixel packing/unpacking code in gluBuild2DMipmaps()
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.13 1999/03/05 17:49:06 brianp
* added support for GL_EXT_abgr (devernay@istar.fr)
*
* Revision 1.12 1999/01/03 03:23:15 brianp
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
*
* Revision 1.11 1998/09/18 02:44:03 brianp
* further changes to gluScaleImage() per Randy Frank
*
* Revision 1.10 1998/09/17 03:20:26 brianp
* fixed another bug in gluScaleImage() per Sven Panne
*
* Revision 1.9 1998/07/31 03:06:20 brianp
* tweaked the gluScaleImage() function per Randy Frank
*
* Revision 1.8 1998/07/08 01:02:53 brianp
* if gluBuildxDMipmaps() width or height <= 0 return GLU_INVALID_VALUE
*
* Revision 1.7 1998/07/01 00:18:02 brianp
* if gluBuildxDMipmaps() width or height <= 0 just return 0
*
* Revision 1.6 1998/06/01 01:06:41 brianp
* small update for Next/OpenStep from Alexander Mai
*
* Revision 1.5 1997/07/24 01:28:44 brianp
* changed precompiled header symbol from PCH to PC_HEADER
*
* Revision 1.4 1997/06/23 00:22:56 brianp
* added dummy() call to work around an MSVC 4.1 bug
*
* Revision 1.3 1997/05/28 02:29:38 brianp
* added support for precompiled headers (PCH), inserted APIENTRY keyword
*
* Revision 1.2 1997/05/24 13:32:25 brianp
* undef EPSILON in case it's already defined
*
* Revision 1.1 1996/09/27 01:19:39 brianp
* Initial revision
*
*/
#ifdef PC_HEADER
#include "all.h"
#else
@@ -105,9 +55,9 @@ void dummy(GLuint j, GLuint k){
GLint GLAPIENTRY gluScaleImage( GLenum format,
GLint widthin, GLint heightin,
GLsizei widthin, GLsizei heightin,
GLenum typein, const void *datain,
GLint widthout, GLint heightout,
GLsizei widthout, GLsizei heightout,
GLenum typeout, void *dataout )
{
GLint components, i, j, k;
@@ -135,9 +85,11 @@ GLint GLAPIENTRY gluScaleImage( GLenum format,
components = 2;
break;
case GL_RGB:
case GL_BGR:
components = 3;
break;
case GL_RGBA:
case GL_BGRA:
#ifdef GL_EXT_abgr
case GL_ABGR_EXT:
#endif
@@ -633,7 +585,7 @@ static GLint bytes_per_pixel( GLenum format, GLenum type )
* WARNING: This function isn't finished and has never been tested!!!!
*/
GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
GLint width, GLenum format,
GLsizei width, GLenum format,
GLenum type, const void *data )
{
GLubyte *texture;
@@ -699,19 +651,13 @@ GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
free( texture );
/* make sure remaining mipmap levels are removed */
for (l=levels;l<max_levels;l++) {
glTexImage1D( GL_TEXTURE_1D, l, components, 0, 0,
format, GL_UNSIGNED_BYTE, NULL );
}
return 0;
}
GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
GLint width, GLint height, GLenum format,
GLsizei width, GLsizei height, GLenum format,
GLenum type, const void *data )
{
GLint w, h, maxsize;

View File

@@ -1,9 +1,9 @@
/* $Id: nurbs.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: nurbs.c,v 1.1.1.1.2.1 2000/02/10 17:23:47 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Copyright (C) 1995-1999 Brian Paul
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,56 +21,6 @@
*/
/*
* $Log: nurbs.c,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
*
* Revision 1.14 1999/01/03 03:23:15 brianp
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
*
* Revision 1.13 1998/06/01 01:07:49 brianp
* small update for Next/OpenStep from Alexander Mai
*
* Revision 1.12 1998/03/15 18:14:30 brianp
* fixed a compiler cast warning
*
* Revision 1.11 1998/02/07 14:29:11 brianp
* fixed casting problem in gluNurbsCallback, again
*
* Revision 1.10 1998/02/04 00:21:20 brianp
* fixed cygnus compilation problem (Stephane Rehel)
*
* Revision 1.9 1998/01/16 03:35:26 brianp
* fixed Windows compilation warnings (Theodore Jump)
*
* Revision 1.8 1997/09/17 01:51:48 brianp
* changed glu*Callback() functions to match prototype in glu.h
*
* Revision 1.7 1997/07/24 01:28:44 brianp
* changed precompiled header symbol from PCH to PC_HEADER
*
* Revision 1.6 1997/07/24 01:26:31 brianp
* added CALLBACK keyword to gluNurbsCallback()
*
* Revision 1.5 1997/05/28 02:29:38 brianp
* added support for precompiled headers (PCH), inserted APIENTRY keyword
*
* Revision 1.4 1997/05/27 03:17:22 brianp
* minor clean-up
*
* Revision 1.3 1997/05/27 03:00:16 brianp
* incorporated Bogdan's new NURBS code
*
* Revision 1.2 1996/09/27 23:11:23 brianp
* ifdef'd out unimplemented trimmed nurbs code
*
* Revision 1.1 1996/09/27 01:19:39 brianp
* Initial revision
*
*/
/*
* NURBS implementation written by Bogdan Sikorski (bogdan@cira.it)
* See README2 for more info.
@@ -602,11 +552,7 @@ void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
void GLAPIENTRY
gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (GLCALLBACK *fn)())
{
#if defined(__CYGWIN32__) || defined(OPENSTEP)
nobj->error_callback = (void(*)(GLenum))fn;
#else
nobj->error_callback = (void(GLCALLBACK*)(GLenum))fn;
#endif
nobj->error_callback = (void(GLCALLBACKPCAST)(GLenum))fn;
if(which!=GLU_ERROR)
call_user_error(nobj,GLU_INVALID_ENUM);

View File

@@ -1,4 +1,4 @@
/* $Id: nurbs.h,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: nurbs.h,v 1.2 1999/11/11 03:21:43 kendallb Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,25 @@
/*
* $Log: nurbs.h,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
* Revision 1.2 1999/11/11 03:21:43 kendallb
*
* . Updated GL/gl.h with GLCALLACKP and GLAPIENTRYP macros for compatibility
* with the IBM VisualAge C++ compiler. Eventually some more code will be
* needed in the headers to enable the reversal of (__stdcall*) to (*__stdcall)
* for the IBM compilers, however we currently build using our own header files
* that already handle this.
*
* . Changed instances of (GLCALLBACK*) to GLCALLBACKP for compatibility
* with the IBM VisualAge C++ compiler in src-glu.
*
* . Misc cleanups for warnings generated with Watcom C++ in src-glu. Compiles
* with 0 warnings now.
*
* . tess_hash.c: line 244 - Why is this function stubbed out? I removed the
* code with a #if 0 to avoid a compiler warning, but it looks dangerous.
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.5 1999/02/27 13:55:31 brianp
* fixed BeOS-related GLU typedef problems
@@ -151,7 +168,7 @@ typedef struct
struct GLUnurbs {
GLboolean culling;
GLenum error;
void (GLCALLBACK *error_callback)( GLenum err );
void (GLCALLBACKP error_callback)( GLenum err );
GLenum display_mode;
GLU_nurbs_enum nurbs_type;
GLboolean auto_load_matrix;

View File

@@ -1,9 +1,9 @@
/* $Id: quadric.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: quadric.c,v 1.1.1.1.2.4 2000/02/10 17:23:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Copyright (C) 1995-1999 Brian Paul
* Version: 3.2
* Copyright (C) 1999-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,71 +21,6 @@
*/
/*
* $Log: quadric.c,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
*
* Revision 1.19 1999/02/27 13:55:31 brianp
* fixed BeOS-related GLU typedef problems
*
* Revision 1.18 1999/01/03 03:23:15 brianp
* now using GLAPIENTRY and GLCALLBACK keywords (Ted Jump)
*
* Revision 1.17 1999/01/03 03:19:15 brianp
* rewrote some of gluCylinder
*
* Revision 1.16 1998/06/01 01:08:36 brianp
* small update for Next/OpenStep from Alexander Mai
*
* Revision 1.15 1998/03/15 18:28:54 brianp
* reimplemented gluDisk() point and line mode
*
* Revision 1.14 1998/03/15 18:14:17 brianp
* fixed a compiler cast warning
*
* Revision 1.13 1998/02/07 14:28:34 brianp
* another change to gluQuadricCallback(), this time for StormC compiler
*
* Revision 1.12 1998/02/05 00:43:19 brianp
* Yes, still another change to gluQuadricCallback()!
*
* Revision 1.11 1998/02/04 00:27:43 brianp
* yet another change to gluQuadricCallback()!
*
* Revision 1.10 1998/02/04 00:23:23 brianp
* fixed CALLBACK problem in gluQuadricCallback() (Stephane Rehel)
*
* Revision 1.9 1998/02/04 00:20:09 brianp
* added missing (int) in ErrorFunc cast
*
* Revision 1.8 1998/01/16 03:37:51 brianp
* fixed another assignment warning in gluQuadricCallback()
*
* Revision 1.7 1998/01/16 03:35:26 brianp
* fixed Windows compilation warnings (Theodore Jump)
*
* Revision 1.6 1997/10/29 02:02:20 brianp
* various MS Windows compiler changes (David Bucciarelli, v20 3dfx driver)
*
* Revision 1.5 1997/09/17 01:51:48 brianp
* changed glu*Callback() functions to match prototype in glu.h
*
* Revision 1.4 1997/07/24 01:28:44 brianp
* changed precompiled header symbol from PCH to PC_HEADER
*
* Revision 1.3 1997/05/28 02:29:38 brianp
* added support for precompiled headers (PCH), inserted APIENTRY keyword
*
* Revision 1.2 1997/03/12 02:15:38 brianp
* fixed problem in gluPartialDisk() reported by Kenneth H. Carpenter
*
* Revision 1.1 1996/09/27 01:19:39 brianp
* Initial revision
*
*/
/* TODO:
* texture coordinate support
* flip normals according to orientation
@@ -228,7 +163,7 @@ void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj,
*/
if (qobj && which==GLU_ERROR) {
#ifdef __CYGWIN32__
qobj->ErrorFunc = (void(*)(int))fn;
qobj->ErrorFunc = (void(GLCALLBACKPCAST)(GLenum))fn;
#elif defined(OPENSTEP)
qobj->ErrorFunc = (void(*)(GLenum))fn;
#elif defined(_WIN32)
@@ -381,8 +316,8 @@ void GLAPIENTRY gluCylinder( GLUquadricObj *qobj,
for (i=0;i<=slices;i++) {
GLfloat x, y;
if (i == slices) {
x = sin(0);
y = cos(0);
x = sin(0.0);
y = cos(0.0);
}
else {
x = sin(i * da);
@@ -772,7 +707,7 @@ void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
for (loop=0; loop<loops; loop++) {
angle = DEG_TO_RAD(startAngle);
glBegin( GL_LINE_STRIP );
for (slice=0; slice<slices; slice++) {
for (slice=0; slice<=slices; slice++) {
glVertex2d( radius * sin(angle), radius * cos(angle) );
angle += delta_angle;
}
@@ -781,7 +716,7 @@ void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
}
/* draw spokes */
angle = DEG_TO_RAD(startAngle);
for (slice=0; slice<slices; slice++) {
for (slice=0; slice<=slices; slice++) {
radius = innerRadius;
glBegin( GL_LINE_STRIP );
for (loop=0; loop<loops; loop++) {
@@ -835,7 +770,7 @@ void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
for (loop=0; loop<loops; loop++) {
glBegin( GL_QUAD_STRIP );
angle = DEG_TO_RAD(startAngle);
for (slice=0; slice<slices; slice++) {
for (slice=0; slice<=slices; slice++) {
if (qobj->Orientation==GLU_OUTSIDE) {
glVertex2d( (radius+delta_radius)*sin(angle),
(radius+delta_radius)*cos(angle) );

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,21 @@
/* $Id: tess.h,v 1.8 1999/09/17 06:31:02 gareth Exp $ */
/* $Id: tess.h,v 1.15.2.6 1999/12/05 17:01:17 gareth Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
*
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -24,28 +24,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* $Log: tess.h,v $
* Revision 1.8 1999/09/17 06:31:02 gareth
* Winding rule updates.
*
* Revision 1.7 1999/09/16 06:42:01 gareth
* Misc winding rule bug fixes.
*
* Revision 1.6 1999/09/15 02:12:16 gareth
* Added debugging pragma message.
*
* Revision 1.5 1999/09/14 22:46:02 gareth
* Added debugging output.
*
* Revision 1.4 1999/09/13 22:20:13 gareth
* Fixed file headers. Tracking down macro bugs.
*
*/
/*****************************************************************************
*
* GLU 1.3 Polygon Tessellation by Gareth Hughes <garethh@lucent.com>
* GLU 1.3 Polygon Tessellation by Gareth Hughes <garethh@bell-labs.com>
*
*****************************************************************************/
@@ -58,6 +39,7 @@
#include "gluP.h"
#include "tess_typedefs.h"
#include "tess_macros.h"
#include "tess_hash.h"
#include "tess_heap.h"
#if 0
@@ -74,55 +56,74 @@ extern "C" {
struct GLUtesselator
{
tess_callbacks_t callbacks;
GLboolean boundary_only;
GLenum winding_rule;
GLboolean boundary_only;
GLdouble tolerance;
tess_plane_t plane;
GLuint contour_count;
GLenum orientation;
void *data;
GLint num_contours;
tess_contour_t *contours, *last_contour;
tess_contour_t *current_contour;
GLdouble mins[2], maxs[2];
GLuint vertex_count;
GLint num_vertices;
tess_vertex_t **sorted_vertices;
#if 0
tess_grid_t *grid; /* Not currently used... */
#endif
heap_t *ears;
hashtable_t *cvc_lists;
GLboolean edge_flag;
GLuint label;
tess_plane_t plane;
GLenum error;
};
/*****************************************************************************
* Tessellation error handler:
* Common tessellation functions:
*****************************************************************************/
extern void tess_error_callback( GLUtesselator *, GLenum, void * );
extern void tess_error_callback( GLUtesselator *, GLenum );
extern GLdouble twice_contour_area( tess_contour_t *contour );
extern void reverse_contour( tess_contour_t *contour );
extern void delete_contour( tess_contour_t **contour );
extern void contour_dump( tess_contour_t *contour );
/*****************************************************************************
* Debugging output: (to be removed...)
* Debugging output:
*****************************************************************************/
#ifdef DEBUG
extern int tess_debug_level;
int vdebugstr( char *format_str, ... );
extern int tess_dbg_level;
#pragma message( "tess: using DEBUGP for debugging output" )
#define DEBUGP(level, body) \
do { \
if ( tess_debug_level >= level ) { \
vdebugstr( "%11.11s:%-5d ", __FILE__, __LINE__, level ); \
vdebugstr body; \
fflush( stderr ); \
} \
} while ( 0 )
#define DEBUGIF(level) do { if ( tess_debug_level >= level ) {
#define DEBUGENDIF } } while ( 0 )
#define DBG_LEVEL_BASE 1
#define DBG_LEVEL_VERBOSE 10
#define DBG_LEVEL_ENTEREXIT 20
#ifdef _WIN32
#define DBG_STREAM stdout
#else
#define DEBUGP(level, body)
#define DEBUGIF(level) while(0) {
#define DEBUGENDIF }
#define DBG_STREAM stderr
#endif
#ifdef __GNUC__
#define MSG( level, format, args... ) \
if ( level <= tess_dbg_level ) { \
fprintf( DBG_STREAM, "%9.9s:%d:\t ", __FILE__, __LINE__ ); \
fprintf( DBG_STREAM, format, ## args ); \
fflush( DBG_STREAM ); \
}
#else
#define MSG tess_msg
#endif /* __GNUC__ */
#else
#define MSG tess_msg
#endif /* DEBUG */
extern INLINE void tess_msg( GLint level, char *format, ... );
extern INLINE void tess_info( char *file, GLint line );
#ifdef __cplusplus
}
#endif

View File

@@ -1,6 +1,5 @@
## BeOS Generic Makefile v2.0 ##
## Modified by Brian Paul to work with Mesa 3.1
## Fill in this file to specify the project being created, and the referenced
@@ -48,9 +47,8 @@ RSRCS=
# naming scheme you need to specify the path to the library
# and it's name
# library: my_lib.a entry: my_lib.a or path/my_lib.a
#LIBS= MesaGL MesaGLU be
LIBS= GL GLU be
# specify additional paths to directories following the standard
# libXXX.so or libXXX.a naming scheme. You can specify full paths
# or paths relative to the makefile. The paths included may not

View File

@@ -303,8 +303,7 @@ interruptibleXNextEvent(Display * dpy, XEvent * event)
}
FD_ZERO(&fds);
FD_SET(__glutConnectionFD, &fds);
rc = select(__glutConnectionFD + 1, &fds,
NULL, NULL, NULL);
rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, NULL);
if (rc < 0) {
if (errno == EINTR) {
return 0;
@@ -897,8 +896,7 @@ waitForSomething(void)
waittime = zerotime;
}
#if !defined(_WIN32)
rc = select(__glutConnectionFD + 1, &fds,
NULL, NULL, &waittime);
rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, &waittime);
if (rc < 0 && errno != EINTR)
__glutFatalError("select error.");
#else

View File

@@ -20,7 +20,9 @@
#include <X11/Xutil.h>
#else
#include <windows.h>
#ifndef __CYGWIN32__
#include <mmsystem.h> /* Win32 Multimedia API header. */
#endif
#endif /* !_WIN32 */
#include "glutint.h"

View File

@@ -7,8 +7,10 @@
#ifdef _WIN32
#include <windows.h>
#ifndef __CYGWIN32__
#include <mmsystem.h> /* Win32 Multimedia API header. */
#endif
#endif
#include "glutint.h"

View File

@@ -24,7 +24,7 @@
#define GLUT_BUILDING_LIB /* Building the GLUT library itself. */
#include <GL/glut.h>
#if defined( MESA ) && defined( _WIN32 )
#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
#include <gl/mesa_wgl.h>
#endif
@@ -71,7 +71,7 @@ extern int sys$gettim(struct timeval *);
#endif
#else
#include <sys/types.h>
#if !defined(_WIN32)
#if !defined(_WIN32) || defined(__CYGWIN32__)
#include <sys/time.h>
#else
#include <winsock.h>

View File

@@ -40,9 +40,57 @@
#define XA_STRING 0
/* Private routines from win32_util.c */
#ifndef __CYGWIN32__
extern int gettimeofday(struct timeval* tp, void* tzp);
#endif
extern void *__glutFont(void *font);
extern int __glutGetTransparentPixel(Display *dpy, XVisualInfo *vinfo);
extern void __glutAdjustCoords(Window parent, int *x, int *y, int *width, int *height);
/* Cygwin B20.1 misses the following definitions */
#ifdef __CYGWIN32__
/* from winuser.h */
#define CDS_FULLSCREEN 4
/* from mmsystem.h */
#define WINMMAPI __declspec(dllimport)
typedef UINT MMRESULT;
#define MM_JOY1MOVE 0x3A0
#define MM_JOY1ZMOVE 0x3A2
#define MM_JOY1BUTTONDOWN 0x3B5
#define MM_JOY1BUTTONUP 0x3B7
#define JOYERR_NOERROR 0
#define JOYERR_PARMS 165
#define JOY_RETURNALL 0x000000ffl
#define JOYSTICKID1 0
typedef struct joyinfoex_tag {
DWORD dwSize; /* size of structure */
DWORD dwFlags; /* flags to indicate what to return */
DWORD dwXpos; /* x position */
DWORD dwYpos; /* y position */
DWORD dwZpos; /* z position */
DWORD dwRpos; /* rudder/4th axis position */
DWORD dwUpos; /* 5th axis position */
DWORD dwVpos; /* 6th axis position */
DWORD dwButtons; /* button states */
DWORD dwButtonNumber; /* current button number pressed */
DWORD dwPOV; /* point of view state */
DWORD dwReserved1; /* reserved for communication between winmm & driver */
DWORD dwReserved2; /* reserved for future expansion */
} JOYINFOEX, *PJOYINFOEX, /* NEAR */ *NPJOYINFOEX, /* FAR */ *LPJOYINFOEX;
WINMMAPI MMRESULT WINAPI joyGetPosEx( UINT uJoyID, LPJOYINFOEX pji);
WINMMAPI MMRESULT WINAPI joyReleaseCapture( UINT uJoyID);
WINMMAPI MMRESULT WINAPI joySetCapture( HWND hwnd, UINT uJoyID, UINT uPeriod, BOOL fChanged);
WINMMAPI MMRESULT WINAPI joySetThreshold( UINT uJoyID, UINT uThreshold);
#endif
#endif /* __glutwin32_h__ */

View File

@@ -129,26 +129,29 @@ __glutXGetLayerVisualInfo(Display * dpy, long lvinfo_mask,
break;
}
}
if (lvinfo_mask & VisualLayerMask)
if (lvinfo_mask & VisualLayerMask) {
if (overlayInfo == NULL) {
if (lvinfo_template->layer != 0)
continue;
} else if (lvinfo_template->layer != overlayInfo->layer)
continue;
if (lvinfo_mask & VisualTransparentType)
}
if (lvinfo_mask & VisualTransparentType) {
if (overlayInfo == NULL) {
if (lvinfo_template->type != None)
continue;
} else if (lvinfo_template->type !=
overlayInfo->transparent_type)
continue;
if (lvinfo_mask & VisualTransparentValue)
}
if (lvinfo_mask & VisualTransparentValue) {
if (overlayInfo == NULL)
/* Non-overlay visuals have no sense of
TransparentValue. */
continue;
else if (lvinfo_template->value != overlayInfo->value)
continue;
}
layerInfo[count].vinfo = *pVinfo;
if (overlayInfo == NULL) {
layerInfo[count].layer = 0;

View File

@@ -11,11 +11,7 @@
#include "glutint.h"
#include "glutstroke.h"
#include "glutbitmap.h"
#if defined(__CYGWIN32__)
typedef MINMAXINFO* LPMINMAXINFO;
#else
#include <sys/timeb.h>
#endif
/* The following added by Paul Garceau <pgarceau@teleport.com> */
#if defined(__MINGW32__)
@@ -27,6 +23,7 @@ struct timeval;
extern StrokeFontRec glutStrokeRoman, glutStrokeMonoRoman;
extern BitmapFontRec glutBitmap8By13, glutBitmap9By15, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18;
#ifndef __CYGWIN32__
int
gettimeofday(struct timeval* tp, void* tzp)
{
@@ -39,6 +36,7 @@ gettimeofday(struct timeval* tp, void* tzp)
/* 0 indicates that the call succeeded. */
return 0;
}
#endif
/* To get around the fact that Microsoft DLLs only allow functions
to be exported and now data addresses (as Unix DSOs support), the

View File

@@ -8,13 +8,9 @@
#include "glutint.h"
#if defined(__CYGWIN32__)
typedef MINMAXINFO* LPMINMAXINFO;
#else
#include <sys/timeb.h>
#endif
#ifdef _WIN32
#if defined(_WIN32) && !defined(__CYGWIN32__)
#include <mmsystem.h> /* Win32 Multimedia API header. */
#endif

View File

@@ -1,59 +1 @@
# Makefile for OpenGL widgets
# NOTE: widget code is from SGI. See any of the .c or .h files for the
# complete copyright. Mesa's GNU copyright DOES NOT apply to this widget
# code.
##### MACROS #####
VPATH = RCS
INCDIRS = -I../include -I/usr/include/Motif1.2 -I/usr/X11R6/include
LIBDIR = ../lib
SOURCES = GLwDrawA.c GLwMDrawA.c
OBJECTS = $(SOURCES:.c=.o)
##### RULES #####
.c.o:
$(CC) -c $(INCDIRS) $(CFLAGS) $<
##### TARGETS #####
default:
@echo "Specify a target configuration"
clean:
-rm *.o *~
# The name of the library file comes from Make-config
#XXX GLW_LIB = libGLw.a
targets: $(LIBDIR)/$(GLW_LIB)
# Make the library
$(LIBDIR)/$(GLW_LIB): $(OBJECTS)
$(MAKELIB) $(GLW_LIB) $(MAJOR) $(MINOR) $(OBJECTS)
mv $(GLW_LIB)* $(LIBDIR)
include ../Make-config
include depend
#
# Run 'make depend' to update the dependencies if you change what's included
# by any source file.
#
dep: $(SOURCES)
makedepend -fdepend -Y -I../include $(SOURCES)
include Makefile.X11

64
src/glw/Makefile.X11 Normal file
View File

@@ -0,0 +1,64 @@
# Makefile for OpenGL widgets
# NOTE: widget code is from SGI. See any of the .c or .h files for the
# complete copyright. Mesa's GNU copyright DOES NOT apply to this widget
# code.
##### MACROS #####
MAJOR = 1
MINOR = 0
TINY = 0
VPATH = RCS
INCDIRS = -I../include -I/usr/include/Motif1.2 -I/usr/X11R6/include
LIBDIR = ../lib
# Compile GLwMDrawA.c only if you have Motif headers!
#SOURCES = GLwDrawA.c GLwMDrawA.c
SOURCES = GLwDrawA.c
OBJECTS = $(SOURCES:.c=.o)
##### RULES #####
.c.o:
$(CC) -c $(INCDIRS) $(CFLAGS) $<
##### TARGETS #####
default:
@echo "Specify a target configuration"
clean:
-rm *.o *~
targets: $(LIBDIR)/$(GLW_LIB)
# Make the library
$(LIBDIR)/$(GLW_LIB): $(OBJECTS)
$(MAKELIB) $(GLW_LIB) $(MAJOR) $(MINOR) $(TINY) $(OBJECTS)
mv $(GLW_LIB)* $(LIBDIR)
-mv *.a $(LIBDIR)
include ../Make-config
include depend
#
# Run 'make depend' to update the dependencies if you change what's included
# by any source file.
#
dep: $(SOURCES)
makedepend -fdepend -Y -I../include $(SOURCES)

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.5 1999/09/17 12:07:10 brianp Exp $
# $Id: Makefile.X11,v 1.6.2.2 2000/01/23 17:47:00 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -46,6 +46,7 @@ CORE_SOURCES = \
feedback.c \
fog.c \
get.c \
glmisc.c \
hash.c \
image.c \
light.c \
@@ -53,7 +54,6 @@ CORE_SOURCES = \
logic.c \
masking.c \
matrix.c \
misc.c \
mmath.c \
mthreads.c \
pb.c \
@@ -104,6 +104,11 @@ DRIVER_SOURCES = \
X/xmesa4.c \
OSmesa/osmesa.c \
SVGA/svgamesa.c \
SVGA/svgamesa8.c \
SVGA/svgamesa15.c \
SVGA/svgamesa16.c \
SVGA/svgamesa24.c \
SVGA/svgamesa32.c \
FX/fxapi.c \
FX/fxclip.c \
FX/fxcva.c \
@@ -220,7 +225,8 @@ X86/3dnow.o: X86/3dnow.c
# @echo "Specify a target configuration"
clean:
-rm *.o *~ */*.o */*~
-rm *.o *~ */*.o */*~ *.lo *.la
-rm -rf .libs
targets: $(LIBDIR)/$(GL_LIB)

View File

@@ -0,0 +1,8 @@
genkgi.conf
.deps
.libs
Makefile
Makefile.in
*.lo
*.o
*.la

View File

@@ -0,0 +1,8 @@
fbdev.conf
.deps
.libs
Makefile
Makefile.in
*.lo
*.o
*.la

View File

@@ -0,0 +1,7 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.o
*.la

View File

@@ -0,0 +1,7 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.o
*.la

View File

@@ -0,0 +1,7 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.o
*.la

View File

@@ -1,24 +1,52 @@
/* -*- mode: C; tab-width:8; -*-
fxapi.c - 3Dfx VooDoo/Mesa interface
*/
/* -*- mode: C; tab-width:8; -*- */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* Mesa 3-D graphics library
* Version: 3.1
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
********************************************************************
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
* terms stated above.
*
* Thank you for your contribution, David!
*
* Please make note of the above copyright/license statement. If you
* contributed code or bug fixes to this code under the previous (GNU
* Library) license and object to the new license, your code will be
* removed at your request. Please see the Mesa docs/COPYRIGHT file
* for more information.
*
* Additional Mesa/3Dfx driver developers:
* Daryll Strauss <daryll@precisioninsight.com>
* Keith Whitwell <keith@precisioninsight.com>
*
* See fxapi.h for more revision/author details.
*/
/* fxapi.c - 3Dfx VooDoo/Mesa interface */
/********************************************************************
*
* Function names:
* fxMesa.... (The driver API)
@@ -820,336 +848,311 @@ void fxsignals()
/*
* Create a new FX/Mesa context and return a handle to it.
*/
fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,GrScreenResolution_t res,
GrScreenRefresh_t ref,
const GLint attribList[])
fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win,
GrScreenResolution_t res,
GrScreenRefresh_t ref,
const GLint attribList[])
{
fxMesaContext fxMesa;
int i,type;
int aux;
GLboolean doubleBuffer=GL_FALSE;
GLboolean alphaBuffer=GL_FALSE;
GLboolean verbose=GL_FALSE;
GLint depthSize=0;
GLint stencilSize=0;
GLint accumSize=0;
GLcontext *shareCtx = NULL;
GLcontext *ctx = 0;
FX_GrContext_t glideContext = 0;
char *errorstr;
fxMesaContext fxMesa = NULL;
int i,type;
int aux;
GLboolean doubleBuffer=GL_FALSE;
GLboolean alphaBuffer=GL_FALSE;
GLboolean verbose=GL_FALSE;
GLint depthSize=0;
GLint stencilSize=0;
GLint accumSize=0;
GLcontext *shareCtx = NULL;
GLcontext *ctx = 0;
/*FX_GrContext_t glideContext = 0;*/
char *errorstr;
GLboolean useBGR;
char *system = NULL;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaCreateContext() Start\n");
}
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaCreateContext() Start\n");
}
if(getenv("MESA_FX_INFO"))
verbose=GL_TRUE;
if(getenv("MESA_FX_INFO"))
verbose=GL_TRUE;
aux=0;
i=0;
while(attribList[i]!=FXMESA_NONE) {
switch (attribList[i]) {
case FXMESA_DOUBLEBUFFER:
doubleBuffer=GL_TRUE;
break;
case FXMESA_ALPHA_SIZE:
i++;
alphaBuffer=attribList[i]>0;
if(alphaBuffer)
aux=1;
break;
case FXMESA_DEPTH_SIZE:
i++;
depthSize=attribList[i];
if(depthSize)
aux=1;
break;
case FXMESA_STENCIL_SIZE:
i++;
stencilSize=attribList[i];
break;
case FXMESA_ACCUM_SIZE:
i++;
accumSize=attribList[i];
break;
/* XXX ugly hack here for sharing display lists */
aux=0;
i=0;
while(attribList[i]!=FXMESA_NONE) {
switch (attribList[i]) {
case FXMESA_DOUBLEBUFFER:
doubleBuffer=GL_TRUE;
break;
case FXMESA_ALPHA_SIZE:
i++;
alphaBuffer=attribList[i]>0;
if(alphaBuffer)
aux=1;
break;
case FXMESA_DEPTH_SIZE:
i++;
depthSize=attribList[i];
if(depthSize)
aux=1;
break;
case FXMESA_STENCIL_SIZE:
i++;
stencilSize=attribList[i];
break;
case FXMESA_ACCUM_SIZE:
i++;
accumSize=attribList[i];
break;
/* XXX ugly hack here for sharing display lists */
#define FXMESA_SHARE_CONTEXT 990099 /* keep in sync with xmesa1.c! */
case FXMESA_SHARE_CONTEXT:
case FXMESA_SHARE_CONTEXT:
i++;
{
const void *vPtr = &attribList[i];
GLcontext **ctx = (GLcontext **) vPtr;
shareCtx = *ctx;
}
break;
default:
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaCreateContext() End (defualt)\n");
}
return NULL;
}
i++;
{
const void *vPtr = &attribList[i];
GLcontext **ctx = (GLcontext **) vPtr;
shareCtx = *ctx;
}
break;
default:
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaCreateContext() End (defualt)\n");
}
}
/* A workaround for Linux GLQuake */
if(depthSize && alphaBuffer)
alphaBuffer=0;
if(verbose)
fprintf(stderr,"Mesa fx Voodoo Device Driver v0.30\nWritten by David Bucciarelli (davibu@tin.it.it)\n");
if((type=fxQueryHardware()) < 0) {
fprintf(stderr,"fx Driver: ERROR no Voodoo1/2 Graphics or Voodoo Rush !\n");
return NULL;
}
i++;
}
}
/* A workaround for Linux GLQuake */
if(depthSize && alphaBuffer)
alphaBuffer=0;
if(verbose)
fprintf(stderr,"Mesa fx Voodoo Device Driver v0.30\nWritten by David Bucciarelli (davibu@tin.it.it)\n");
if((type=fxQueryHardware()) >= 0) {
if(type==GR_SSTTYPE_VOODOO)
if(type==GR_SSTTYPE_VOODOO)
win=0;
grSstSelect(glbCurrentBoard);
grSstSelect(glbCurrentBoard);
fxMesa=(fxMesaContext)calloc(1,sizeof(struct tfxMesaContext));
if(!fxMesa) {
errorstr = "malloc";
goto errorhandler;
}
if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO)
fxMesa->haveTwoTMUs=(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx > 1);
else if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96)
fxMesa->haveTwoTMUs=(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx > 1);
else
fxMesa->haveTwoTMUs=GL_FALSE;
fxMesa->haveDoubleBuffer=doubleBuffer;
fxMesa->haveAlphaBuffer=alphaBuffer;
fxMesa->haveGlobalPaletteTexture=GL_FALSE;
fxMesa->haveZBuffer=depthSize ? 1 : 0;
fxMesa->verbose=verbose;
fxMesa->board=glbCurrentBoard;
#if FXMESA_USE_ARGB
glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
GR_COLORFORMAT_ARGB,GR_ORIGIN_LOWER_LEFT,2,aux);
fxMesa->glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
GR_COLORFORMAT_ARGB,
GR_ORIGIN_LOWER_LEFT,
2,aux);
#else
glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
GR_COLORFORMAT_ABGR,GR_ORIGIN_LOWER_LEFT,2,aux);
fxMesa->glideContext = FX_grSstWinOpen((FxU32)win,res,ref,
GR_COLORFORMAT_ABGR,
GR_ORIGIN_LOWER_LEFT,
2,aux);
#endif
if (!glideContext){
if (!fxMesa->glideContext){
errorstr = "grSstWinOpen";
goto errorhandler;
}
}
/*
* Pixel tables are use during pixel read-back
* Either initialize them for RGB or BGR order.
*/
#if FXMESA_USE_ARGB
useBGR = GL_FALSE; /* Force RGB pixel order */
system = "FXMESA_USE_ARGB";
#else
if (glbHWConfig.SSTs[glbCurrentBoard].type == GR_SSTTYPE_VOODOO) {
/* jk991130 - Voodoo 3s don't use BGR. Query the # of TMUs
* as Voodoo3s have 2 TMUs on board, Banshee has only 1
* bk000413 - another suggestion from Joseph Kain is using
* VendorID 0x121a for all 3dfx boards
* DeviceID VG 1/V2 2/VB 3/V3 5
* For now we cehck for known BGR devices, and presume
* everything else to be a V3/RGB.
*/
GrVoodooConfig_t *voodoo;
voodoo = &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig;
if(verbose)
if (voodoo->nTexelfx == 1) {
/* Voodoo1 or Banshee */
useBGR = GL_TRUE;
system = "Voodoo1";
}
else if (voodoo->nTexelfx == 2 &&
voodoo->fbiRev == 260 &&
voodoo->tmuConfig[0].tmuRev == 4 &&
voodoo->tmuConfig[0].tmuRam == 2) {
/* Voodoo 2 */
useBGR = GL_TRUE;
system = "Voodoo2";
}
else if (voodoo->nTexelfx == 2 &&
voodoo->fbiRev == 2 &&
voodoo->tmuConfig[0].tmuRev == 1 &&
voodoo->tmuConfig[0].tmuRam == 4) {
/* Quantum3D Obsidian 50/100 */
useBGR = GL_TRUE;
system = "Quantum3D Obsidian";
}
else
/* Brian
* (voodoo->nTexelfx == 2 &&
* voodoo->fbiRev == 0 &&
* voodoo->tmuConfig[0].tmuRev == 148441048 &&
* voodoo->tmuConfig[0].tmuRam == 3)
* Bernd
* (voodoo->nTexelfx == 2 &&
* voodoo->fbiRev == 69634 &&
* voodoo->tmuConfig[0].tmuRev == 69634 &&
* voodoo->tmuConfig[0].tmuRam == 2 )
*/
{
/* Presumed Voodoo3 */
useBGR = GL_FALSE;
system = "Voodoo3";
}
if (getenv("MESA_FX_INFO")) {
printf("Voodoo: Texelfx: %d / FBI Rev.: %d / TMU Rev.: %d / TMU RAM: %d\n",
voodoo->nTexelfx,
voodoo->fbiRev,
voodoo->tmuConfig[0].tmuRev,
voodoo->tmuConfig[0].tmuRam );
}
}
else {
useBGR = GL_FALSE; /* use RGB pixel order otherwise */
system = "non-voodoo";
}
#endif /*FXMESA_USE_ARGB*/
if (getenv("MESA_FX_INFO"))
printf("Voodoo pixel order: %s (%s)\n", useBGR ? "BGR" : "RGB", system);
fxInitPixelTables(fxMesa, useBGR);
fxMesa->width=FX_grSstScreenWidth();
fxMesa->height=FX_grSstScreenHeight();
fxMesa->clipMinX = 0;
fxMesa->clipMaxX = fxMesa->width;
fxMesa->clipMinY = 0;
fxMesa->clipMaxY = fxMesa->height;
fxMesa->screen_width = fxMesa->width;
fxMesa->screen_height = fxMesa->height;
fxMesa->x_offset = 0;
fxMesa->y_offset = 0;
fxMesa->y_delta = 0;
fxMesa->needClip = 0;
if(verbose)
fprintf(stderr,"Glide screen size: %dx%d\n",
(int)FX_grSstScreenWidth(),(int)FX_grSstScreenHeight());
} else {
fprintf(stderr,"fx Driver: ERROR no Voodoo1/2 Graphics or Voodoo Rush !\n");
return NULL;
}
fxMesa=(fxMesaContext)calloc(1,sizeof(struct tfxMesaContext));
if(!fxMesa) {
errorstr = "malloc";
goto errorhandler;
}
FX_setupGrVertexLayout();
fxMesa->glideContext = glideContext;
fxMesa->board=glbCurrentBoard;
fxMesa->width=FX_grSstScreenWidth();
fxMesa->height=FX_grSstScreenHeight();
fxMesa->glVis=gl_create_visual(GL_TRUE, /* RGB mode */
alphaBuffer,
doubleBuffer,
GL_FALSE, /* stereo */
depthSize, /* depth_size */
stencilSize, /* stencil_size */
accumSize, /* accum_size */
0, /* index bits */
5,6,5,0); /* RGBA bits */
if (!fxMesa->glVis) {
errorstr = "gl_create_visual";
goto errorhandler;
}
fxMesa->verbose=verbose;
if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO)
fxMesa->haveTwoTMUs=(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx > 1);
else if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96)
fxMesa->haveTwoTMUs=(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx > 1);
else
fxMesa->haveTwoTMUs=GL_FALSE;
if (getenv("FX_EMULATE_SINGLE_TMU")) {
if (MESA_VERBOSE&VERBOSE_DRIVER)
fprintf(stderr, "\n\nEmulating single tmu\n\n");
fxMesa->haveTwoTMUs = GL_FALSE;
}
fxMesa->emulateTwoTMUs = fxMesa->haveTwoTMUs;
if (!getenv("FX_DONT_FAKE_MULTITEX")) {
if (MESA_VERBOSE&VERBOSE_DRIVER) {
if (!fxMesa->haveTwoTMUs)
fprintf(stderr, "\n\nEmulating multitexture\n\n");
}
fxMesa->emulateTwoTMUs = GL_TRUE;
}
fxMesa->haveDoubleBuffer=doubleBuffer;
fxMesa->haveAlphaBuffer=alphaBuffer;
fxMesa->haveGlobalPaletteTexture=GL_FALSE;
if(getenv("FX_GLIDE_SWAPINTERVAL"))
fxMesa->swapInterval=atoi(getenv("FX_GLIDE_SWAPINTERVAL"));
else
fxMesa->swapInterval=1;
if(getenv("MESA_FX_SWAP_PENDING"))
fxMesa->maxPendingSwapBuffers=atoi(getenv("MESA_FX_SWAP_PENDING"));
else
fxMesa->maxPendingSwapBuffers=2;
fxMesa->color=0xffffffff;
fxMesa->clearC=0;
fxMesa->clearA=0;
fxMesa->stats.swapBuffer=0;
fxMesa->stats.reqTexUpload=0;
fxMesa->stats.texUpload=0;
fxMesa->stats.memTexUpload=0;
fxMesa->tmuSrc=FX_TMU_NONE;
fxMesa->lastUnitsMode=FX_UM_NONE;
fxTMInit(fxMesa);
/* FX units setup */
fxMesa->unitsState.alphaTestEnabled=GL_FALSE;
fxMesa->unitsState.alphaTestFunc=GR_CMP_ALWAYS;
fxMesa->unitsState.alphaTestRefValue=0;
fxMesa->unitsState.blendEnabled=GL_FALSE;
fxMesa->unitsState.blendSrcFuncRGB=GR_BLEND_ONE;
fxMesa->unitsState.blendDstFuncRGB=GR_BLEND_ZERO;
fxMesa->unitsState.blendSrcFuncAlpha=GR_BLEND_ONE;
fxMesa->unitsState.blendDstFuncAlpha=GR_BLEND_ZERO;
fxMesa->unitsState.depthTestEnabled =GL_FALSE;
fxMesa->unitsState.depthMask =GL_TRUE;
fxMesa->unitsState.depthTestFunc =GR_CMP_LESS;
grColorMask(FXTRUE,alphaBuffer ? FXTRUE : FXFALSE);
if(doubleBuffer) {
fxMesa->currentFB=GR_BUFFER_BACKBUFFER;
grRenderBuffer(GR_BUFFER_BACKBUFFER);
} else {
fxMesa->currentFB=GR_BUFFER_FRONTBUFFER;
grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
fxMesa->state = NULL;
fxMesa->fogTable = NULL;
fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE));
fxMesa->fogTable = malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES)*sizeof(GrFog_t));
if (!fxMesa->state || !fxMesa->fogTable) {
errorstr = "malloc";
goto errorhandler;
}
if(depthSize)
grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
#if (!FXMESA_USE_ARGB)
grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); /* Not every Glide supports this */
#endif
fxMesa->glVis=gl_create_visual(GL_TRUE, /* RGB mode */
alphaBuffer,
doubleBuffer,
GL_FALSE, /* stereo */
depthSize, /* depth_size */
stencilSize, /* stencil_size */
accumSize, /* accum_size */
0, /* index bits */
5,6,5,0); /* RGBA bits */
if (!fxMesa->glVis) {
errorstr = "gl_create_visual";
goto errorhandler;
}
ctx = fxMesa->glCtx=gl_create_context(fxMesa->glVis,
shareCtx, /* share list context */
(void *) fxMesa, GL_TRUE);
if (!ctx) {
errorstr = "gl_create_context";
goto errorhandler;
}
fxMesa->glBuffer=gl_create_framebuffer(fxMesa->glVis);
if (!fxMesa->glBuffer) {
errorstr = "gl_create_framebuffer";
goto errorhandler;
}
fxMesa->glCtx->Const.MaxTextureLevels=9;
fxMesa->glCtx->Const.MaxTextureSize=256;
fxMesa->glCtx->Const.MaxTextureUnits=fxMesa->emulateTwoTMUs ? 2 : 1;
fxMesa->glCtx->NewState|=NEW_DRVSTATE1;
fxMesa->new_state = NEW_ALL;
fxDDSetupInit();
fxDDCvaInit();
fxDDClipInit();
fxDDTrifuncInit();
fxDDFastPathInit();
fxSetupDDPointers(fxMesa->glCtx);
fxDDRenderInit(fxMesa->glCtx);
fxDDInitExtensions(fxMesa->glCtx);
fxDDSetNearFar(fxMesa->glCtx,1.0,100.0);
grGlideGetState((GrState*)fxMesa->state);
/* XXX Fix me: callback not registered when main VB is created.
*/
if (fxMesa->glCtx->VB)
fxDDRegisterVB( fxMesa->glCtx->VB );
/* XXX Fix me too: need to have the 'struct dd' prepared prior to
* creating the context... The below is broken if you try to insert
* new stages.
*/
if (ctx->NrPipelineStages)
ctx->NrPipelineStages = fxDDRegisterPipelineStages( ctx->PipelineStage,
ctx->PipelineStage,
ctx->NrPipelineStages);
glbTotNumCtx++;
/* Run the config file */
gl_context_initialize( fxMesa->glCtx );
/* install signal handlers */
#if defined(__linux__)
if (fxMesa->glCtx->CatchSignals) {
signal(SIGINT,cleangraphics_handler);
signal(SIGHUP,cleangraphics_handler);
signal(SIGPIPE,cleangraphics_handler);
signal(SIGFPE,cleangraphics_handler);
signal(SIGBUS,cleangraphics_handler);
signal(SIGILL,cleangraphics_handler);
signal(SIGSEGV,cleangraphics_handler);
signal(SIGTERM,cleangraphics_handler);
}
#endif
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaCreateContext() End\n");
}
return fxMesa;
errorhandler:
if (fxMesa) {
if (fxMesa->glideContext)
FX_grSstWinClose(fxMesa->glideContext);
fxMesa->glideContext = 0;
if (fxMesa->state)
free(fxMesa->state);
if (fxMesa && fxMesa->fogTable)
free(fxMesa->fogTable);
if (fxMesa->glBuffer)
gl_destroy_framebuffer(fxMesa->glBuffer);
if (fxMesa->glVis)
gl_destroy_visual(fxMesa->glVis);
if (fxMesa->glCtx)
gl_destroy_context(fxMesa->glCtx);
free(fxMesa);
ctx = fxMesa->glCtx=gl_create_context(fxMesa->glVis,
shareCtx, /* share list context */
(void *) fxMesa, GL_TRUE);
if (!ctx) {
errorstr = "gl_create_context";
goto errorhandler;
}
if (!fxDDInitFxMesaContext( fxMesa )) {
errorstr = "fxDDInitFxMesaContext failed";
goto errorhandler;
}
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fxMesa->glBuffer=gl_create_framebuffer(fxMesa->glVis);
if (!fxMesa->glBuffer) {
errorstr = "gl_create_framebuffer";
goto errorhandler;
}
glbTotNumCtx++;
/* install signal handlers */
#if defined(__linux__)
/* Only install if environment var. is not set. */
if (fxMesa->glCtx->CatchSignals && !getenv("MESA_FX_NO_SIGNALS")) {
signal(SIGINT,cleangraphics_handler);
signal(SIGHUP,cleangraphics_handler);
signal(SIGPIPE,cleangraphics_handler);
signal(SIGFPE,cleangraphics_handler);
signal(SIGBUS,cleangraphics_handler);
signal(SIGILL,cleangraphics_handler);
signal(SIGSEGV,cleangraphics_handler);
signal(SIGTERM,cleangraphics_handler);
}
#endif
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaCreateContext() End\n");
}
return fxMesa;
errorhandler:
if (fxMesa) {
if (fxMesa->glideContext)
FX_grSstWinClose(fxMesa->glideContext);
fxMesa->glideContext = 0;
if (fxMesa->state)
free(fxMesa->state);
if (fxMesa->fogTable)
free(fxMesa->fogTable);
if (fxMesa->glBuffer)
gl_destroy_framebuffer(fxMesa->glBuffer);
if (fxMesa->glVis)
gl_destroy_visual(fxMesa->glVis);
if (fxMesa->glCtx)
gl_destroy_context(fxMesa->glCtx);
free(fxMesa);
}
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxMesaCreateContext() End (%s)\n",errorstr);
}
return NULL;
}
return NULL;
}
@@ -1324,7 +1327,7 @@ int GLAPIENTRY fxQueryHardware(void)
char buf[80];
FX_grGlideGetVersion(buf);
fprintf(stderr,"Using Glide V%s\n",0);
fprintf(stderr,"Using Glide V%s\n","");
fprintf(stderr,"Number of boards: %d\n",glbHWConfig.num_sst);
if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO) {
@@ -1334,6 +1337,8 @@ int GLAPIENTRY fxQueryHardware(void)
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbRam);
fprintf(stderr,"Number of TMUs: %d\n",
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx);
fprintf(stderr,"fbiRev: %d\n",
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbiRev);
fprintf(stderr,"SLI detected: %d\n",
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.sliDetect);
} else if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96) {
@@ -1352,7 +1357,10 @@ int GLAPIENTRY fxQueryHardware(void)
#if defined(__WIN32__)
onexit((_onexit_t)cleangraphics);
#elif defined(__linux__)
atexit(cleangraphics);
/* Only register handler if environment variable is not defined. */
if (!getenv("MESA_FX_NO_SIGNALS")) {
atexit(cleangraphics);
}
#endif
}

View File

@@ -1,38 +1,102 @@
/* -*- mode: C; tab-width:8; -*-
fxdd.c - 3Dfx VooDoo Mesa device driver functions
*/
/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* Mesa 3-D graphics library
* Version: 3.1
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* See the file fxapi.c for more informations about authors
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
* terms stated above.
*
* Thank you for your contribution, David!
*
* Please make note of the above copyright/license statement. If you
* contributed code or bug fixes to this code under the previous (GNU
* Library) license and object to the new license, your code will be
* removed at your request. Please see the Mesa docs/COPYRIGHT file
* for more information.
*
* Additional Mesa/3Dfx driver developers:
* Daryll Strauss <daryll@precisioninsight.com>
* Keith Whitwell <keith@precisioninsight.com>
*
* See fxapi.h for more revision/author details.
*/
/* fxdd.c - 3Dfx VooDoo Mesa device driver functions */
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#if defined(FX)
#include "types.h"
#include "fxdrv.h"
#include "enums.h"
#include "extensions.h"
/* These lookup table are used to extract RGB values in [0,255] from
* 16-bit pixel values.
*/
GLubyte FX_PixelToR[0x10000];
GLubyte FX_PixelToG[0x10000];
GLubyte FX_PixelToB[0x10000];
/*
* Initialize the FX_PixelTo{RGB} arrays.
* Input: bgrOrder - if TRUE, pixels are in BGR order, else RGB order.
*/
void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder)
{
GLuint pixel;
fxMesa->bgrOrder=bgrOrder;
for (pixel = 0; pixel <= 0xffff; pixel++) {
GLuint r, g, b;
if (bgrOrder) {
r = (pixel & 0x001F) << 3;
g = (pixel & 0x07E0) >> 3;
b = (pixel & 0xF800) >> 8;
}
else {
r = (pixel & 0xF800) >> 8;
g = (pixel & 0x07E0) >> 3;
b = (pixel & 0x001F) << 3;
}
r = r * 255 / 0xF8; /* fill in low-order bits */
g = g * 255 / 0xFC;
b = b * 255 / 0xF8;
FX_PixelToR[pixel] = r;
FX_PixelToG[pixel] = g;
FX_PixelToB[pixel] = b;
}
}
/**********************************************************************/
/***** Miscellaneous functions *****/
/**********************************************************************/
@@ -44,10 +108,11 @@ void fxDDDither(GLcontext *ctx, GLboolean enable)
fprintf(stderr,"fxmesa: fxDDDither()\n");
}
if(enable)
grDitherMode(GR_DITHER_4x4);
else
grDitherMode(GR_DITHER_DISABLE);
if (enable) {
FX_grDitherMode(GR_DITHER_4x4);
} else {
FX_grDitherMode(GR_DITHER_DISABLE);
}
}
@@ -120,14 +185,14 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
/* clear color and depth buffer */
if (ctx->Color.DrawDestMask & BACK_LEFT_BIT) {
grRenderBuffer(GR_BUFFER_BACKBUFFER);
grBufferClear(fxMesa->clearC, fxMesa->clearA,
(FxU16)(ctx->Depth.Clear*0xffff));
FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
(FxU16)(ctx->Depth.Clear*0xffff));
}
if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT) {
grRenderBuffer(GR_BUFFER_FRONTBUFFER);
grBufferClear(fxMesa->clearC, fxMesa->clearA,
(FxU16)(ctx->Depth.Clear*0xffff));
FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
(FxU16)(ctx->Depth.Clear*0xffff));
}
newmask=mask & (~(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT));
@@ -136,19 +201,20 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
/* clear color buffer */
if(ctx->Color.ColorMask) {
grDepthMask(FXFALSE);
FX_grDepthMask(FXFALSE);
if (ctx->Color.DrawDestMask & BACK_LEFT_BIT) {
grRenderBuffer(GR_BUFFER_BACKBUFFER);
grBufferClear(fxMesa->clearC, fxMesa->clearA, 0);
FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, 0);
}
if (ctx->Color.DrawDestMask & FRONT_LEFT_BIT) {
grRenderBuffer(GR_BUFFER_FRONTBUFFER);
grBufferClear(fxMesa->clearC, fxMesa->clearA, 0);
FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA, 0);
}
if(ctx->Depth.Mask)
grDepthMask(FXTRUE);
if(ctx->Depth.Mask) {
FX_grDepthMask(FXTRUE);
}
}
newmask=mask & (~(GL_COLOR_BUFFER_BIT));
@@ -157,14 +223,14 @@ static GLbitfield fxDDClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
/* clear depth buffer */
if(ctx->Depth.Mask) {
grColorMask(FXFALSE,FXFALSE);
grBufferClear(fxMesa->clearC, fxMesa->clearA,
(FxU16)(ctx->Depth.Clear*0xffff));
FX_grColorMask(FXFALSE,FXFALSE);
FX_grBufferClear(fxMesa->clearC, fxMesa->clearA,
(FxU16)(ctx->Depth.Clear*0xffff));
grColorMask(ctx->Color.ColorMask[RCOMP] ||
ctx->Color.ColorMask[GCOMP] ||
ctx->Color.ColorMask[BCOMP],
ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
FX_grColorMask(ctx->Color.ColorMask[RCOMP] ||
ctx->Color.ColorMask[GCOMP] ||
ctx->Color.ColorMask[BCOMP],
ctx->Color.ColorMask[ACOMP] && fxMesa->haveAlphaBuffer);
}
newmask=mask & (~(GL_DEPTH_BUFFER_BIT));
@@ -189,12 +255,12 @@ static GLboolean fxDDSetBuffer(GLcontext *ctx, GLenum mode )
if (mode == GL_FRONT_LEFT) {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
grRenderBuffer(fxMesa->currentFB);
FX_grRenderBuffer(fxMesa->currentFB);
return GL_TRUE;
}
else if (mode == GL_BACK_LEFT) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
grRenderBuffer(fxMesa->currentFB);
FX_grRenderBuffer(fxMesa->currentFB);
return GL_TRUE;
}
else {
@@ -203,6 +269,22 @@ static GLboolean fxDDSetBuffer(GLcontext *ctx, GLenum mode )
}
#ifdef XF86DRI
static GLboolean inClipRects(fxMesaContext fxMesa, int px, int py)
{
int i;
py=fxMesa->height+fxMesa->y_offset-py;
for (i=0; i<fxMesa->numClipRects; i++) {
if ((px>=fxMesa->pClipRects[i].x1) &&
(px<fxMesa->pClipRects[i].x2) &&
(py>=fxMesa->pClipRects[i].y1) &&
(py<fxMesa->pClipRects[i].y2)) return GL_TRUE;
}
return GL_FALSE;
}
#endif
static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
GLsizei width, GLsizei height,
@@ -240,10 +322,16 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
ymax=fxMesa->height;
}
xmin+=fxMesa->x_offset;
xmax+=fxMesa->x_offset;
#define ISCLIPPED(rx) ( ((rx)<xmin) || ((rx)>=xmax) )
#ifdef XF86DRI
#define ISCLIPPED(rx, ry) ( ((rx)<xmin) || ((rx)>=xmax) || !inClipRects(fxMesa, rx, ry))
#else
#define ISCLIPPED(rx, ry) ( ((rx)<xmin) || ((rx)>=xmax) )
#endif
#define DRAWBIT(i) { \
if(!ISCLIPPED(x+px)) \
if(!ISCLIPPED(x+px, y)) \
if( (*pb) & (1<<(i)) ) \
(*p)=color; \
p++; \
@@ -257,7 +345,7 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
scrwidth=fxMesa->width;
scrheight=fxMesa->height;
if((px>=scrwidth) || (px+width<=0) || (py>=scrheight) || (py+height<=0))
if ((px>=scrwidth) || (px+width<=0) || (py>=scrheight) || (py+height<=0))
return GL_TRUE;
pb=bitmap;
@@ -268,16 +356,16 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
py=0;
}
if(py+height>=scrheight)
if (py+height>=scrheight)
height-=(py+height)-scrheight;
info.size=sizeof(info);
if(!grLfbLock(GR_LFB_WRITE_ONLY,
fxMesa->currentFB,
GR_LFBWRITEMODE_565,
GR_ORIGIN_UPPER_LEFT,
FXFALSE,
&info)) {
if(!FX_grLfbLock(GR_LFB_WRITE_ONLY,
fxMesa->currentFB,
GR_LFBWRITEMODE_565,
GR_ORIGIN_UPPER_LEFT,
FXFALSE,
&info)) {
#ifndef FX_SILENT
fprintf(stderr,"fx Driver: error locking the linear frame buffer\n");
#endif
@@ -288,22 +376,28 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
g=(GLint)(ctx->Current.RasterColor[1]*255.0f);
b=(GLint)(ctx->Current.RasterColor[2]*255.0f);
a=(GLint)(ctx->Current.RasterColor[3]*255.0f);
color=(FxU16)
( ((FxU16)0xf8 & b) <<(11-3)) |
( ((FxU16)0xfc & g) <<(5-3+1)) |
( ((FxU16)0xf8 & r) >> 3);
if (fxMesa->bgrOrder)
color=(FxU16)
( ((FxU16)0xf8 & b) <<(11-3)) |
( ((FxU16)0xfc & g) <<(5-3+1)) |
( ((FxU16)0xf8 & r) >> 3);
else
color=(FxU16)
( ((FxU16)0xf8 & r) <<(11-3)) |
( ((FxU16)0xfc & g) <<(5-3+1)) |
( ((FxU16)0xf8 & b) >> 3);
stride=info.strideInBytes>>1;
/* This code is a bit slow... */
for(y=py;y<(py+height);y++) {
if (py>ymin) ymin=py;
if (py+height<ymax) ymax=py+height;
if (y>=ymax)
break;
px+=fxMesa->x_offset;
scrheight=fxMesa->height+fxMesa->y_offset;
if (y<=ymin)
continue;
for(y=ymin; y<ymax; y++) {
p=((FxU16 *)info.lfbPtr)+px+((scrheight-y)*stride);
@@ -314,7 +408,7 @@ static GLboolean fxDDDrawBitMap(GLcontext *ctx, GLint px, GLint py,
}
}
grLfbUnlock(GR_LFB_WRITE_ONLY,fxMesa->currentFB);
FX_grLfbUnlock(GR_LFB_WRITE_ONLY,fxMesa->currentFB);
#undef ISCLIPPED
#undef DRAWBIT
@@ -337,6 +431,7 @@ static GLint fxDDGetParameteri(const GLcontext *ctx, GLint param)
fprintf(stderr,"fx Driver: internal error in fxDDGetParameteri(): %x\n",param);
fxCloseHardware();
exit(-1);
return 0;
}
}
@@ -353,55 +448,181 @@ void fxDDSetNearFar(GLcontext *ctx, GLfloat n, GLfloat f)
*/
static const GLubyte *fxDDGetString(GLcontext *ctx, GLenum name)
{
static char *extensions="GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_logic_op GL_EXT_blend_subtract GL_EXT_paletted_texture GL_EXT_point_parameters GL_EXT_polygon_offset GL_EXT_vertex_array GL_EXT_texture_object GL_EXT_texture3D GL_MESA_window_pos GL_MESA_resize_buffers GL_EXT_shared_texture_palette GL_EXT_rescale_normal GL_EXT_abgr GL_SGIS_texture_edge_clamp 3DFX_set_global_palette GL_FXMESA_global_texture_lod_bias";
switch (name) {
case GL_RENDERER:
#if defined(GLX_DIRECT_RENDERING)
return "Mesa Glide - DRI VB/V3";
#else
{
static char buf[80];
static char buf[MAX_NUM_SST][64];
if (glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO)
{
GrVoodooConfig_t *vc =
&glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig;
fxQueryHardware();
sprintf(buf,
"Mesa Glide v0.30 Voodoo_Graphics %d "
"CARD/%d FB/%d TM/%d TMU/%s",
glbCurrentBoard,
(vc->sliDetect ? (vc->fbRam*2) : vc->fbRam),
(vc->tmuConfig[GR_TMU0].tmuRam +
((vc->nTexelfx>1) ? vc->tmuConfig[GR_TMU1].tmuRam : 0)),
vc->nTexelfx,
(vc->sliDetect ? "SLI" : "NOSLI"));
}
else if (glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96)
{
GrSst96Config_t *sc =
&glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config;
switch (name) {
case GL_RENDERER:
if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO) {
sprintf(buf[glbCurrentBoard],"Mesa Glide v0.30 Voodoo_Graphics %d CARD/%d FB/%d TM/%d TMU/%s",
glbCurrentBoard,
sprintf(buf,
"Glide v0.30 Voodoo_Rush %d "
"CARD/%d FB/%d TM/%d TMU/NOSLI",
glbCurrentBoard,
sc->fbRam,
sc->tmuConfig.tmuRam,
sc->nTexelfx);
}
else
{
strcpy(buf, "Glide v0.30 UNKNOWN");
}
(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.sliDetect ?
(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbRam*2) :
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.fbRam),
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.tmuConfig[GR_TMU0].tmuRam+
((glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx>1) ?
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.tmuConfig[GR_TMU1].tmuRam :
0),
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.nTexelfx,
(glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig.sliDetect ? "SLI" : "NOSLI")
);
return (GLubyte *) buf;
}
else {
if(glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96)
sprintf(buf[glbCurrentBoard],"Glide v0.30 Voodoo_Rush %d CARD/%d FB/%d TM/%d TMU/NOSLI",
glbCurrentBoard,
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.fbRam,
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.tmuConfig.tmuRam,
glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config.nTexelfx
);
else
strcpy(buf[glbCurrentBoard],"Glide v0.30 UNKNOWN");
}
return (GLubyte *) buf[glbCurrentBoard];
case GL_EXTENSIONS:
return (GLubyte *) extensions;
default:
#endif
default:
return NULL;
}
}
}
int fxDDInitFxMesaContext( fxMesaContext fxMesa )
{
FX_setupGrVertexLayout();
if (getenv("FX_EMULATE_SINGLE_TMU"))
fxMesa->haveTwoTMUs = GL_FALSE;
fxMesa->emulateTwoTMUs = fxMesa->haveTwoTMUs;
if (!getenv("FX_DONT_FAKE_MULTITEX"))
fxMesa->emulateTwoTMUs = GL_TRUE;
if(getenv("FX_GLIDE_SWAPINTERVAL"))
fxMesa->swapInterval=atoi(getenv("FX_GLIDE_SWAPINTERVAL"));
else
fxMesa->swapInterval=1;
if(getenv("MESA_FX_SWAP_PENDING"))
fxMesa->maxPendingSwapBuffers=atoi(getenv("MESA_FX_SWAP_PENDING"));
else
fxMesa->maxPendingSwapBuffers=2;
fxMesa->color=0xffffffff;
fxMesa->clearC=0;
fxMesa->clearA=0;
fxMesa->stats.swapBuffer=0;
fxMesa->stats.reqTexUpload=0;
fxMesa->stats.texUpload=0;
fxMesa->stats.memTexUpload=0;
fxMesa->tmuSrc=FX_TMU_NONE;
fxMesa->lastUnitsMode=FX_UM_NONE;
fxTMInit(fxMesa);
/* FX units setup */
fxMesa->unitsState.alphaTestEnabled=GL_FALSE;
fxMesa->unitsState.alphaTestFunc=GR_CMP_ALWAYS;
fxMesa->unitsState.alphaTestRefValue=0;
fxMesa->unitsState.blendEnabled=GL_FALSE;
fxMesa->unitsState.blendSrcFuncRGB=GR_BLEND_ONE;
fxMesa->unitsState.blendDstFuncRGB=GR_BLEND_ZERO;
fxMesa->unitsState.blendSrcFuncAlpha=GR_BLEND_ONE;
fxMesa->unitsState.blendDstFuncAlpha=GR_BLEND_ZERO;
fxMesa->unitsState.depthTestEnabled =GL_FALSE;
fxMesa->unitsState.depthMask =GL_TRUE;
fxMesa->unitsState.depthTestFunc =GR_CMP_LESS;
FX_grColorMask(FXTRUE, fxMesa->haveAlphaBuffer ? FXTRUE : FXFALSE);
if(fxMesa->haveDoubleBuffer) {
fxMesa->currentFB=GR_BUFFER_BACKBUFFER;
FX_grRenderBuffer(GR_BUFFER_BACKBUFFER);
} else {
fxMesa->currentFB=GR_BUFFER_FRONTBUFFER;
FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER);
}
fxMesa->state = NULL;
fxMesa->fogTable = NULL;
fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE));
fxMesa->fogTable = malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES)*sizeof(GrFog_t));
if (!fxMesa->state || !fxMesa->fogTable) {
if (fxMesa->state) free(fxMesa->state);
if (fxMesa->fogTable) free(fxMesa->fogTable);
return 0;
}
if(fxMesa->haveZBuffer)
FX_grDepthBufferMode(GR_DEPTHBUFFER_ZBUFFER);
#if (!FXMESA_USE_ARGB)
FX_grLfbWriteColorFormat(GR_COLORFORMAT_ABGR); /* Not every Glide has this */
#endif
fxMesa->glCtx->Const.MaxTextureLevels=9;
fxMesa->glCtx->Const.MaxTextureSize=256;
fxMesa->glCtx->Const.MaxTextureUnits=fxMesa->emulateTwoTMUs ? 2 : 1;
fxMesa->glCtx->NewState|=NEW_DRVSTATE1;
fxMesa->new_state = NEW_ALL;
fxDDSetupInit();
fxDDCvaInit();
fxDDClipInit();
fxDDTrifuncInit();
fxDDFastPathInit();
fxSetupDDPointers(fxMesa->glCtx);
fxDDRenderInit(fxMesa->glCtx);
fxDDInitExtensions(fxMesa->glCtx);
fxDDSetNearFar(fxMesa->glCtx,1.0,100.0);
FX_grGlideGetState((GrState*)fxMesa->state);
/* XXX Fix me: callback not registered when main VB is created.
*/
if (fxMesa->glCtx->VB)
fxDDRegisterVB( fxMesa->glCtx->VB );
/* XXX Fix me too: need to have the 'struct dd' prepared prior to
* creating the context... The below is broken if you try to insert
* new stages.
*/
if (fxMesa->glCtx->NrPipelineStages)
fxMesa->glCtx->NrPipelineStages = fxDDRegisterPipelineStages(
fxMesa->glCtx->PipelineStage,
fxMesa->glCtx->PipelineStage,
fxMesa->glCtx->NrPipelineStages);
/* Run the config file */
gl_context_initialize( fxMesa->glCtx );
return 1;
}
void fxDDInitExtensions( GLcontext *ctx )
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
@@ -409,10 +630,19 @@ void fxDDInitExtensions( GLcontext *ctx )
gl_extensions_add( ctx, DEFAULT_ON, "3DFX_set_global_palette", 0 );
gl_extensions_add( ctx, DEFAULT_ON, "GL_FXMESA_global_texture_lod_bias", 0);
if(fxMesa->haveTwoTMUs)
gl_extensions_add( ctx, DEFAULT_ON, "GL_EXT_texture_env_add", 0);
if (!fxMesa->emulateTwoTMUs)
gl_extensions_disable( ctx, "GL_ARB_multitexture" );
}
/*
This driver may need to move the drawing operations to a different sub
window. This modifies the viewport command to add our X,Y offset to all
drawn objects that go through the viewport transformation.
*/
/************************************************************************/
/************************************************************************/
/************************************************************************/
@@ -458,16 +688,19 @@ static GLboolean fxIsInHardware(GLcontext *ctx)
/* Not very well written ... */
((ctx->Enabled & (TEXTURE0_1D | TEXTURE1_1D)) &&
((ctx->Enabled & (TEXTURE0_2D | TEXTURE1_2D))!=(TEXTURE0_2D | TEXTURE1_2D)))
)
) {
return GL_FALSE;
}
if((ctx->Texture.ReallyEnabled & TEXTURE0_2D) &&
(ctx->Texture.Unit[0].EnvMode==GL_BLEND))
(ctx->Texture.Unit[0].EnvMode==GL_BLEND)) {
return GL_FALSE;
}
if((ctx->Texture.ReallyEnabled & TEXTURE1_2D) &&
(ctx->Texture.Unit[1].EnvMode==GL_BLEND))
(ctx->Texture.Unit[1].EnvMode==GL_BLEND)) {
return GL_FALSE;
}
if (MESA_VERBOSE & (VERBOSE_DRIVER|VERBOSE_TEXTURE))
@@ -484,8 +717,9 @@ static GLboolean fxIsInHardware(GLcontext *ctx)
/* Can't use multipass to blend a multitextured triangle - fall
* back to software.
*/
if (!fxMesa->haveTwoTMUs && ctx->Color.BlendEnabled)
if (!fxMesa->haveTwoTMUs && ctx->Color.BlendEnabled) {
return GL_FALSE;
}
if ((ctx->Texture.Unit[0].EnvMode!=ctx->Texture.Unit[1].EnvMode) &&
(ctx->Texture.Unit[0].EnvMode!=GL_MODULATE) &&
@@ -493,7 +727,6 @@ static GLboolean fxIsInHardware(GLcontext *ctx)
{
if (MESA_VERBOSE&VERBOSE_DRIVER)
fprintf(stderr, "fxMesa: unsupported multitex env mode\n");
return GL_FALSE;
}
}
@@ -502,13 +735,15 @@ static GLboolean fxIsInHardware(GLcontext *ctx)
/* Not very well written ... */
((ctx->Enabled & TEXTURE0_1D) &&
(!(ctx->Enabled & TEXTURE0_2D)))
)
) {
return GL_FALSE;
}
if((ctx->Texture.ReallyEnabled & TEXTURE0_2D) &&
(ctx->Texture.Unit[0].EnvMode==GL_BLEND))
(ctx->Texture.Unit[0].EnvMode==GL_BLEND)) {
return GL_FALSE;
}
}
return GL_TRUE;
@@ -547,11 +782,11 @@ static void fxDDUpdateDDPointers(GLcontext *ctx)
ctx->Driver.LineFunc=fxMesa->LineFunc;
ctx->Driver.TriangleFunc=fxMesa->TriangleFunc;
ctx->Driver.QuadFunc=fxMesa->QuadFunc;
} else
} else {
fxMesa->render_index = FX_FALLBACK;
}
}
void fxSetupDDPointers(GLcontext *ctx)
{
if (MESA_VERBOSE&VERBOSE_DRIVER) {
@@ -615,7 +850,6 @@ void fxSetupDDPointers(GLcontext *ctx)
ctx->Driver.CullFace=fxDDCullFace;
ctx->Driver.ShadeModel=fxDDShadeModel;
ctx->Driver.Enable=fxDDEnable;
ctx->Driver.RegisterVB=fxDDRegisterVB;
ctx->Driver.UnregisterVB=fxDDUnregisterVB;
@@ -653,3 +887,4 @@ int gl_fx_dummy_function_dd(void)
}
#endif /* FX */

View File

@@ -1,27 +1,51 @@
/* -*- mode: C; tab-width:8; -*-
fxdd.c - 3Dfx VooDoo Mesa span and pixel functions
*/
/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* Mesa 3-D graphics library
* Version: 3.1
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* See the file fxapi.c for more informations about authors
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
* terms stated above.
*
* Thank you for your contribution, David!
*
* Please make note of the above copyright/license statement. If you
* contributed code or bug fixes to this code under the previous (GNU
* Library) license and object to the new license, your code will be
* removed at your request. Please see the Mesa docs/COPYRIGHT file
* for more information.
*
* Additional Mesa/3Dfx driver developers:
* Daryll Strauss <daryll@precisioninsight.com>
* Keith Whitwell <keith@precisioninsight.com>
*
* See fxapi.h for more revision/author details.
*/
/* fxdd.c - 3Dfx VooDoo Mesa span and pixel functions */
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
@@ -42,6 +66,72 @@
#if !defined(FXMESA_USE_ARGB)
#if defined(FX_GLIDE3) && defined(XF86DRI)
static FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format,
FxU32 src_width, FxU32 src_height, FxI32 src_stride,
void *src_data);
FxBool writeRegionClipped(fxMesaContext fxMesa, GrBuffer_t dst_buffer,
FxU32 dst_x, FxU32 dst_y, GrLfbSrcFmt_t src_format,
FxU32 src_width, FxU32 src_height, FxI32 src_stride,
void *src_data)
{
int i, x, w, srcElt;
void *data;
if (src_width==1 && src_height==1) { /* Easy case writing a point */
for (i=0; i<fxMesa->numClipRects; i++) {
if ((dst_x>=fxMesa->pClipRects[i].x1) &&
(dst_x<fxMesa->pClipRects[i].x2) &&
(dst_y>=fxMesa->pClipRects[i].y1) &&
(dst_y<fxMesa->pClipRects[i].y2)) {
FX_grLfbWriteRegion(dst_buffer, dst_x, dst_y, src_format,
1, 1, src_stride, src_data);
return GL_TRUE;
}
}
} else if (src_height==1) { /* Writing a span */
if (src_format==GR_LFB_SRC_FMT_8888) srcElt=4;
else if (src_format==GR_LFB_SRC_FMT_ZA16) srcElt=2;
else {
fprintf(stderr, "Unknown src_format passed to writeRegionClipped\n");
return GL_FALSE;
}
for (i=0; i<fxMesa->numClipRects; i++) {
if (dst_y>=fxMesa->pClipRects[i].y1 && dst_y<fxMesa->pClipRects[i].y2) {
if (dst_x<fxMesa->pClipRects[i].x1) {
x=fxMesa->pClipRects[i].x1;
data=((char*)src_data)+srcElt*(dst_x-x);
w=src_width-(x-dst_x);
} else {
x=dst_x;
data=src_data;
w=src_width;
}
if (x+w>fxMesa->pClipRects[i].x2) {
w=fxMesa->pClipRects[i].x2-x;
}
FX_grLfbWriteRegion(dst_buffer, x, dst_y, src_format, w, 1,
src_stride, data);
}
}
} else { /* Punt on the case of arbitrary rectangles */
return GL_FALSE;
}
return GL_TRUE;
}
#else
#define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
#endif
/* KW: Rearranged the args in the call to grLfbWriteRegion().
*/
#define LFB_WRITE_SPAN_MESA(dst_buffer, \
@@ -50,7 +140,7 @@
src_width, \
src_stride, \
src_data) \
grLfbWriteRegion(dst_buffer, \
writeRegionClipped(fxMesa, dst_buffer, \
dst_x, \
dst_y, \
GR_LFB_SRC_FMT_8888, \
@@ -60,7 +150,11 @@
src_data) \
#else /* defined(FXMESA_USE_RGBA) */
#else /* !defined(FXMESA_USE_RGBA) */
#define writeRegionClipped(fxm,dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
#define MESACOLOR_TO_ARGB(c) ( \
( ((unsigned int)(c[ACOMP]))<<24 ) | \
@@ -68,7 +162,7 @@
( ((unsigned int)(c[GCOMP]))<<8 ) | \
( (unsigned int)(c[BCOMP])) )
void LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer,
inline void LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer,
FxU32 dst_x,
FxU32 dst_y,
FxU32 src_width,
@@ -84,7 +178,7 @@ void LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer,
{
argb[i] = MESACOLOR_TO_ARGB(rgba[i]);
}
FX_grLfbWriteRegion(dst_buffer,
writeRegionClipped( /*fxMesa,*/ NULL, dst_buffer,
dst_x,
dst_y,
GR_LFB_SRC_FMT_8888,
@@ -93,8 +187,9 @@ void LFB_WRITE_SPAN_MESA(GrBuffer_t dst_buffer,
src_stride,
(void*)argb);
}
#endif /* !defined(FXMESA_USE_RGBA) */
#endif
/************************************************************************/
/***** Span functions *****/
@@ -107,12 +202,13 @@ static void fxDDWriteRGBASpan(const GLcontext *ctx,
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteRGBASpan(...)\n");
}
x+=fxMesa->x_offset;
if (mask) {
int span=0;
@@ -143,13 +239,14 @@ static void fxDDWriteRGBSpan(const GLcontext *ctx,
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
GLubyte rgba[MAX_WIDTH][4];
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteRGBSpan()\n");
}
x+=fxMesa->x_offset;
if (mask) {
int span=0;
@@ -192,13 +289,14 @@ static void fxDDWriteMonoRGBASpan(const GLcontext *ctx,
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
GLuint data[MAX_WIDTH];
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteMonoRGBASpan(...)\n");
}
x+=fxMesa->x_offset;
if (mask) {
int span=0;
@@ -208,7 +306,7 @@ static void fxDDWriteMonoRGBASpan(const GLcontext *ctx,
++span;
} else {
if (span > 0) {
FX_grLfbWriteRegion( fxMesa->currentFB, x+i-span, bottom-y,
writeRegionClipped(fxMesa, fxMesa->currentFB, x+i-span, bottom-y,
GR_LFB_SRC_FMT_8888, span, 1, 0,
(void *) data );
span = 0;
@@ -217,7 +315,7 @@ static void fxDDWriteMonoRGBASpan(const GLcontext *ctx,
}
if (span > 0)
FX_grLfbWriteRegion( fxMesa->currentFB, x+n-span, bottom-y,
writeRegionClipped(fxMesa, fxMesa->currentFB, x+n-span, bottom-y,
GR_LFB_SRC_FMT_8888, span, 1, 0,
(void *) data );
} else {
@@ -225,7 +323,7 @@ static void fxDDWriteMonoRGBASpan(const GLcontext *ctx,
data[i]=(GLuint) fxMesa->color;
}
FX_grLfbWriteRegion( fxMesa->currentFB, x, bottom-y, GR_LFB_SRC_FMT_8888,
writeRegionClipped(fxMesa, fxMesa->currentFB, x, bottom-y, GR_LFB_SRC_FMT_8888,
n, 1, 0, (void *) data );
}
}
@@ -237,7 +335,7 @@ static void fxDDReadRGBASpan(const GLcontext *ctx,
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLushort data[MAX_WIDTH];
GLuint i;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDReadRGBASpan(...)\n");
@@ -245,20 +343,16 @@ static void fxDDReadRGBASpan(const GLcontext *ctx,
assert(n < MAX_WIDTH);
grLfbReadRegion( fxMesa->currentFB, x, bottom-y, n, 1, 0, data);
for (i=0;i<n;i++) {
#if FXMESA_USE_ARGB
rgba[i][RCOMP]=(data[i] & 0xF800) >> 8;
rgba[i][GCOMP]=(data[i] & 0x07E0) >> 3;
rgba[i][BCOMP]=(data[i] & 0x001F) << 3;
#else
rgba[i][RCOMP]=(data[i] & 0x001f) << 3;
rgba[i][GCOMP]=(data[i] & 0x07e0) >> 3;
rgba[i][BCOMP]=(data[i] & 0xf800) >> 8;
#endif
rgba[i][ACOMP]=255;
}
x+=fxMesa->x_offset;
FX_grLfbReadRegion( fxMesa->currentFB, x, bottom-y, n, 1, 0, data);
for (i=0;i<n;i++) {
GLushort pixel = data[i];
rgba[i][RCOMP] = FX_PixelToR[pixel];
rgba[i][GCOMP] = FX_PixelToG[pixel];
rgba[i][BCOMP] = FX_PixelToB[pixel];
rgba[i][ACOMP] = 255;
}
}
/************************************************************************/
@@ -271,7 +365,7 @@ static void fxDDWriteRGBAPixels(const GLcontext *ctx,
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteRGBAPixels(...)\n");
@@ -279,8 +373,8 @@ static void fxDDWriteRGBAPixels(const GLcontext *ctx,
for(i=0;i<n;i++)
if(mask[i])
LFB_WRITE_SPAN_MESA(fxMesa->currentFB,x[i],bottom-y[i],
/*GR_LFB_SRC_FMT_8888,*/1,/*1,*/0,(void *)rgba[i]);
LFB_WRITE_SPAN_MESA(fxMesa->currentFB, x[i]+fxMesa->x_offset, bottom-y[i],
1, 1, (void *)rgba[i]);
}
static void fxDDWriteMonoRGBAPixels(const GLcontext *ctx,
@@ -289,7 +383,7 @@ static void fxDDWriteMonoRGBAPixels(const GLcontext *ctx,
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDWriteMonoRGBAPixels(...)\n");
@@ -297,7 +391,7 @@ static void fxDDWriteMonoRGBAPixels(const GLcontext *ctx,
for(i=0;i<n;i++)
if(mask[i])
FX_grLfbWriteRegion(fxMesa->currentFB,x[i],bottom-y[i],
writeRegionClipped(fxMesa, fxMesa->currentFB,x[i]+fxMesa->x_offset,bottom-y[i],
GR_LFB_SRC_FMT_8888,1,1,0,(void *) &fxMesa->color);
}
@@ -307,31 +401,25 @@ static void fxDDReadRGBAPixels(const GLcontext *ctx,
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
GLint bottom=fxMesa->height-1;
GLushort data;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDReadRGBAPixels(...)\n");
}
for(i=0;i<n;i++)
for(i=0;i<n;i++) {
if(mask[i]) {
grLfbReadRegion(fxMesa->currentFB,x[i],bottom-y[i],1,1,0,&data);
#if FXMESA_USE_ARGB
rgba[i][RCOMP]=(data & 0xF800) >> 8;
rgba[i][GCOMP]=(data & 0x07E0) >> 3;
rgba[i][BCOMP]=(data & 0x001F) >> 8;
#else
rgba[i][RCOMP]=(data & 0x001f) << 3;
rgba[i][GCOMP]=(data & 0x07e0) >> 3;
rgba[i][BCOMP]=(data & 0xf800) >> 8;
#endif
/* the alpha value should be read from the auxiliary buffer when required */
rgba[i][ACOMP]=255;
GLushort pixel;
FX_grLfbReadRegion(fxMesa->currentFB,x[i],bottom-y[i],1,1,0,&pixel);
rgba[i][RCOMP] = FX_PixelToR[pixel];
rgba[i][GCOMP] = FX_PixelToG[pixel];
rgba[i][BCOMP] = FX_PixelToB[pixel];
rgba[i][ACOMP] = 255;
}
}
}
/************************************************************************/
/***** Depth functions *****/
/************************************************************************/
@@ -340,15 +428,42 @@ void fxDDReadDepthSpanFloat(GLcontext *ctx,
GLuint n, GLint x, GLint y, GLfloat depth[])
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLuint i;
GLint bottom=fxMesa->height-1;
GLint i;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
GLushort data[MAX_WIDTH];
GLint count = (GLint) n;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDReadDepthSpanFloat(...)\n");
}
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,data);
if (y < 0 || y >= ctx->Buffer->Height ||
x >= ctx->Buffer->Width || x + count < 0) {
/* completely outside frame buffer */
for (i = 0; i < count; i++)
depth[i] = 0;
return;
}
if (x < 0) {
GLint dx = -x;
for (i = 0; i < dx; i++)
depth[i] = 0;
x = 0;
depth += dx;
count -= dx;
}
if (x + count > ctx->Buffer->Width) {
GLint dx = x + count - ctx->Buffer->Width;
for (i = 0; i < dx; i++)
depth[count - dx - 1] = 0;
count -= dx;
}
if (count <= 0)
return;
x+=fxMesa->x_offset;
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,data);
/*
convert the read values to float values [0.0 .. 1.0].
@@ -361,13 +476,41 @@ void fxDDReadDepthSpanInt(GLcontext *ctx,
GLuint n, GLint x, GLint y, GLdepth depth[])
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
GLint count = (GLint) n;
GLint i;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDReadDepthSpanInt(...)\n");
}
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,depth);
if (y < 0 || y >= ctx->Buffer->Height ||
x >= ctx->Buffer->Width || x + count < 0) {
/* completely outside frame buffer */
for (i = 0; i < count; i++)
depth[i] = 0;
return;
}
if (x < 0) {
GLint dx = -x;
for (i = 0; i < dx; i++)
depth[i] = 0;
x = 0;
depth += dx;
count -= dx;
}
if (x + count > ctx->Buffer->Width) {
GLint dx = x + count - ctx->Buffer->Width;
for (i = 0; i < dx; i++)
depth[count - dx - 1] = 0;
count -= dx;
}
if (count <= 0)
return;
x+=fxMesa->x_offset;
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,depth);
}
GLuint fxDDDepthTestSpanGeneric(GLcontext *ctx,
@@ -380,13 +523,14 @@ GLuint fxDDDepthTestSpanGeneric(GLcontext *ctx,
GLubyte *m=mask;
GLuint i;
GLuint passed=0;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDDepthTestSpanGeneric(...)\n");
}
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,depthdata);
x+=fxMesa->x_offset;
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,n,1,0,depthdata);
/* switch cases ordered from most frequent to less frequent */
switch (ctx->Depth.Func) {
@@ -578,7 +722,7 @@ GLuint fxDDDepthTestSpanGeneric(GLcontext *ctx,
} /*switch*/
if(passed)
FX_grLfbWriteRegion(GR_BUFFER_AUXBUFFER,x,bottom-y,GR_LFB_SRC_FMT_ZA16,n,1,0,depthdata);
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x,bottom-y,GR_LFB_SRC_FMT_ZA16,n,1,0,depthdata);
return passed;
}
@@ -590,7 +734,7 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
GLdepth zval;
GLuint i;
GLint bottom=fxMesa->height-1;
GLint bottom=fxMesa->height+fxMesa->y_offset-1;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDDepthTestPixelsGeneric(...)\n");
@@ -603,10 +747,10 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] < zval) {
/* pass */
FX_grLfbWriteRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
} else {
/* fail */
mask[i] = 0;
@@ -617,7 +761,7 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Don't update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] < zval) {
/* pass */
}
@@ -634,10 +778,10 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] <= zval) {
/* pass */
FX_grLfbWriteRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
} else {
/* fail */
mask[i] = 0;
@@ -648,7 +792,7 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Don't update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] <= zval) {
/* pass */
} else {
@@ -664,10 +808,10 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] >= zval) {
/* pass */
FX_grLfbWriteRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
} else {
/* fail */
mask[i] = 0;
@@ -678,7 +822,7 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Don't update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] >= zval) {
/* pass */
} else {
@@ -694,10 +838,10 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] > zval) {
/* pass */
FX_grLfbWriteRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
} else {
/* fail */
mask[i] = 0;
@@ -708,7 +852,7 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Don't update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] > zval) {
/* pass */
} else {
@@ -724,10 +868,10 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] != zval) {
/* pass */
FX_grLfbWriteRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
} else {
/* fail */
mask[i] = 0;
@@ -738,7 +882,7 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Don't update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] != zval) {
/* pass */
}
@@ -755,10 +899,10 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] == zval) {
/* pass */
FX_grLfbWriteRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
} else {
/* fail */
mask[i] = 0;
@@ -769,7 +913,7 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Don't update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],1,1,0,&zval);
FX_grLfbReadRegion(GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],1,1,0,&zval);
if (z[i] == zval) {
/* pass */
} else {
@@ -785,7 +929,7 @@ void fxDDDepthTestPixelsGeneric(GLcontext* ctx,
/* Update Z buffer */
for (i=0; i<n; i++) {
if (mask[i]) {
FX_grLfbWriteRegion(GR_BUFFER_AUXBUFFER,x[i],bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
writeRegionClipped(fxMesa, GR_BUFFER_AUXBUFFER,x[i]+fxMesa->x_offset,bottom-y[i],GR_LFB_SRC_FMT_ZA16,1,1,0,(void*)&z[i]);
}
}
} else {

View File

@@ -1,27 +1,48 @@
/* -*- mode: C; tab-width:8; -*-
fxddtex.c - 3Dfx VooDoo Texture mapping functions
*/
/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* Mesa 3-D graphics library
* Version: 3.1
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* See the file fxapi.c for more informations about authors
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
* terms stated above.
*
* Thank you for your contribution, David!
*
* Please make note of the above copyright/license statement. If you
* contributed code or bug fixes to this code under the previous (GNU
* Library) license and object to the new license, your code will be
* removed at your request. Please see the Mesa docs/COPYRIGHT file
* for more information.
*
* Additional Mesa/3Dfx driver developers:
* Daryll Strauss <daryll@precisioninsight.com>
* Keith Whitwell <keith@precisioninsight.com>
*
* See fxapi.h for more revision/author details.
*/
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
@@ -30,18 +51,49 @@
#include "fxdrv.h"
void fxPrintTextureData(tfxTexInfo *ti)
{
fprintf(stderr, "Texture Data:\n");
if (ti->tObj) {
fprintf(stderr, "\tName: %d\n", ti->tObj->Name);
fprintf(stderr, "\tBaseLevel: %d\n", ti->tObj->BaseLevel);
fprintf(stderr, "\tSize: %d x %d\n",
ti->tObj->Image[ti->tObj->BaseLevel]->Width,
ti->tObj->Image[ti->tObj->BaseLevel]->Height);
} else
fprintf(stderr, "\tName: UNNAMED\n");
fprintf(stderr, "\tLast used: %d\n", ti->lastTimeUsed);
fprintf(stderr, "\tTMU: %d\n", ti->whichTMU);
fprintf(stderr, "\t%s\n", (ti->isInTM)?"In TMU":"Not in TMU");
if (ti->tm[0])
fprintf(stderr, "\tMem0: %x-%x\n", ti->tm[0]->startAddr,
ti->tm[0]->endAddr);
if (ti->tm[1])
fprintf(stderr, "\tMem1: %x-%x\n", ti->tm[1]->startAddr,
ti->tm[1]->endAddr);
fprintf(stderr, "\tMipmaps: %d-%d\n", ti->minLevel, ti->maxLevel);
fprintf(stderr, "\tFilters: min %d min %d\n", ti->minFilt, ti->maxFilt);
fprintf(stderr, "\tClamps: s %d t %d\n", ti->sClamp, ti->tClamp);
fprintf(stderr, "\tScales: s %f t %f\n", ti->sScale, ti->tScale);
fprintf(stderr, "\tInt Scales: s %d t %d\n",
ti->int_sScale/0x800000, ti->int_tScale/0x800000);
fprintf(stderr, "\t%s\n", (ti->fixedPalette)?"Fixed palette":"Non fixed palette");
fprintf(stderr, "\t%s\n", (ti->validated)?"Validated":"Not validated");
}
/************************************************************************/
/*************************** Texture Mapping ****************************/
/************************************************************************/
static void fxTexInvalidate(GLcontext *ctx, struct gl_texture_object *tObj)
void fxTexInvalidate(GLcontext *ctx, struct gl_texture_object *tObj)
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
tfxTexInfo *ti;
fxTMMoveOutTM(fxMesa,tObj); /* TO DO: SLOW but easy to write */
ti=(tfxTexInfo *)tObj->DriverData;
ti=fxTMGetTexInfo(tObj);
ti->validated=GL_FALSE;
fxMesa->new_state|=FX_NEW_TEXTURING;
ctx->Driver.RenderStart = fxSetupFXUnits;
@@ -52,19 +104,19 @@ static tfxTexInfo *fxAllocTexObjData(fxMesaContext fxMesa)
tfxTexInfo *ti;
int i;
if(!(ti=malloc(sizeof(tfxTexInfo)))) {
if(!(ti=CALLOC(sizeof(tfxTexInfo)))) {
fprintf(stderr,"fx Driver: out of memory !\n");
fxCloseHardware();
exit(-1);
}
ti->validated=GL_FALSE;
ti->tmi.isInTM=GL_FALSE;
ti->isInTM=GL_FALSE;
ti->tmi.whichTMU=FX_TMU_NONE;
ti->whichTMU=FX_TMU_NONE;
ti->tmi.tm[FX_TMU0]=NULL;
ti->tmi.tm[FX_TMU1]=NULL;
ti->tm[FX_TMU0]=NULL;
ti->tm[FX_TMU1]=NULL;
ti->minFilt=GR_TEXTUREFILTER_POINT_SAMPLED;
ti->maxFilt=GR_TEXTUREFILTER_BILINEAR;
@@ -72,17 +124,12 @@ static tfxTexInfo *fxAllocTexObjData(fxMesaContext fxMesa)
ti->sClamp=GR_TEXTURECLAMP_WRAP;
ti->tClamp=GR_TEXTURECLAMP_WRAP;
if(fxMesa->haveTwoTMUs) {
ti->mmMode=GR_MIPMAP_NEAREST;
ti->LODblend=FXTRUE;
} else {
ti->mmMode=GR_MIPMAP_NEAREST_DITHER;
ti->LODblend=FXFALSE;
}
ti->mmMode=GR_MIPMAP_NEAREST;
ti->LODblend=FXFALSE;
for(i=0;i<MAX_TEXTURE_LEVELS;i++) {
ti->tmi.mipmapLevel[i].used=GL_FALSE;
ti->tmi.mipmapLevel[i].data=NULL;
ti->mipmapLevel[i].used=GL_FALSE;
ti->mipmapLevel[i].data=NULL;
}
return ti;
@@ -100,13 +147,14 @@ void fxDDTexBind(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj)
if(target!=GL_TEXTURE_2D)
return;
if(!tObj->DriverData)
if (!tObj->DriverData) {
tObj->DriverData=fxAllocTexObjData(fxMesa);
}
ti=(tfxTexInfo *)tObj->DriverData;
ti=fxTMGetTexInfo(tObj);
fxMesa->texBindNumber++;
ti->tmi.lastTimeUsed=fxMesa->texBindNumber;
ti->lastTimeUsed=fxMesa->texBindNumber;
fxMesa->new_state|=FX_NEW_TEXTURING;
ctx->Driver.RenderStart = fxSetupFXUnits;
@@ -141,10 +189,10 @@ void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj,
if(target!=GL_TEXTURE_2D)
return;
if(!tObj->DriverData)
if (!tObj->DriverData)
tObj->DriverData=fxAllocTexObjData(fxMesa);
ti=(tfxTexInfo *)tObj->DriverData;
ti=fxTMGetTexInfo(tObj);
switch(pname) {
@@ -265,7 +313,7 @@ void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj,
void fxDDTexDel(GLcontext *ctx, struct gl_texture_object *tObj)
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
tfxTexInfo *ti=(tfxTexInfo *)tObj->DriverData;
tfxTexInfo *ti=fxTMGetTexInfo(tObj);
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxDDTexDel(%d,%x)\n",tObj->Name,(GLuint)ti);
@@ -276,7 +324,7 @@ void fxDDTexDel(GLcontext *ctx, struct gl_texture_object *tObj)
fxTMFreeTexture(fxMesa,tObj);
free(ti);
FREE(ti);
tObj->DriverData=NULL;
ctx->NewState|=NEW_TEXTURING;
@@ -308,10 +356,10 @@ void fxDDTexPalette(GLcontext *ctx, struct gl_texture_object *tObj)
return;
}
if(!tObj->DriverData)
if (!tObj->DriverData)
tObj->DriverData=fxAllocTexObjData(fxMesa);
ti=(tfxTexInfo *)tObj->DriverData;
ti=fxTMGetTexInfo(tObj);
for(i=0;i<tObj->PaletteSize;i++) {
r=tObj->Palette[i*4];
@@ -373,13 +421,10 @@ void fxDDTexUseGlbPalette(GLcontext *ctx, GLboolean state)
if((ctx->Texture.Unit[0].Current==ctx->Texture.Unit[0].CurrentD[2]) &&
(ctx->Texture.Unit[0].Current!=NULL)) {
struct gl_texture_object *tObj=ctx->Texture.Unit[0].Current;
tfxTexInfo *ti;
if(!tObj->DriverData)
if (!tObj->DriverData)
tObj->DriverData=fxAllocTexObjData(fxMesa);
ti=(tfxTexInfo *)tObj->DriverData;
fxTexInvalidate(ctx,tObj);
}
}
@@ -833,7 +878,7 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
(*istranslate)=GL_TRUE;
if(!(*dest)) {
if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned char)*w*h))) {
if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned char)*w*h))) {
fprintf(stderr,"fx Driver: out of memory !\n");
fxCloseHardware();
exit(-1);
@@ -861,7 +906,7 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
(*istranslate)=GL_TRUE;
if(!(*dest)) {
if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned short)*w*h))) {
if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) {
fprintf(stderr,"fx Driver: out of memory !\n");
fxCloseHardware();
exit(-1);
@@ -871,10 +916,10 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
if(wscale==hscale==1) {
int i=0;
int lenght=h*w;
int length=h*w;
unsigned short a,l;
while(i++<lenght) {
while(i++<length) {
l=*data++;
a=*data++;
@@ -905,7 +950,7 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
(*istranslate)=GL_TRUE;
if(!(*dest)) {
if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned short)*w*h))) {
if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) {
fprintf(stderr,"fx Driver: out of memory !\n");
fxCloseHardware();
exit(-1);
@@ -915,10 +960,10 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
if(wscale==hscale==1) {
int i=0;
int lenght=h*w;
int length=h*w;
unsigned short r,g,b;
while(i++<lenght) {
while(i++<length) {
r=*data++;
g=*data++;
b=*data++;
@@ -955,7 +1000,7 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
(*istranslate)=GL_TRUE;
if(!(*dest)) {
if(!((*dest)=src=(unsigned short *)malloc(sizeof(unsigned short)*w*h))) {
if(!((*dest)=src=(unsigned short *)MALLOC(sizeof(unsigned short)*w*h))) {
fprintf(stderr,"fx Driver: out of memory !\n");
fxCloseHardware();
exit(-1);
@@ -965,10 +1010,10 @@ static void fxTexBuildImageMap(const struct gl_texture_image *image,
if(wscale==hscale==1) {
int i=0;
int lenght=h*w;
int length=h*w;
unsigned short r,g,b,a;
while(i++<lenght) {
while(i++<length) {
r=*data++;
g=*data++;
b=*data++;
@@ -1013,21 +1058,23 @@ void fxDDTexImg(GLcontext *ctx, GLenum target,
tfxTexInfo *ti;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: (%d) fxDDTexImg(...,%d,%x,%d,%d...)\n",tObj->Name,
target,internalFormat,image->Width,image->Height);
fprintf(stderr,
"fxmesa: (%d) fxDDTexImg(...,level=%d,target=%d,format=%x,width=%d,height=%d...)\n",
tObj->Name, level, target, internalFormat, image->Width,
image->Height);
}
if(target!=GL_TEXTURE_2D)
return;
if(!tObj->DriverData)
if (!tObj->DriverData)
tObj->DriverData=fxAllocTexObjData(fxMesa);
ti=(tfxTexInfo *)tObj->DriverData;
ti=fxTMGetTexInfo(tObj);
if(fxIsTexSupported(target,internalFormat,image)) {
GrTextureFormat_t gldformat;
tfxMipMapLevel *mml=&ti->tmi.mipmapLevel[level];
tfxMipMapLevel *mml=&ti->mipmapLevel[level];
fxTexGetFormat(internalFormat,&gldformat,NULL);
@@ -1038,7 +1085,7 @@ void fxDDTexImg(GLcontext *ctx, GLenum target,
fxTexBuildImageMap(image,internalFormat,&(mml->data),
&(mml->translated));
if(ti->validated && ti->tmi.isInTM)
if(ti->validated && ti->isInTM)
fxTMReloadMipMapLevel(fxMesa,tObj,level);
else
fxTexInvalidate(ctx,tObj);
@@ -1046,7 +1093,7 @@ void fxDDTexImg(GLcontext *ctx, GLenum target,
return;
} else {
if(mml->translated)
free(mml->data);
FREE(mml->data);
mml->data=NULL;
}
}
@@ -1238,18 +1285,20 @@ void fxDDTexSubImg(GLcontext *ctx, GLenum target,
tfxMipMapLevel *mml;
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: (%d) fxDDTexSubImg(...,%d,%x,%d,%d...)\n",tObj->Name,
target,internalFormat,image->Width,image->Height);
fprintf(stderr,
"fxmesa: (%d) fxDDTexSubImg(level=%d,target=%d,format=%x,width=%d,height=%d)\n",
tObj->Name, level, target, internalFormat, image->Width,
image->Height);
}
if(target!=GL_TEXTURE_2D)
return;
if(!tObj->DriverData)
if (!tObj->DriverData)
return;
ti=(tfxTexInfo *)tObj->DriverData;
mml=&ti->tmi.mipmapLevel[level];
ti=fxTMGetTexInfo(tObj);
mml=&ti->mipmapLevel[level];
fxTexGetFormat(internalFormat,&gldformat,NULL);
@@ -1277,7 +1326,7 @@ void fxDDTexSubImg(GLcontext *ctx, GLenum target,
fxTexBuildSubImageMap(image,internalFormat,xoffset,yoffset,
width,height,mml->data);
if(ti->validated && ti->tmi.isInTM)
if(ti->validated && ti->isInTM)
fxTMReloadSubMipMapLevel(fxMesa,tObj,level,yoffset,height);
else
fxTexInvalidate(ctx,tObj);

View File

@@ -1,27 +1,48 @@
/* -*- mode: C; tab-width:8; -*-
fxdrv.h - 3Dfx VooDoo driver types
*/
/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* Mesa 3-D graphics library
* Version: 3.1
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* See the file fxapi.c for more informations about authors
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
* terms stated above.
*
* Thank you for your contribution, David!
*
* Please make note of the above copyright/license statement. If you
* contributed code or bug fixes to this code under the previous (GNU
* Library) license and object to the new license, your code will be
* removed at your request. Please see the Mesa docs/COPYRIGHT file
* for more information.
*
* Additional Mesa/3Dfx driver developers:
* Daryll Strauss <daryll@precisioninsight.com>
* Keith Whitwell <keith@precisioninsight.com>
*
* See fxapi.h for more revision/author details.
*/
#ifndef FXDRV_H
#define FXDRV_H
@@ -29,11 +50,16 @@
* you turn debugging on/off from the debugger.
*/
#ifndef XFree86Server
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <assert.h>
#else
#include "GL/xf86glx.h"
#endif
#if defined(__linux__)
#include <signal.h>
@@ -49,7 +75,11 @@
#include "clip.h"
#include "vbrender.h"
#ifdef XF86DRI
typedef struct tfxMesaContext *fxMesaContext;
#else
#include "GL/fxmesa.h"
#endif
#include "fxglidew.h"
/* use gl/gl.h GLAPI/GLAPIENTRY/GLCALLBACK in place of WINGDIAPI/APIENTRY/CALLBACK, */
/* these are defined in mesa gl/gl.h - tjump@spgs.com */
@@ -79,6 +109,20 @@ extern void fx_sanity_triangle( GrVertex *, GrVertex *, GrVertex * );
#define S1COORD GR_VERTEX_SOW_TMU1_OFFSET
#define T1COORD GR_VERTEX_TOW_TMU1_OFFSET
#if FX_USE_PARGB
#define CLIP_XCOORD 0 /* normal place */
#define CLIP_YCOROD 1 /* normal place */
#define CLIP_ZCOORD 2 /* normal place */
#define CLIP_WCOORD 3 /* normal place */
#define CLIP_GCOORD 4 /* GR_VERTEX_PARGB_OFFSET */
#define CLIP_BCOORD 5 /* GR_VERTEX_SOW_TMU0_OFFSET */
#define CLIP_RCOORD 6 /* GR_VERTEX_TOW_TMU0_OFFSET */
#define CLIP_ACOORD 7 /* GR_VERTEX_OOW_TMU0_OFFSET */
#else
#define CLIP_XCOORD 0 /* normal place */
#define CLIP_YCOROD 1 /* normal place */
#define CLIP_ZCOORD 2 /* GR_VERTEX_Z_OFFSET */
@@ -89,7 +133,7 @@ extern void fx_sanity_triangle( GrVertex *, GrVertex *, GrVertex * );
#define CLIP_ACOORD 7 /* normal place */
#endif
/* Should have size == 16 * sizeof(float).
*/
@@ -121,17 +165,17 @@ typedef struct {
#endif
#endif
#define FX_VB_COLOR(fxm, color) \
do { \
if (sizeof(GLint) == 4*sizeof(GLubyte)) { \
if (fxm->constColor != *(GLuint*)color) { \
fxm->constColor = *(GLuint*)color; \
grConstantColorValue(FXCOLOR4(color)); \
} \
} else { \
grConstantColorValue(FXCOLOR4(color)); \
} \
} while (0)
#define FX_VB_COLOR(fxm, color) \
do { \
if (sizeof(GLint) == 4*sizeof(GLubyte)) { \
if (fxm->constColor != *(GLuint*)color) { \
fxm->constColor = *(GLuint*)color; \
FX_grConstantColorValue(FXCOLOR4(color)); \
} \
} else { \
FX_grConstantColorValue(FXCOLOR4(color)); \
} \
} while (0)
#define GOURAUD(x) { \
GLubyte *col = VB->ColorPtr->data[(x)]; \
@@ -141,6 +185,12 @@ do { \
gWin[(x)].v.a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); \
}
#if FX_USE_PARGB
#define GOURAUD2(v, c) { \
GLubyte *col = c; \
v->argb=MESACOLOR2PARGB(col); \
}
#else
#define GOURAUD2(v, c) { \
GLubyte *col = c; \
v->r=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[0]); \
@@ -148,6 +198,7 @@ do { \
v->b=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[2]); \
v->a=UBYTE_COLOR_TO_FLOAT_255_COLOR(col[3]); \
}
#endif
/* Mergable items first
@@ -178,47 +229,46 @@ do { \
#define FX_UM_E0_MODULATE 0x00000002
#define FX_UM_E0_DECAL 0x00000004
#define FX_UM_E0_BLEND 0x00000008
#define FX_UM_E0_ADD 0x00000010
#define FX_UM_E1_REPLACE 0x00000010
#define FX_UM_E1_MODULATE 0x00000020
#define FX_UM_E1_DECAL 0x00000040
#define FX_UM_E1_BLEND 0x00000080
#define FX_UM_E1_REPLACE 0x00000020
#define FX_UM_E1_MODULATE 0x00000040
#define FX_UM_E1_DECAL 0x00000080
#define FX_UM_E1_BLEND 0x00000100
#define FX_UM_E1_ADD 0x00000200
#define FX_UM_E_ENVMODE 0x000000ff
#define FX_UM_E_ENVMODE 0x000003ff
#define FX_UM_E0_ALPHA 0x00000100
#define FX_UM_E0_LUMINANCE 0x00000200
#define FX_UM_E0_LUMINANCE_ALPHA 0x00000400
#define FX_UM_E0_INTENSITY 0x00000800
#define FX_UM_E0_RGB 0x00001000
#define FX_UM_E0_RGBA 0x00002000
#define FX_UM_E0_ALPHA 0x00001000
#define FX_UM_E0_LUMINANCE 0x00002000
#define FX_UM_E0_LUMINANCE_ALPHA 0x00004000
#define FX_UM_E0_INTENSITY 0x00008000
#define FX_UM_E0_RGB 0x00010000
#define FX_UM_E0_RGBA 0x00020000
#define FX_UM_E1_ALPHA 0x00004000
#define FX_UM_E1_LUMINANCE 0x00008000
#define FX_UM_E1_LUMINANCE_ALPHA 0x00010000
#define FX_UM_E1_INTENSITY 0x00020000
#define FX_UM_E1_RGB 0x00040000
#define FX_UM_E1_RGBA 0x00080000
#define FX_UM_E1_ALPHA 0x00040000
#define FX_UM_E1_LUMINANCE 0x00080000
#define FX_UM_E1_LUMINANCE_ALPHA 0x00100000
#define FX_UM_E1_INTENSITY 0x00200000
#define FX_UM_E1_RGB 0x00400000
#define FX_UM_E1_RGBA 0x00800000
#define FX_UM_E_IFMT 0x000fff00
#define FX_UM_E_IFMT 0x00fff000
#define FX_UM_COLOR_ITERATED 0x00100000
#define FX_UM_COLOR_CONSTANT 0x00200000
#define FX_UM_ALPHA_ITERATED 0x00400000
#define FX_UM_ALPHA_CONSTANT 0x00800000
#define FX_UM_COLOR_ITERATED 0x01000000
#define FX_UM_COLOR_CONSTANT 0x02000000
#define FX_UM_ALPHA_ITERATED 0x04000000
#define FX_UM_ALPHA_CONSTANT 0x08000000
typedef void (*tfxRenderVBFunc)(GLcontext *);
typedef struct tfxTMFreeListNode {
struct tfxTMFreeListNode *next;
FxU32 startAddress, endAddress;
} tfxTMFreeNode;
typedef struct tfxTMAllocListNode {
struct tfxTMAllocListNode *next;
FxU32 startAddress, endAddress;
struct gl_texture_object *tObj;
} tfxTMAllocNode;
/*
Memory range from startAddr to endAddr-1
*/
typedef struct MemRange_t {
struct MemRange_t *next;
FxU32 startAddr, endAddr;
} MemRange;
typedef struct {
GLsizei width, height;
@@ -228,19 +278,17 @@ typedef struct {
GLboolean translated, used;
} tfxMipMapLevel;
typedef struct {
typedef struct tfxTexInfo_t {
struct tfxTexInfo *next;
struct gl_texture_object *tObj;
GLuint lastTimeUsed;
FxU32 whichTMU;
tfxTMAllocNode *tm[FX_NUM_TMU];
GLboolean isInTM;
tfxMipMapLevel mipmapLevel[MAX_TEXTURE_LEVELS];
GLboolean isInTM;
} tfxTMInfo;
typedef struct {
tfxTMInfo tmi;
MemRange *tm[FX_NUM_TMU];
GLint minLevel, maxLevel;
GLint baseLevelInternalFormat;
@@ -355,8 +403,27 @@ struct tfxMesaVertexBuffer {
};
#define FX_DRIVER_DATA(vb) ((struct tfxMesaVertexBuffer *)((vb)->driver_data))
#define FX_CONTEXT(ctx) ((struct tfxMesaContext *)((ctx)->DriverCtx))
#define FX_TEXTURE_DATA(t) ((tfxTexInfo *) ((t)->Current->DriverData))
#define FX_CONTEXT(ctx) ((fxMesaContext)((ctx)->DriverCtx))
#define FX_TEXTURE_DATA(t) fxTMGetTexInfo((t)->Current)
#if defined(XFree86Server) || defined(GLX_DIRECT_RENDERING)
#include "tdfx_init.h"
#else
#define DRI_FX_CONTEXT
#define BEGIN_BOARD_LOCK()
#define END_BOARD_LOCK()
#define BEGIN_CLIP_LOOP()
#define END_CLIP_LOOP()
#endif
/* These lookup table are used to extract RGB values in [0,255] from
* 16-bit pixel values.
*/
extern GLubyte FX_PixelToR[0x10000];
extern GLubyte FX_PixelToG[0x10000];
extern GLubyte FX_PixelToB[0x10000];
struct tfxMesaContext {
GuTexPalette glbPalette;
@@ -370,6 +437,7 @@ struct tfxMesaContext {
GrBuffer_t currentFB;
GLboolean bgrOrder;
GrColor_t color;
GrColor_t clearC;
GrAlpha_t clearA;
@@ -378,7 +446,6 @@ struct tfxMesaContext {
tfxUnitsState unitsState;
tfxUnitsState restoreUnitsState; /* saved during multipass */
GLuint tmu_source[FX_NUM_TMU];
GLuint tex_dest[MAX_TEXTURE_UNITS];
GLuint setupindex;
@@ -404,11 +471,12 @@ struct tfxMesaContext {
GLint tmuSrc;
GLuint lastUnitsMode;
GLuint freeTexMem[FX_NUM_TMU];
tfxTMFreeNode *tmFree[FX_NUM_TMU];
tfxTMAllocNode *tmAlloc[FX_NUM_TMU];
MemRange *tmPool;
MemRange *tmFree[FX_NUM_TMU];
GLenum fogTableMode;
GLfloat fogDensity;
GLfloat fogStart, fogEnd;
GrFog_t *fogTable;
/* Acc. functions */
@@ -435,12 +503,27 @@ struct tfxMesaContext {
GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */
GLboolean emulateTwoTMUs; /* True if we present 2 tmu's to mesa. */
GLboolean haveAlphaBuffer;
GLboolean haveZBuffer;
GLboolean haveDoubleBuffer;
GLboolean haveGlobalPaletteTexture;
GLint swapInterval;
GLint maxPendingSwapBuffers;
FX_GrContext_t glideContext;
int x_offset;
int y_offset;
int y_delta;
int screen_width;
int screen_height;
int initDone;
int clipMinX;
int clipMaxX;
int clipMinY;
int clipMaxY;
int needClip;
DRI_FX_CONTEXT
};
typedef void (*tfxSetupFunc)(struct vertex_buffer *, GLuint, GLuint);
@@ -452,10 +535,10 @@ extern void fxSetupFXUnits(GLcontext *);
extern void fxSetupDDPointers(GLcontext *);
extern void fxDDSetNearFar(GLcontext *, GLfloat, GLfloat);
extern void fxDDSetupInit();
extern void fxDDCvaInit();
extern void fxDDTrifuncInit();
extern void fxDDFastPathInit();
extern void fxDDSetupInit(void);
extern void fxDDCvaInit(void);
extern void fxDDTrifuncInit(void);
extern void fxDDFastPathInit(void);
extern void fxDDChooseRenderState( GLcontext *ctx );
@@ -475,13 +558,14 @@ extern quad_func fxDDChooseQuadFunction(GLcontext *);
extern render_func **fxDDChooseRenderVBTables(GLcontext *);
extern void fxDDRenderInit(GLcontext *);
extern void fxDDClipInit();
extern void fxDDClipInit(void);
extern void fxUpdateDDSpanPointers(GLcontext *);
extern void fxSetupDDSpanPointers(GLcontext *);
extern void fxDDBufferSize(GLcontext *, GLuint *, GLuint *);
extern void fxPrintTextureData(tfxTexInfo *ti);
extern void fxDDTexEnv(GLcontext *, GLenum, const GLfloat *);
extern void fxDDTexImg(GLcontext *, GLenum, struct gl_texture_object *,
GLint, GLint, const struct gl_texture_image *);
@@ -531,10 +615,12 @@ extern void fxDDRenderVBIndirectDirect( struct vertex_buffer *VB );
extern void fxDDInitExtensions( GLcontext *ctx );
extern void fxTMInit(fxMesaContext);
extern void fxTMClose(fxMesaContext);
#define fxTMGetTexInfo(o) ((tfxTexInfo*)((o)->DriverData))
extern void fxTMInit(fxMesaContext ctx);
extern void fxTMClose(fxMesaContext ctx);
extern void fxTMMoveInTM(fxMesaContext, struct gl_texture_object *, GLint);
extern void fxTMMoveOutTM(fxMesaContext, struct gl_texture_object *);
#define fxTMMoveOutTM_NoLock fxTMMoveOutTM
extern void fxTMFreeTexture(fxMesaContext, struct gl_texture_object *);
extern void fxTMReloadMipMapLevel(fxMesaContext, struct gl_texture_object *, GLint);
extern void fxTMReloadSubMipMapLevel(fxMesaContext, struct gl_texture_object *,
@@ -580,5 +666,13 @@ extern void fxPrintHintState( const char *msg, GLuint state );
extern void fxDDDoRenderVB( struct vertex_buffer *VB );
extern int fxDDInitFxMesaContext( fxMesaContext fxMesa );
extern void fxSetScissorValues(GLcontext *ctx);
extern void fxTMMoveInTM_NoLock(fxMesaContext fxMesa,
struct gl_texture_object *tObj,
GLint where);
extern void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder);
#endif

View File

@@ -1,28 +1,47 @@
/* $Id: fxglidew.c,v 1.2 1999/09/17 03:07:28 tjump Exp $ */
/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
* Version: 3.1
*
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
* terms stated above.
*
* Thank you for your contribution, David!
*
* Please make note of the above copyright/license statement. If you
* contributed code or bug fixes to this code under the previous (GNU
* Library) license and object to the new license, your code will be
* removed at your request. Please see the Mesa docs/COPYRIGHT file
* for more information.
*
* Additional Mesa/3Dfx driver developers:
* Daryll Strauss <daryll@precisioninsight.com>
* Keith Whitwell <keith@precisioninsight.com>
*
* See fxapi.h for more revision/author details.
*/
#ifdef HAVE_CONFIG_H
#include "conf.h"
@@ -36,8 +55,7 @@
#include <stdlib.h>
#include <string.h>
FxI32 FX_grGetInteger(FxU32 pname)
static FxI32 FX_grGetInteger_NoLock(FxU32 pname)
{
#if !defined(FX_GLIDE3)
switch (pname)
@@ -49,7 +67,7 @@ FxI32 FX_grGetInteger(FxU32 pname)
case FX_LFB_PIXEL_PIPE:
return FXFALSE;
case FX_PENDING_BUFFERSWAPS:
return grBufferNumPending();
return grBufferNumPending();
default:
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"Wrong parameter in FX_grGetInteger!\n");
@@ -74,12 +92,74 @@ FxI32 FX_grGetInteger(FxU32 pname)
}
return -1;
}
grGet(grname,4,&result);
return result;
#endif
}
FxI32 FX_grGetInteger(FxU32 pname)
{
int result;
BEGIN_BOARD_LOCK();
result=FX_grGetInteger_NoLock(pname);
END_BOARD_LOCK();
return result;
}
FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
GrLfbWriteMode_t writeMode, GrOriginLocation_t origin,
FxBool pixelPipeline, GrLfbInfo_t *info ) {
FxBool result;
BEGIN_BOARD_LOCK();
result=grLfbLock(type, buffer, writeMode, origin, pixelPipeline, info);
END_BOARD_LOCK();
return result;
}
FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info) {
FxU32 result;
BEGIN_BOARD_LOCK();
result=grTexTextureMemRequired(evenOdd, info);
END_BOARD_LOCK();
return result;
}
FxU32 FX_grTexMinAddress(GrChipID_t tmu) {
FxU32 result;
BEGIN_BOARD_LOCK();
result=grTexMinAddress(tmu);
END_BOARD_LOCK();
return result;
}
extern FxU32 FX_grTexMaxAddress(GrChipID_t tmu) {
FxU32 result;
BEGIN_BOARD_LOCK();
result=grTexMaxAddress(tmu);
END_BOARD_LOCK();
return result;
}
FxBool FX_grSstControl(FxU32 code)
{
#if defined(FX_GLIDE3)
(void) code;
return 1; /* OK? */
#else
FxU32 result;
BEGIN_BOARD_LOCK();
result = grSstControl(code);
END_BOARD_LOCK();
return result;
#endif
}
#if defined(FX_GLIDE3)
@@ -90,39 +170,33 @@ void FX_grGammaCorrectionValue(float val)
/* ToDo */
}
void FX_grSstControl(int par)
{
(void)par;
/* ToDo */
}
int FX_getFogTableSize(void)
{
int result;
BEGIN_BOARD_LOCK();
grGet(GR_FOG_TABLE_ENTRIES,sizeof(int),(void*)&result);
END_BOARD_LOCK();
return result;
}
int FX_getGrStateSize(void)
{
int result;
BEGIN_BOARD_LOCK();
grGet(GR_GLIDE_STATE_SIZE,sizeof(int),(void*)&result);
END_BOARD_LOCK();
return result;
}
int FX_grBufferNumPending()
{
int result;
grGet(GR_PENDING_BUFFERSWAPS,sizeof(int),(void*)&result);
return result;
}
int FX_grSstScreenWidth()
{
FxI32 result[4];
BEGIN_BOARD_LOCK();
grGet(GR_VIEWPORT,sizeof(FxI32)*4,result);
END_BOARD_LOCK();
return result[2];
}
@@ -130,15 +204,19 @@ int FX_grSstScreenWidth()
int FX_grSstScreenHeight()
{
FxI32 result[4];
BEGIN_BOARD_LOCK();
grGet(GR_VIEWPORT,sizeof(FxI32)*4,result);
END_BOARD_LOCK();
return result[3];
}
void FX_grGlideGetVersion(char *buf)
{
strcpy(buf,grGetString(GR_VERSION));
BEGIN_BOARD_LOCK();
strcpy(buf,grGetString(GR_VERSION));
END_BOARD_LOCK();
}
void FX_grSstPerfStats(GrSstPerfStats_t *st)
@@ -154,57 +232,91 @@ void FX_grSstPerfStats(GrSstPerfStats_t *st)
void FX_grAADrawLine(GrVertex *a,GrVertex *b)
{
/* ToDo */
BEGIN_CLIP_LOOP();
grDrawLine(a,b);
END_CLIP_LOOP();
}
void FX_grAADrawPoint(GrVertex *a)
{
BEGIN_CLIP_LOOP();
grDrawPoint(a);
END_CLIP_LOOP();
}
#if FX_USE_PARGB
void FX_setupGrVertexLayout(void)
{
grReset(GR_VERTEX_PARAMETER);
BEGIN_BOARD_LOCK();
grReset(GR_VERTEX_PARAMETER);
grCoordinateSpace(GR_WINDOW_COORDS);
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
/* grVertexLayout(GR_PARAM_Z, GR_VERTEX_Z_OFFSET << 2, GR_PARAM_ENABLE); */
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_DISABLE);
grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
grCoordinateSpace(GR_WINDOW_COORDS);
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_PARGB, GR_VERTEX_PARGB_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_DISABLE);
grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
END_BOARD_LOCK();
}
#else /* FX_USE_PARGB */
void FX_setupGrVertexLayout(void)
{
BEGIN_BOARD_LOCK();
grReset(GR_VERTEX_PARAMETER);
grCoordinateSpace(GR_WINDOW_COORDS);
grVertexLayout(GR_PARAM_XY, GR_VERTEX_X_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_RGB, GR_VERTEX_R_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_A, GR_VERTEX_A_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Q, GR_VERTEX_OOW_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Z, GR_VERTEX_OOZ_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_ST0, GR_VERTEX_SOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_DISABLE);
grVertexLayout(GR_PARAM_ST1, GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
grVertexLayout(GR_PARAM_Q1, GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
END_BOARD_LOCK();
}
#endif
void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask)
{
switch(hintType) {
case GR_HINT_STWHINT:
{
if (hintMask & GR_STWHINT_W_DIFF_TMU0)
grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
else
grVertexLayout(GR_PARAM_Q0,GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_DISABLE);
if (hintMask & GR_STWHINT_ST_DIFF_TMU1)
grVertexLayout(GR_PARAM_ST1,GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_ENABLE);
else
grVertexLayout(GR_PARAM_ST1,GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
if (hintMask & GR_STWHINT_W_DIFF_TMU1)
grVertexLayout(GR_PARAM_Q1,GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_ENABLE);
else
grVertexLayout(GR_PARAM_Q1,GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
}
}
}
void FX_grHints(GrHint_t hintType, FxU32 hintMask)
{
switch(hintType) {
case GR_HINT_STWHINT:
{
if (hintMask & GR_STWHINT_W_DIFF_TMU0)
grVertexLayout(GR_PARAM_Q0, GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_ENABLE);
else
grVertexLayout(GR_PARAM_Q0,GR_VERTEX_OOW_TMU0_OFFSET << 2, GR_PARAM_DISABLE);
if (hintMask & GR_STWHINT_ST_DIFF_TMU1)
grVertexLayout(GR_PARAM_ST1,GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_ENABLE);
else
grVertexLayout(GR_PARAM_ST1,GR_VERTEX_SOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
if (hintMask & GR_STWHINT_W_DIFF_TMU1)
grVertexLayout(GR_PARAM_Q1,GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_ENABLE);
else
grVertexLayout(GR_PARAM_Q1,GR_VERTEX_OOW_TMU1_OFFSET << 2, GR_PARAM_DISABLE);
}
}
void FX_grHints(GrHint_t hintType, FxU32 hintMask) {
BEGIN_BOARD_LOCK();
FX_grHints_NoLock(hintType, hintMask);
END_BOARD_LOCK();
}
int FX_grSstQueryHardware(GrHwConfiguration *config)
{
int i,j;
int numFB;
BEGIN_BOARD_LOCK();
grGet(GR_NUM_BOARDS,4,(void*)&(config->num_sst));
if (config->num_sst == 0)
return 0;
@@ -225,12 +337,80 @@ int FX_grSstQueryHardware(GrHwConfiguration *config)
config->SSTs[i].sstBoard.VoodooConfig.sliDetect = FXFALSE;
for (j = 0; j < config->SSTs[i].sstBoard.VoodooConfig.nTexelfx; j++)
{
grGet(GR_MEMORY_TMU,4,(void*)&(config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[i].tmuRam));
grGet(GR_MEMORY_TMU,4,(void*)&(config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRam));
config->SSTs[i].sstBoard.VoodooConfig.tmuConfig[j].tmuRam /= 1024*1024;
}
}
END_BOARD_LOCK();
return 1;
}
#else
int FX_grSstScreenWidth()
{
int i;
BEGIN_BOARD_LOCK();
i = grSstScreenWidth();
END_BOARD_LOCK();
return i;
}
int FX_grSstScreenHeight()
{
int i;
BEGIN_BOARD_LOCK();
i = grSstScreenHeight();
END_BOARD_LOCK();
return i;
}
int FX_grSstQueryHardware(GrHwConfiguration *c)
{
int i;
BEGIN_BOARD_LOCK();
i = grSstQueryHardware(c);
END_BOARD_LOCK();
return i;
}
FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd,
GrScreenResolution_t screen_resolution,
GrScreenRefresh_t refresh_rate,
GrColorFormat_t color_format,
GrOriginLocation_t origin_location,
int nColBuffers,
int nAuxBuffers)
{
FX_GrContext_t i;
BEGIN_BOARD_LOCK();
i = grSstWinOpen( hWnd,
screen_resolution,
refresh_rate,
color_format,
origin_location,
nColBuffers,
nAuxBuffers );
/*
fprintf(stderr,
"grSstWinOpen( win %d res %d ref %d fmt %d\n"
" org %d ncol %d naux %d )\n"
" ==> %d\n",
hWnd,
screen_resolution,
refresh_rate,
color_format,
origin_location,
nColBuffers,
nAuxBuffers,
i);
*/
END_BOARD_LOCK();
return i;
}
#endif
#else

View File

@@ -1,26 +1,48 @@
/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
* Version: 3.1
*
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
* terms stated above.
*
* Thank you for your contribution, David!
*
* Please make note of the above copyright/license statement. If you
* contributed code or bug fixes to this code under the previous (GNU
* Library) license and object to the new license, your code will be
* removed at your request. Please see the Mesa docs/COPYRIGHT file
* for more information.
*
* Additional Mesa/3Dfx driver developers:
* Daryll Strauss <daryll@precisioninsight.com>
* Keith Whitwell <keith@precisioninsight.com>
*
* See fxapi.h for more revision/author details.
*/
#ifndef __FX_GLIDE_WARPER__
#define __FX_GLIDE_WARPER__
@@ -155,31 +177,76 @@ typedef struct {
float oow; /* 1/w (used mipmapping - really 0xfff/w) */
} GrTmuVertex;
#if FX_USE_PARGB
typedef struct
{
float x, y; /* X and Y in screen space */
float ooz; /* 65535/Z (used for Z-buffering) */
float oow; /* 1/W (used for W-buffering, texturing) */
float r, g, b, a; /* R, G, B, A [0..255.0] */
FxU32 argb; /* R, G, B, A [0..255.0] */
GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
float z; /* Z is ignored */
GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
} GrVertex;
#define GR_VERTEX_X_OFFSET 0
#define GR_VERTEX_Y_OFFSET 1
#define GR_VERTEX_OOZ_OFFSET 2
#define GR_VERTEX_OOW_OFFSET 3
#define GR_VERTEX_R_OFFSET 4
#define GR_VERTEX_G_OFFSET 5
#define GR_VERTEX_B_OFFSET 6
#define GR_VERTEX_PARGB_OFFSET 4
#define GR_VERTEX_SOW_TMU0_OFFSET 5
#define GR_VERTEX_TOW_TMU0_OFFSET 6
#define GR_VERTEX_OOW_TMU0_OFFSET 7
#define GR_VERTEX_SOW_TMU1_OFFSET 8
#define GR_VERTEX_TOW_TMU1_OFFSET 9
#define GR_VERTEX_OOW_TMU1_OFFSET 10
#define GR_VERTEX_Z_OFFSET 11
#define GET_PARGB(v) ((FxU32*)(v))[GR_VERTEX_PARGB_OFFSET]
/* GET_PA: returns the alpha component */
#if GLIDE_ENDIAN == GLIDE_ENDIAN_BIG
#define GET_PA(v) ((FxU8*)(v))[GR_VERTEX_PARGB_OFFSET*4]
#else
#define GET_PA(v) ((FxU8*)(v))[GR_VERTEX_PARGB_OFFSET*4+3]
#endif
#define MESACOLOR2PARGB(c) (c[ACOMP] << 24 | c[GCOMP] << 16 | c[GCOMP] << 8 | c[BCOMP])
#define PACK_4F_ARGB(dest,a,r,g,b) { \
const GLuint cr = (int)r; \
const GLuint cg = (int)g; \
const GLuint ca = (int)a; \
const GLuint cb = (int)b; \
dest = ca << 24 | cr << 16 | cg << 8 | cb; \
}
#else /* FX_USE_PARGB */
typedef struct
{
float x, y, z; /* X, Y, and Z of scrn space -- Z is ignored */
float r, g, b; /* R, G, B, ([0..255.0]) */
float ooz; /* 65535/Z (used for Z-buffering) */
float a; /* Alpha [0..255.0] */
float oow; /* 1/W (used for W-buffering, texturing) */
GrTmuVertex tmuvtx[GLIDE_NUM_TMU];
} GrVertex;
#define GR_VERTEX_X_OFFSET 0
#define GR_VERTEX_Y_OFFSET 1
#define GR_VERTEX_Z_OFFSET 2
#define GR_VERTEX_R_OFFSET 3
#define GR_VERTEX_G_OFFSET 4
#define GR_VERTEX_B_OFFSET 5
#define GR_VERTEX_OOZ_OFFSET 6
#define GR_VERTEX_A_OFFSET 7
#define GR_VERTEX_Z_OFFSET 8
#define GR_VERTEX_OOW_OFFSET 8
#define GR_VERTEX_SOW_TMU0_OFFSET 9
#define GR_VERTEX_TOW_TMU0_OFFSET 10
#define GR_VERTEX_OOW_TMU0_OFFSET 11
#define GR_VERTEX_SOW_TMU1_OFFSET 12
#define GR_VERTEX_TOW_TMU1_OFFSET 13
#define GR_VERTEX_OOW_TMU1_OFFSET 14
#endif /* FX_USE_PARGB */
#endif
@@ -188,29 +255,89 @@ typedef struct
* Glide2 functions for Glide3
*/
#if defined(FX_GLIDE3)
#define FX_grTexDownloadTable(TMU,type,data) grTexDownloadTable(type,data)
#define FX_grTexDownloadTable(TMU,type,data) \
do { \
BEGIN_BOARD_LOCK(); \
grTexDownloadTable(type,data); \
END_BOARD_LOCK(); \
} while (0);
#define FX_grTexDownloadTable_NoLock(TMU,type,data) \
grTexDownloadTable(type, data)
#else
#define FX_grTexDownloadTable(TMU,type,data) grTexDownloadTable(TMU,type,data)
#define FX_grTexDownloadTable(TMU,type,data) \
do { \
BEGIN_BOARD_LOCK(); \
grTexDownloadTable(TMU,type,data); \
END_BOARD_LOCK(); \
} while (0);
#define FX_grTexDownloadTable_NoLock grTexDownloadTable
#endif
/*
* Flush
*/
#if defined(FX_GLIDE3)
#define FX_grFlush grFlush
#define FX_grFlush() \
do { \
BEGIN_BOARD_LOCK(); \
grFlush(); \
END_BOARD_LOCK(); \
} while (0)
#else
#define FX_grFlush grSstIdle
#define FX_grFlush() \
do { \
BEGIN_BOARD_LOCK(); \
grSstIdle(); \
END_BOARD_LOCK(); \
} while (0)
#endif
#define FX_grFinish() \
do { \
BEGIN_BOARD_LOCK(); \
grFinish(); \
END_BOARD_LOCK(); \
} while (0)
/*
* Write region: ToDo possible exploit the PixelPipe parameter.
*/
#if defined(FX_GLIDE3)
#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,FXFALSE,src_stride,src_data)
#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
do { \
BEGIN_BOARD_LOCK(); \
grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,FXFALSE,src_stride,src_data); \
END_BOARD_LOCK(); \
} while(0)
#else
#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data)
#define FX_grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data) \
do { \
BEGIN_BOARD_LOCK(); \
grLfbWriteRegion(dst_buffer,dst_x,dst_y,src_format,src_width,src_height,src_stride,src_data); \
END_BOARD_LOCK(); \
} while (0)
#endif
/*
* Read region
*/
#define FX_grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data) \
do { \
BEGIN_BOARD_LOCK(); \
grLfbReadRegion(src_buffer,src_x,src_y,src_width,src_height,dst_stride,dst_data); \
END_BOARD_LOCK(); \
} while (0);
/*
* Draw triangle
*/
#define FX_grDrawTriangle(a,b,c) \
do { \
BEGIN_CLIP_LOOP(); \
grDrawTriangle(a,b,c); \
END_CLIP_LOOP(); \
} while (0)
/*
* For Lod/LodLog2 conversion.
*/
@@ -243,12 +370,14 @@ typedef struct
#else
#define FX_largeLodValue(info) ((int)(info).largeLod)
#endif
#define FX_largeLodValue_NoLock FX_largeLodValue
#if defined(FX_GLIDE3)
#define FX_smallLodValue(info) ((int)(GR_LOD_256-(info).smallLodLog2))
#else
#define FX_smallLodValue(info) ((int)(info).smallLod)
#endif
#define FX_smallLodValue_NoLock FX_smallLodValue
#if defined(FX_GLIDE3)
#define FX_valueToLod(val) ((GrLOD_t)(GR_LOD_256-val))
@@ -259,13 +388,9 @@ typedef struct
/*
* ScreenWidth/Height stuff.
*/
#if defined(FX_GLIDE3)
extern int FX_grSstScreenWidth();
extern int FX_grSstScreenHeight();
#else
#define FX_grSstScreenWidth() grSstScreenWidth()
#define FX_grSstScreenHeight() grSstScreenHeight()
#endif
extern int FX_grSstScreenWidth(void);
extern int FX_grSstScreenHeight(void);
/*
@@ -274,7 +399,12 @@ typedef struct
#if defined(FX_GLIDE3)
extern void FX_grGlideGetVersion(char *buf);
#else
#define FX_grGlideGetVersion grGlideGetVersion
#define FX_grGlideGetVersion(b) \
do { \
BEGIN_BOARD_LOCK(); \
grGlideGetVersion(b); \
END_BOARD_LOCK(); \
} while (0)
#endif
/*
* Performance statistics
@@ -282,25 +412,33 @@ typedef struct
#if defined(FX_GLIDE3)
extern void FX_grSstPerfStats(GrSstPerfStats_t *st);
#else
#define FX_grSstPerfStats grSstPerfStats
#define FX_grSstPerfStats(s) \
do { \
BEGIN_BOARD_LOCK(); \
grSstPerfStats(s); \
END_BOARD_LOCK(); \
} while (0)
#endif
/*
* Hardware Query
*/
#if defined(FX_GLIDE3)
extern int FX_grSstQueryHardware(GrHwConfiguration *config);
#else
#define FX_grSstQueryHardware grSstQueryHardware
#endif
/*
* GrHints
*/
#if defined(FX_GLIDE3)
extern void FX_grHints_NoLock(GrHint_t hintType, FxU32 hintMask);
extern void FX_grHints(GrHint_t hintType, FxU32 hintMask);
#else
#define FX_grHints grHints
#define FX_grHints(t,m) \
do { \
BEGIN_BOARD_LOCK(); \
grHints(t, m); \
END_BOARD_LOCK(); \
} while(0)
#define FX_grHints_NoLock grHints
#endif
/*
* Antialiashed line+point drawing.
@@ -308,13 +446,23 @@ typedef struct
#if defined(FX_GLIDE3)
extern void FX_grAADrawLine(GrVertex *a,GrVertex *b);
#else
#define FX_grAADrawLine grAADrawLine
#define FX_grAADrawLine(a,b) \
do { \
BEGIN_CLIP_LOOP(); \
grAADrawLine(a,b); \
END_CLIP_LOOP(); \
} while (0)
#endif
#if defined(FX_GLIDE3)
extern void FX_grAADrawPoint(GrVertex *a);
#else
#define FX_grAADrawPoint grAADrawPoint
#define FX_grAADrawPoint(a) \
do { \
BEGIN_CLIP_LOOP(); \
grAADrawPoint(a); \
END_CLIP_LOOP(); \
} while (0)
#endif
/*
@@ -328,31 +476,345 @@ typedef struct
/*
* grSstControl stuff
*/
#if defined(FX_GLIDE3)
extern void FX_grSstControl(int par);
#else
#define FX_grSstControl grSstControl
#endif
extern FxBool FX_grSstControl(FxU32 code);
/*
* grGammaCorrectionValue
*/
#if defined(FX_GLIDE3)
extern void FX_grGammaCorrectionValue(float val);
#else
#define FX_grGammaCorrectionValue grGammaCorrectionValue
#define FX_grGammaCorrectionValue(v) \
do { \
BEGIN_BOARD_LOCK(); \
grGammaCorrectionValue(v) \
END_BOARD_LOCK(); \
} while (0)
#endif
/*
* WinOpen/Close.
*/
#if defined(FX_GLIDE3)
#define FX_grSstWinOpen(hWnd,screen_resolution,refresh_rate,color_format,origin_location,nColBuffers,nAuxBuffers) \
grSstWinOpen(-1,screen_resolution,refresh_rate,color_format,origin_location,nColBuffers,nAuxBuffers)
#define FX_grSstWinClose grSstWinClose
#define FX_grSstWinClose(w) \
do { \
BEGIN_BOARD_LOCK(); \
grSstWinClose(w); \
END_BOARD_LOCK(); \
} while (0)
#else
#define FX_grSstWinOpen grSstWinOpen
#define FX_grSstWinClose(win) grSstWinClose()
#define FX_grSstWinClose(w) \
do { \
BEGIN_BOARD_LOCK(); \
grSstWinClose(); \
END_BOARD_LOCK(); \
} while (0)
#endif
extern FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd,
GrScreenResolution_t screen_resolution,
GrScreenRefresh_t refresh_rate,
GrColorFormat_t color_format,
GrOriginLocation_t origin_location,
int nColBuffers,
int nAuxBuffers);
#define FX_grDrawLine(v1, v2) \
do { \
BEGIN_CLIP_LOOP(); \
grDrawLine(v1, v2); \
END_CLIP_LOOP(); \
} while (0)
#define FX_grDrawPoint(p) \
do { \
BEGIN_CLIP_LOOP(); \
grDrawPoint(p); \
END_CLIP_LOOP(); \
} while (0)
#define FX_grDitherMode(m) \
do { \
BEGIN_BOARD_LOCK(); \
grDitherMode(m); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grRenderBuffer(b) \
do { \
BEGIN_BOARD_LOCK(); \
grRenderBuffer(b); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grBufferClear(c, a, d) \
do { \
BEGIN_CLIP_LOOP(); \
grBufferClear(c, a, d); \
END_CLIP_LOOP(); \
} while (0)
#define FX_grDepthMask(m) \
do { \
BEGIN_BOARD_LOCK(); \
grDepthMask(m); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grColorMask(c, a) \
do { \
BEGIN_BOARD_LOCK(); \
grColorMask(c, a); \
END_BOARD_LOCK(); \
} while (0)
extern FxBool FX_grLfbLock(GrLock_t type, GrBuffer_t buffer,
GrLfbWriteMode_t writeMode,
GrOriginLocation_t origin, FxBool pixelPipeline,
GrLfbInfo_t *info );
#define FX_grLfbUnlock(t, b) \
do { \
BEGIN_BOARD_LOCK(); \
grLfbUnlock(t, b); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grConstantColorValue(v) \
do { \
BEGIN_BOARD_LOCK(); \
grConstantColorValue(v); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grConstantColorValue_NoLock grConstantColorValue
#define FX_grAADrawTriangle(a, b, c, ab, bc, ca) \
do { \
BEGIN_CLIP_LOOP(); \
grAADrawTriangle(a, b, c, ab, bc, ca); \
END_CLIP_LOOP(); \
} while (0)
#define FX_grAlphaBlendFunction(rs, rd, as, ad) \
do { \
BEGIN_BOARD_LOCK(); \
grAlphaBlendFunction(rs, rd, as, ad); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grAlphaCombine(func, fact, loc, oth, inv) \
do { \
BEGIN_BOARD_LOCK(); \
grAlphaCombine(func, fact, loc, oth, inv); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grAlphaCombine_NoLock grAlphaCombine
#define FX_grAlphaTestFunction(f) \
do { \
BEGIN_BOARD_LOCK(); \
grAlphaTestFunction(f); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grAlphaTestReferenceValue(v) \
do { \
BEGIN_BOARD_LOCK(); \
grAlphaTestReferenceValue(v); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grClipWindow(minx, miny, maxx, maxy) \
do { \
BEGIN_BOARD_LOCK(); \
grClipWindow(minx, miny, maxx, maxy); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grClipWindow_NoLock grClipWindow
#define FX_grColorCombine(func, fact, loc, oth, inv) \
do { \
BEGIN_BOARD_LOCK(); \
grColorCombine(func, fact, loc, oth, inv); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grColorCombine_NoLock grColorCombine
#define FX_grCullMode(m) \
do { \
BEGIN_BOARD_LOCK(); \
grCullMode(m); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grDepthBiasLevel(lev) \
do { \
BEGIN_BOARD_LOCK(); \
grDepthBiasLevel(lev); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grDepthBufferFunction(func) \
do { \
BEGIN_BOARD_LOCK(); \
grDepthBufferFunction(func); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grFogColorValue(c) \
do { \
BEGIN_BOARD_LOCK(); \
grFogColorValue(c); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grFogMode(m) \
do { \
BEGIN_BOARD_LOCK(); \
grFogMode(m); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grFogTable(t) \
do { \
BEGIN_BOARD_LOCK(); \
grFogTable(t); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grTexClampMode(t, sc, tc) \
do { \
BEGIN_BOARD_LOCK(); \
grTexClampMode(t, sc, tc); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grTexClampMode_NoLock grTexClampMode
#define FX_grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv) \
do { \
BEGIN_BOARD_LOCK(); \
grTexCombine(t, rfunc, rfact, afunc, afact, rinv, ainv); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grTexCombine_NoLock grTexCombine
#define FX_grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d) \
do { \
BEGIN_BOARD_LOCK(); \
grTexDownloadMipMapLevel(t, sa, tlod, llod, ar, f, eo, d); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grTexDownloadMipMapLevel_NoLock grTexDownloadMipMapLevel
#define FX_grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
do { \
BEGIN_BOARD_LOCK(); \
grTexDownloadMipMapLevelPartial(t, sa, tlod, llod, ar, f, eo, d, s, e); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grTexFilterMode(t, minf, magf) \
do { \
BEGIN_BOARD_LOCK(); \
grTexFilterMode(t, minf, magf); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grTexFilterMode_NoLock grTexFilterMode
extern FxU32 FX_grTexMinAddress(GrChipID_t tmu);
extern FxU32 FX_grTexMaxAddress(GrChipID_t tmu);
#define FX_grTexMipMapMode(t, m, lod) \
do { \
BEGIN_BOARD_LOCK(); \
grTexMipMapMode(t, m, lod); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grTexMipMapMode_NoLock grTexMipMapMode
#define FX_grTexSource(t, sa, eo, i) \
do { \
BEGIN_BOARD_LOCK(); \
grTexSource(t, sa, eo, i); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grTexSource_NoLock grTexSource
extern FxU32 FX_grTexTextureMemRequired(FxU32 evenOdd, GrTexInfo *info);
#define FX_grTexTextureMemRequired_NoLock grTexTextureMemRequired
#define FX_grGlideGetState(s) \
do { \
BEGIN_BOARD_LOCK(); \
grGlideGetState(s); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grDRIBufferSwap(i) \
do { \
BEGIN_BOARD_LOCK(); \
grDRIBufferSwap(i); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grSstSelect(b) \
do { \
BEGIN_BOARD_LOCK(); \
grSstSelect(b); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grSstSelect_NoLock grSstSelect
#define FX_grGlideSetState(s) \
do { \
BEGIN_BOARD_LOCK(); \
grGlideSetState(s); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grDepthBufferMode(m) \
do { \
BEGIN_BOARD_LOCK(); \
grDepthBufferMode(m); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grLfbWriteColorFormat(f) \
do { \
BEGIN_BOARD_LOCK(); \
grLfbWriteColorFormat(f); \
END_BOARD_LOCK(); \
} while (0)
#define FX_grDrawVertexArray(m, c, p) \
do { \
BEGIN_CLIP_LOOP(); \
grDrawVertexArray(m, c, p); \
END_CLIP_LOOP(); \
} while (0)
#define FX_grGlideShutdown() \
do { \
BEGIN_CLIP_LOOP(); \
grGlideShutdown(); \
END_CLIP_LOOP(); \
} while (0)
#define FX_grGlideInit_NoLock grGlideInit
#define FX_grSstWinOpen_NoLock grSstWinOpen
extern int FX_getFogTableSize(void);
extern int FX_getGrStateSize(void);
#endif /* __FX_GLIDE_WARPER__ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +1,53 @@
/* -*- mode: C; tab-width:8; c-basic-offset:2 -*- */
/*
* Mesa 3-D graphics library
* Version: 3.1
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*
* Original Mesa / 3Dfx device driver (C) 1999 David Bucciarelli, by the
* terms stated above.
*
* Thank you for your contribution, David!
*
* Please make note of the above copyright/license statement. If you
* contributed code or bug fixes to this code under the previous (GNU
* Library) license and object to the new license, your code will be
* removed at your request. Please see the Mesa docs/COPYRIGHT file
* for more information.
*
* Additional Mesa/3Dfx driver developers:
* Daryll Strauss <daryll@precisioninsight.com>
* Keith Whitwell <keith@precisioninsight.com>
*
* See fxapi.h for more revision/author details.
*/
/* fxwgl.c - Microsoft wgl functions emulation for
* 3Dfx VooDoo/Mesa interface
*/
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* See the file fxapi.c for more informations about authors
*
*/
#ifdef __WIN32__
@@ -28,14 +56,14 @@ extern "C" {
#endif
#include <windows.h>
#include <GL/gl.h>
#include "GL/gl.h"
#ifdef __cplusplus
}
#endif
#include <stdio.h>
#include <GL/fxmesa.h>
#include "GL/fxmesa.h"
#include "fxdrv.h"
#define MAX_MESA_ATTRS 20
@@ -243,11 +271,11 @@ LONG GLAPIENTRY __wglMonitor(HWND hwnd,UINT message,UINT wParam,LONG lParam)
static int moving = 0;
if (!moving) {
if(fxQueryHardware()!=GR_SSTTYPE_VOODOO) {
if(!grSstControl(GR_CONTROL_RESIZE)) {
if(!FX_grSstControl(GR_CONTROL_RESIZE)) {
moving = 1;
SetWindowPos(hwnd, 0, 0, 0, 300, 300, SWP_NOMOVE|SWP_NOZORDER);
moving = 0;
if(!grSstControl(GR_CONTROL_RESIZE)) {
if(!FX_grSstControl(GR_CONTROL_RESIZE)) {
/*MessageBox(0,_T("Error changing windowsize"),_T("fxMESA"),MB_OK);*/
PostMessage(hWND,WM_CLOSE,0,0);
}
@@ -255,7 +283,7 @@ LONG GLAPIENTRY __wglMonitor(HWND hwnd,UINT message,UINT wParam,LONG lParam)
}
/* Do the clipping in the glide library */
grClipWindow(0,0,grSstScreenWidth(),grSstScreenHeight());
FX_grClipWindow(0,0,FX_grSstScreenWidth(),FX_grSstScreenHeight());
/* And let the new size set in the context */
fxMesaUpdateScreenSize(ctx);
}
@@ -269,21 +297,22 @@ LONG GLAPIENTRY __wglMonitor(HWND hwnd,UINT message,UINT wParam,LONG lParam)
BOOL fMinimized = (BOOL) HIWORD(wParam);
if((fActive == WA_INACTIVE) || fMinimized)
grSstControl(GR_CONTROL_DEACTIVATE);
FX_grSstControl(GR_CONTROL_DEACTIVATE);
else
grSstControl(GR_CONTROL_ACTIVATE);
FX_grSstControl(GR_CONTROL_ACTIVATE);
}
break;
case WM_SHOWWINDOW:
break;
case WM_SYSKEYDOWN:
case WM_SYSCHAR:
if(gdiWindowHackEna && (VK_RETURN == wParam)) {
if(gdiWindowHack) {
gdiWindowHack = GL_FALSE;
grSstControl(GR_CONTROL_ACTIVATE);
FX_grSstControl(GR_CONTROL_ACTIVATE);
} else {
gdiWindowHack = GL_TRUE;
grSstControl(GR_CONTROL_DEACTIVATE);
FX_grSstControl(GR_CONTROL_DEACTIVATE);
}
}
break;
@@ -351,7 +380,7 @@ HGLRC GLAPIENTRY wglCreateContext(HDC hdc)
hDC = GetDC(dibWnd);
dibBMI = (BITMAPINFO*) malloc( sizeof(BITMAPINFO) + (256*sizeof(RGBQUAD)));
dibBMI = (BITMAPINFO*) MALLOC( sizeof(BITMAPINFO) + (256*sizeof(RGBQUAD)));
memset(dibBMI,0,sizeof(BITMAPINFO) + (256*sizeof(RGBQUAD)));
@@ -382,7 +411,7 @@ HGLRC GLAPIENTRY wglCreateContext(HDC hdc)
gdiWindowHack = GL_FALSE;
else {
gdiWindowHack = GL_TRUE;
grSstControl(GR_CONTROL_DEACTIVATE);
FX_grSstControl(GR_CONTROL_DEACTIVATE);
}
}
} else {
@@ -429,7 +458,7 @@ BOOL GLAPIENTRY wglDeleteContext(HGLRC hglrc)
if(ctx && hglrc == (HGLRC)1) {
if (gdiWindowHackEna) {
DeleteObject(dibHBM);
free(dibBMI);
FREE(dibBMI);
dibSurfacePtr = NULL;
dibBMI = NULL;
@@ -542,7 +571,7 @@ BOOL GLAPIENTRY wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChar
SetTextColor(bitDevice, tempColor);
// Place chars based on base line
VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0);
VERIFY(SetTextAlign(bitDevice, TA_BASELINE) >= 0 ? 1 : 0);
for(i = 0; i < numChars; i++) {
SIZE size;
@@ -584,7 +613,7 @@ BOOL GLAPIENTRY wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChar
// Convert the display dependant representation to a 1 bit deep DIB
numBytes = (bmapWidth * bmapHeight) / 8;
bmap = malloc(numBytes);
bmap = MALLOC(numBytes);
dibInfo->bmiHeader.biWidth = bmapWidth;
dibInfo->bmiHeader.biHeight = bmapHeight;
res = GetDIBits(bitDevice, bitObject, 0, bmapHeight, bmap,
@@ -604,13 +633,13 @@ BOOL GLAPIENTRY wglUseFontBitmaps(HDC fontDevice, DWORD firstChar, DWORD numChar
DeleteObject(bitObject);
// Deallocate the bitmap data
free(bmap);
FREE(bmap);
}
// Destroy the DC
VERIFY(DeleteDC(bitDevice));
free(dibInfo);
FREE(dibInfo);
return TRUE;
#undef VERIFY
@@ -779,7 +808,7 @@ BOOL GLAPIENTRY wglSwapBuffers(HDC hdc)
HDC hdcDIBSection = CreateCompatibleDC(hdcScreen);
HBITMAP holdBitmap = (HBITMAP) SelectObject(hdcDIBSection, dibHBM);
grLfbReadRegion(GR_BUFFER_FRONTBUFFER, 0, 0,
FX_grLfbReadRegion(GR_BUFFER_FRONTBUFFER, 0, 0,
width, height,
width * 2,
dibSurfacePtr);
@@ -799,6 +828,7 @@ BOOL GLAPIENTRY wglSwapBuffers(HDC hdc)
* display. Obviously, it's performance hit will be higher on larger displays and
* less on smaller displays. To support the window-hack display this is probably fine.
*/
#if FXMESA_USE_ARGB
{
unsigned long *pixel = dibSurfacePtr;
unsigned long count = (width * height) / 2;
@@ -811,7 +841,8 @@ BOOL GLAPIENTRY wglSwapBuffers(HDC hdc)
;
}
}
#endif
BitBlt(hdcScreen, 0, 0,
width, height,
hdcDIBSection,

View File

@@ -1,10 +1,10 @@
/* $Id: osmesa.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: osmesa.c,v 1.2.2.3 2000/04/04 00:52:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.2
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -212,7 +212,7 @@ OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, OSMesaContext share
}
osmesa = (OSMesaContext) calloc( 1, sizeof(struct osmesa_context) );
osmesa = (OSMesaContext) CALLOC_STRUCT(osmesa_context);
if (osmesa) {
osmesa->gl_visual = gl_create_visual( rgbmode,
swalpha, /* software alpha */
@@ -224,6 +224,7 @@ OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, OSMesaContext share
indexBits,
8, 8, 8, alphaBits );
if (!osmesa->gl_visual) {
FREE(osmesa);
return NULL;
}
@@ -232,14 +233,14 @@ OSMesaContext GLAPIENTRY OSMesaCreateContext( GLenum format, OSMesaContext share
(void *) osmesa, GL_TRUE );
if (!osmesa->gl_ctx) {
gl_destroy_visual( osmesa->gl_visual );
free(osmesa);
FREE(osmesa);
return NULL;
}
osmesa->gl_buffer = gl_create_framebuffer( osmesa->gl_visual );
if (!osmesa->gl_buffer) {
gl_destroy_visual( osmesa->gl_visual );
gl_destroy_context( osmesa->gl_ctx );
free(osmesa);
FREE(osmesa);
return NULL;
}
osmesa->format = format;
@@ -275,7 +276,7 @@ void GLAPIENTRY OSMesaDestroyContext( OSMesaContext ctx )
gl_destroy_visual( ctx->gl_visual );
gl_destroy_framebuffer( ctx->gl_buffer );
gl_destroy_context( ctx->gl_ctx );
free( ctx );
FREE( ctx );
}
}
@@ -631,8 +632,13 @@ static GLbitfield clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLuint i, n, *ptr4;
n = osmesa->rowlength * osmesa->height;
ptr4 = (GLuint *) osmesa->buffer;
for (i=0;i<n;i++) {
*ptr4++ = osmesa->clearpixel;
if (osmesa->clearpixel) {
for (i=0;i<n;i++) {
*ptr4++ = osmesa->clearpixel;
}
}
else {
BZERO(ptr4, n * sizeof(GLuint));
}
}
else {

View File

@@ -1,9 +1,9 @@
/* $Id: svgamesa.c,v 1.1 1999/08/19 00:55:42 jtg Exp $ */
/* $Id: svgamesa.c,v 1.1.1.1.2.3 2000/01/22 20:06:20 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.0
* Copyright (C) 1995-1998 Brian Paul
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,23 +21,19 @@
*/
/*
* Linux SVGA/Mesa interface.
*
* This interface is not finished! Still have to implement pixel
* reading functions and double buffering. Then, look into accelerated
* line and polygon rendering. And, clean up a bunch of other stuff.
* Any volunteers?
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#ifdef SVGA
#ifdef PC_HEADER
#include "all.h"
#else
@@ -48,35 +44,164 @@
#include "context.h"
#include "matrix.h"
#include "types.h"
#include <string.h>
#endif
#include "svgapix.h"
#include "svgamesa8.h"
#include "svgamesa15.h"
#include "svgamesa16.h"
#include "svgamesa24.h"
#include "svgamesa32.h"
struct svgamesa_context {
GLcontext *gl_ctx; /* the core Mesa context */
GLvisual *gl_vis; /* describes the color buffer */
GLframebuffer *gl_buffer; /* the ancillary buffers */
GLuint index; /* current color index */
GLint red, green, blue; /* current rgb color */
GLint width, height; /* size of color buffer */
GLint depth; /* bits per pixel (8,16,24 or 32) */
};
struct svga_buffer SVGABuffer;
vga_modeinfo * SVGAInfo;
SVGAMesaContext SVGAMesa; /* the current context */
#ifdef SVGA_DEBUG
static SVGAMesaContext SVGAMesa = NULL; /* the current context */
#include <sys/types.h>
#include <signal.h>
FILE * logfile;
char cbuf[1024]={0};
void SVGAlog(char * what)
{
logfile=fopen("svgamesa.log","a");
if (!logfile) return;
fprintf(logfile,"%s\n",what);
fclose(logfile);
}
#endif
/*
* Convert Mesa window Y coordinate to VGA screen Y coordinate:
*/
#define FLIP(Y) (SVGAMesa->height-(Y)-1)
/**********************************************************************/
/***** Init stuff... *****/
/**********************************************************************/
int SVGAMesaInit( int GraphMode )
{
vga_init();
if (!vga_hasmode(GraphMode))
{
fprintf(stderr,"GraphMode %d unavailable...",GraphMode);
#ifdef SVGA_DEBUG
SVGAlog("SVGAMesaInit: invalid GraphMode (doesn't exist)");
#endif
return(1);
}
SVGAInfo=vga_getmodeinfo(GraphMode);
if (SVGAInfo->flags & IS_MODEX)
{
fprintf(stderr,"ModeX not implemented...");
#ifdef SVGA_DEBUG
SVGAlog("SVGAMesaInit: invalid GraphMode (ModeX)");
#endif
return(2);
}
if (!SVGAInfo->bytesperpixel)
{
fprintf(stderr,"1 / 4 bit color not implemented...");
#ifdef SVGA_DEBUG
SVGAlog("SVGAMesaInit: invalid GraphMode (1 or 4 bit)");
#endif
return(3);
}
switch (SVGAInfo->colors) {
case 256: SVGABuffer.Depth = 8; break;
case 32768: SVGABuffer.Depth = 15; break;
case 65536: SVGABuffer.Depth = 16; break;
default: SVGABuffer.Depth = SVGAInfo->bytesperpixel<<3; break;
}
SVGABuffer.BufferSize=SVGAInfo->linewidth*SVGAInfo->height;
#ifdef SVGA_DEBUG
sprintf(cbuf,"SVGAMesaInit: double buffer info.\n" \
" depth : %d\n" \
" mode : %d\n" \
" width : %d\n" \
" height : %d\n" \
" bufsize: %d\n", \
SVGABuffer.Depth,GraphMode,SVGAInfo->linewidth, \
SVGAInfo->height,SVGABuffer.BufferSize);
SVGAlog(cbuf);
#endif
SVGABuffer.FrontBuffer=(void*)malloc(SVGABuffer.BufferSize + 4);
if (!SVGABuffer.FrontBuffer) {
{
fprintf(stderr,"Not enough RAM for FRONT_LEFT_BUFFER...");
#ifdef SVGA_DEBUG
SVGAlog("SVGAMesaInit: Not enough RAM (front buffer)");
#endif
return(4);
}
}
#ifdef SVGA_DEBUG
sprintf(cbuf,"SVGAMesaInit: FrontBuffer - %p",SVGABuffer.FrontBuffer);
SVGAlog(cbuf);
#endif
SVGABuffer.BackBuffer=(void*)malloc(SVGABuffer.BufferSize + 4);
if (!SVGABuffer.BackBuffer) {
{
free(SVGABuffer.FrontBuffer);
fprintf(stderr,"Not enough RAM for BACK_LEFT_BUFFER...");
#ifdef SVGA_DEBUG
SVGAlog("SVGAMesaInit: Not enough RAM (back buffer)");
#endif
return(5);
}
}
#ifdef SVGA_DEBUG
sprintf(cbuf,"SVGAMesaInit: BackBuffer - %p",SVGABuffer.BackBuffer);
SVGAlog(cbuf);
#endif
vga_setmode(GraphMode);
SVGABuffer.VideoRam=vga_getgraphmem();
#ifdef SVGA_DEBUG
sprintf(cbuf,"SVGAMesaInit: VRAM - %p",SVGABuffer.VideoRam);
SVGAlog(cbuf);
sprintf(cbuf,"SVGAMesaInit: done. (Mode %d)",GraphMode);
SVGAlog(cbuf);
#endif
return 0;
}
int SVGAMesaClose( void )
{
vga_setmode(TEXT);
free(SVGABuffer.FrontBuffer);
free(SVGABuffer.BackBuffer);
return 0;
}
void SVGAMesaSetCI(int ndx, GLubyte red, GLubyte green, GLubyte blue)
{
if (ndx<256) vga_setpalette(ndx, red>>2, green>>2, blue>>2);
}
/**********************************************************************/
/***** Miscellaneous functions *****/
/**********************************************************************/
static void copy_buffer( GLubyte * buffer) {
int size = SVGABuffer.BufferSize, page = 0;
#ifdef SVGA_DEBUG
sprintf(cbuf,"copy_buffer: copy %p to %p",buffer,SVGABuffer.VideoRam);
SVGAlog(cbuf);
#endif
while(size>0) {
vga_setpage(page++);
if (size>>16) {
memcpy(SVGABuffer.VideoRam,buffer,0x10000);
buffer+=0x10000;
}else{
memcpy(SVGABuffer.VideoRam,buffer,size & 0xffff);
}
size-=0xffff;
}
}
static void get_buffer_size( GLcontext *ctx, GLuint *width, GLuint *height )
{
@@ -84,279 +209,33 @@ static void get_buffer_size( GLcontext *ctx, GLuint *width, GLuint *height )
*height = SVGAMesa->height = vga_getydim();
}
/* Set current color index */
static void set_index( GLcontext *ctx, GLuint index )
{
SVGAMesa->index = index;
vga_setcolor( index );
}
/* Set current drawing color */
static void set_color( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->red = red;
SVGAMesa->green = green;
SVGAMesa->blue = blue;
vga_setrgbcolor( red, green, blue );
}
static void clear_index( GLcontext *ctx, GLuint index )
{
/* TODO: Implements glClearIndex() */
}
static void clear_color( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
/* TODO: Implements glClearColor() */
}
static GLbitfield clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
if (mask & GL_COLOR_BUFFER_BIT) {
vga_clear();
}
return mask & (~GL_COLOR_BUFFER_BIT);
}
static GLboolean set_buffer( GLcontext *ctx, GLenum buffer )
{
/* TODO: implement double buffering and use this function to select */
/* between front and back buffers. */
void * tmpptr;
if (buffer == GL_FRONT_LEFT)
return GL_TRUE;
{
/* vga_waitretrace(); */
copy_buffer(SVGABuffer.FrontBuffer);
tmpptr=SVGABuffer.BackBuffer;
SVGABuffer.BackBuffer=SVGABuffer.FrontBuffer;
SVGABuffer.FrontBuffer=tmpptr;
return GL_TRUE;
}
else if (buffer == GL_BACK_LEFT)
return GL_TRUE;
{
/* vga_waitretrace(); */
copy_buffer(SVGABuffer.BackBuffer);
return GL_TRUE;
}
else
return GL_FALSE;
}
/**********************************************************************/
/***** Write spans of pixels *****/
/***** *****/
/**********************************************************************/
static void write_ci32_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLuint index[], const GLubyte mask[] )
{
int i;
y = FLIP(y);
for (i=0;i<n;i++,x++) {
if (mask[i]) {
vga_setcolor( index[i] );
vga_drawpixel( x, y );
}
}
}
static void write_ci8_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte index[], const GLubyte mask[] )
{
int i;
y = FLIP(y);
for (i=0;i<n;i++,x++) {
if (mask[i]) {
vga_setcolor( index[i] );
vga_drawpixel( x, y );
}
}
}
static void write_mono_ci_span( const GLcontext *ctx, GLuint n,
GLint x, GLint y, const GLubyte mask[] )
{
int i;
y = FLIP(y);
/* use current color index */
vga_setcolor( SVGAMesa->index );
for (i=0;i<n;i++,x++) {
if (mask[i]) {
vga_drawpixel( x, y );
}
}
}
static void write_rgba_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
y=FLIP(y);
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++, x++) {
if (mask[i]) {
vga_setrgbcolor( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
vga_drawpixel( x, y );
}
}
}
else {
/* draw all pixels */
for (i=0; i<n; i++, x++) {
vga_setrgbcolor( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
vga_drawpixel( x, y );
}
}
}
static void write_mono_rgba_span( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLubyte mask[])
{
int i;
y=FLIP(y);
/* use current rgb color */
vga_setrgbcolor( SVGAMesa->red, SVGAMesa->green, SVGAMesa->blue );
for (i=0; i<n; i++, x++) {
if (mask[i]) {
vga_drawpixel( x, y );
}
}
}
/**********************************************************************/
/***** Read spans of pixels *****/
/**********************************************************************/
static void read_ci32_span( const GLcontext *ctx,
GLuint n, GLint x, GLint y, GLuint index[])
{
int i;
y = FLIP(y);
for (i=0; i<n; i++,x++) {
index[i] = vga_getpixel( x, y );
}
}
static void read_rgba_span( const GLcontext *ctx, GLuint n, GLint x, GLint y,
GLubyte rgba[][4] )
{
int i;
for (i=0; i<n; i++, x++) {
/* TODO */
}
}
/**********************************************************************/
/***** Write arrays of pixels *****/
/**********************************************************************/
static void write_ci32_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLuint index[], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++) {
if (mask[i]) {
vga_setcolor( index[i] );
vga_drawpixel( x[i], FLIP(y[i]) );
}
}
}
static void write_mono_ci_pixels( const GLcontext *ctx, GLuint n,
const GLint x[], const GLint y[],
const GLubyte mask[] )
{
int i;
/* use current color index */
vga_setcolor( SVGAMesa->index );
for (i=0; i<n; i++) {
if (mask[i]) {
vga_drawpixel( x[i], FLIP(y[i]) );
}
}
}
static void write_rgba_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++) {
if (mask[i]) {
vga_setrgbcolor( rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP] );
vga_drawpixel( x[i], FLIP(y[i]) );
}
}
}
static void write_mono_rgba_pixels( const GLcontext *ctx,
GLuint n,
const GLint x[], const GLint y[],
const GLubyte mask[] )
{
int i;
/* use current rgb color */
vga_setrgbcolor( SVGAMesa->red, SVGAMesa->green, SVGAMesa->blue );
for (i=0; i<n; i++) {
if (mask[i]) {
vga_drawpixel( x[i], FLIP(y[i]) );
}
}
}
/**********************************************************************/
/***** Read arrays of pixels *****/
/**********************************************************************/
/* Read an array of color index pixels. */
static void read_ci32_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLuint index[], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++,x++) {
index[i] = vga_getpixel( x[i], FLIP(y[i]) );
}
}
static void read_rgba_pixels( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLubyte rgba[][4], const GLubyte mask[] )
{
/* TODO */
}
static void svgamesa_update_state( GLcontext *ctx )
{
/* Initialize all the pointers in the DD struct. Do this whenever */
@@ -364,13 +243,6 @@ static void svgamesa_update_state( GLcontext *ctx )
ctx->Driver.UpdateState = svgamesa_update_state;
ctx->Driver.ClearIndex = clear_index;
ctx->Driver.ClearColor = clear_color;
ctx->Driver.Clear = clear;
ctx->Driver.Index = set_index;
ctx->Driver.Color = set_color;
ctx->Driver.SetBuffer = set_buffer;
ctx->Driver.GetBufferSize = get_buffer_size;
@@ -378,59 +250,119 @@ static void svgamesa_update_state( GLcontext *ctx )
ctx->Driver.LineFunc = NULL;
ctx->Driver.TriangleFunc = NULL;
/* Pixel/span writing functions: */
/* TODO: use different funcs for 8, 16, 32-bit depths */
ctx->Driver.WriteRGBASpan = write_rgba_span;
ctx->Driver.WriteMonoRGBASpan = write_mono_rgba_span;
ctx->Driver.WriteRGBAPixels = write_rgba_pixels;
ctx->Driver.WriteMonoRGBAPixels = write_mono_rgba_pixels;
ctx->Driver.WriteCI32Span = write_ci32_span;
ctx->Driver.WriteCI8Span = write_ci8_span;
ctx->Driver.WriteMonoCISpan = write_mono_ci_span;
ctx->Driver.WriteCI32Pixels = write_ci32_pixels;
ctx->Driver.WriteMonoCIPixels = write_mono_ci_pixels;
switch (SVGABuffer.Depth) {
case 8: ctx->Driver.ClearIndex = __clear_index8;
ctx->Driver.Clear = __clear8;
ctx->Driver.Index = __set_index8;
/* Pixel/span reading functions: */
/* TODO: use different funcs for 8, 16, 32-bit depths */
ctx->Driver.ReadCI32Span = read_ci32_span;
ctx->Driver.ReadRGBASpan = read_rgba_span;
ctx->Driver.ReadCI32Pixels = read_ci32_pixels;
ctx->Driver.ReadRGBAPixels = read_rgba_pixels;
ctx->Driver.ReadCI32Span = __read_ci32_span8;
ctx->Driver.ReadCI32Pixels = __read_ci32_pixels8;
ctx->Driver.WriteCI8Span = __write_ci8_span8;
ctx->Driver.WriteCI32Span = __write_ci32_span8;
ctx->Driver.WriteCI32Pixels = __write_ci32_pixels8;
ctx->Driver.WriteMonoCISpan = __write_mono_ci_span8;
ctx->Driver.WriteMonoCIPixels = __write_mono_ci_pixels8;
#ifdef SVGA_DEBUG
SVGAlog("SVGAUpdateState: 8 bit mode.");
#endif
break;
case 15: ctx->Driver.ClearColor = __clear_color15;
ctx->Driver.Clear = __clear15;
ctx->Driver.Color = __set_color15;
ctx->Driver.ReadRGBASpan = __read_rgba_span15;
ctx->Driver.ReadRGBAPixels = __read_rgba_pixels15;
ctx->Driver.WriteRGBASpan = __write_rgba_span15;
ctx->Driver.WriteRGBAPixels = __write_rgba_pixels15;
ctx->Driver.WriteMonoRGBASpan = __write_mono_rgba_span15;
ctx->Driver.WriteMonoRGBAPixels = __write_mono_rgba_pixels15;
#ifdef SVGA_DEBUG
SVGAlog("SVGAUpdateState: 15 bit mode.");
#endif
break;
case 16: ctx->Driver.ClearColor = __clear_color16;
ctx->Driver.Clear = __clear16;
ctx->Driver.Color = __set_color16;
ctx->Driver.ReadRGBASpan = __read_rgba_span16;
ctx->Driver.ReadRGBAPixels = __read_rgba_pixels16;
ctx->Driver.WriteRGBASpan = __write_rgba_span16;
ctx->Driver.WriteRGBAPixels = __write_rgba_pixels16;
ctx->Driver.WriteMonoRGBASpan = __write_mono_rgba_span16;
ctx->Driver.WriteMonoRGBAPixels = __write_mono_rgba_pixels16;
break;
#ifdef SVGA_DEBUG
SVGAlog("SVGAUpdateState: 16 bit mode.");
#endif
case 24: ctx->Driver.ClearColor = __clear_color24;
ctx->Driver.Clear = __clear24;
ctx->Driver.Color = __set_color24;
ctx->Driver.ReadRGBASpan = __read_rgba_span24;
ctx->Driver.ReadRGBAPixels = __read_rgba_pixels24;
ctx->Driver.WriteRGBASpan = __write_rgba_span24;
ctx->Driver.WriteRGBAPixels = __write_rgba_pixels24;
ctx->Driver.WriteMonoRGBASpan = __write_mono_rgba_span24;
ctx->Driver.WriteMonoRGBAPixels = __write_mono_rgba_pixels24;
break;
#ifdef SVGA_DEBUG
SVGAlog("SVGAUpdateState: 32 bit mode.");
#endif
case 32: ctx->Driver.ClearColor = __clear_color32;
ctx->Driver.Clear = __clear32;
ctx->Driver.Color = __set_color32;
ctx->Driver.ReadRGBASpan = __read_rgba_span32;
ctx->Driver.ReadRGBAPixels = __read_rgba_pixels32;
ctx->Driver.WriteRGBASpan = __write_rgba_span32;
ctx->Driver.WriteRGBAPixels = __write_rgba_pixels32;
ctx->Driver.WriteMonoRGBASpan = __write_mono_rgba_span32;
ctx->Driver.WriteMonoRGBAPixels = __write_mono_rgba_pixels32;
}
}
/*
* Create a new VGA/Mesa context and return a handle to it.
*/
SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer )
{
SVGAMesaContext ctx;
#ifndef DEV
GLboolean rgb_flag;
GLfloat redscale, greenscale, bluescale, alphascale;
GLboolean alpha_flag = GL_FALSE;
int colors;
GLint index_bits;
GLint redbits, greenbits, bluebits, alphabits;
/* determine if we're in RGB or color index mode */
colors = vga_getcolors();
if (colors==32768) {
if ((SVGABuffer.Depth==32) || (SVGABuffer.Depth==24)) {
rgb_flag = GL_TRUE;
redscale = greenscale = bluescale = alphascale = 255.0;
redbits = greenbits = bluebits = 8;
alphabits = 0;
index_bits = 0;
}
else if (colors==256) {
else if (SVGABuffer.Depth==8) {
rgb_flag = GL_FALSE;
redscale = greenscale = bluescale = alphascale = 0.0;
redbits = greenbits = bluebits = alphabits = 0;
index_bits = 8;
}
else {
printf(">16 bit color not implemented yet!\n");
return NULL;
else if (SVGABuffer.Depth==15) {
rgb_flag = GL_TRUE;
redscale = greenscale = bluescale = alphascale = 31.0;
redbits = greenbits = bluebits = 5;
alphabits = 0;
index_bits = 0;
}
else if (SVGABuffer.Depth==16) {
rgb_flag = GL_TRUE;
redscale = bluescale = alphascale = 31.0;
greenscale = 63.0;
redbits = bluebits = 5;
greenbits = 6;
alphabits = 0;
index_bits = 0;
}
ctx = (SVGAMesaContext) calloc( 1, sizeof(struct svgamesa_context) );
@@ -459,18 +391,16 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer )
ctx->red = ctx->green = ctx->blue = 255;
ctx->width = ctx->height = 0; /* temporary until first "make-current" */
#endif
return ctx;
}
/*
* Destroy the given VGA/Mesa context.
*/
void SVGAMesaDestroyContext( SVGAMesaContext ctx )
{
#ifndef DEV
if (ctx) {
gl_destroy_visual( ctx->gl_vis );
gl_destroy_context( ctx->gl_ctx );
@@ -480,15 +410,15 @@ void SVGAMesaDestroyContext( SVGAMesaContext ctx )
SVGAMesa = NULL;
}
}
#endif
}
/*
* Make the specified VGA/Mesa context the current one.
*/
void SVGAMesaMakeCurrent( SVGAMesaContext ctx )
{
#ifndef DEV
SVGAMesa = ctx;
svgamesa_update_state( ctx->gl_ctx );
gl_make_current( ctx->gl_ctx, ctx->gl_buffer );
@@ -499,10 +429,9 @@ void SVGAMesaMakeCurrent( SVGAMesaContext ctx )
ctx->height = vga_getydim();
gl_Viewport( ctx->gl_ctx, 0, 0, ctx->width, ctx->height );
}
#endif
}
/*
* Return a handle to the current VGA/Mesa context.
*/
@@ -511,20 +440,38 @@ SVGAMesaContext SVGAMesaGetCurrentContext( void )
return SVGAMesa;
}
/*
* Swap front/back buffers for current context if double buffered.
*/
void SVGAMesaSwapBuffers( void )
{
void * tmpptr;
/* vga_waitretrace(); */
copy_buffer(SVGABuffer.BackBuffer);
#ifndef DEV
FLUSH_VB( SVGAMesa->gl_ctx, "swap buffers" );
if (SVGAMesa->gl_vis->DBflag) {
vga_flip();
}
if (SVGAMesa->gl_vis->DBflag)
#endif /* DEV */
{
#ifdef SVGA_DEBUG
sprintf(cbuf,"SVGAMesaSwapBuffers : Swapping...");
SVGAlog(cbuf);
#endif /* SVGA_DEBUG */
tmpptr=SVGABuffer.BackBuffer;
SVGABuffer.BackBuffer=SVGABuffer.FrontBuffer;
SVGABuffer.FrontBuffer=tmpptr;
#ifdef SVGA_DEBUG
sprintf(cbuf,"SVGAMesaSwapBuffers : WriteBuffer : %p\n"
" Readbuffer : %p", \
SVGABuffer.BackBuffer, SVGABuffer.FrontBuffer );
SVGAlog(cbuf);
#endif /* SVGA_DEBUG */
}
}
#else
#else /*SVGA*/
/*
* Need this to provide at least one external definition when SVGA is

View File

@@ -0,0 +1,185 @@
/* $Id: svgamesa15.c,v 1.1.2.4 2000/01/31 22:10:39 tanner Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#ifdef SVGA
#include "svgapix.h"
GLshort * shortBuffer;
int __svga_drawpixel15(int x, int y, unsigned long c)
{
unsigned long offset;
shortBuffer=(void *)SVGABuffer.BackBuffer;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->width + x;
shortBuffer[offset]=c;
return 0;
}
unsigned long __svga_getpixel15(int x, int y)
{
unsigned long offset;
shortBuffer=(void *)SVGABuffer.BackBuffer;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->width + x;
return shortBuffer[offset];
}
void __set_color15( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->hicolor=(red>>3)<<10 | (green>>3)<<5 | (blue>>3);
/* SVGAMesa->hicolor=(red)<<10 | (green)<<5 | (blue); */
}
void __clear_color15( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->clear_hicolor=(red>>3)<<10 | (green>>3)<<5 | (blue>>3);
/* SVGAMesa->clear_hicolor=(red)<<10 | (green)<<5 | (blue);*/
}
GLbitfield __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
int i,j;
if (mask & GL_COLOR_BUFFER_BIT) {
shortBuffer=(void *)SVGABuffer.BackBuffer;
if (all) {
for (i=0;i<SVGABuffer.BufferSize / 2;i++) shortBuffer[i]=SVGAMesa->clear_hicolor;
} else {
for (i=x;i<width;i++)
for (j=y;j<height;j++)
__svga_drawpixel15(i,j,SVGAMesa->clear_hicolor);
}
}
return mask & (~GL_COLOR_BUFFER_BIT);
}
void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++, x++) {
if (mask[i]) {
__svga_drawpixel15( x, y, (rgba[i][RCOMP]>>3)<<10 | \
(rgba[i][GCOMP]>>3)<<5 | \
(rgba[i][BCOMP]>>3));
}
}
}
else {
/* draw all pixels */
for (i=0; i<n; i++, x++) {
__svga_drawpixel15( x, y, (rgba[i][RCOMP]>>3)<<10 | \
(rgba[i][GCOMP]>>3)<<5 | \
(rgba[i][BCOMP]>>3));
}
}
}
void __write_mono_rgba_span15( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLubyte mask[])
{
int i;
for (i=0; i<n; i++, x++) {
if (mask[i]) {
__svga_drawpixel15( x, y, SVGAMesa->hicolor);
}
}
}
void __read_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y,
GLubyte rgba[][4] )
{
int i,pix;
for (i=0; i<n; i++, x++) {
pix = __svga_getpixel15( x, y);
rgba[i][RCOMP] = ((pix>>10)<<3) & 0xff;
rgba[i][GCOMP] = ((pix>> 5)<<3) & 0xff;
rgba[i][BCOMP] = ((pix )<<3) & 0xff;
}
}
void __write_rgba_pixels15( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel15( x[i], y[i], (rgba[i][RCOMP]>>3)<<10 | \
(rgba[i][GCOMP]>>3)<<5 | \
(rgba[i][BCOMP]>>3));
}
}
}
void __write_mono_rgba_pixels15( const GLcontext *ctx,
GLuint n,
const GLint x[], const GLint y[],
const GLubyte mask[] )
{
int i;
/* use current rgb color */
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel15( x[i], y[i], SVGAMesa->hicolor );
}
}
}
void __read_rgba_pixels15( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLubyte rgba[][4], const GLubyte mask[] )
{
int i,pix;
for (i=0; i<n; i++,x++) {
pix = __svga_getpixel15( x[i], y[i] );
rgba[i][RCOMP] = ((pix>>10)<<3) & 0xff;
rgba[i][GCOMP] = ((pix>> 5)<<3) & 0xff;
rgba[i][BCOMP] = ((pix )<<3) & 0xff;
}
}
#endif

View File

@@ -0,0 +1,44 @@
/* $Id: svgamesa15.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifndef SVGA_MESA_15_H
#define SVGA_MESA_15_H
extern void __set_color15( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern void __clear_color15( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern GLbitfield __clear15( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
extern void __write_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
extern void __write_mono_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[]);
extern void __read_rgba_span15( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
extern void __write_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
extern void __write_mono_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
extern void __read_rgba_pixels15( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
#endif /* SVGA_MESA_15_H */

View File

@@ -0,0 +1,185 @@
/* $Id: svgamesa16.c,v 1.1.2.4 2000/01/31 22:10:39 tanner Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#ifdef SVGA
#include "svgapix.h"
GLshort * shortBuffer;
int __svga_drawpixel16(int x, int y, unsigned long c)
{
unsigned long offset;
shortBuffer=(void *)SVGABuffer.BackBuffer;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->width + x;
shortBuffer[offset]=c;
return 0;
}
unsigned long __svga_getpixel16(int x, int y)
{
unsigned long offset;
shortBuffer=(void *)SVGABuffer.BackBuffer;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->width + x;
return shortBuffer[offset];
}
void __set_color16( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->hicolor=(red>>3)<<11 | (green>>2)<<5 | (blue>>3);
/* SVGAMesa->hicolor=(red)<<11 | (green)<<5 | (blue); */
}
void __clear_color16( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->clear_hicolor=(red>>3)<<11 | (green>>2)<<5 | (blue>>3);
/* SVGAMesa->clear_hicolor=(red)<<11 | (green)<<5 | (blue); */
}
GLbitfield __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
int i,j;
if (mask & GL_COLOR_BUFFER_BIT) {
if (all) {
shortBuffer=(void *)SVGABuffer.BackBuffer;
for (i=0;i<SVGABuffer.BufferSize / 2;i++) shortBuffer[i]=SVGAMesa->clear_hicolor;
} else {
for (i=x;i<width;i++)
for (j=y;j<height;j++)
__svga_drawpixel16(i,j,SVGAMesa->clear_hicolor);
}
}
return mask & (~GL_COLOR_BUFFER_BIT);
}
void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++, x++) {
if (mask[i]) {
__svga_drawpixel16( x, y, (rgba[i][RCOMP]>>3)<<11 | \
(rgba[i][GCOMP]>>2)<<5 | \
(rgba[i][BCOMP]>>3));
}
}
}
else {
/* draw all pixels */
for (i=0; i<n; i++, x++) {
__svga_drawpixel16( x, y, (rgba[i][RCOMP]>>3)<<11 | \
(rgba[i][GCOMP]>>2)<<5 | \
(rgba[i][BCOMP]>>3));
}
}
}
void __write_mono_rgba_span16( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLubyte mask[])
{
int i;
for (i=0; i<n; i++, x++) {
if (mask[i]) {
__svga_drawpixel16( x, y, SVGAMesa->hicolor);
}
}
}
void __read_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y,
GLubyte rgba[][4] )
{
int i,pix;
for (i=0; i<n; i++, x++) {
pix = __svga_getpixel16( x, y );
rgba[i][RCOMP] = ((pix>>11)<<3) & 0xff;
rgba[i][GCOMP] = ((pix>> 5)<<2) & 0xff;
rgba[i][BCOMP] = ((pix )<<3) & 0xff;
}
}
void __write_rgba_pixels16( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel16( x[i], y[i], (rgba[i][RCOMP]>>3)<<11 | \
(rgba[i][GCOMP]>>2)<<5 | \
(rgba[i][BCOMP]>>3));
}
}
}
void __write_mono_rgba_pixels16( const GLcontext *ctx,
GLuint n,
const GLint x[], const GLint y[],
const GLubyte mask[] )
{
int i;
/* use current rgb color */
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel16( x[i], y[i], SVGAMesa->hicolor );
}
}
}
void __read_rgba_pixels16( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLubyte rgba[][4], const GLubyte mask[] )
{
int i,pix;
for (i=0; i<n; i++,x++) {
pix = __svga_getpixel16( x[i], y[i] );
rgba[i][RCOMP] = ((pix>>11)<<3) & 0xff;
rgba[i][GCOMP] = ((pix>> 5)<<2) & 0xff;
rgba[i][BCOMP] = ((pix )<<3) & 0xff;
}
}
#endif

View File

@@ -0,0 +1,45 @@
/* $Id: svgamesa16.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifndef SVGA_MESA_16_H
#define SVGA_MESA_16_H
extern void __set_color16( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern void __clear_color16( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern GLbitfield __clear16( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
extern void __write_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
extern void __write_mono_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[]);
extern void __read_rgba_span16( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
extern void __write_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
extern void __write_mono_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
extern void __read_rgba_pixels16( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
#endif /* SVGA_MESA_16_H */

View File

@@ -0,0 +1,215 @@
/* $Id: svgamesa24.c,v 1.1.2.5 2000/01/31 22:10:39 tanner Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#ifdef SVGA
#include "svgapix.h"
_RGB * rgbBuffer;
#if 0
/* this doesn't compile with GCC on RedHat 6.1 */
inline int RGB2BGR24(int c)
{
asm("rorw $8, %0\n"
"rorl $16, %0\n"
"rorw $8, %0\n"
"shrl $8, %0\n"
: "=q"(c):"0"(c));
return c;
}
#else
static unsigned long RGB2BGR24(unsigned long color)
{
return (color & 0xff00)|(color>>16)|((color & 0xff)<<16);
}
#endif
int __svga_drawpixel24(int x, int y, GLubyte r, GLubyte g, GLubyte b)
{
unsigned long offset;
rgbBuffer=(void *)SVGABuffer.BackBuffer;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->width + x;
rgbBuffer[offset].r=r;
rgbBuffer[offset].g=g;
rgbBuffer[offset].b=b;
return 0;
}
unsigned long __svga_getpixel24(int x, int y)
{
unsigned long offset;
rgbBuffer=(void *)SVGABuffer.BackBuffer;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->width + x;
return rgbBuffer[offset].r<<16 | rgbBuffer[offset].g<<8 | rgbBuffer[offset].b;
}
void __set_color24( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->red = red;
SVGAMesa->green = green;
SVGAMesa->blue = blue;
/* SVGAMesa->truecolor = red<<16 | green<<8 | blue; */
}
void __clear_color24( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->clear_red = red;
SVGAMesa->clear_green = green;
SVGAMesa->clear_blue = blue;
/* SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue; */
}
GLbitfield __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
int i,j;
if (mask & GL_COLOR_BUFFER_BIT) {
if (all) {
rgbBuffer=(void *)SVGABuffer.BackBuffer;
for (i=0;i<SVGABuffer.BufferSize / 3;i++)
{
rgbBuffer[i].r=SVGAMesa->clear_red;
rgbBuffer[i].g=SVGAMesa->clear_green;
rgbBuffer[i].b=SVGAMesa->clear_blue;
}
} else {
for (i=x;i<width;i++)
for (j=y;j<height;j++)
__svga_drawpixel24( i, j, SVGAMesa->clear_red,
SVGAMesa->clear_green,
SVGAMesa->clear_blue);
}
}
return mask & (~GL_COLOR_BUFFER_BIT);
}
void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++, x++) {
if (mask[i]) {
__svga_drawpixel24( x, y, rgba[i][RCOMP],
rgba[i][GCOMP],
rgba[i][BCOMP]);
}
}
}
else {
/* draw all pixels */
for (i=0; i<n; i++, x++) {
__svga_drawpixel24( x, y, rgba[i][RCOMP],
rgba[i][GCOMP],
rgba[i][BCOMP]);
}
}
}
void __write_mono_rgba_span24( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLubyte mask[])
{
int i;
for (i=0; i<n; i++, x++) {
if (mask[i]) {
__svga_drawpixel24( x, y, SVGAMesa->red,
SVGAMesa->green,
SVGAMesa->blue);
}
}
}
void __read_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y,
GLubyte rgba[][4] )
{
int i;
for (i=0; i<n; i++, x++) {
*((GLint*)rgba[i]) = RGB2BGR24(__svga_getpixel24( x, y));
}
}
void __write_rgba_pixels24( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel24( x[i], y[i], rgba[i][RCOMP],
rgba[i][GCOMP],
rgba[i][BCOMP]);
}
}
}
void __write_mono_rgba_pixels24( const GLcontext *ctx,
GLuint n,
const GLint x[], const GLint y[],
const GLubyte mask[] )
{
int i;
/* use current rgb color */
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel24( x[i], y[i], SVGAMesa->red,
SVGAMesa->green,
SVGAMesa->blue);
}
}
}
void __read_rgba_pixels24( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++,x++) {
*((GLint*)rgba[i]) = RGB2BGR24(__svga_getpixel24( x[i], y[i]));
}
}
#endif

View File

@@ -0,0 +1,45 @@
/* $Id: svgamesa24.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifndef SVGA_MESA_24_H
#define SVGA_MESA_24_H
extern void __set_color24( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern void __clear_color24( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern GLbitfield __clear24( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
extern void __write_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
extern void __write_mono_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[]);
extern void __read_rgba_span24( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
extern void __write_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
extern void __write_mono_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
extern void __read_rgba_pixels24( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
#endif /* SVGA_MESA_24_H */

View File

@@ -0,0 +1,192 @@
/* $Id: svgamesa32.c,v 1.1.2.5 2000/01/31 22:10:39 tanner Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#ifdef SVGA
#include "svgapix.h"
GLint * intBuffer;
#if 0
/* this doesn't compile with GCC on RedHat 6.1 */
inline int RGB2BGR32(int c)
{
asm("rorw $8, %0\n"
"rorl $16, %0\n"
"rorw $8, %0\n"
"shrl $8, %0\n"
: "=q"(c):"0"(c));
return c;
}
#else
static unsigned long RGB2BGR32(unsigned long color)
{
return (color & 0xff00)|(color>>16)|((color & 0xff)<<16);
}
#endif
int __svga_drawpixel32(int x, int y, unsigned long c)
{
unsigned long offset;
intBuffer=(void *)SVGABuffer.BackBuffer;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->width + x;
intBuffer[offset]=c;
return 0;
}
unsigned long __svga_getpixel32(int x, int y)
{
unsigned long offset;
intBuffer=(void *)SVGABuffer.BackBuffer;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->width + x;
return intBuffer[offset];
}
void __set_color32( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->red = red;
SVGAMesa->green = green;
SVGAMesa->blue = blue;
SVGAMesa->truecolor = red<<16 | green<<8 | blue;
}
void __clear_color32( GLcontext *ctx,
GLubyte red, GLubyte green,
GLubyte blue, GLubyte alpha )
{
SVGAMesa->clear_truecolor = red<<16 | green<<8 | blue;
}
GLbitfield __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
int i,j;
if (mask & GL_COLOR_BUFFER_BIT) {
if (all) {
intBuffer=(void *)SVGABuffer.BackBuffer;
for (i=0;i<SVGABuffer.BufferSize / 4;i++) intBuffer[i]=SVGAMesa->clear_truecolor;
} else {
for (i=x;i<width;i++)
for (j=y;j<height;j++)
__svga_drawpixel32(i,j,SVGAMesa->clear_truecolor);
}
}
return mask & (~GL_COLOR_BUFFER_BIT);
}
void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++, x++) {
if (mask[i]) {
__svga_drawpixel32( x, y, RGB2BGR32(*((GLint*)rgba[i])));
}
}
}
else {
/* draw all pixels */
for (i=0; i<n; i++, x++) {
__svga_drawpixel32( x, y, RGB2BGR32(*((GLint*)rgba[i])));
}
}
}
void __write_mono_rgba_span32( const GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLubyte mask[])
{
int i;
for (i=0; i<n; i++, x++) {
if (mask[i]) {
__svga_drawpixel32( x, y, SVGAMesa->truecolor);
}
}
}
void __read_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y,
GLubyte rgba[][4] )
{
int i;
for (i=0; i<n; i++, x++) {
*((GLint*)rgba[i]) = RGB2BGR32(__svga_getpixel32( x, y ));
}
}
void __write_rgba_pixels32( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel32( x[i], y[i], RGB2BGR32(*((GLint*)rgba[i])));
}
}
}
void __write_mono_rgba_pixels32( const GLcontext *ctx,
GLuint n,
const GLint x[], const GLint y[],
const GLubyte mask[] )
{
int i;
/* use current rgb color */
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel32( x[i], y[i], SVGAMesa->truecolor );
}
}
}
void __read_rgba_pixels32( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLubyte rgba[][4], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++,x++) {
*((GLint*)rgba[i]) = RGB2BGR32(__svga_getpixel32( x[i], y[i] ));
}
}
#endif

View File

@@ -0,0 +1,45 @@
/* $Id: svgamesa32.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifndef SVGA_MESA_32_H
#define SVGA_MESA_32_H
extern void __set_color32( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern void __clear_color32( GLcontext *ctx, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern GLbitfield __clear32( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
extern void __write_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
extern void __write_mono_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[]);
extern void __read_rgba_span32( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
extern void __write_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
extern void __write_mono_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
extern void __read_rgba_pixels32( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
#endif /* SVGA_MESA_32_H */

View File

@@ -0,0 +1,167 @@
/* $Id: svgamesa8.c,v 1.1.2.3 2000/01/31 22:10:39 tanner Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifdef HAVE_CONFIG_H
#include "conf.h"
#endif
#ifdef SVGA
#include "svgapix.h"
int __svga_drawpixel8(int x, int y, unsigned long c)
{
unsigned long offset;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->linewidth + x;
SVGABuffer.BackBuffer[offset]=c;
return 0;
}
unsigned long __svga_getpixel8(int x, int y)
{
unsigned long offset;
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->linewidth + x;
return SVGABuffer.BackBuffer[offset];
}
void __set_index8( GLcontext *ctx, GLuint index )
{
SVGAMesa->index = index;
}
void __clear_index8( GLcontext *ctx, GLuint index )
{
SVGAMesa->clear_index = index;
}
GLbitfield __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height )
{
int i,j;
if (mask & GL_COLOR_BUFFER_BIT) {
if (all)
{
memset(SVGABuffer.BackBuffer,SVGAMesa->clear_index,SVGABuffer.BufferSize);
} else {
for (i=x;i<width;i++)
for (j=y;j<height;j++)
__svga_drawpixel8(i,j,SVGAMesa->clear_index);
}
}
return mask & (~GL_COLOR_BUFFER_BIT);
}
void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLuint index[], const GLubyte mask[] )
{
int i;
for (i=0;i<n;i++,x++) {
if (mask[i]) {
__svga_drawpixel8( x, y, index[i]);
}
}
}
void __write_ci8_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte index[], const GLubyte mask[] )
{
int i;
for (i=0;i<n;i++,x++) {
if (mask[i]) {
__svga_drawpixel8( x, y, index[i]);
}
}
}
void __write_mono_ci_span8( const GLcontext *ctx, GLuint n,
GLint x, GLint y, const GLubyte mask[] )
{
int i;
for (i=0;i<n;i++,x++) {
if (mask[i]) {
__svga_drawpixel8( x, y, SVGAMesa->index);
}
}
}
void __read_ci32_span8( const GLcontext *ctx,
GLuint n, GLint x, GLint y, GLuint index[])
{
int i;
for (i=0; i<n; i++,x++) {
index[i] = __svga_getpixel8( x, y);
}
}
void __write_ci32_pixels8( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLuint index[], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel8( x[i], y[i], index[i]);
}
}
}
void __write_mono_ci_pixels8( const GLcontext *ctx, GLuint n,
const GLint x[], const GLint y[],
const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++) {
if (mask[i]) {
__svga_drawpixel8( x[i], y[i], SVGAMesa->index);
}
}
}
void __read_ci32_pixels8( const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLuint index[], const GLubyte mask[] )
{
int i;
for (i=0; i<n; i++,x++) {
index[i] = __svga_getpixel8( x[i], y[i]);
}
}
#endif

View File

@@ -0,0 +1,45 @@
/* $Id: svgamesa8.h,v 1.1.2.1 2000/01/22 20:05:09 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifndef SVGA_MESA_8_H
#define SVGA_MESA_8_H
extern void __set_index8( GLcontext *ctx, GLuint index );
extern void __clear_index8( GLcontext *ctx, GLuint index );
extern GLbitfield __clear8( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
extern void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLuint index[], const GLubyte mask[] );
extern void __write_ci8_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte index[], const GLubyte mask[] );
extern void __write_mono_ci_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] );
extern void __read_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y, GLuint index[]);
extern void __write_ci32_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLuint index[], const GLubyte mask[] );
extern void __write_mono_ci_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
extern void __read_ci32_pixels8( const GLcontext *ctx, GLuint n, const GLint x[], const GLint y[], GLuint index[], const GLubyte mask[] );
#endif /* SVGA_MESA_15_H */

View File

@@ -0,0 +1,71 @@
/* $Id: svgapix.h,v 1.1.2.2 2000/01/22 20:05:28 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.2
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* SVGA driver for Mesa.
* Original author: Brian Paul
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
#ifndef SVGAPIX_H
#define SVGAPIX_H
#include "GL/gl.h"
#include "GL/svgamesa.h"
#include "context.h"
#include "vga.h"
struct svgamesa_context {
GLcontext *gl_ctx; /* the core Mesa context */
GLvisual *gl_vis; /* describes the color buffer */
GLframebuffer *gl_buffer; /* the ancillary buffers */
GLuint index; /* current color index */
GLuint clear_index; /* current clear index */
GLint red, green, blue; /* current rgb color */
GLuint truecolor; /* current rgb color */
GLint clear_red,
clear_green,
clear_blue; /* current clear rgb color */
GLuint clear_truecolor; /* current clear rgb color */
GLushort hicolor; /* current hicolor */
GLushort clear_hicolor; /* current clear hicolor */
GLint width, height; /* size of color buffer */
GLint depth; /* bits per pixel (8,16,24 or 32) */
};
typedef struct { GLubyte b,g,r; } _RGB;
struct svga_buffer {
GLint Depth;
GLint BufferSize;
GLubyte * FrontBuffer;
GLubyte * BackBuffer;
GLubyte * VideoRam;
};
extern struct svga_buffer SVGABuffer;
extern vga_modeinfo * SVGAInfo;
extern SVGAMesaContext SVGAMesa; /* the current context */
#endif /* SVGAPIX_H */

Some files were not shown because too many files have changed in this diff Show More