Compare commits

..

342 Commits

Author SHA1 Message Date
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
Jon Taylor
0b6ae412d3 Disable genkgi sublib handling until we have some sublibs to handle 1999-09-21 00:46:26 +00:00
Keith Whitwell
7d1071526d added mesa.conf 1999-09-20 21:06:57 +00:00
Keith Whitwell
14f8b8b5c3 Bugfix for ctx->backface_sign calculation 1999-09-20 14:30:22 +00:00
Keith Whitwell
5a437d5889 Cleaning up 1999-09-19 23:43:02 +00:00
Keith Whitwell
c656951110 RasterMask was set incorrectly 1999-09-19 23:06:40 +00:00
tanner
bc34adfc54 lots of autoconf updates 1999-09-19 20:09:00 +00:00
Ted Jump
01db31b678 Changed name 'glGetProcAddressEXT' to 'gluGetProcAddressEXT' 1999-09-19 10:04:01 +00:00
Ted Jump
ea8e0b2156 Fixed LIBNAME entry 1999-09-19 10:03:19 +00:00
Ted Jump
a63baa3e8d Removed use of GLU.H - prevents compiler warning wrt:gluGetProcAddressEXT 1999-09-19 09:59:12 +00:00
Ted Jump
32b20284b8 Added NASM support 1999-09-19 09:55:37 +00:00
Ted Jump
725ec81ae8 More Win32 build compliance fixups 1999-09-19 02:03:18 +00:00
Keith Whitwell
1bf9dfaf5d Large patch:
- FX bug fixes.
        - Polygon mode and edgeflag work properly.
	- Clipping works with edgeflag.
	- Driver.ReducedPrimitiveChange() callback so drivers
          that implement lines & points as triangles can turn culling off
	  before rendering groups of these primitives.
        - Cleaned up feedback & select primitives.
1999-09-18 20:41:22 +00:00
Brian Paul
56b58668e8 disabled GL_EXT_get_proc_address for the time being 1999-09-18 01:06:52 +00:00
Brian Paul
e23bb9ff36 added a bunch of missing files to LIB_FILES 1999-09-17 18:08:32 +00:00
Keith Whitwell
39d29fe7fe Fix for write-rgba-span and others 1999-09-17 15:14:02 +00:00
Brian Paul
ecaf1a0865 silenced some warnings 1999-09-17 12:27:01 +00:00
Brian Paul
1bf28c46c2 glGetProcAddressEXT changes to accomodate Win32 and non-Win32 1999-09-17 12:21:36 +00:00
Brian Paul
9b563507cb pad GL_TINY to 6 digits 1999-09-17 12:07:10 +00:00
Brian Paul
d2a57c9b2b pad GLU_TINY to 6 digits 1999-09-17 12:06:56 +00:00
Gareth Hughes
b32966fc80 Winding rule updates. 1999-09-17 06:31:02 +00:00
Jouk Jansen
727f35a518 mesa_wgl.h should only be included when _WIN32 is defined 1999-09-17 05:56:43 +00:00
Ted Jump
477da9eff1 Modified to build better with Mesa wgl functions 1999-09-17 04:27:02 +00:00
Ted Jump
6799ecb675 Relocated wgl function prototypes to separate .h for easier work with fxwgl & glut 1999-09-17 04:25:56 +00:00
Ted Jump
5eea3d068f wgl function prototypes moved out to better work with fxwgl 1999-09-17 04:25:10 +00:00
Ted Jump
d29b1c2ea6 Patch error fixup 1999-09-17 03:17:18 +00:00
Ted Jump
1f256fd6b3 Win32 build req't updates 1999-09-17 03:07:28 +00:00
Ted Jump
3849b44d66 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?
1999-09-17 02:44:19 +00:00
Ted Jump
d043adc890 Cleaned up exit from main to prevent MSVC warnings 1999-09-17 02:41:38 +00:00
Ted Jump
83c02efa52 Added ESC key handling 1999-09-17 02:40:51 +00:00
Ted Jump
74783e9936 Update for beta3 1999-09-17 02:37:14 +00:00
Brian Paul
67e9bd246b fixed typo 1999-09-17 01:00:38 +00:00
Brian Paul
6efd0fb9b5 link with -lGL instead of -lMesaGL 1999-09-17 00:55:21 +00:00
Brian Paul
1300ce1e14 added src-glut.beos back in demo files 1999-09-17 00:54:27 +00:00
Brian Paul
738e977580 link with -lGLU -lGL instead of -lMesaGLU -lMesaGL 1999-09-17 00:07:26 +00:00
Brian Paul
f33e6b1e83 version symbol changes 1999-09-17 00:06:57 +00:00
Brian Paul
20298685c3 gluGetProcAddressEXT change for C++ / BeOS 1999-09-17 00:06:14 +00:00
Brian Paul
3d7e15533f updated for GL instead of MesaGL 1999-09-17 00:03:47 +00:00
Brian Paul
4811b7c7e0 initial check-in 1999-09-16 22:45:24 +00:00
Brian Paul
b9e8741c8f added some casts in gluGetProcAddressEXT() 1999-09-16 22:37:56 +00:00
Brian Paul
1447677fa4 GLU_EXT_get_proc_address clean-up 1999-09-16 16:54:22 +00:00
Brian Paul
978b089aee clean-up of GLU_EXT_get_proc_address 1999-09-16 16:53:28 +00:00
Brian Paul
dd4f708894 GL_EXT_get_proc_address clean-up 1999-09-16 16:47:35 +00:00
Brian Paul
9df2b25af1 added GL_EXT_get_proc_address 1999-09-16 16:44:37 +00:00
Brian Paul
4ed71ebbb9 changed archive filenames to beta3 1999-09-16 16:43:38 +00:00
Brian Paul
92460c25a3 added glxinfo 1999-09-16 16:41:03 +00:00
Brian Paul
d2bfe1ee29 initial check-in 1999-09-16 16:40:46 +00:00
Brian Paul
43c9c2cfae added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress 1999-09-16 15:52:51 +00:00
Brian Paul
17f0efb896 changed version string to return 1.2 1999-09-16 15:46:05 +00:00
Keith Whitwell
e3f37862d2 Do pop for GL_VIEWPORT_BIT via. the api 1999-09-16 11:54:56 +00:00
Gareth Hughes
0099981b1c Misc winding rule bug fixes. 1999-09-16 06:41:42 +00:00
Brian Paul
69b78057d1 bumped version strings to Mesa 3.1 1999-09-15 20:04:04 +00:00
Brian Paul
b7064bcf33 misc changes to tar file list 1999-09-15 19:38:28 +00:00
Brian Paul
7bc00c9ca8 minor library name changes 1999-09-15 17:02:06 +00:00
Brian Paul
c8c391d584 removed mention of libMesaGL 1999-09-15 16:39:01 +00:00
Brian Paul
e42048f937 3.1 beta 3 info 1999-09-15 16:34:43 +00:00
Brian Paul
e300ab8b2b new MESA_ version number symbols 1999-09-15 16:32:48 +00:00
Brian Paul
212e625c24 new version number symbols 1999-09-15 16:31:31 +00:00
Brian Paul
cd65179540 added a few more files to the tar list 1999-09-15 15:20:50 +00:00
Brian Paul
2f49a40a07 added third, tiny version number to mklib scripts 1999-09-15 15:11:01 +00:00
Brian Paul
d9bb106726 added third, tiny version number to arguments 1999-09-15 15:10:20 +00:00
Brian Paul
210ef19797 added TINY version symbol 1999-09-15 15:09:00 +00:00
Brian Paul
af19f37b79 removed unused GLcontext arg from a few functions 1999-09-15 13:56:44 +00:00
Gareth Hughes
a852e8fc0f Added debugging pragma message. 1999-09-15 02:12:16 +00:00
Gareth Hughes
d7c9c1e5c0 Fixed vector macro calls, specifically COPY_3V params. 1999-09-15 02:11:10 +00:00
Gareth Hughes
2b2746fedd Added debugging output. 1999-09-14 22:46:02 +00:00
Brian Paul
bbe0c46722 added linux-386-pthread-shared-glide 1999-09-14 12:20:17 +00:00
Gareth Hughes
d21c43cd15 Win32 fix by Eero Pajarre. 1999-09-14 06:23:40 +00:00
Gareth Hughes
77dcf82d81 Fixed legacy gluNextContour impact on gluTessEndContour. 1999-09-14 05:37:58 +00:00
Gareth Hughes
49e0bc42e2 Fixed GLUtriangulatorObj again (spelling). 1999-09-14 03:23:08 +00:00
Gareth Hughes
32c658b057 Fixed definition of GLUtriangluatorObj for 1.3 tessellator. 1999-09-14 01:32:58 +00:00
Brian Paul
de37ce3e22 fixed pixel packing/unpacking code in gluBuild2DMipmaps() 1999-09-14 00:30:28 +00:00
Brian Paul
a96e8ad978 added gluCheckExtension() 1999-09-14 00:11:40 +00:00
Brian Paul
daa0b0f656 added gluUnProject4() 1999-09-14 00:10:31 +00:00
Gareth Hughes
d1603d4a46 Fixed file headers. Tracking down macro bugs. 1999-09-13 22:20:13 +00:00
Jouk Jansen
70cf58648a strcmp needs the string.h 1999-09-13 14:31:32 +00:00
Brian Paul
eada67136a added Eero's multitexture function patch 1999-09-13 14:09:23 +00:00
Jon Taylor
9c097c0f11 Re-added missing GGIMesa context bufsize structure member 1999-09-13 01:08:37 +00:00
Brian Paul
0f9aed04d8 fixed typo in GetProcAddress 1999-09-12 12:04:13 +00:00
Brian Paul
d8ede96148 clean-up of glXGetProcAddressEXT() 1999-09-11 20:13:21 +00:00
Keith Whitwell
6fd3b96822 bugix from raul for fxddbitmap 1999-09-11 16:01:26 +00:00
Brian Paul
84ffacb978 added 1.2 function to gluGetProcAddressEXT() 1999-09-11 12:04:54 +00:00
Brian Paul
c5d7d70be8 GL_EXT_get_proc_address clean-up 1999-09-11 11:48:11 +00:00
Brian Paul
c0e2871718 include extensions.h 1999-09-11 11:47:15 +00:00
Brian Paul
f893f032fa added GLU_EXT_get_proc_address 1999-09-11 11:34:21 +00:00
Brian Paul
89a42b7e73 added GLX_EXT_get_proc_address 1999-09-11 11:33:45 +00:00
Brian Paul
585a68c82b added GL_EXT_get_proc_address 1999-09-11 11:31:34 +00:00
Brian Paul
ed3453350a added GL_EXT_get_proc_address 1999-09-11 11:26:34 +00:00
Keith Whitwell
6c8657fa5f new DD_Z_NEVER flag 1999-09-10 14:24:35 +00:00
Gareth Hughes
f0f3815e4f Fixed triangle output, recovery process termination. 1999-09-10 04:32:10 +00:00
Brian Paul
95740b2c11 changed C++ comments to C style 1999-09-10 03:05:04 +00:00
Gareth Hughes
2856b53e03 Added GLU 1.3 tessellation (except winding rule code). 1999-09-10 02:03:31 +00:00
Brian Paul
2ba7c1cbe4 moved gl_GetPointerv() into get.h 1999-09-09 23:48:02 +00:00
Brian Paul
00dd504c72 moved gl_GetString() into get.c 1999-09-09 23:47:09 +00:00
Miklos Fazekas
e4c15c12d8 More compliant error check. 1999-09-09 18:49:36 +00:00
Brian Paul
36ca6bd82a minor changes. always call compactify_arrays() 1999-09-08 22:14:31 +00:00
Brian Paul
45224face0 removed TexCoordUnit from GLcontext, use Array.ActiveTexture instead 1999-09-07 22:31:30 +00:00
Brian Paul
2ca99ca2e7 added vertices.c 1999-09-07 21:32:30 +00:00
Keith Whitwell
9b7c843671 fixes for the mga driver 1999-09-05 19:59:33 +00:00
Keith Whitwell
324beb95f3 fix for mga depthbuffer resize 1999-09-04 14:40:49 +00:00
Keith Whitwell
da54ffc852 more bugfixes 1999-09-03 15:48:54 +00:00
Keith Whitwell
44c73933e9 Fog, displaylist and zoom operations 1999-09-03 14:56:40 +00:00
Keith Whitwell
8d8e248ab2 fix for GL_COMPILE_AND_EXECUTE bug 1999-09-03 11:53:33 +00:00
Keith Whitwell
b6e6937287 fixed GL_FRONT_AND_BACK cull bug 1999-09-02 13:16:17 +00:00
Jouk Jansen
a4bb2ef30e Added vertices.c to compile list 1999-08-30 07:13:55 +00:00
Keith Whitwell
d858a651d8 removed bogus call 1999-08-29 16:18:23 +00:00
Keith Whitwell
50149b085e more fixes on the fast path 1999-08-29 14:06:02 +00:00
Keith Whitwell
3875679607 new files to support vertex-based geometry 1999-08-29 10:26:31 +00:00
Josh Vanderhoof
4f738b4c10 features weren 1999-08-28 01:38:54 +00:00
Jon Taylor
a43cfd71da Fixed double buffering bug when running in X 1999-08-27 21:06:30 +00:00
Jouk Jansen
443dd9fd4d This time the correct file 1999-08-27 11:02:57 +00:00
Keith Whitwell
2be79c1aa2 various pipeline bugs 1999-08-26 14:50:49 +00:00
Jouk Jansen
0552b30633 Update after disk crash 1999-08-24 12:34:50 +00:00
Jouk Jansen
49160c9a81 Update after disk crash 1999-08-24 12:34:20 +00:00
Jon Taylor
668b4ab2fa *** empty log message *** 1999-08-24 02:03:34 +00:00
Jon Taylor
6583efcfe9 Misc small cleanups 1999-08-23 22:34:08 +00:00
Jon Taylor
e76342e688 Updated to reflect GGIMesa 3.1 changes 1999-08-23 22:22:31 +00:00
Jon Taylor
7b9c36d568 *** empty log message *** 1999-08-23 21:13:19 +00:00
Jon Taylor
72fc9a527d *** empty log message *** 1999-08-22 08:56:50 +00:00
Jon Taylor
14c53fe1d5 *** empty log message *** 1999-08-21 22:46:13 +00:00
Jon Taylor
035e8d0143 *** empty log message *** 1999-08-21 22:36:52 +00:00
Jon Taylor
b35b28e4d9 *** empty log message *** 1999-08-21 08:53:27 +00:00
Jon Taylor
035e96ec3c *** empty log message *** 1999-08-21 06:27:37 +00:00
Jon Taylor
95dcb43951 *** empty log message *** 1999-08-21 05:57:17 +00:00
Brian Paul
212ce73b08 added a few more bug fixes 1999-08-20 01:19:36 +00:00
Brian Paul
b30e70436c fixed alpha channel problem in gl_blend_pixels() 1999-08-19 15:48:01 +00:00
Brian Paul
a4dcdcf0ff initial check-in (post crash) 1999-08-19 13:57:42 +00:00
Brian Paul
2d550f6ff1 initial check-in (post-crash) 1999-08-19 13:52:56 +00:00
Brian Paul
5a41d02502 minor change for irix-debug 1999-08-19 13:26:16 +00:00
Brian Paul
65b5e1e3fd glIsEnabled(GL_TEXTURE_3D) was wrong 1999-08-19 13:24:27 +00:00
Brian Paul
cddc583aeb testing 1999-08-19 11:54:28 +00:00
385 changed files with 90358 additions and 12941 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.1.1.1 1999/08/19 00:55:39 jtg Exp $
# $Id: Makefile.X11,v 1.12.2.2 1999/12/14 20:54:24 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -84,6 +84,7 @@ default:
@echo " make linux-3dnow-glide for Linux on AMD w/ 3DNow! for Glide"
@echo " make linux-386-pthread for Linux w/ Intel assembly and linuxthreads"
@echo " make linux-386-pthread-shared for Linux w/ Intel assembly and linuxthreads"
@echo " make linux-386-pthread-shared-glide for Linux w/ Intel assembly, linuxthreads, and 3Dfx Glide driver"
@echo " make linux-sparc for Linux on Sparc systems"
@echo " make linux-sparc5-elf for Sparc5 systems, make ELF shared libs"
@echo " make linux-sparc-ultra for UltraSparc systems, make ELF shared libs"
@@ -103,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"
@@ -137,20 +139,20 @@ default:
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 \
irix-debug irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \
linux linux-debug linux-prof linux-elf linux-elf-debug \
irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \
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 \
linux-3dnow linux-3dnow-glide \
linux-alpha linux-alpha-elf \
linux-ppc linux-ppc-so \
linux-386-pthread linux-386-pthread-shared \
linux-386-pthread linux-386-pthread-shared linux-386-pthread-shared-glide \
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 \
@@ -169,7 +171,7 @@ sunos5-x11r6-gcc-sl ultrix-gcc unicos unixware uwin vistra:
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
irix6-n32 irix6-n32-dso irix6-gcc-n32-sl:
irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug:
-mkdir lib32
touch src/depend
touch src-glu/depend
@@ -307,141 +309,188 @@ 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.1beta2
DEMO_NAME = MesaDemos-3.1beta2
LIB_NAME = MesaLib-3.1
DEMO_NAME = MesaDemos-3.1
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)/INSTALL \
$(DIRECTORY)/INSTALL.GNU \
$(DIRECTORY)/configure \
$(DIRECTORY)/docs/CONFIG \
$(DIRECTORY)/docs/CONFORM \
$(DIRECTORY)/docs/COPYRIGHT \
$(DIRECTORY)/docs/IAFA-PACKAGE \
$(DIRECTORY)/docs/LICENSE \
$(DIRECTORY)/docs/README \
$(DIRECTORY)/docs/README.* \
$(DIRECTORY)/docs/RELNOTES \
$(DIRECTORY)/docs/VERSIONS \
$(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/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)/src/Makefile* \
$(DIRECTORY)/src/descrip.mms \
$(DIRECTORY)/src/mms_depend \
$(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/*.[ch] \
$(DIRECTORY)/src/FX/*.def \
$(DIRECTORY)/src/GGI/*.[ch] \
$(DIRECTORY)/src/GGI/ggimesa.conf \
$(DIRECTORY)/src/GGI/default/*.c \
$(DIRECTORY)/src/GGI/default/Makefile \
$(DIRECTORY)/src/GGI/display/*.c \
$(DIRECTORY)/src/GGI/display/Makefile \
$(DIRECTORY)/src/KNOWN_BUGS \
$(DIRECTORY)/src/MGL/*.[ch] \
$(DIRECTORY)/src/MGL/*.txt \
$(DIRECTORY)/src/OSmesa/*.[ch] \
$(DIRECTORY)/src/S3/*.[ch] \
$(DIRECTORY)/src/S3/*.def \
$(DIRECTORY)/src/S3/*.mak \
$(DIRECTORY)/src/S3/*.rc \
$(DIRECTORY)/src/SVGA/*.[ch] \
$(DIRECTORY)/src/Windows/*.[ch] \
$(DIRECTORY)/src/Windows/*.def \
$(DIRECTORY)/src/X/*.[ch] \
$(DIRECTORY)/src/X86/*.[ch] \
$(DIRECTORY)/src/X86/Makefile \
$(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/*.[ch] \
$(DIRECTORY)/util/sampleMakefile \
$(DIRECTORY)/BeOS/Makefile \
$(DIRECTORY)/BeOS/*.cpp
# old stuff
# $(DIRECTORY)/Win32 \
# $(DIRECTORY)/win32
# $(DIRECTORY)/OpenStep \
#
#
$(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)/src/GGI/Makefile.am \
$(DIRECTORY)/src/GGI/Makefile.in \
$(DIRECTORY)/src/GGI/*.[ch] \
$(DIRECTORY)/src/GGI/ggimesa.conf.in \
$(DIRECTORY)/src/GGI/default/*.c \
$(DIRECTORY)/src/GGI/default/Makefile.am \
$(DIRECTORY)/src/GGI/default/Makefile.in \
$(DIRECTORY)/src/GGI/default/genkgi.conf.in \
$(DIRECTORY)/src/GGI/display/*.c \
$(DIRECTORY)/src/GGI/display/Makefile.am \
$(DIRECTORY)/src/GGI/display/Makefile.in \
$(DIRECTORY)/src/GGI/display/fbdev.conf.in \
$(DIRECTORY)/src/GGI/include/Makefile.am \
$(DIRECTORY)/src/GGI/include/Makefile.in \
$(DIRECTORY)/src/GGI/include/ggi/Makefile.am \
$(DIRECTORY)/src/GGI/include/ggi/Makefile.in \
$(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 \
$(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]
DEMO_FILES = \

153
bin/mklib.aix Executable file
View File

@@ -0,0 +1,153 @@
#!/bin/ksh
# Make an AIX shared library (tricky!!!)
# Based on a script from Athanasios G. Gaitatzes (gaitat@vnet.ibm.com)
# Improved by Greg Thompson <gregt@visix.com> -gt
#--identification------------------------------------------------------
# $Id: mklib.aix,v 1.2 1999/09/15 15:10:20 brianp Exp $
# $Log: mklib.aix,v $
# Revision 1.2 1999/09/15 15:10:20 brianp
# added third, tiny version number to arguments
#
# Revision 1.1 1999/08/19 13:52:56 brianp
# initial check-in (post-crash)
#
#--common--------------------------------------------------------------
LIBRARY=$1
shift 1
MAJOR=$1
shift 1
MINOR=$1
shift 1
TINY=$1
shift 1
OBJECTS=$*
#--platform------------------------------------------------------------
# BASENAME = LIBRARY without .a suffix
BASENAME=`echo ${LIBRARY} | sed "s/\.a//g"`
# Name of exports file
EXPFILE=${BASENAME}.exp
# Name of temporary shared lib file
OFILE=shr.o
####OFILE=${BASENAME}.o
# Remove any old files from previous make
rm -f ${LIBRARY} ${EXPFILE} ${OFILE}
# Pick a way to use nm -gt
NM=${NM-/bin/nm -eC}
# Determine which version of AIX this is
AIXVERSION=`uname -v`
# Pick a way to tell the linker there's no entrypoint -gt
case ${AIXVERSION}
{
3*)
ENTRY='-e _nostart'
;;
4*)
ENTRY=-bnoentry
;;
*)
echo "Error in mklib.aix!"
exit 1
;;
}
# Other libraries which we may be dependent on. Since we make the libraries
# in the order libGL.a, libaGLU.a, libglut.a just depends on its predecessor.
# modified to make otherlibs in the form of -lfoo -gt
OTHERLIBS=`ls ../lib/*.a | sed "s/..\/lib\/lib/-l/g" | sed "s/\.a//g"`
##echo OTHERLIBS are ${OTHERLIBS}
# Make exports (.exp) file header
echo "#! ${LIBRARY}" > ${EXPFILE}
# Append list of exported symbols to exports file -gt
case ${AIXVERSION}
{
3*)
${NM} ${OBJECTS} | awk -F'|' '{
if ($3 != "extern" || substr($7,1,1) == " ") continue
sub (" *", "", $1); sub (" *", "", $7)
if ( (($7 == ".text") || ($7 == ".data") || ($7 == ".bss")) \
&& ( substr($1,1,1) != ".")) {
if (substr ($1, 1, 7) != "__sinit" &&
substr ($1, 1, 7) != "__sterm") {
if (substr ($1, 1, 5) == "__tf1")
print (substr ($1, 7))
else if (substr ($1, 1, 5) == "__tf9")
print (substr ($1, 15))
else
print $1
}
}
}' | sort -u >> ${EXPFILE}
;;
4*)
${NM} ${OBJECTS} | awk '{
if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \
&& ( substr($1,1,1) != ".")) {
if (substr ($1, 1, 7) != "__sinit" &&
substr ($1, 1, 7) != "__sterm") {
if (substr ($1, 1, 5) == "__tf1")
print (substr ($1, 7))
else if (substr ($1, 1, 5) == "__tf9")
print (substr ($1, 15))
else
print $1
}
}
}' | sort -u >> ${EXPFILE}
;;
}
# This next line is a hack to allow full compatibility with IBM's OpenGL
# libraries. IBM mistakenly exports glLoadIdentity from the libGLU.a
# library. We have to do the same thing. Problem reported by Yemi Adesanya
# (adesanya@afsmail.cern.ch) and Patrick Brown (pbrown@austin.ibm.com)
if [ "${BASENAME}" = libGLU ] ; then
echo "glLoadIdentity" >> ${EXPFILE}
fi
# Make the shared lib file
cc -o ${OFILE} ${OBJECTS} -L../lib ${OTHERLIBS} -lX11 -lXext -lXmu -lXi -lm -lc -bE:${EXPFILE} -bM:SRE ${ENTRY}
# Make the .a file
ar ruv ${LIBRARY} ${OFILE}
# Put exports file in Mesa lib directory
mv ${EXPFILE} ../lib
# Remove OFILE
rm -f ${OFILE}
#NOTES
# AIX 4.x /usr/bin/nm -B patch from ssclift@mach.me.queensu.ca (Simon Clift)
# Robustified symbol extraction for AIX 3 and 4
# Greg Thompson <gregt@visix.com>

38
bin/mklib.ar-ruv Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/sh
# Make a standard Unix .a library file with 'ar ruv'
#--identification------------------------------------------------------
# $Id: mklib.ar-ruv,v 1.2 1999/09/15 15:10:20 brianp Exp $
# $Log: mklib.ar-ruv,v $
# Revision 1.2 1999/09/15 15:10:20 brianp
# added third, tiny version number to arguments
#
# Revision 1.1 1999/08/19 13:52:57 brianp
# initial check-in (post-crash)
#
#--common--------------------------------------------------------------
LIBRARY=$1
shift 1
MAJOR=$1
shift 1
MINOR=$1
shift 1
TINY=$1
shift 1
OBJECTS=$*
#--platform-------------------------------------------------------------
#ar ruv $LIBRARY $OBJECTS
ar ru $LIBRARY $OBJECTS

52
bin/mklib.solaris Normal file
View File

@@ -0,0 +1,52 @@
#!/bin/sh
# Make a Solaris shared library
# contributed by Arno Hahma (arno@nitro.pp.utu.fi)
#--identification------------------------------------------------------
# $Id: mklib.solaris,v 1.2 1999/09/15 15:10:20 brianp Exp $
# $Log: mklib.solaris,v $
# Revision 1.2 1999/09/15 15:10:20 brianp
# added third, tiny version number to arguments
#
# Revision 1.1 1999/08/19 13:53:06 brianp
# initial check-in (post-crash)
#
#--common--------------------------------------------------------------
LIBRARY=$1
shift 1
MAJOR=$1
shift 1
MINOR=$1
shift 1
TINY=$1
shift 1
OBJECTS=$*
#--platform-------------------------------------------------------------
set -x
LIBRARY=`basename $LIBRARY .a`
VERSION=$MAJOR.$MINOR
echo "Building shared object $LIBRARY.so.$VERSION and the archive library $LIBRARY.a"
rm -f ${LIBRARY}.a ${LIBRARY}.so.${VERSION}
ar ruv ${LIBRARY}.a ${OBJECTS}
ld -G -o ${LIBRARY}.so.${VERSION} ${OBJECTS}
cp ${LIBRARY}.a ${LIBRARY}.so.${VERSION} ../lib
cd ../lib
ln -s ${LIBRARY}.so.${VERSION} ${LIBRARY}.so

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,172 +1,26 @@
LibGGI driver for Mesa-3.0
by Uwe Maurer (uwe_maurer@t-online.de)
GGIMesa for LibGGI 2.x
Requirements:
-------------
LibGGI 2.0 or greater
Introduction
============
[from libggi.txt by Steve Cheng and Hartmut Niemann]
Installation:
-------------
To install GGIMesa, follow the instructions in INSTALL.GNU. If you
wish to install GGIGLUT as well, first install GGIMesa and then run
"LibGGI, the dynamic GGI (General Graphics Interface) library is a
flexible drawing library.
make
make install (must be root)
It provides an opaque interface to the display's acceleration
functions. It was originally intended to allow user programs to
interface with KGI, the kernel side of the GGI code, but other display
types can be easily used by loading the appropriate "display target"
(e.g. X, memory).
in ggi/ggiglut.
LibGGI consists of a main library (libggi.so) and a multitude of
dynamic drivers. The library then loads the necessary "drivers" for
the requested mode, taking hints from the graphics device if
necessary. LibGGI can also load extension libraries, e.g. to provide
enhanced 2D and 3D functions.
Notes:
------
It has been designed after having a look at several existing
libraries, and so far we have found porting to be quite simple from
and to most of them."
* Set the environment variables GGIMESA_DEBUG and/or GGIGLUT_DEBUG
to 255 to see lots of debugging output.
----------------------------------------------------------------------------
More information about the GGI project and LibGGI can be
obtained from the GGI website:
www.ggi-project.org
----------------------------------------------------------------------------
Installation
============
- Install LibGGI
- Unpack the Mesa archives
- In the Mesa directory type:
make linux-ggi
su
make linux-ggi-install
exit
- Now you can try some demos.
If they don't work, you can set the GGIMESA_DEBUG
variable to 255 and you will see some information from the
LibGGI-driver.
export GGIMESA_DEBUG=255
GLUT
====
You can change these default values in ggi/ggiglut.c:
#define WIDTH 640
#define HEIGHT 400
#define GRAPHTYPE_RGB GT_16BIT
#define GRAPHTYPE_INDEX GT_8BIT
Options:
-bpp x Set graphic mode with x bits per pixel
-size x y Screen (or window) is x*y pixels
Example:
demos/gears -size 320 200 -bpp 24
Updates
=======
You can find the latest LibGGI-driver and ggiglut on my
homepage:
http://home.t-online.de/home/uwe_maurer/ggimesa.htm
Uwe Maurer - uwe_maurer@t-online.de
LibGGI driver for Mesa-3.0
by Uwe Maurer (uwe_maurer@t-online.de)
Introduction
============
[from libggi.txt by Steve Cheng and Hartmut Niemann]
"LibGGI, the dynamic GGI (General Graphics Interface) library is a
flexible drawing library.
It provides an opaque interface to the display's acceleration
functions. It was originally intended to allow user programs to
interface with KGI, the kernel side of the GGI code, but other display
types can be easily used by loading the appropriate "display target"
(e.g. X, memory).
LibGGI consists of a main library (libggi.so) and a multitude of
dynamic drivers. The library then loads the necessary "drivers" for
the requested mode, taking hints from the graphics device if
necessary. LibGGI can also load extension libraries, e.g. to provide
enhanced 2D and 3D functions.
It has been designed after having a look at several existing
libraries, and so far we have found porting to be quite simple from
and to most of them."
----------------------------------------------------------------------------
More information about the GGI project and LibGGI can be
obtained from the GGI website:
www.ggi-project.org
----------------------------------------------------------------------------
Installation
============
- Install LibGGI
- Unpack the Mesa archives
- In the Mesa directory type:
make linux-ggi
su
make linux-ggi-install
exit
- Now you can try some demos.
If they don't work, you can set the GGIMESA_DEBUG
variable to 255 and you will see some information from the
LibGGI-driver.
export GGIMESA_DEBUG=255
GLUT
====
You can change these default values in ggi/ggiglut.c:
#define WIDTH 640
#define HEIGHT 400
#define GRAPHTYPE_RGB GT_16BIT
#define GRAPHTYPE_INDEX GT_8BIT
Options:
-bpp x Set graphic mode with x bits per pixel
-size x y Screen (or window) is x*y pixels
Example:
demos/gears -size 320 200 -bpp 24
Updates
=======
You can find the latest LibGGI-driver and ggiglut on my
homepage:
http://home.t-online.de/home/uwe_maurer/ggimesa.htm
Uwe Maurer - uwe_maurer@t-online.de
* GGIGLUT contains support for all of the GLUT 3.6 API except for the
high-level primitive drawing functions, but many of the functions (in
particular the menu drawing functions) are just stubs.

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,15 +1,32 @@
Mesa/Readme.win32
Last Updated: Friday, July 9th, 1999 - tjump@tertius.com
Last Updated: Sunday, September 19th, 1999 - tjump@tertius.com
*** What's New
- Updated for Mesa 3.1beta2/CVS.
- Updated for Mesa 3.1beta3/CVS. Debug and Release command-line builds of
Mesa, fxMesa, GLU, GLUT and all sample programs DLL-based. Manual
executions tests with minimum requisite results (aka: things looked like
I expected them to).
What did you expect, complete regression testing maybe?
- NASM build support. Any file in the project coded as a .S file will
automatically be recognized and built as a NASM-source assember file.
To enable building using NASM, set the environment variable NASM to
indicate that command to execute to run nasm on a file. If NASM is in
your command search path then all this needs be set to is 'nasmw' -
otherwise you will need to include the complete drive and directory path.
NASM may be retrieved here: http://www.web-sites.co.uk/nasm/
- DevStudio projects suspended for compatability reasons: projects modified
by DevStudio 6 are not compatible with DevStudio 5.
These will slowly be rebuilt and put into CVS as I can.
- Build environment change: The Glide SDK is no longer assumed to be in
the global INCLUDE/LIB environment vars, it is required that you set the
value 'GLIDE2X' as either an environment variable pointing to your Glide

View File

@@ -1,28 +1,35 @@
Mesa 3.0 Unix/X11 Information
Mesa 3.1 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.1/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.
@@ -40,16 +47,6 @@ Header and library files:
(actually, use "cp -d" on Linux to preserve symbolic links)
Create a few symbolic links so that compiling OpenGL applications is easy:
cd /usr/local/lib
IF USING STATIC (lib*.a) FILES THEN
ln -s libMesaGL.a libGL.a
ln -s libMesaGLU.a libGLU.a
ELSE
ln -s libMesaGL.so libGL.so
ln -s libMesaGLU.so libGLU.so
ENDIF
Xt/Motif widgets:
If you want to use Mesa or OpenGL in your Xt/Motif program you can build
@@ -108,8 +105,6 @@ Remote display of OpenGL/GLX programs:
in /usr/local/Mesa and using the C-shell:
% cd /usr/local/Mesa
% make irix5-dso
% cd lib
% ln -s libMesaGL.so libGL.so
% setenv _RLD_LIST "/usr/local/Mesa/lib/libGL.so:DEFAULT"
% /usr/demos/bin/ideas_ogl // this is a test
@@ -313,4 +308,4 @@ Summary of X-related environment variables:
----------------------------------------------------------------------
$Id: README.X11,v 3.2 1998/10/03 12:48:50 brianp Exp $
$Id: README.X11,v 3.3.2.2 1999/12/14 15:12:52 brianp Exp $

View File

@@ -1,4 +1,4 @@
$Id: VERSIONS,v 1.10 1999/07/30 18:58:30 brianp Exp $
$Id: VERSIONS,v 1.13.2.5 1999/12/14 07:17:42 brianp Exp $
Mesa Version History
@@ -644,12 +644,29 @@ Mesa Version History
- new copyright on core Mesa code
3.1 beta 3 August ??, 1999
3.1 beta 3 September 17, 1999
New:
- optimized glAccum function
- optimized 24bpp rendering in XMesa driver
- GLU 1.2 polygon tessellator
Bug Fixes:
- glGetTexLevelParameter wasn't fully implemented
- glXUseXFont now handles multi-byte fonts
- glIsEnabled(GL_TEXTURE_2D / 3D) returned wrong result
- alpha channel of blending points, lines was sometimes incorrect
Changes:
- New library names: libGL.so and libGLU.so
- New library names: "libGL" instead of "libMesaGL"
- 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

View File

@@ -22,9 +22,13 @@ if HAVE_X11
INC_X11 = glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h
endif
if NEED_GLUT
INC_GLUT = glut.h
endif
EXTRA_DIST = fxmesa.h ggimesa.h osmesa.h svgamesa.h \
glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h
GLinclude_HEADERS = gl.h gl_mangle.h glu.h glu_mangle.h \
$(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11)
$(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT)

View File

@@ -1,4 +1,4 @@
/* $Id: amesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: amesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library
@@ -27,8 +27,8 @@
/*
* $Log: amesa.h,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* 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

View File

@@ -1,4 +1,4 @@
/* $Id: foomesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: foomesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,8 @@
/*
* $Log: foomesa.h,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 1.1 1998/06/02 01:34:18 brianp
* Initial revision

View File

@@ -1,40 +1,27 @@
/* $Id: fxmesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: fxmesa.h,v 1.1.1.1.2.1 1999/11/24 18:38:52 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.
* Copyright (C) 1999 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.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
* 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 1
/*

View File

@@ -1,4 +1,4 @@
/* $Id: ggimesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: ggimesa.h,v 1.2 1999/08/23 22:34:08 jtaylor Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,6 +24,9 @@
/*
* $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
*
@@ -49,16 +52,16 @@ typedef struct ggi_mesa_context *GGIMesaContext;
extern GGIMesaContext GGIMesaCreateContext(void);
extern void GGIMesaDestroyContext( GGIMesaContext ctx );
extern void GGIMesaDestroyContext(GGIMesaContext ctx);
extern void GGIMesaMakeCurrent(GGIMesaContext ctx );
extern void GGIMesaMakeCurrent(GGIMesaContext ctx);
extern GGIMesaContext GGIMesaGetCurrentContext( void );
extern GGIMesaContext GGIMesaGetCurrentContext(void);
extern void GGIMesaSwapBuffers( void );
extern void GGIMesaSwapBuffers(void);
extern int GGIMesaSetVisual(GGIMesaContext ctx,ggi_visual_t vis,
GLboolean rgb_flag,GLboolean db_flag);
extern int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis,
GLboolean rgb_flag, GLboolean db_flag);
#ifdef __cplusplus
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
/* $Id: gl_mangle.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: gl_mangle.h,v 1.3 1999/11/04 00:43:09 miklos Exp $ */
/*
* Mesa 3-D graphics library
@@ -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,16 @@
#define glTexImage3DEXT mglTexImage3DEXT
#define glTexSubImage3DEXT mglTexSubImage3DEXT
#define glCopyTexSubImage3DEXT mglCopyTexSubImage3DEXT
#define glColorTable mglColorTable
#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 +513,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,8 +1,9 @@
/* $Id: glu.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: glu.h,v 1.16 1999/11/11 03:21:43 kendallb Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.1
* Version: 3.3
*
* Copyright (C) 1995-1999 Brian Paul
*
* This library is free software; you can redistribute it and/or
@@ -21,35 +22,6 @@
*/
/*
* $Log: glu.h,v $
* 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
@@ -86,136 +58,178 @@ extern "C" {
#endif
#endif
#ifndef GLUAPI
#define GLUAPI
#endif
#define GLU_VERSION_1_1 1
#ifndef GLAPIENTRY
#define GLAPIENTRY
#endif
#ifndef GLCALLBACK
#define GLCALLBACK
#endif
#define GLU_TRUE GL_TRUE
#define GLU_FALSE GL_FALSE
#define GLU_VERSION_1_1 1
#define GLU_VERSION_1_2 1
enum {
/* Normal vectors */
GLU_SMOOTH = 100000,
GLU_FLAT = 100001,
GLU_NONE = 100002,
#define GLU_TRUE 1
#define GLU_FALSE 0
/* Quadric draw styles */
GLU_POINT = 100010,
GLU_LINE = 100011,
GLU_FILL = 100012,
GLU_SILHOUETTE = 100013,
/* Quadric orientation */
GLU_OUTSIDE = 100020,
GLU_INSIDE = 100021,
/* Normal vectors */
#define GLU_SMOOTH 100000
#define GLU_FLAT 100001
#define GLU_NONE 100002
/* Tesselator */
GLU_BEGIN = 100100,
GLU_VERTEX = 100101,
GLU_END = 100102,
GLU_ERROR = 100103,
GLU_EDGE_FLAG = 100104,
/* Quadric draw styles */
#define GLU_POINT 100010
#define GLU_LINE 100011
#define GLU_FILL 100012
#define GLU_SILHOUETTE 100013
/* Contour types */
GLU_CW = 100120,
GLU_CCW = 100121,
GLU_INTERIOR = 100122,
GLU_EXTERIOR = 100123,
GLU_UNKNOWN = 100124,
/* Quadric orientation */
#define GLU_OUTSIDE 100020
#define GLU_INSIDE 100021
/* Tesselation errors */
GLU_TESS_ERROR1 = 100151, /* missing gluEndPolygon */
GLU_TESS_ERROR2 = 100152, /* missing gluBeginPolygon */
GLU_TESS_ERROR3 = 100153, /* misoriented contour */
GLU_TESS_ERROR4 = 100154, /* vertex/edge intersection */
GLU_TESS_ERROR5 = 100155, /* misoriented or self-intersecting loops */
GLU_TESS_ERROR6 = 100156, /* coincident vertices */
GLU_TESS_ERROR7 = 100157, /* all vertices collinear */
GLU_TESS_ERROR8 = 100158, /* intersecting edges */
GLU_TESS_ERROR9 = 100159, /* not coplanar contours */
/* Tessellator */
#define GLU_TESS_BEGIN 100100
#define GLU_TESS_VERTEX 100101
#define GLU_TESS_END 100102
#define GLU_TESS_ERROR 100103
#define GLU_TESS_EDGE_FLAG 100104
#define GLU_TESS_COMBINE 100105
/* NURBS */
GLU_AUTO_LOAD_MATRIX = 100200,
GLU_CULLING = 100201,
GLU_PARAMETRIC_TOLERANCE= 100202,
GLU_SAMPLING_TOLERANCE = 100203,
GLU_DISPLAY_MODE = 100204,
GLU_SAMPLING_METHOD = 100205,
GLU_U_STEP = 100206,
GLU_V_STEP = 100207,
#define GLU_TESS_BEGIN_DATA 100106
#define GLU_TESS_VERTEX_DATA 100107
#define GLU_TESS_END_DATA 100108
#define GLU_TESS_ERROR_DATA 100109
#define GLU_TESS_EDGE_FLAG_DATA 100110
#define GLU_TESS_COMBINE_DATA 100111
GLU_PATH_LENGTH = 100215,
GLU_PARAMETRIC_ERROR = 100216,
GLU_DOMAIN_DISTANCE = 100217,
/* Winding rules */
#define GLU_TESS_WINDING_ODD 100130
#define GLU_TESS_WINDING_NONZERO 100131
#define GLU_TESS_WINDING_POSITIVE 100132
#define GLU_TESS_WINDING_NEGATIVE 100133
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
GLU_MAP1_TRIM_2 = 100210,
GLU_MAP1_TRIM_3 = 100211,
/* Tessellation properties */
#define GLU_TESS_WINDING_RULE 100140
#define GLU_TESS_BOUNDARY_ONLY 100141
#define GLU_TESS_TOLERANCE 100142
GLU_OUTLINE_POLYGON = 100240,
GLU_OUTLINE_PATCH = 100241,
/* Tessellation errors */
#define GLU_TESS_ERROR1 100151 /* Missing gluBeginPolygon */
#define GLU_TESS_ERROR2 100152 /* Missing gluBeginContour */
#define GLU_TESS_ERROR3 100153 /* Missing gluEndPolygon */
#define GLU_TESS_ERROR4 100154 /* Missing gluEndContour */
#define GLU_TESS_ERROR5 100155 /* */
#define GLU_TESS_ERROR6 100156 /* */
#define GLU_TESS_ERROR7 100157 /* */
#define GLU_TESS_ERROR8 100158 /* */
GLU_NURBS_ERROR1 = 100251, /* spline order un-supported */
GLU_NURBS_ERROR2 = 100252, /* too few knots */
GLU_NURBS_ERROR3 = 100253, /* valid knot range is empty */
GLU_NURBS_ERROR4 = 100254, /* decreasing knot sequence */
GLU_NURBS_ERROR5 = 100255, /* knot multiplicity > spline order */
GLU_NURBS_ERROR6 = 100256, /* endcurve() must follow bgncurve() */
GLU_NURBS_ERROR7 = 100257, /* bgncurve() must precede endcurve() */
GLU_NURBS_ERROR8 = 100258, /* ctrlarray or knot vector is NULL */
GLU_NURBS_ERROR9 = 100259, /* can't draw pwlcurves */
GLU_NURBS_ERROR10 = 100260, /* missing gluNurbsCurve() */
GLU_NURBS_ERROR11 = 100261, /* missing gluNurbsSurface() */
GLU_NURBS_ERROR12 = 100262, /* endtrim() must precede endsurface() */
GLU_NURBS_ERROR13 = 100263, /* bgnsurface() must precede endsurface() */
GLU_NURBS_ERROR14 = 100264, /* curve of improper type passed as trim curve */
GLU_NURBS_ERROR15 = 100265, /* bgnsurface() must precede bgntrim() */
GLU_NURBS_ERROR16 = 100266, /* endtrim() must follow bgntrim() */
GLU_NURBS_ERROR17 = 100267, /* bgntrim() must precede endtrim()*/
GLU_NURBS_ERROR18 = 100268, /* invalid or missing trim curve*/
GLU_NURBS_ERROR19 = 100269, /* bgntrim() must precede pwlcurve() */
GLU_NURBS_ERROR20 = 100270, /* pwlcurve referenced twice*/
GLU_NURBS_ERROR21 = 100271, /* pwlcurve and nurbscurve mixed */
GLU_NURBS_ERROR22 = 100272, /* improper usage of trim data type */
GLU_NURBS_ERROR23 = 100273, /* nurbscurve referenced twice */
GLU_NURBS_ERROR24 = 100274, /* nurbscurve and pwlcurve mixed */
GLU_NURBS_ERROR25 = 100275, /* nurbssurface referenced twice */
GLU_NURBS_ERROR26 = 100276, /* invalid property */
GLU_NURBS_ERROR27 = 100277, /* endsurface() must follow bgnsurface() */
GLU_NURBS_ERROR28 = 100278, /* intersecting or misoriented trim curves */
GLU_NURBS_ERROR29 = 100279, /* intersecting trim curves */
GLU_NURBS_ERROR30 = 100280, /* UNUSED */
GLU_NURBS_ERROR31 = 100281, /* unconnected trim curves */
GLU_NURBS_ERROR32 = 100282, /* unknown knot error */
GLU_NURBS_ERROR33 = 100283, /* negative vertex count encountered */
GLU_NURBS_ERROR34 = 100284, /* negative byte-stride */
GLU_NURBS_ERROR35 = 100285, /* unknown type descriptor */
GLU_NURBS_ERROR36 = 100286, /* null control point reference */
GLU_NURBS_ERROR37 = 100287, /* duplicate point on pwlcurve */
/* NURBS */
#define GLU_AUTO_LOAD_MATRIX 100200
#define GLU_CULLING 100201
#define GLU_PARAMETRIC_TOLERANCE 100202
#define GLU_SAMPLING_TOLERANCE 100203
#define GLU_DISPLAY_MODE 100204
#define GLU_SAMPLING_METHOD 100205
#define GLU_U_STEP 100206
#define GLU_V_STEP 100207
/* Errors */
GLU_INVALID_ENUM = 100900,
GLU_INVALID_VALUE = 100901,
GLU_OUT_OF_MEMORY = 100902,
GLU_INCOMPATIBLE_GL_VERSION = 100903,
#define GLU_PATH_LENGTH 100215
#define GLU_PARAMETRIC_ERROR 100216
#define GLU_DOMAIN_DISTANCE 100217
/* New in GLU 1.1 */
GLU_VERSION = 100800,
GLU_EXTENSIONS = 100801
};
#define GLU_MAP1_TRIM_2 100210
#define GLU_MAP1_TRIM_3 100211
#define GLU_OUTLINE_POLYGON 100240
#define GLU_OUTLINE_PATCH 100241
#define GLU_NURBS_ERROR1 100251 /* spline order un-supported */
#define GLU_NURBS_ERROR2 100252 /* too few knots */
#define GLU_NURBS_ERROR3 100253 /* valid knot range is empty */
#define GLU_NURBS_ERROR4 100254 /* decreasing knot sequence */
#define GLU_NURBS_ERROR5 100255 /* knot multiplicity > spline order */
#define GLU_NURBS_ERROR6 100256 /* endcurve() must follow bgncurve() */
#define GLU_NURBS_ERROR7 100257 /* bgncurve() must precede endcurve() */
#define GLU_NURBS_ERROR8 100258 /* ctrlarray or knot vector is NULL */
#define GLU_NURBS_ERROR9 100259 /* can't draw pwlcurves */
#define GLU_NURBS_ERROR10 100260 /* missing gluNurbsCurve() */
#define GLU_NURBS_ERROR11 100261 /* missing gluNurbsSurface() */
#define GLU_NURBS_ERROR12 100262 /* endtrim() must precede endsurface() */
#define GLU_NURBS_ERROR13 100263 /* bgnsurface() must precede endsurface() */
#define GLU_NURBS_ERROR14 100264 /* curve of improper type passed as trim curve */
#define GLU_NURBS_ERROR15 100265 /* bgnsurface() must precede bgntrim() */
#define GLU_NURBS_ERROR16 100266 /* endtrim() must follow bgntrim() */
#define GLU_NURBS_ERROR17 100267 /* bgntrim() must precede endtrim()*/
#define GLU_NURBS_ERROR18 100268 /* invalid or missing trim curve*/
#define GLU_NURBS_ERROR19 100269 /* bgntrim() must precede pwlcurve() */
#define GLU_NURBS_ERROR20 100270 /* pwlcurve referenced twice*/
#define GLU_NURBS_ERROR21 100271 /* pwlcurve and nurbscurve mixed */
#define GLU_NURBS_ERROR22 100272 /* improper usage of trim data type */
#define GLU_NURBS_ERROR23 100273 /* nurbscurve referenced twice */
#define GLU_NURBS_ERROR24 100274 /* nurbscurve and pwlcurve mixed */
#define GLU_NURBS_ERROR25 100275 /* nurbssurface referenced twice */
#define GLU_NURBS_ERROR26 100276 /* invalid property */
#define GLU_NURBS_ERROR27 100277 /* endsurface() must follow bgnsurface() */
#define GLU_NURBS_ERROR28 100278 /* intersecting or misoriented trim curves */
#define GLU_NURBS_ERROR29 100279 /* intersecting trim curves */
#define GLU_NURBS_ERROR30 100280 /* UNUSED */
#define GLU_NURBS_ERROR31 100281 /* unconnected trim curves */
#define GLU_NURBS_ERROR32 100282 /* unknown knot error */
#define GLU_NURBS_ERROR33 100283 /* negative vertex count encountered */
#define GLU_NURBS_ERROR34 100284 /* negative byte-stride */
#define GLU_NURBS_ERROR35 100285 /* unknown type descriptor */
#define GLU_NURBS_ERROR36 100286 /* null control point reference */
#define GLU_NURBS_ERROR37 100287 /* duplicate point on pwlcurve */
/* Errors */
#define GLU_INVALID_ENUM 100900
#define GLU_INVALID_VALUE 100901
#define GLU_OUT_OF_MEMORY 100902
#define GLU_INCOMPATIBLE_GL_VERSION 100903
/* New in GLU 1.1 */
#define GLU_VERSION 100800
#define GLU_EXTENSIONS 100801
/*** GLU 1.0 tessellation - obsolete! ***/
/* Contour types */
#define GLU_CW 100120
#define GLU_CCW 100121
#define GLU_INTERIOR 100122
#define GLU_EXTERIOR 100123
#define GLU_UNKNOWN 100124
/* Tessellator */
#define GLU_BEGIN GLU_TESS_BEGIN
#define GLU_VERTEX GLU_TESS_VERTEX
#define GLU_END GLU_TESS_END
#define GLU_ERROR GLU_TESS_ERROR
#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG
/*
* These are the GLU 1.1 typedefs. GLU 1.2 has different ones!
* These are the GLU 1.1 typedefs. GLU 1.3 has different ones!
*/
#if defined(__BEOS__)
/* The BeOS does something funky and makes these typedefs in one
* of its system headers.
*/
/* The BeOS does something funky and makes these typedefs in one
* of its system headers.
*/
#else
typedef struct GLUquadric GLUquadricObj;
typedef struct GLUtesselator GLUtriangulatorObj;
typedef struct GLUnurbs GLUnurbsObj;
typedef struct GLUquadric GLUquadricObj;
typedef struct GLUnurbs GLUnurbsObj;
/* FIXME: We need to implement the other 1.3 typedefs - GH */
typedef struct GLUtesselator GLUtesselator;
typedef GLUtesselator GLUtriangulatorObj;
#endif
@@ -232,37 +246,37 @@ enum {
*/
GLUAPI void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
GLdouble centerx, GLdouble centery,
GLdouble centerz,
GLdouble upx, GLdouble upy, GLdouble upz );
GLdouble centerx, GLdouble centery,
GLdouble centerz,
GLdouble upx, GLdouble upy, GLdouble upz );
GLUAPI void GLAPIENTRY gluOrtho2D( GLdouble left, GLdouble right,
GLdouble bottom, GLdouble top );
GLdouble bottom, GLdouble top );
GLUAPI void GLAPIENTRY gluPerspective( GLdouble fovy, GLdouble aspect,
GLdouble zNear, GLdouble zFar );
GLdouble zNear, GLdouble zFar );
GLUAPI void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y,
GLdouble width, GLdouble height,
const GLint viewport[4] );
GLdouble width, GLdouble height,
const GLint viewport[4] );
GLUAPI GLint GLAPIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *winx, GLdouble *winy,
GLdouble *winz );
GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy,
GLdouble winz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *objx, GLdouble *objy,
GLdouble *objz );
GLdouble *winx, GLdouble *winy,
GLdouble *winz );
GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy,
GLdouble winz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *objx, GLdouble *objy,
GLdouble *objz );
GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode );
@@ -275,19 +289,19 @@ GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode );
*/
GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format,
GLint widthin, GLint heightin,
GLenum typein, const void *datain,
GLint widthout, GLint heightout,
GLenum typeout, void *dataout );
GLint widthin, GLint heightin,
GLenum typein, const void *datain,
GLint widthout, GLint heightout,
GLenum typeout, void *dataout );
GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components,
GLint width, GLenum format,
GLenum type, const void *data );
GLint width, GLenum format,
GLenum type, const void *data );
GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components,
GLint width, GLint height,
GLenum format,
GLenum type, const void *data );
GLint width, GLint height,
GLenum format,
GLenum type, const void *data );
@@ -302,37 +316,39 @@ GLUAPI GLUquadricObj* GLAPIENTRY gluNewQuadric( void );
GLUAPI void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state );
GLUAPI void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject,
GLenum drawStyle );
GLenum drawStyle );
GLUAPI void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject,
GLenum orientation );
GLenum orientation );
GLUAPI void GLAPIENTRY gluQuadricNormals( GLUquadricObj *quadObject,
GLenum normals );
GLenum normals );
GLUAPI void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject,
GLboolean textureCoords );
GLboolean textureCoords );
GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj,
GLenum which, void (GLCALLBACK *fn)() );
GLenum which,
void (GLCALLBACK *fn)() );
GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj,
GLdouble baseRadius,
GLdouble topRadius,
GLdouble height,
GLint slices, GLint stacks );
GLdouble baseRadius,
GLdouble topRadius,
GLdouble height,
GLint slices, GLint stacks );
GLUAPI void GLAPIENTRY gluSphere( GLUquadricObj *qobj,
GLdouble radius, GLint slices, GLint stacks );
GLdouble radius, GLint slices,
GLint stacks );
GLUAPI void GLAPIENTRY gluDisk( GLUquadricObj *qobj,
GLdouble innerRadius, GLdouble outerRadius,
GLint slices, GLint loops );
GLdouble innerRadius, GLdouble outerRadius,
GLint slices, GLint loops );
GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
GLdouble outerRadius, GLint slices,
GLint loops, GLdouble startAngle,
GLdouble sweepAngle );
GLdouble outerRadius, GLint slices,
GLint loops, GLdouble startAngle,
GLdouble sweepAngle );
@@ -347,70 +363,95 @@ GLUAPI GLUnurbsObj* GLAPIENTRY gluNewNurbsRenderer( void );
GLUAPI void GLAPIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
GLUAPI void GLAPIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj,
const GLfloat modelMatrix[16],
const GLfloat projMatrix[16],
const GLint viewport[4] );
const GLfloat modelMatrix[16],
const GLfloat projMatrix[16],
const GLint viewport[4] );
GLUAPI void GLAPIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property,
GLfloat value );
GLfloat value );
GLUAPI void GLAPIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
GLfloat *value );
GLfloat *value );
GLUAPI void GLAPIENTRY gluBeginCurve( GLUnurbsObj *nobj );
GLUAPI void GLAPIENTRY gluEndCurve( GLUnurbsObj * nobj );
GLUAPI void GLAPIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots,
GLfloat *knot, GLint stride,
GLfloat *ctlarray, GLint order,
GLenum type );
GLfloat *knot, GLint stride,
GLfloat *ctlarray, GLint order,
GLenum type );
GLUAPI void GLAPIENTRY gluBeginSurface( GLUnurbsObj *nobj );
GLUAPI void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj );
GLUAPI void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj,
GLint sknot_count, GLfloat *sknot,
GLint tknot_count, GLfloat *tknot,
GLint s_stride, GLint t_stride,
GLfloat *ctlarray,
GLint sorder, GLint torder,
GLenum type );
GLint sknot_count, GLfloat *sknot,
GLint tknot_count, GLfloat *tknot,
GLint s_stride, GLint t_stride,
GLfloat *ctlarray,
GLint sorder, GLint torder,
GLenum type );
GLUAPI void GLAPIENTRY gluBeginTrim( GLUnurbsObj *nobj );
GLUAPI void GLAPIENTRY gluEndTrim( GLUnurbsObj *nobj );
GLUAPI void GLAPIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count,
GLfloat *array, GLint stride, GLenum type );
GLfloat *array, GLint stride,
GLenum type );
GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which,
void (GLCALLBACK *fn)() );
void (GLCALLBACK *fn)() );
/*
*
* Polygon tesselation
* Polygon tessellation
*
*/
GLUAPI GLUtriangulatorObj* GLAPIENTRY gluNewTess( void );
GLUAPI GLUtesselator* GLAPIENTRY gluNewTess( void );
GLUAPI void GLAPIENTRY gluTessCallback( GLUtriangulatorObj *tobj, GLenum which,
void (GLCALLBACK *fn)() );
GLUAPI void GLAPIENTRY gluDeleteTess( GLUtesselator *tobj );
GLUAPI void GLAPIENTRY gluDeleteTess( GLUtriangulatorObj *tobj );
GLUAPI void GLAPIENTRY gluTessBeginPolygon( GLUtesselator *tobj,
void *polygon_data );
GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtriangulatorObj *tobj );
GLUAPI void GLAPIENTRY gluTessBeginContour( GLUtesselator *tobj );
GLUAPI void GLAPIENTRY gluEndPolygon( GLUtriangulatorObj *tobj );
GLUAPI void GLAPIENTRY gluTessVertex( GLUtesselator *tobj, GLdouble coords[3],
void *vertex_data );
GLUAPI void GLAPIENTRY gluNextContour( GLUtriangulatorObj *tobj, GLenum type );
GLUAPI void GLAPIENTRY gluTessEndContour( GLUtesselator *tobj );
GLUAPI void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
void *data );
GLUAPI void GLAPIENTRY gluTessEndPolygon( GLUtesselator *tobj );
GLUAPI void GLAPIENTRY gluTessProperty( GLUtesselator *tobj, GLenum which,
GLdouble value );
GLUAPI void GLAPIENTRY gluTessNormal( GLUtesselator *tobj, GLdouble x,
GLdouble y, GLdouble z );
GLUAPI void GLAPIENTRY gluTessCallback( GLUtesselator *tobj, GLenum which,
void (GLCALLBACK *fn)() );
GLUAPI void GLAPIENTRY gluGetTessProperty( GLUtesselator *tobj, GLenum which,
GLdouble *value );
/*
*
* Obsolete 1.0 tessellation functions
*
*/
GLUAPI void GLAPIENTRY gluBeginPolygon( GLUtesselator *tobj );
GLUAPI void GLAPIENTRY gluNextContour( GLUtesselator *tobj, GLenum type );
GLUAPI void GLAPIENTRY gluEndPolygon( GLUtesselator *tobj );
@@ -423,6 +464,7 @@ GLUAPI void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name );
#if defined(__BEOS__) || defined(__QUICKDRAW__)
#pragma export off
#endif

View File

@@ -1,4 +1,4 @@
/* $Id: glu_mangle.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: glu_mangle.h,v 1.2 1999/09/10 02:08:19 gareth Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,6 +23,9 @@
/*
* $Log: glu_mangle.h,v $
* Revision 1.2 1999/09/10 02:08:19 gareth
* Added GLU 1.3 tessellation (except winding rule code).
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -75,12 +78,19 @@
#define gluPwlCurve mgluPwlCurve
#define gluNurbsCallback mgluNurbsCallback
#define gluNewTess mgluNewTess
#define gluTessCallback mgluTessCallback
#define gluDeleteTess mgluDeleteTess
#define gluBeginPolygon mgluBeginPolygon
#define gluEndPolygon mgluEndPolygon
#define gluNextContour mgluNextContour
#define gluTessBeginPolygon mgluTessBeginPolygon
#define gluTessBeginContour mgluTessBeginContour
#define gluTessVertex mgluTessVertex
#define gluTessEndPolygon mgluTessEndPolygon
#define gluTessEndContour mgluTessEndContour
#define gluTessProperty mgluTessProperty
#define gluTessNormal mgluTessNormal
#define gluTessCallback mgluTessCallback
#define gluGetTessProperty mgluGetTessProperty
#define gluBeginPolygon mgluBeginPolygon
#define gluNextContour mgluNextContour
#define gluEndPolygon mgluEndPolygon
#define gluGetString mgluGetString
#endif

View File

@@ -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

@@ -23,8 +23,8 @@
/*
* $Log: glut_h.dja,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 1.1 1999/06/23 00:51:27 brianp
* initial check-in

View File

@@ -1,4 +1,4 @@
/* $Id: glx.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: glx.h,v 1.5.2.2 1999/12/10 14:55:38 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -25,44 +25,11 @@
*/
/*
* $Log: glx.h,v $
* 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"
@@ -154,13 +121,13 @@ enum _GLX_CONFIGS {
/*
* Compile-time extension tests
*/
#ifdef MESA
#define GLX_EXT_visual_info 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
#endif
#define GLX_ARB_get_proc_address 1
@@ -228,29 +195,32 @@ extern const char *glXGetClientString( Display *dpy, int name );
/*
* Mesa GLX Extensions
*/
#ifdef GLX_MESA_pixmap_colormap
/* GLX_MESA_pixmap_colormap */
extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
Pixmap pixmap, Colormap cmap );
#endif
#ifdef GLX_MESA_release_buffers
/* GLX_MESA_release_buffers */
extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
#endif
#ifdef GLX_MESA_copy_sub_buffer
/* GLX_MESA_copy_sub_buffer */
extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
int x, int y, int width, int height );
#endif
#ifdef GLX_SGI_video_sync
/* GLX_MESA_set_3dfx_mode */
extern GLboolean glXSet3DfxModeMESA( GLint mode );
/* GLX_SGI_video_sync */
extern int glXGetVideoSyncSGI(unsigned int *count);
extern int glXWaitVideoSyncSGI(int divisor, int remainder,
unsigned int *count);
#endif
/* GLX_ARB_get_proc_address */
extern void (*glXGetProcAddressARB(const GLubyte *procName))();

View File

@@ -1,4 +1,4 @@
/* $Id: glx_mangle.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: glx_mangle.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,8 @@
/*
* $Log: glx_mangle.h,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.3 1999/06/21 22:01:00 brianp
* added #ifndef GLX_MANGLE_H stuff, video sync extension functions

88
include/GL/mesa_wgl.h Normal file
View File

@@ -0,0 +1,88 @@
/* $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 _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);
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 *);
#ifdef _MSC_VER
# pragma warning( pop )
#endif
#ifdef __cplusplus
}
#endif
#endif /* _mesa_wgl_h_ */

View File

@@ -6,7 +6,7 @@
* All rights reserved.
*
* Filename: $Workfile: mglmesa.h $
* Version: $Revision: 1.1.1.1 $
* Version: $Revision: 1.1 $
*
* Language: ANSI C
* Environment: Any

View File

@@ -1,4 +1,4 @@
/* $Id: osmesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: osmesa.h,v 1.1.1.1.2.1 1999/11/24 18:39:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -27,6 +27,9 @@
/*
* $Log: osmesa.h,v $
* Revision 1.1.1.1.2.1 1999/11/24 18:39:17 brianp
* bumped version to 3.1
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -86,7 +89,7 @@ extern "C" {
#define OSMESA_MAJOR_VERSION 3
#define OSMESA_MINOR_VERSION 0
#define OSMESA_MINOR_VERSION 1

View File

@@ -1,8 +1,8 @@
/* $Id: svgamesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: svgamesa.h,v 1.1.1.1.2.1 1999/11/24 18:40:45 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.0
* Version: 3.1
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
@@ -23,6 +23,9 @@
/*
* $Log: svgamesa.h,v $
* Revision 1.1.1.1.2.1 1999/11/24 18:40:45 brianp
* bumped version to 3.1
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -65,7 +68,7 @@
#define SVGAMESA_MAJOR_VERSION 3
#define SVGAMESA_MINOR_VERSION 0
#define SVGAMESA_MINOR_VERSION 1
#ifdef __cplusplus

View File

@@ -1,4 +1,4 @@
/* $Id: wmesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: wmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library
@@ -24,8 +24,8 @@
/*
* $Log: wmesa.h,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.2 1999/01/03 02:54:45 brianp
* updated per Ted Jump

View File

@@ -1,4 +1,4 @@
/* $Id: xmesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: xmesa.h,v 1.1.1.1.2.2 1999/12/13 21:54:19 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -27,6 +27,12 @@
/*
* $Log: xmesa.h,v $
* Revision 1.1.1.1.2.2 1999/12/13 21:54:19 brianp
* applied Daryll's patches
*
* Revision 1.1.1.1.2.1 1999/11/24 18:41:37 brianp
* bumped version to 3.1
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -96,6 +102,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 +115,7 @@ extern struct Library *XLibBase;
#define XMESA_MAJOR_VERSION 3
#define XMESA_MINOR_VERSION 0
#define XMESA_MINOR_VERSION 1
@@ -131,7 +140,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 +198,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 +215,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 +228,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_x.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/include/GL/xmesa_x.h,v 1.1 1999/08/19 00:55:40 jtg Exp $
*/
#ifndef _XMESA_X_H_

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.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,4 +1,4 @@
# $Id: Makefile,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $
# $Id: Makefile,v 1.2 1999/09/17 00:55:21 brianp Exp $
# Makefile for BeOS demos
@@ -11,7 +11,7 @@ CC = g++
# Use Mesa:
CFLAGS = -I../include -c -g
LFLAGS = -L../lib -Xlinker -rpath ../lib -lbe -lMesaGL
LFLAGS = -L../lib -Xlinker -rpath ../lib -lbe -lGL
# Use BeOS OpenGL:
#CFLAGS = -I/boot/develop/headers/be/opengl -c -g

View File

@@ -1,4 +1,4 @@
// $Id: demo.cpp,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $
// $Id: demo.cpp,v 1.1 1999/08/19 00:55:40 jtg Exp $
// Simple BeOS GLView demo
// Written by Brian Paul

View File

@@ -1,59 +1,23 @@
# $Id: Makefile.BeOS-R4,v 1.1.1.1 1999/08/19 00:55:40 jtg 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.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
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -L/boot/home/config/lib -Xlinker -rpath $(LIBDIR) -lbe -lglut -lMesaGLU -lMesaGL $(XLIBS)
GL_LIBS = -L$(LIBDIR) -L/boot/home/config/lib -Xlinker -rpath $(LIBDIR) -lbe -lglut -lGLU -lGL $(XLIBS)
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,4 +1,4 @@
# $Id: Makefile.X11,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $
# $Id: Makefile.X11,v 1.3 1999/10/27 10:09:53 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -13,13 +13,13 @@
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
renormal spectex stex3d tessdemo texcyl texobj trispd winpos \
##### RULES #####

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.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.1.1 1999/08/19 00:55:40 jtg
# Imported sources
#
# 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: bounce.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: bounce.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Bouncing ball demo. Color index mode only!
@@ -12,8 +12,8 @@
/*
* $Log: bounce.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.3 1999/03/18 08:16:14 joukj
*

View File

@@ -1,4 +1,4 @@
/* $Id: clearspd.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: clearspd.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Simple GLUT program to measure glClear() and glutSwapBuffers() speed.
@@ -7,8 +7,8 @@
/*
* $Log: clearspd.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.3 1999/03/28 18:18:33 brianp
* minor clean-up

View File

@@ -1,4 +1,4 @@
/* $Id: drawpix.c,v 1.1.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,6 +8,12 @@
/*
* $Log: drawpix.c,v $
* 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
*
@@ -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.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: gamma.c,v 1.1 1999/08/19 00:55:40 jtg 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,8 @@
/*
* $Log: gamma.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.1 1999/06/19 01:35:38 brianp
* merged in Kai Schuetz's RGB changes

View File

@@ -1,8 +1,12 @@
/* $Id: gears.c,v 1.1.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,6 +14,9 @@
/*
* $Log: gears.c,v $
* 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
*
@@ -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);

View File

@@ -1,4 +1,4 @@
/* $Id: glinfo.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: glinfo.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Print GL, GLU and GLUT version and extension info
@@ -10,8 +10,8 @@
/*
* $Log: glinfo.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.2 1999/02/02 04:45:49 brianp
* include stdio.h before glut.h

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,4 +1,4 @@
/* $Id: glutfx.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: glutfx.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Example of how one might use GLUT with the 3Dfx driver in full-screen mode.
@@ -16,8 +16,8 @@
/*
* $Log: glutfx.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.2 1999/03/28 18:18:33 brianp
* minor clean-up

View File

@@ -1,15 +1,40 @@
/* $Id: isosurf.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: isosurf.c,v 1.4 1999/10/21 16:39:06 brianp Exp $ */
/*
* Display an isosurface of 3-D wind speed volume. Use arrow keys to
* rotate, S toggles smooth shading, L toggles lighting
* Display an isosurface of 3-D wind speed volume.
*
* Command line options:
* -info print GL implementation information
*
* Brian Paul This file in public domain.
*/
/* Keys:
* =====
*
* - Arrow keys to rotate
* - 's' toggles smooth shading
* - 'l' toggles lighting
* - 'f' toggles fog
* - 'I' and 'i' zoom in and out
* - 'c' toggles a user clip plane
* - 'm' toggles colorful materials in GL_TRIANGLES modes.
* - '+' and '-' move the user clip plane
*
* Other options are available via the popup menu.
*/
/*
* $Log: isosurf.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* 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()
*
* Revision 1.2 1999/09/03 14:56:40 keithw
* Fog, displaylist and zoom operations
*
* Revision 3.4 1999/04/24 01:10:47 keithw
* clip planes, materials
@@ -30,6 +55,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "GL/glut.h"
@@ -44,11 +70,11 @@
#define NO_REFLECT 0x20
#define POINT_FILTER 0x40
#define LINEAR_FILTER 0x80
#define IMMEDIATE 0x100
#define GLVERTEX 0x100
#define DRAW_ARRAYS 0x200 /* or draw_elts, if compiled */
#define ARRAY_ELT 0x400
#define COMPILED 0x800
#define NOT_COMPILED 0x1000
#define IMMEDIATE 0x1000
#define SHADE_SMOOTH 0x2000
#define SHADE_FLAT 0x4000
#define TRIANGLES 0x8000
@@ -57,18 +83,22 @@
#define NO_USER_CLIP 0x40000
#define MATERIALS 0x80000
#define NO_MATERIALS 0x100000
#define FOG 0x200000
#define NO_FOG 0x400000
#define QUIT 0x800000
#define DISPLAYLIST 0x1000000
#define LIGHT_MASK (LIT|UNLIT)
#define TEXTURE_MASK (TEXTURE|NO_TEXTURE)
#define REFLECT_MASK (REFLECT|NO_REFLECT)
#define FILTER_MASK (POINT_FILTER|LINEAR_FILTER)
#define RENDER_STYLE_MASK (IMMEDIATE|DRAW_ARRAYS|ARRAY_ELT)
#define COMPILED_MASK (COMPILED|NOT_COMPILED)
#define RENDER_STYLE_MASK (GLVERTEX|DRAW_ARRAYS|ARRAY_ELT)
#define COMPILED_MASK (COMPILED|IMMEDIATE|DISPLAYLIST)
#define MATERIAL_MASK (MATERIALS|NO_MATERIALS)
#define PRIMITIVE_MASK (TRIANGLES|STRIPS)
#define CLIP_MASK (USER_CLIP|NO_USER_CLIP)
#define SHADE_MASK (SHADE_SMOOTH|SHADE_FLAT)
#define FOG_MASK (FOG|NO_FOG)
#define MAXVERTS 10000
static float data[MAXVERTS][6];
@@ -80,9 +110,16 @@ static GLint numverts, num_tri_verts, numuniq;
static GLfloat xrot;
static GLfloat yrot;
static GLfloat dist = -6;
static GLint state, allowed = ~0;
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 );
static void read_surface( char *filename )
@@ -119,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] ); \
@@ -225,7 +262,7 @@ static void extract_indices1( const struct data_idx *in, unsigned int *out,
}
static void compactify_arrays()
static void compactify_arrays(void)
{
int i;
struct data_idx *ind;
@@ -290,11 +327,11 @@ static void make_tri_indices( void )
#define MIN(x,y) (x < y) ? x : y
static void draw_surface( void )
static void draw_surface( int with_state )
{
GLuint i, j;
switch (state & (COMPILED_MASK|RENDER_STYLE_MASK|PRIMITIVE_MASK)) {
switch (with_state & (COMPILED_MASK|RENDER_STYLE_MASK|PRIMITIVE_MASK)) {
#ifdef GL_EXT_vertex_array
case (COMPILED|DRAW_ARRAYS|STRIPS):
@@ -310,8 +347,8 @@ static void draw_surface( void )
break;
case (COMPILED|DRAW_ARRAYS|TRIANGLES):
case (NOT_COMPILED|DRAW_ARRAYS|TRIANGLES):
if (state & MATERIALS) {
case (IMMEDIATE|DRAW_ARRAYS|TRIANGLES):
if (with_state & MATERIALS) {
for (j = i = 0 ; i < num_tri_verts ; i += 600, j++) {
GLuint nr = MIN(num_tri_verts-i, 600);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, col[j]);
@@ -327,22 +364,22 @@ static void draw_surface( void )
/* Uses the original arrays (including duplicate elements):
*/
case (NOT_COMPILED|DRAW_ARRAYS|STRIPS):
case (IMMEDIATE|DRAW_ARRAYS|STRIPS):
glDrawArraysEXT( GL_TRIANGLE_STRIP, 0, numverts );
break;
/* Uses the original arrays (including duplicate elements):
*/
case (NOT_COMPILED|ARRAY_ELT|STRIPS):
case (IMMEDIATE|ARRAY_ELT|STRIPS):
glBegin( GL_TRIANGLE_STRIP );
for (i = 0 ; i < numverts ; i++)
glArrayElement( i );
glEnd();
break;
case (NOT_COMPILED|ARRAY_ELT|TRIANGLES):
case (IMMEDIATE|ARRAY_ELT|TRIANGLES):
case (COMPILED|ARRAY_ELT|TRIANGLES):
if (state & MATERIALS) {
if (with_state & MATERIALS) {
for (j = i = 0 ; i < num_tri_verts ; i += 600, j++) {
GLuint nr = MIN(num_tri_verts-i, 600);
GLuint k;
@@ -357,12 +394,13 @@ static void draw_surface( void )
glBegin( GL_TRIANGLES );
for (i = 0 ; i < num_tri_verts ; i++)
glArrayElement( tri_indices[i] );
glEnd();
}
break;
case (NOT_COMPILED|IMMEDIATE|TRIANGLES):
if (state & MATERIALS) {
case (IMMEDIATE|GLVERTEX|TRIANGLES):
if (with_state & MATERIALS) {
for (j = i = 0 ; i < num_tri_verts ; i += 600, j++) {
GLuint nr = MIN(num_tri_verts-i, 600);
GLuint k;
@@ -385,6 +423,13 @@ static void draw_surface( void )
}
break;
case (DISPLAYLIST|GLVERTEX|STRIPS):
if (!surf1)
surf1 = BuildList( GL_COMPILE_AND_EXECUTE );
else
glCallList(surf1);
break;
#endif
/* Uses the original arrays (including duplicate elements):
@@ -404,18 +449,27 @@ static void draw_surface( void )
static void Display(void)
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
draw_surface();
draw_surface( state );
glFlush();
if (doubleBuffer) glutSwapBuffers();
}
int BuildList( int mode )
{
int rv = glGenLists(1);
glNewList(rv, mode );
draw_surface( IMMEDIATE|GLVERTEX|STRIPS );
glEndList();
return rv;
}
/* KW: only do this when necessary, so CVA can re-use results.
*/
static void set_matrix( void )
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef( 0.0, 0.0, -6.0 );
glTranslatef( 0.0, 0.0, dist );
glRotatef( yrot, 0.0, 1.0, 0.0 );
glRotatef( xrot, 1.0, 0.0, 0.0 );
}
@@ -548,10 +602,23 @@ static void ModeMenu(int m)
}
}
if (CHANGED(state, m, FOG_MASK)) {
if (m & FOG)
{
glEnable(GL_FOG);
printf("FOG enable\n");
}
else
{
glDisable(GL_FOG);
printf("FOG disable\n");
}
}
#ifdef GL_EXT_vertex_array
if (CHANGED(state, m, (COMPILED_MASK|RENDER_STYLE_MASK|PRIMITIVE_MASK)))
{
if ((m & (COMPILED_MASK|PRIMITIVE_MASK)) == (NOT_COMPILED|STRIPS))
if ((m & (COMPILED_MASK|PRIMITIVE_MASK)) == (IMMEDIATE|STRIPS))
{
glVertexPointerEXT( 3, GL_FLOAT, sizeof(data[0]), numverts, data );
glNormalPointerEXT( GL_FLOAT, sizeof(data[0]), numverts, &data[0][3]);
@@ -586,8 +653,10 @@ 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};
glClearColor(0.0, 0.0, 0.0, 0.0);
glEnable( GL_DEPTH_TEST );
glEnable( GL_VERTEX_ARRAY_EXT );
@@ -616,20 +685,35 @@ static void Init(void)
exit(1);
}
if (allowed & COMPILED) {
compactify_arrays();
make_tri_indices();
}
/* Green fog is easy to see */
glFogi(GL_FOG_MODE,GL_EXP2);
glFogfv(GL_FOG_COLOR,fogColor);
glFogf(GL_FOG_DENSITY,0.15);
glHint(GL_FOG_HINT,GL_DONT_CARE);
compactify_arrays();
make_tri_indices();
surf1 = BuildList( GL_COMPILE );
ModeMenu(SHADE_SMOOTH|
LIT|
NO_TEXTURE|
NO_REFLECT|
POINT_FILTER|
NOT_COMPILED|
IMMEDIATE|
NO_USER_CLIP|
NO_MATERIALS|
IMMEDIATE);
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));
}
}
@@ -643,45 +727,60 @@ static void Reshape(int width, int height)
static void Key( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch (key) {
case 27:
exit(0);
case 's':
ModeMenu((state ^ SHADE_MASK) & SHADE_MASK);
break;
case 'l':
ModeMenu((state ^ LIGHT_MASK) & LIGHT_MASK);
break;
case 'm':
ModeMenu((state ^ MATERIAL_MASK) & MATERIAL_MASK);
break;
case 'c':
ModeMenu((state ^ CLIP_MASK) & CLIP_MASK);
break;
case 'b':
Benchmark(5.0, 0);
break;
case 'B':
Benchmark(0, 5.0);
break;
case '-':
case '_':
plane[3] += 2.0;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClipPlane(GL_CLIP_PLANE0, plane);
set_matrix();
glutPostRedisplay();
break;
case '+':
case '=':
plane[3] -= 2.0;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClipPlane(GL_CLIP_PLANE0, plane);
set_matrix();
glutPostRedisplay();
break;
case 27:
exit(0);
case 'f':
ModeMenu((state ^ FOG_MASK) & FOG_MASK);
break;
case 's':
ModeMenu((state ^ SHADE_MASK) & SHADE_MASK);
break;
case 'l':
ModeMenu((state ^ LIGHT_MASK) & LIGHT_MASK);
break;
case 'm':
ModeMenu((state ^ MATERIAL_MASK) & MATERIAL_MASK);
break;
case 'c':
ModeMenu((state ^ CLIP_MASK) & CLIP_MASK);
break;
case 'b':
Benchmark(5.0, 0);
break;
case 'B':
Benchmark(0, 5.0);
break;
case 'i':
dist += .25;
set_matrix();
glutPostRedisplay();
break;
case 'I':
dist -= .25;
set_matrix();
glutPostRedisplay();
break;
case '-':
case '_':
plane[3] += 2.0;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClipPlane(GL_CLIP_PLANE0, plane);
set_matrix();
glutPostRedisplay();
break;
case '+':
case '=':
plane[3] -= 2.0;
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClipPlane(GL_CLIP_PLANE0, plane);
set_matrix();
glutPostRedisplay();
break;
}
}
@@ -689,6 +788,8 @@ 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_LEFT:
yrot -= 15.0;
@@ -723,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;
@@ -770,7 +874,7 @@ int main(int argc, char **argv)
allowed &= ~COMPILED;
}
Init();
Init(argc, argv);
ModeMenu(arg_mode);
glutCreateMenu(ModeMenu);
@@ -782,21 +886,27 @@ int main(int argc, char **argv)
glutAddMenuEntry("Smooth", SHADE_SMOOTH);
glutAddMenuEntry("Flat", SHADE_FLAT);
glutAddMenuEntry("", 0);
glutAddMenuEntry("Fog", FOG);
glutAddMenuEntry("No Fog", NO_FOG);
glutAddMenuEntry("", 0);
glutAddMenuEntry("Point Filtered", POINT_FILTER);
glutAddMenuEntry("Linear Filtered", LINEAR_FILTER);
glutAddMenuEntry("", 0);
glutAddMenuEntry("Immediate (STRIPS)", NOT_COMPILED|IMMEDIATE|STRIPS);
glutAddMenuEntry("Immediate (TRIANGLES)", NOT_COMPILED|IMMEDIATE|TRIANGLES);
glutAddMenuEntry("glVertex (STRIPS)", IMMEDIATE|GLVERTEX|STRIPS);
glutAddMenuEntry("glVertex (TRIANGLES)", IMMEDIATE|GLVERTEX|TRIANGLES);
glutAddMenuEntry("", 0);
glutAddMenuEntry("glVertex display list (STRIPS)",
DISPLAYLIST|GLVERTEX|STRIPS);
glutAddMenuEntry("", 0);
if (allowed & DRAW_ARRAYS) {
glutAddMenuEntry("DrawArrays (STRIPS)",
NOT_COMPILED|DRAW_ARRAYS|STRIPS);
IMMEDIATE|DRAW_ARRAYS|STRIPS);
glutAddMenuEntry("ArrayElement (STRIPS)",
NOT_COMPILED|ARRAY_ELT|STRIPS);
IMMEDIATE|ARRAY_ELT|STRIPS);
glutAddMenuEntry("DrawElements (TRIANGLES)",
NOT_COMPILED|DRAW_ARRAYS|TRIANGLES);
IMMEDIATE|DRAW_ARRAYS|TRIANGLES);
glutAddMenuEntry("ArrayElement (TRIANGLES)",
NOT_COMPILED|ARRAY_ELT|TRIANGLES);
IMMEDIATE|ARRAY_ELT|TRIANGLES);
glutAddMenuEntry("", 0);
}
@@ -805,7 +915,9 @@ int main(int argc, char **argv)
COMPILED|DRAW_ARRAYS|TRIANGLES);
glutAddMenuEntry("Compiled DrawElements (STRIPS)",
COMPILED|DRAW_ARRAYS|STRIPS);
glutAddMenuEntry("Compiled ArrayElement",
glutAddMenuEntry("Compiled ArrayElement (TRIANGLES)",
COMPILED|ARRAY_ELT|TRIANGLES);
glutAddMenuEntry("Compiled ArrayElement (STRIPS)",
COMPILED|ARRAY_ELT|STRIPS);
glutAddMenuEntry("", 0);
}

View File

@@ -1,7 +1,10 @@
/* $Id: morph3d.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: morph3d.c,v 1.2 1999/09/17 12:27:01 brianp Exp $ */
/*
* $Log: morph3d.c,v $
* Revision 1.2 1999/09/17 12:27:01 brianp
* silenced some warnings
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -717,6 +720,8 @@ static void pinit(void);
static void key( unsigned char k, int x, int y )
{
(void) x;
(void) y;
switch (k) {
case '1': object=1; break;
case '2': object=2; break;

View File

@@ -1,12 +1,23 @@
/* $Id: multiarb.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: multiarb.c,v 1.3 1999/10/21 16:40:32 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.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
*
@@ -221,18 +232,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 +266,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 +284,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 +314,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,4 +1,4 @@
/* $Id: osdemo.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: osdemo.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Demo of off-screen Mesa rendering
@@ -19,8 +19,8 @@
/*
* $Log: osdemo.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.0 1998/02/14 18:42:29 brianp
* initial rev

View File

@@ -1,11 +1,15 @@
/* $Id: paltex.c,v 1.1.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.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
*
@@ -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

@@ -13,8 +13,8 @@
/*
* $Log: pointblast.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.3 1998/07/26 01:24:27 brianp
* removed include of gl.h

View File

@@ -1,4 +1,4 @@
/* $Id: reflect.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: reflect.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Demo of a reflective, texture-mapped surface with OpenGL.
@@ -31,8 +31,8 @@
/*
* $Log: reflect.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.4 1999/03/28 18:22:05 brianp
* minor clean-up

View File

@@ -1,4 +1,4 @@
/* $Id: renormal.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: renormal.c,v 1.3 1999/09/17 12:27:01 brianp Exp $ */
/*
* Test GL_EXT_rescale_normal extension
@@ -6,7 +6,7 @@
*/
/*
* $Id: renormal.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $
* $Id: renormal.c,v 1.3 1999/09/17 12:27:01 brianp Exp $
*/
@@ -95,6 +95,20 @@ static void ModeMenu(int entry)
glutPostRedisplay();
}
static void
key(unsigned char k, int x, int y)
{
(void) x;
(void) y;
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
int main( int argc, char *argv[] )
{
@@ -110,6 +124,7 @@ int main( int argc, char *argv[] )
glutIdleFunc( Idle );
glutReshapeFunc( Reshape );
glutDisplayFunc( Display );
glutKeyboardFunc(key);
glutCreateMenu(ModeMenu);
glutAddMenuEntry("Unscaled", UNSCALED);

View File

@@ -1,4 +1,4 @@
/* $Id: spectex.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: spectex.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* GLUT demonstration of texturing with specular highlights.
@@ -20,8 +20,8 @@
/*
* $Log: spectex.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.2 1999/03/28 18:22:05 brianp
* minor clean-up

View File

@@ -1,4 +1,4 @@
/* $Id: stex3d.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: stex3d.c,v 1.2 1999/09/17 12:27:01 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 1999/09/17 12:27:01 brianp
* silenced some warnings
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -401,6 +404,8 @@ void cleanEverything(void)
void KeyHandler( unsigned char key, int x, int y )
{
(void) x;
(void) y;
switch(key) {
case 27:
case 'q':

View File

@@ -1,4 +1,4 @@
/* $Id: tessdemo.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: tessdemo.c,v 1.3.2.1 1999/11/16 11:09:09 gareth Exp $ */
/*
* A demo of the GLU polygon tesselation functions written by Bogdan Sikorski.
@@ -8,9 +8,23 @@
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
*/
/*
* Updated for GLU 1.3 tessellation by Gareth Hughes <garethh@bell-labs.com>
*/
/*
* $Log: tessdemo.c,v $
* Revision 1.3.2.1 1999/11/16 11:09:09 gareth
* Added combine callback. Converted vertices from ints to floats.
*
* Revision 1.3 1999/11/04 04:00:42 gareth
* Updated demo for new GLU 1.3 tessellation. Added optimized rendering
* by saving the output of the tessellation into display lists.
*
* 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
*
@@ -40,29 +54,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
@@ -72,368 +66,513 @@ 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)
{
GLUtriangulatorObj *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 );
}
}
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,12 +1,20 @@
/* $Id: texcyl.c,v 1.1.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.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
*
@@ -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.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: texobj.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Example of using the 1.1 texture object functions.
@@ -10,8 +10,8 @@
/*
* $Log: texobj.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.1 1999/03/28 18:24:37 brianp
* minor clean-up

View File

@@ -1,4 +1,4 @@
/* $Id: trispd.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: trispd.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Simple GLUT program to measure triangle strip rendering speed.
@@ -7,8 +7,8 @@
/*
* $Log: trispd.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.4 1999/03/28 18:24:37 brianp
* minor clean-up

View File

@@ -1,4 +1,4 @@
/* $Id: winpos.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: winpos.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Example of how to use the GL_MESA_window_pos extension.
@@ -8,8 +8,8 @@
/*
* $Log: winpos.c,v $
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.3 1999/03/28 18:24:37 brianp
* minor clean-up

377
progs/ggi/asc-view.c Normal file
View File

@@ -0,0 +1,377 @@
/*
test program for the ggi-mesa driver
Copyright (C) 1997,1998 Uwe Maurer - uwe_maurer@t-online.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <GL/gl.h>
#include <GL/ggimesa.h>
#include <ggi/ggi.h>
#include <stdlib.h>
ggi_visual_t vis,vis_mem;
GGIMesaContext ctx;
int screen_x=GGI_AUTO,screen_y=GGI_AUTO;
ggi_graphtype bpp=GT_AUTO;
//#define ZBUFFER
//#define SMOOTH_NORMALS
void Init()
{
GLfloat h=(GLfloat)3/4;
GLfloat pos[4]={5,5,-20,0};
GLfloat specular[4]={.4,.4,.4,1};
GLfloat diffuse[4]={.3,.3,.3,1};
GLfloat ambient[4]={.2,.2,.2,1};
int err;
if (ggiInit()<0)
{
printf("ggiInit() failed\n");
exit(1);
}
ctx=GGIMesaCreateContext();
if (ctx==NULL)
{
printf("Can't create Context!\n");
exit(1);
}
vis=ggiOpen(NULL);
vis_mem=ggiOpen("display-memory",NULL);
if (vis==NULL || vis_mem==NULL)
{
printf("Can't open ggi_visuals!\n");
exit(1);
}
err=ggiSetGraphMode(vis,screen_x,screen_y,screen_x,screen_y,bpp);
err+=ggiSetGraphMode(vis_mem,screen_x,screen_y,screen_x,screen_y,bpp);
if (err)
{
printf("Can't set %ix%i\n",screen_x,screen_y);
exit(1);
}
if (GGIMesaSetVisual(ctx,vis_mem,GL_TRUE,GL_FALSE)<0)
{
printf("GGIMesaSetVisual() failed!\n");
exit(1);
}
GGIMesaMakeCurrent(ctx);
glViewport(0,0,screen_x,screen_y);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1,1,-h,h,1,50);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0,0,-9);
glShadeModel(GL_FLAT);
glFrontFace(GL_CW);
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0,GL_POSITION,pos);
glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse);
glLightfv(GL_LIGHT0,GL_AMBIENT,ambient);
glLightfv(GL_LIGHT0,GL_SPECULAR,specular);
#ifdef ZBUFFER
glEnable(GL_DEPTH_TEST);
#endif
}
#define MAX_VERTS 1000
#define MAX_TRIS 2000
#define MAX_LEN 1024
#define MAX_F 100000000
void LoadAsc(GLuint *list,char *file)
{
FILE *fp;
GLfloat p[MAX_VERTS][3];
GLfloat normal[MAX_VERTS][3];
float ncount[MAX_VERTS];
int v[MAX_TRIS][3];
char line[MAX_LEN];
char *s;
int i,j;
int verts,faces;
GLuint v0,v1,v2;
GLfloat n[3];
GLfloat len,k;
GLfloat min[3]={MAX_F,MAX_F,MAX_F};
GLfloat max[3]={-MAX_F,-MAX_F,-MAX_F};
char *coord_str[]={"X","Z","Y"};
fp=fopen(file,"r");
if (!fp)
{
printf("Can't open %s!\n",file);
exit(1);
}
while (strncmp(fgets(line,MAX_LEN,fp),"Tri-mesh",8)) ;
s=strstr(line,":")+1;
verts=atoi(s);
s=strstr(s,":")+1;
faces=atoi(s);
if (verts>MAX_VERTS)
{
printf("Too many vertices..\n");
exit(1);
}
while (strncmp(fgets(line,MAX_LEN,fp),"Vertex list",11)) ;
for (i=0;i<verts;i++)
{
while (strncmp(fgets(line,MAX_LEN,fp),"Vertex",6)) ;
for (j=0;j<3;j++)
{
s=strstr(line,coord_str[j])+2;
k=atoi(s);
if (k>max[j]) max[j]=k;
if (k<min[j]) min[j]=k;
p[i][j]=k;
}
}
len=0;
for (i=0;i<3;i++)
{
k=max[i]-min[i];
if (k>len) {len=k;j=i;}
n[i]=(max[i]+min[i])/2;
}
len/=2;
for (i=0;i<verts;i++)
{
for (j=0;j<3;j++)
{
p[i][j]-=n[j];
p[i][j]/=len;
}
}
*list=glGenLists(1);
glNewList(*list,GL_COMPILE);
glBegin(GL_TRIANGLES);
memset(ncount,0,sizeof(ncount));
memset(normal,0,sizeof(normal));
while (strncmp(fgets(line,MAX_LEN,fp),"Face list",9)) ;
for (i=0;i<faces;i++)
{
while (strncmp(fgets(line,MAX_LEN,fp),"Face",4)) ;
s=strstr(line,"A")+2;
v0=v[i][0]=atoi(s);
s=strstr(line,"B")+2;
v1=v[i][1]=atoi(s);
s=strstr(line,"C")+2;
v2=v[i][2]=atoi(s);
n[0]=((p[v1][1]-p[v0][1])*(p[v2][2]-p[v0][2])
- (p[v1][2]-p[v0][2])*(p[v2][1]-p[v0][1]));
n[1]=((p[v1][2]-p[v0][2])*(p[v2][0]-p[v0][0])
- (p[v1][0]-p[v0][0])*(p[v2][2]-p[v0][2]));
n[2]=((p[v1][0]-p[v0][0])*(p[v2][1]-p[v0][1])
- (p[v1][1]-p[v0][1])*(p[v2][0]-p[v0][0]));
len=n[0]*n[0]+n[1]*n[1]+n[2]*n[2];
len=sqrt(len);
n[0]/=len;
n[1]/=len;
n[2]/=len;
#ifdef SMOOTH_NORMALS
for (j=0;j<3;j++){
normal[v[i][j]][0]+=n[0];
normal[v[i][j]][1]+=n[1];
normal[v[i][j]][2]+=n[2];
ncount[v[i][j]]++;
}
#else
glNormal3fv(n);
for (j=0;j<3;j++)
glVertex3fv(p[v[i][j]]);
#endif
}
#ifdef SMOOTH_NORMALS
for (i=0;i<verts;i++) {
for (j=0;j<3;j++) {
normal[i][j]/=ncount[i];
}
}
for (i=0;i<faces;i++) {
for (j=0;j<3;j++) {
glNormal3f(normal[v[i][j]][0],
normal[v[i][j]][1],
normal[v[i][j]][2]);
glVertex3fv(p[v[i][j]]);
}
}
#endif
glEnd();
glEndList();
fclose(fp);
}
double Display(GLuint l,int *maxframes)
{
int x,y;
GLfloat col[]={.25,0,.25,1};
int frames=0;
struct timeval start,stop;
double len;
GLfloat rotate=0;
gettimeofday(&start,NULL);
while(1)
{
glClearColor(0,0,0,0);
glClearIndex(0);
#ifdef ZBUFFER
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
#else
glClear(GL_COLOR_BUFFER_BIT);
#endif
glPushMatrix();
glRotatef(30,1,0,0);
glRotatef(rotate/10,0,0,1);
glTranslatef(-6,-4,0);
for (y=0;y<3;y++)
{
glPushMatrix();
for (x=0;x<5;x++)
{
glPushMatrix();
glRotatef(rotate,y+1,-x-1,0);
col[0]=(GLfloat)(x+1)/4;
col[1]=0;
col[2]=(GLfloat)(y+1)/2;
glMaterialfv(GL_FRONT,GL_AMBIENT,col);
glCallList(l);
glPopMatrix();
glTranslatef(3,0,0);
}
glPopMatrix();
glTranslatef(0,4,0);
}
glPopMatrix();
glFinish();
ggiPutBox(vis,0,0,screen_x,screen_y,ggiDBGetBuffer(vis,0)->read);
rotate+=10;
frames++;
if (frames==(*maxframes)) break;
if (ggiKbhit(vis))
{
*maxframes=frames;
break;
}
}
gettimeofday(&stop,NULL);
len=(double)(stop.tv_sec-start.tv_sec)+
(double)(stop.tv_usec-start.tv_usec)/1e6;
return len;
}
void visible(int vis)
{
if (vis == GLUT_VISIBLE)
glutIdleFunc(idle);
else
glutIdleFunc(NULL);
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowPosition(0, 0);
glutInitWindowSize(300, 300);
glutCreateWindow("asc-view");
init();
glutDisplayFunc(draw);
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutSpecialFunc(special);
glutVisibilityFunc(visible);
glutMainLoop();
#if 0
GLuint l;
char *file;
int maxframes=0;
double len;
Init();
file=(argc>1) ? argv[1] : "asc/box.asc";
if (argc>2) maxframes=atoi(argv[2]);
if (argc==1)
{
printf("usage: %s filename.asc\n",argv[0]);
}
LoadAsc(&l,file);
len=Display(l,&maxframes);
printf("\ttime: %.3f sec\n",len);
printf("\tframes: %i\n",maxframes);
printf("\tfps: %.3f \n",(double)maxframes/len);
GGIMesaDestroyContext(ctx);
ggiClose(vis);
ggiClose(vis_mem);
ggiExit();
#endif
return 0;
}

2
progs/ggi/blah Normal file
View File

@@ -0,0 +1,2 @@
Terminating on signal 11

7
progs/ggi/blat Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/sh
function foobar() {
echo "foo!"
}
foobar

66
progs/ggi/box.asc Normal file
View File

@@ -0,0 +1,66 @@
Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216
Named object: "Object01"
Tri-mesh, Vertices: 8 Faces: 12
Vertex list:
Vertex 0: X: -20 Y: -19.999998 Z: 20.000002
Vertex 1: X: 20 Y: -19.999998 Z: 20.000002
Vertex 2: X: 20 Y: 20.000002 Z: 19.999998
Vertex 3: X: -20 Y: 20.000002 Z: 19.999998
Vertex 4: X: -20 Y: -20.000002 Z: -19.999998
Vertex 5: X: 20 Y: -20.000002 Z: -19.999998
Vertex 6: X: 20 Y: 19.999998 Z: -20.000002
Vertex 7: X: -20 Y: 19.999998 Z: -20.000002
Face list:
Face 0: A:0 B:1 C:2 AB:1 BC:1 CA:0
Smoothing: 1
Face 1: A:0 B:2 C:3 AB:0 BC:1 CA:1
Smoothing: 1
Face 2: A:0 B:4 C:5 AB:1 BC:1 CA:0
Smoothing: 2
Face 3: A:0 B:5 C:1 AB:0 BC:1 CA:1
Smoothing: 2
Face 4: A:1 B:5 C:6 AB:1 BC:1 CA:0
Smoothing: 3
Face 5: A:1 B:6 C:2 AB:0 BC:1 CA:1
Smoothing: 3
Face 6: A:2 B:6 C:7 AB:1 BC:1 CA:0
Smoothing: 4
Face 7: A:2 B:7 C:3 AB:0 BC:1 CA:1
Smoothing: 4
Face 8: A:3 B:7 C:4 AB:1 BC:1 CA:0
Smoothing: 5
Face 9: A:3 B:4 C:0 AB:0 BC:1 CA:1
Smoothing: 5
Face 10: A:4 B:7 C:6 AB:1 BC:1 CA:0
Smoothing: 6
Face 11: A:4 B:6 C:5 AB:0 BC:1 CA:1
Smoothing: 6
Page 1

198
progs/ggi/cone.asc Normal file
View File

@@ -0,0 +1,198 @@
Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216
Named object: "Object01"
Tri-mesh, Vertices: 34 Faces: 64
Vertex list:
Vertex 0: X: 60.167416 Y: -87.419525 Z: -53.3088
Vertex 1: X: 76.70787 Y: -87.419518 Z: -29.84565
Vertex 2: X: 83.0103 Y: -87.419518 Z: -1.838764
Vertex 3: X: 78.115204 Y: -87.419518 Z: 26.448057
Vertex 4: X: 62.767834 Y: -87.41951 Z: 50.708401
Vertex 5: X: 39.304672 Y: -87.41951 Z: 67.248848
Vertex 6: X: 11.297782 Y: -87.41951 Z: 73.551254
Vertex 7: X: -16.989004 Y: -87.41951 Z: 68.656158
Vertex 8: X: -41.249344 Y: -87.41951 Z: 53.308777
Vertex 9: X: -57.789783 Y: -87.419518 Z: 29.845612
Vertex 10: X: -64.092194 Y: -87.419518 Z: 1.838721
Vertex 11: X: -59.197079 Y: -87.419518 Z: -26.448097
Vertex 12: X: -43.849678 Y: -87.419525 Z: -50.708427
Vertex 13: X: -20.386503 Y: -87.419525 Z: -67.248856
Vertex 14: X: 7.62039 Y: -87.419525 Z: -73.551239
Vertex 15: X: 35.907204 Y: -87.419525 Z: -68.656105
Vertex 16: X: 101.684875 Y: 94.590591 Z: -96.955391
Vertex 17: X: 131.767838 Y: 94.590591 Z: -54.281792
Vertex 18: X: 143.230377 Y: 94.590599 Z: -3.344275
Vertex 19: X: 134.327423 Y: 94.590607 Z: 48.102379
Vertex 20: X: 106.414383 Y: 94.590607 Z: 92.225876
Vertex 21: X: 63.740765 Y: 94.590607 Z: 122.3088
Vertex 22: X: 12.803238 Y: 94.590614 Z: 133.771301
Vertex 23: X: -38.643349 Y: 94.590607 Z: 124.868355
Vertex 24: X: -82.766846 Y: 94.590607 Z: 96.955307
Vertex 25: X: -112.849762 Y: 94.590607 Z: 54.281677
Vertex 26: X: -124.312256 Y: 94.590599 Z: 3.344152
Vertex 27: X: -115.409271 Y: 94.590591 Z: -48.102493
Vertex 28: X: -87.496201 Y: 94.590591 Z: -92.225967
Vertex 29: X: -44.822552 Y: 94.590591 Z: -122.308861
Vertex 30: X: 6.114983 Y: 94.590584 Z: -133.771332
Vertex 31: X: 57.561623 Y: 94.590591 Z: -124.868301
Vertex 32: X: 9.459057 Y: -87.419518 Z: 0.000008
Vertex 33: X: 9.459057 Y: 94.590599 Z: -0.000008
Face list:
Face 0: A:0 B:1 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 1: A:1 B:2 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 2: A:2 B:3 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 3: A:3 B:4 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 4: A:4 B:5 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 5: A:5 B:6 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 6: A:6 B:7 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 7: A:7 B:8 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 8: A:8 B:9 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 9: A:9 B:10 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 10: A:10 B:11 C:32 AB:1 BC:0 CA:0
Page 1
Smoothing: 1
Face 11: A:11 B:12 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 12: A:12 B:13 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 13: A:13 B:14 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 14: A:14 B:15 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 15: A:15 B:0 C:32 AB:1 BC:0 CA:0
Smoothing: 1
Face 16: A:0 B:16 C:17 AB:1 BC:1 CA:0
Smoothing: 2
Face 17: A:0 B:17 C:1 AB:0 BC:1 CA:1
Smoothing: 2
Face 18: A:1 B:17 C:18 AB:1 BC:1 CA:0
Smoothing: 3
Face 19: A:1 B:18 C:2 AB:0 BC:1 CA:1
Smoothing: 3
Face 20: A:2 B:18 C:19 AB:1 BC:1 CA:0
Smoothing: 4
Face 21: A:2 B:19 C:3 AB:0 BC:1 CA:1
Smoothing: 4
Face 22: A:3 B:19 C:20 AB:1 BC:1 CA:0
Smoothing: 5
Face 23: A:3 B:20 C:4 AB:0 BC:1 CA:1
Smoothing: 5
Face 24: A:4 B:20 C:21 AB:1 BC:1 CA:0
Smoothing: 6
Face 25: A:4 B:21 C:5 AB:0 BC:1 CA:1
Smoothing: 6
Face 26: A:5 B:21 C:22 AB:1 BC:1 CA:0
Smoothing: 7
Face 27: A:5 B:22 C:6 AB:0 BC:1 CA:1
Smoothing: 7
Face 28: A:6 B:22 C:23 AB:1 BC:1 CA:0
Smoothing: 8
Face 29: A:6 B:23 C:7 AB:0 BC:1 CA:1
Smoothing: 8
Face 30: A:7 B:23 C:24 AB:1 BC:1 CA:0
Smoothing: 9
Face 31: A:7 B:24 C:8 AB:0 BC:1 CA:1
Smoothing: 9
Face 32: A:8 B:24 C:25 AB:1 BC:1 CA:0
Smoothing: 10
Face 33: A:8 B:25 C:9 AB:0 BC:1 CA:1
Smoothing: 10
Face 34: A:9 B:25 C:26 AB:1 BC:1 CA:0
Smoothing: 11
Face 35: A:9 B:26 C:10 AB:0 BC:1 CA:1
Smoothing: 11
Face 36: A:10 B:26 C:27 AB:1 BC:1 CA:0
Smoothing: 12
Face 37: A:10 B:27 C:11 AB:0 BC:1 CA:1
Smoothing: 12
Face 38: A:11 B:27 C:28 AB:1 BC:1 CA:0
Smoothing: 13
Face 39: A:11 B:28 C:12 AB:0 BC:1 CA:1
Smoothing: 13
Face 40: A:12 B:28 C:29 AB:1 BC:1 CA:0
Smoothing: 14
Page 2
Face 41: A:12 B:29 C:13 AB:0 BC:1 CA:1
Smoothing: 14
Face 42: A:13 B:29 C:30 AB:1 BC:1 CA:0
Smoothing: 15
Face 43: A:13 B:30 C:14 AB:0 BC:1 CA:1
Smoothing: 15
Face 44: A:14 B:30 C:31 AB:1 BC:1 CA:0
Smoothing: 16
Face 45: A:14 B:31 C:15 AB:0 BC:1 CA:1
Smoothing: 16
Face 46: A:15 B:31 C:16 AB:1 BC:1 CA:0
Smoothing: 17
Face 47: A:15 B:16 C:0 AB:0 BC:1 CA:1
Smoothing: 17
Face 48: A:16 B:33 C:17 AB:0 BC:0 CA:1
Smoothing: 18
Face 49: A:17 B:33 C:18 AB:0 BC:0 CA:1
Smoothing: 18
Face 50: A:18 B:33 C:19 AB:0 BC:0 CA:1
Smoothing: 18
Face 51: A:19 B:33 C:20 AB:0 BC:0 CA:1
Smoothing: 18
Face 52: A:20 B:33 C:21 AB:0 BC:0 CA:1
Smoothing: 18
Face 53: A:21 B:33 C:22 AB:0 BC:0 CA:1
Smoothing: 18
Face 54: A:22 B:33 C:23 AB:0 BC:0 CA:1
Smoothing: 18
Face 55: A:23 B:33 C:24 AB:0 BC:0 CA:1
Smoothing: 18
Face 56: A:24 B:33 C:25 AB:0 BC:0 CA:1
Smoothing: 18
Face 57: A:25 B:33 C:26 AB:0 BC:0 CA:1
Smoothing: 18
Face 58: A:26 B:33 C:27 AB:0 BC:0 CA:1
Smoothing: 18
Face 59: A:27 B:33 C:28 AB:0 BC:0 CA:1
Smoothing: 18
Face 60: A:28 B:33 C:29 AB:0 BC:0 CA:1
Smoothing: 18
Face 61: A:29 B:33 C:30 AB:0 BC:0 CA:1
Smoothing: 18
Face 62: A:30 B:33 C:31 AB:0 BC:0 CA:1
Smoothing: 18
Face 63: A:31 B:33 C:16 AB:0 BC:0 CA:1
Smoothing: 18
Page 3

340
progs/ggi/gears.c Normal file
View File

@@ -0,0 +1,340 @@
/* $Id: gears.c,v 1.3 1999/08/22 08:56:50 jtaylor Exp $ */
/*
* 3-D gear wheels. This program is in the public domain.
*
* Brian Paul
*/
/* Conversion to GLUT by Mark J. Kilgard */
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <GL/glut.h>
#ifndef M_PI
#define M_PI 3.14159265
#endif
static GLint T0 = 0;
static GLint Frames = 0;
/**
Draw a gear wheel. You'll probably want to call this function when
building a display list since we do a lot of trig here.
Input: inner_radius - radius of hole at center
outer_radius - radius at center of teeth
width - width of gear
teeth - number of teeth
tooth_depth - depth of tooth
**/
static void
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
GLint teeth, GLfloat tooth_depth)
{
GLint i;
GLfloat r0, r1, r2;
GLfloat angle, da;
GLfloat u, v, len;
r0 = inner_radius;
r1 = outer_radius - tooth_depth / 2.0;
r2 = outer_radius + tooth_depth / 2.0;
da = 2.0 * M_PI / teeth / 4.0;
glShadeModel(GL_FLAT);
glNormal3f(0.0, 0.0, 1.0);
/* draw front face */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
if (i < teeth) {
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
}
}
glEnd();
/* draw front sides of teeth */
glBegin(GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
}
glEnd();
glNormal3f(0.0, 0.0, -1.0);
/* draw back face */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
if (i < teeth) {
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
}
}
glEnd();
/* draw back sides of teeth */
glBegin(GL_QUADS);
da = 2.0 * M_PI / teeth / 4.0;
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
}
glEnd();
/* draw outward faces of teeth */
glBegin(GL_QUAD_STRIP);
for (i = 0; i < teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
u = r2 * cos(angle + da) - r1 * cos(angle);
v = r2 * sin(angle + da) - r1 * sin(angle);
len = sqrt(u * u + v * v);
u /= len;
v /= len;
glNormal3f(v, -u, 0.0);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
glNormal3f(cos(angle), sin(angle), 0.0);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), width * 0.5);
glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da), -width * 0.5);
u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
glNormal3f(v, -u, 0.0);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), width * 0.5);
glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5);
glNormal3f(cos(angle), sin(angle), 0.0);
}
glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
glEnd();
glShadeModel(GL_SMOOTH);
/* draw inside radius cylinder */
glBegin(GL_QUAD_STRIP);
for (i = 0; i <= teeth; i++) {
angle = i * 2.0 * M_PI / teeth;
glNormal3f(-cos(angle), -sin(angle), 0.0);
glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
}
glEnd();
}
static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
static void
draw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(view_rotx, 1.0, 0.0, 0.0);
glRotatef(view_roty, 0.0, 1.0, 0.0);
glRotatef(view_rotz, 0.0, 0.0, 1.0);
glPushMatrix();
glTranslatef(-3.0, -2.0, 0.0);
glRotatef(angle, 0.0, 0.0, 1.0);
glCallList(gear1);
glPopMatrix();
glPushMatrix();
glTranslatef(3.1, -2.0, 0.0);
glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
glCallList(gear2);
glPopMatrix();
glPushMatrix();
glTranslatef(-3.1, 4.2, 0.0);
glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
glCallList(gear3);
glPopMatrix();
glPopMatrix();
glutSwapBuffers();
Frames++;
{
GLint t = glutGet(GLUT_ELAPSED_TIME);
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
idle(void)
{
angle += 2.0;
glutPostRedisplay();
}
/* change view angle, exit upon ESC */
/* ARGSUSED1 */
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 'z':
view_rotz += 5.0;
break;
case 'Z':
view_rotz -= 5.0;
break;
case 27: /* Escape */
exit(0); /* FIXME: Shutdown and free resources cleanly in ggiglut */
break;
default:
return;
}
glutPostRedisplay();
}
/* change view angle */
/* ARGSUSED1 */
static void
special(int k, int x, int y)
{
switch (k) {
case GLUT_KEY_UP:
view_rotx += 5.0;
break;
case GLUT_KEY_DOWN:
view_rotx -= 5.0;
break;
case GLUT_KEY_LEFT:
view_roty += 5.0;
break;
case GLUT_KEY_RIGHT:
view_roty -= 5.0;
break;
default:
return;
}
glutPostRedisplay();
}
/* new window size or exposure */
static void
reshape(int width, int height)
{
GLfloat h = (GLfloat) height / (GLfloat) width;
glViewport(0, 0, (GLint) width, (GLint) height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0, 0.0, -40.0);
}
static void
init(void)
{
static GLfloat pos[4] =
{5.0, 5.0, 10.0, 0.0};
static GLfloat red[4] =
{0.8, 0.1, 0.0, 1.0};
static GLfloat green[4] =
{0.0, 0.8, 0.2, 1.0};
static GLfloat blue[4] =
{0.2, 0.2, 1.0, 1.0};
glLightfv(GL_LIGHT0, GL_POSITION, pos);
glEnable(GL_CULL_FACE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
/* make the gears */
gear1 = glGenLists(1);
glNewList(gear1, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
gear(1.0, 4.0, 1.0, 20, 0.7);
glEndList();
gear2 = glGenLists(1);
glNewList(gear2, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
gear(0.5, 2.0, 2.0, 10, 0.7);
glEndList();
gear3 = glGenLists(1);
glNewList(gear3, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
gear(1.3, 2.0, 0.5, 10, 0.7);
glEndList();
glEnable(GL_NORMALIZE);
}
void
visible(int vis)
{
if (vis == GLUT_VISIBLE)
glutIdleFunc(idle);
else
glutIdleFunc(NULL);
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
// glutInitWindowPosition(0, 0);
// glutInitWindowSize(300, 300);
glutCreateWindow("Gears");
init();
glutDisplayFunc(draw);
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutSpecialFunc(special);
glutVisibilityFunc(visible);
glutMainLoop();
return 0;
}

359
progs/ggi/gears2.c Normal file
View File

@@ -0,0 +1,359 @@
/* gears.c */
/*
* 3-D gear wheels. This program is in the public domain.
*
* Brian Paul
* modified by Uwe Maurer (uwe_maurer@t-online.de)
*/
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <ggi/ggi.h>
#include <GL/ggimesa.h>
#ifndef M_PI
# define M_PI 3.14159265
#endif
ggi_visual_t vis;
char text[100];
/*
* Draw a gear wheel. You'll probably want to call this function when
* building a display list since we do a lot of trig here.
*
* Input: inner_radius - radius of hole at center
* outer_radius - radius at center of teeth
* width - width of gear
* teeth - number of teeth
* tooth_depth - depth of tooth
*/
static void gear( GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
GLint teeth, GLfloat tooth_depth )
{
GLint i;
GLfloat r0, r1, r2;
GLfloat angle, da;
GLfloat u, v, len;
r0 = inner_radius;
r1 = outer_radius - tooth_depth/2.0;
r2 = outer_radius + tooth_depth/2.0;
da = 2.0*M_PI / teeth / 4.0;
glShadeModel( GL_FLAT );
glNormal3f( 0.0, 0.0, 1.0 );
/* draw front face */
glBegin( GL_QUAD_STRIP );
for (i=0;i<=teeth;i++) {
angle = i * 2.0*M_PI / teeth;
glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 );
glVertex3f( r1*cos(angle), r1*sin(angle), width*0.5 );
glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 );
glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), width*0.5 );
}
glEnd();
/* draw front sides of teeth */
glBegin( GL_QUADS );
da = 2.0*M_PI / teeth / 4.0;
for (i=0;i<teeth;i++) {
angle = i * 2.0*M_PI / teeth;
glVertex3f( r1*cos(angle), r1*sin(angle), width*0.5 );
glVertex3f( r2*cos(angle+da), r2*sin(angle+da), width*0.5 );
glVertex3f( r2*cos(angle+2*da), r2*sin(angle+2*da), width*0.5 );
glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), width*0.5 );
}
glEnd();
glNormal3f( 0.0, 0.0, -1.0 );
/* draw back face */
glBegin( GL_QUAD_STRIP );
for (i=0;i<=teeth;i++) {
angle = i * 2.0*M_PI / teeth;
glVertex3f( r1*cos(angle), r1*sin(angle), -width*0.5 );
glVertex3f( r0*cos(angle), r0*sin(angle), -width*0.5 );
glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), -width*0.5 );
glVertex3f( r0*cos(angle), r0*sin(angle), -width*0.5 );
}
glEnd();
/* draw back sides of teeth */
glBegin( GL_QUADS );
da = 2.0*M_PI / teeth / 4.0;
for (i=0;i<teeth;i++) {
angle = i * 2.0*M_PI / teeth;
glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), -width*0.5 );
glVertex3f( r2*cos(angle+2*da), r2*sin(angle+2*da), -width*0.5 );
glVertex3f( r2*cos(angle+da), r2*sin(angle+da), -width*0.5 );
glVertex3f( r1*cos(angle), r1*sin(angle), -width*0.5 );
}
glEnd();
/* draw outward faces of teeth */
glBegin( GL_QUAD_STRIP );
for (i=0;i<teeth;i++) {
angle = i * 2.0*M_PI / teeth;
glVertex3f( r1*cos(angle), r1*sin(angle), width*0.5 );
glVertex3f( r1*cos(angle), r1*sin(angle), -width*0.5 );
u = r2*cos(angle+da) - r1*cos(angle);
v = r2*sin(angle+da) - r1*sin(angle);
len = sqrt( u*u + v*v );
u /= len;
v /= len;
glNormal3f( v, -u, 0.0 );
glVertex3f( r2*cos(angle+da), r2*sin(angle+da), width*0.5 );
glVertex3f( r2*cos(angle+da), r2*sin(angle+da), -width*0.5 );
glNormal3f( cos(angle), sin(angle), 0.0 );
glVertex3f( r2*cos(angle+2*da), r2*sin(angle+2*da), width*0.5 );
glVertex3f( r2*cos(angle+2*da), r2*sin(angle+2*da), -width*0.5 );
u = r1*cos(angle+3*da) - r2*cos(angle+2*da);
v = r1*sin(angle+3*da) - r2*sin(angle+2*da);
glNormal3f( v, -u, 0.0 );
glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), width*0.5 );
glVertex3f( r1*cos(angle+3*da), r1*sin(angle+3*da), -width*0.5 );
glNormal3f( cos(angle), sin(angle), 0.0 );
}
glVertex3f( r1*cos(0), r1*sin(0), width*0.5 );
glVertex3f( r1*cos(0), r1*sin(0), -width*0.5 );
glEnd();
glShadeModel( GL_SMOOTH );
/* draw inside radius cylinder */
glBegin( GL_QUAD_STRIP );
for (i=0;i<=teeth;i++) {
angle = i * 2.0*M_PI / teeth;
glNormal3f( -cos(angle), -sin(angle), 0.0 );
glVertex3f( r0*cos(angle), r0*sin(angle), -width*0.5 );
glVertex3f( r0*cos(angle), r0*sin(angle), width*0.5 );
}
glEnd();
}
static GLfloat view_rotx=20.0, view_roty=30.0, view_rotz=0.0;
static GLint gear1, gear2, gear3;
static GLfloat angle = 0.0;
static GLuint limit;
static GLuint count = 1;
static void draw( void )
{
glClearColor(0,0,0,0);
glClearIndex(0);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glPushMatrix();
glRotatef( view_rotx, 1.0, 0.0, 0.0 );
glRotatef( view_roty, 0.0, 1.0, 0.0 );
glRotatef( view_rotz, 0.0, 0.0, 1.0 );
glPushMatrix();
glTranslatef( -3.0, -2.0, 0.0 );
glRotatef( angle, 0.0, 0.0, 1.0 );
glCallList(gear1);
glPopMatrix();
glPushMatrix();
glTranslatef( 3.1, -2.0, 0.0 );
glRotatef( -2.0*angle-9.0, 0.0, 0.0, 1.0 );
glCallList(gear2);
glPopMatrix();
glPushMatrix();
glTranslatef( -3.1, 4.2, 0.0 );
glRotatef( -2.0*angle-25.0, 0.0, 0.0, 1.0 );
glCallList(gear3);
glPopMatrix();
glPopMatrix();
glFlush();
glFinish();
#if 0
ggiSetGCForeground(vis,255);
ggiPuts(vis,0,0,"Mesa -> GGI");
ggiPuts(vis,0,ggiGetInfo(vis)->mode->visible.y," Mesa -> GGI");
ggiPuts(vis,0,16,text);
ggiPuts(vis,0,ggiGetInfo(vis)->mode->visible.y+16,text);
#endif
GGIMesaSwapBuffers();
count++;
if (count==limit) {
exit(1);
}
}
static void idle( void )
{
angle += 2.0;
draw();
}
/* new window size or exposure */
static void reshape( int width, int height )
{
GLfloat h = (GLfloat) height / (GLfloat) width;
glViewport(0, 0, (GLint)width, (GLint)height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum( -1.0, 1.0, -h, h, 5.0, 60.0 );
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef( 0.0, 0.0, -40.0 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
}
static void init( void )
{
static GLfloat pos[4] = {5.0, 5.0, 10.0, 0.0 };
static GLfloat red[4] = {0.8, 0.1, 0.0, 1.0 };
static GLfloat green[4] = {0.0, 0.8, 0.2, 1.0 };
static GLfloat blue[4] = {0.2, 0.2, 1.0, 1.0 };
glLightfv( GL_LIGHT0, GL_POSITION, pos );
glEnable( GL_CULL_FACE );
glEnable( GL_LIGHTING );
glEnable( GL_LIGHT0 );
glEnable( GL_DEPTH_TEST );
/* make the gears */
gear1 = glGenLists(1);
glNewList(gear1, GL_COMPILE);
glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red );
glIndexi(1);
gear( 1.0, 4.0, 1.0, 20, 0.7 );
glEndList();
gear2 = glGenLists(1);
glNewList(gear2, GL_COMPILE);
glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green );
glIndexi(2);
gear( 0.5, 2.0, 2.0, 10, 0.7 );
glEndList();
gear3 = glGenLists(1);
glNewList(gear3, GL_COMPILE);
glMaterialfv( GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue );
glIndexi(3);
gear( 1.3, 2.0, 0.5, 10, 0.7 );
glEndList();
glEnable( GL_NORMALIZE );
}
static void usage(char *s)
{
printf("%s visible_x visible_y virtual_x virtual_y bpp db_flag\n",s);
printf("example:\n");
printf("%s 320 200 320 400 8 1\n",s);
exit(1);
}
int main( int argc, char *argv[] )
{
GGIMesaContext ctx;
int vis_x,vis_y,vir_x,vir_y,bpp,db_flag,gt;
ggi_mode mode;
limit=0;
if (argc<7) usage(argv[0]);
vis_x=atoi(argv[1]);
vis_y=atoi(argv[2]);
vir_x=atoi(argv[3]);
vir_y=atoi(argv[4]);
bpp=atoi(argv[5]);
db_flag=atoi(argv[6]);
switch(bpp)
{
case 4: gt=GT_4BIT;break;
case 8: gt=GT_8BIT;break;
case 15:gt=GT_15BIT;break;
case 16:gt=GT_16BIT;break;
case 24:gt=GT_24BIT;break;
case 32:gt=GT_32BIT;break;
default:
printf("%i Bits per Pixel ???\n",bpp);
exit(1);
}
sprintf(text,"%sx%s %i colors, RGB mode, %s",
argv[1],argv[2],1<<bpp,
(db_flag) ? "doublebuffer" : "no doublebuffer");
if (ggiInit()<0)
{
printf("ggiInit() failed\n");
exit(1);
}
ctx=GGIMesaCreateContext();
if (ctx==NULL)
{
printf("GGIMesaCreateContext() failed\n");
exit(1);
}
vis=ggiOpen(NULL);
if (vis==NULL)
{
printf("ggiOpen() failed\n");
exit(1);
}
if (ggiSetGraphMode(vis,vis_x,vis_y,vir_x,vir_y,gt)<0)
{
printf("%s: can't set graphmode (%i %i %i %i) %i BPP\n",
argv[0],vis_x,vis_y,vir_x,vir_y,bpp);
exit(1);
}
if (GGIMesaSetVisual(ctx,vis,GL_TRUE,db_flag)<0)
{
printf ("GGIMesaSetVisual() failed\n");
exit(1);
}
GGIMesaMakeCurrent(ctx);
ggiGetMode(vis,&mode);
reshape(mode.visible.x,mode.visible.y);
init();
while (!ggiKbhit(vis)) idle();
GGIMesaDestroyContext(ctx);
ggiClose(vis);
printf("%s\n",text);
ggiExit();
return 0;
}

132
progs/ggi/sphere.asc Normal file
View File

@@ -0,0 +1,132 @@
Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216
Named object: "Object01"
Tri-mesh, Vertices: 20 Faces: 36
Vertex list:
Vertex 0: X: -210 Y: -432.781738 Z: 180.000031
Vertex 1: X: -610.810303 Y: 144.260559 Z: 103.580154
Vertex 2: X: 56.586655 Y: 144.260544 Z: -128.902023
Vertex 3: X: -75.776352 Y: 144.260605 Z: 565.321838
Vertex 4: X: -462.815979 Y: -347.937683 Z: 131.797302
Vertex 5: X: -616.506042 Y: -126.67173 Z: 102.494209
Vertex 6: X: -41.847229 Y: -347.937683 Z: -14.843644
Vertex 7: X: 60.375015 Y: -126.671753 Z: -133.291641
Vertex 8: X: -125.336807 Y: -347.937653 Z: 423.046448
Vertex 9: X: -73.868958 Y: -126.671692 Z: 570.797424
Vertex 10: X: -448.353271 Y: 237.304672 Z: -92.34951
Vertex 11: X: -192.440964 Y: 237.304672 Z: -181.494431
Vertex 12: X: 145.038193 Y: 237.304672 Z: 109.754745
Vertex 13: X: 94.283768 Y: 237.304688 Z: 375.953766
Vertex 14: X: -326.684937 Y: 237.304733 Z: 522.594727
Vertex 15: X: -531.842834 Y: 237.304718 Z: 345.540588
Vertex 16: X: -331.419525 Y: -225.964966 Z: -168.564438
Vertex 17: X: 152.575485 Y: -225.964935 Z: 249.129868
Vertex 18: X: -451.155914 Y: -225.964905 Z: 459.434662
Vertex 19: X: -298.413483 Y: 423.31897 Z: 163.142761
Face list:
Face 0: A:0 B:4 C:6 AB:1 BC:1 CA:1
Face 1: A:4 B:5 C:16 AB:1 BC:1 CA:1
Face 2: A:4 B:16 C:6 AB:1 BC:1 CA:1
Face 3: A:6 B:16 C:7 AB:1 BC:1 CA:1
Face 4: A:5 B:1 C:10 AB:1 BC:1 CA:1
Face 5: A:5 B:10 C:16 AB:1 BC:1 CA:1
Face 6: A:16 B:10 C:11 AB:1 BC:1 CA:1
Face 7: A:16 B:11 C:7 AB:1 BC:1 CA:1
Face 8: A:7 B:11 C:2 AB:1 BC:1 CA:1
Face 9: A:0 B:6 C:8 AB:1 BC:1 CA:1
Face 10: A:6 B:7 C:17 AB:1 BC:1 CA:1
Face 11: A:6 B:17 C:8 AB:1 BC:1 CA:1
Face 12: A:8 B:17 C:9 AB:1 BC:1 CA:1
Face 13: A:7 B:2 C:12 AB:1 BC:1 CA:1
Face 14: A:7 B:12 C:17 AB:1 BC:1 CA:1
Face 15: A:17 B:12 C:13 AB:1 BC:1 CA:1
Face 16: A:17 B:13 C:9 AB:1 BC:1 CA:1
Face 17: A:9 B:13 C:3 AB:1 BC:1 CA:1
Face 18: A:0 B:8 C:4 AB:1 BC:1 CA:1
Face 19: A:8 B:9 C:18 AB:1 BC:1 CA:1
Face 20: A:8 B:18 C:4 AB:1 BC:1 CA:1
Face 21: A:4 B:18 C:5 AB:1 BC:1 CA:1
Face 22: A:9 B:3 C:14 AB:1 BC:1 CA:1
Face 23: A:9 B:14 C:18 AB:1 BC:1 CA:1
Face 24: A:18 B:14 C:15 AB:1 BC:1 CA:1
Face 25: A:18 B:15 C:5 AB:1 BC:1 CA:1
Face 26: A:5 B:15 C:1 AB:1 BC:1 CA:1
Face 27: A:1 B:15 C:10 AB:1 BC:1 CA:1
Face 28: A:15 B:14 C:19 AB:1 BC:1 CA:1
Face 29: A:15 B:19 C:10 AB:1 BC:1 CA:1
Face 30: A:10 B:19 C:11 AB:1 BC:1 CA:1
Face 31: A:14 B:3 C:13 AB:1 BC:1 CA:1
Face 32: A:14 B:13 C:19 AB:1 BC:1 CA:1
Face 33: A:19 B:13 C:12 AB:1 BC:1 CA:1
Face 34: A:19 B:12 C:11 AB:1 BC:1 CA:1
Page 1
Face 35: A:11 B:12 C:2 AB:1 BC:1 CA:1
Page 2

264
progs/ggi/torus.asc Normal file
View File

@@ -0,0 +1,264 @@
Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216
Named object: "Object01"
Tri-mesh, Vertices: 40 Faces: 80
Vertex list:
Vertex 0: X: -50.170624 Y: -0.000026 Z: -240.147842
Vertex 1: X: -80.584503 Y: -63.958851 Z: -205.014572
Vertex 2: X: -129.795166 Y: -39.528744 Z: -148.16774
Vertex 3: X: -129.795166 Y: 39.528721 Z: -148.16774
Vertex 4: X: -80.584503 Y: 63.958797 Z: -205.014572
Vertex 5: X: 85.963654 Y: -0.000002 Z: 31.490465
Vertex 6: X: 39.614838 Y: -63.958828 Z: 34.827602
Vertex 7: X: -35.37915 Y: -39.528728 Z: 40.227196
Vertex 8: X: -35.37912 Y: 39.528736 Z: 40.227188
Vertex 9: X: 39.614838 Y: 63.95882 Z: 34.827595
Vertex 10: X: -9.852051 Y: 0.000023 Z: 319.829254
Vertex 11: X: -44.985352 Y: -63.958805 Z: 289.415405
Vertex 12: X: -101.832199 Y: -39.528709 Z: 240.204758
Vertex 13: X: -101.832184 Y: 39.528755 Z: 240.204773
Vertex 14: X: -44.985352 Y: 63.958843 Z: 289.415405
Vertex 15: X: -281.490326 Y: 0.000035 Z: 455.963654
Vertex 16: X: -284.827484 Y: -63.958794 Z: 409.614868
Vertex 17: X: -290.227112 Y: -39.528702 Z: 334.62085
Vertex 18: X: -290.227112 Y: 39.528763 Z: 334.62088
Vertex 19: X: -284.827484 Y: 63.958855 Z: 409.614838
Vertex 20: X: -569.829163 Y: 0.000026 Z: 360.14798
Vertex 21: X: -539.415344 Y: -63.958801 Z: 325.014709
Vertex 22: X: -490.204712 Y: -39.528709 Z: 268.167847
Vertex 23: X: -490.204712 Y: 39.528755 Z: 268.167847
Vertex 24: X: -539.415344 Y: 63.958847 Z: 325.014679
Vertex 25: X: -705.963684 Y: 0.000002 Z: 88.509598
Vertex 26: X: -659.614807 Y: -63.958824 Z: 85.172462
Vertex 27: X: -584.62085 Y: -39.528725 Z: 79.77285
Vertex 28: X: -584.62085 Y: 39.52874 Z: 79.77285
Vertex 29: X: -659.614868 Y: 63.958824 Z: 85.172447
Vertex 30: X: -610.147827 Y: -0.000023 Z: -199.829361
Vertex 31: X: -575.014587 Y: -63.958847 Z: -169.415497
Vertex 32: X: -518.167725 Y: -39.528744 Z: -120.204819
Vertex 33: X: -518.167725 Y: 39.528721 Z: -120.204834
Vertex 34: X: -575.014587 Y: 63.958801 Z: -169.415497
Vertex 35: X: -338.509338 Y: -0.000035 Z: -335.963745
Vertex 36: X: -335.172241 Y: -63.958858 Z: -289.614868
Vertex 37: X: -329.772675 Y: -39.528751 Z: -214.620865
Vertex 38: X: -329.772675 Y: 39.528713 Z: -214.620865
Vertex 39: X: -335.172241 Y: 63.95879 Z: -289.614899
Face list:
Face 0: A:0 B:6 C:1 AB:0 BC:1 CA:1
Smoothing: 1
Face 1: A:0 B:5 C:6 AB:1 BC:1 CA:0
Smoothing: 1
Face 2: A:1 B:7 C:2 AB:0 BC:1 CA:1
Smoothing: 2
Face 3: A:1 B:6 C:7 AB:1 BC:1 CA:0
Smoothing: 2
Face 4: A:2 B:8 C:3 AB:0 BC:1 CA:1
Smoothing: 3
Face 5: A:2 B:7 C:8 AB:1 BC:1 CA:0
Smoothing: 3
Face 6: A:3 B:9 C:4 AB:0 BC:1 CA:1
Smoothing: 4
Face 7: A:3 B:8 C:9 AB:1 BC:1 CA:0
Page 1
Smoothing: 4
Face 8: A:4 B:5 C:0 AB:0 BC:1 CA:1
Smoothing: 5
Face 9: A:4 B:9 C:5 AB:1 BC:1 CA:0
Smoothing: 5
Face 10: A:5 B:11 C:6 AB:0 BC:1 CA:1
Smoothing: 6
Face 11: A:5 B:10 C:11 AB:1 BC:1 CA:0
Smoothing: 6
Face 12: A:6 B:12 C:7 AB:0 BC:1 CA:1
Smoothing: 7
Face 13: A:6 B:11 C:12 AB:1 BC:1 CA:0
Smoothing: 7
Face 14: A:7 B:13 C:8 AB:0 BC:1 CA:1
Smoothing: 8
Face 15: A:7 B:12 C:13 AB:1 BC:1 CA:0
Smoothing: 8
Face 16: A:8 B:14 C:9 AB:0 BC:1 CA:1
Smoothing: 9
Face 17: A:8 B:13 C:14 AB:1 BC:1 CA:0
Smoothing: 9
Face 18: A:9 B:10 C:5 AB:0 BC:1 CA:1
Smoothing: 10
Face 19: A:9 B:14 C:10 AB:1 BC:1 CA:0
Smoothing: 10
Face 20: A:10 B:16 C:11 AB:0 BC:1 CA:1
Smoothing: 11
Face 21: A:10 B:15 C:16 AB:1 BC:1 CA:0
Smoothing: 11
Face 22: A:11 B:17 C:12 AB:0 BC:1 CA:1
Smoothing: 12
Face 23: A:11 B:16 C:17 AB:1 BC:1 CA:0
Smoothing: 12
Face 24: A:12 B:18 C:13 AB:0 BC:1 CA:1
Smoothing: 13
Face 25: A:12 B:17 C:18 AB:1 BC:1 CA:0
Smoothing: 13
Face 26: A:13 B:19 C:14 AB:0 BC:1 CA:1
Smoothing: 14
Face 27: A:13 B:18 C:19 AB:1 BC:1 CA:0
Smoothing: 14
Face 28: A:14 B:15 C:10 AB:0 BC:1 CA:1
Smoothing: 15
Face 29: A:14 B:19 C:15 AB:1 BC:1 CA:0
Smoothing: 15
Face 30: A:15 B:21 C:16 AB:0 BC:1 CA:1
Smoothing: 16
Face 31: A:15 B:20 C:21 AB:1 BC:1 CA:0
Smoothing: 16
Face 32: A:16 B:22 C:17 AB:0 BC:1 CA:1
Smoothing: 17
Face 33: A:16 B:21 C:22 AB:1 BC:1 CA:0
Smoothing: 17
Face 34: A:17 B:23 C:18 AB:0 BC:1 CA:1
Smoothing: 18
Face 35: A:17 B:22 C:23 AB:1 BC:1 CA:0
Smoothing: 18
Face 36: A:18 B:24 C:19 AB:0 BC:1 CA:1
Smoothing: 19
Face 37: A:18 B:23 C:24 AB:1 BC:1 CA:0
Smoothing: 19
Page 2
Face 38: A:19 B:20 C:15 AB:0 BC:1 CA:1
Smoothing: 20
Face 39: A:19 B:24 C:20 AB:1 BC:1 CA:0
Smoothing: 20
Face 40: A:20 B:26 C:21 AB:0 BC:1 CA:1
Smoothing: 21
Face 41: A:20 B:25 C:26 AB:1 BC:1 CA:0
Smoothing: 21
Face 42: A:21 B:27 C:22 AB:0 BC:1 CA:1
Smoothing: 22
Face 43: A:21 B:26 C:27 AB:1 BC:1 CA:0
Smoothing: 22
Face 44: A:22 B:28 C:23 AB:0 BC:1 CA:1
Smoothing: 23
Face 45: A:22 B:27 C:28 AB:1 BC:1 CA:0
Smoothing: 23
Face 46: A:23 B:29 C:24 AB:0 BC:1 CA:1
Smoothing: 24
Face 47: A:23 B:28 C:29 AB:1 BC:1 CA:0
Smoothing: 24
Face 48: A:24 B:25 C:20 AB:0 BC:1 CA:1
Smoothing: 25
Face 49: A:24 B:29 C:25 AB:1 BC:1 CA:0
Smoothing: 25
Face 50: A:25 B:31 C:26 AB:0 BC:1 CA:1
Smoothing: 26
Face 51: A:25 B:30 C:31 AB:1 BC:1 CA:0
Smoothing: 26
Face 52: A:26 B:32 C:27 AB:0 BC:1 CA:1
Smoothing: 27
Face 53: A:26 B:31 C:32 AB:1 BC:1 CA:0
Smoothing: 27
Face 54: A:27 B:33 C:28 AB:0 BC:1 CA:1
Smoothing: 28
Face 55: A:27 B:32 C:33 AB:1 BC:1 CA:0
Smoothing: 28
Face 56: A:28 B:34 C:29 AB:0 BC:1 CA:1
Smoothing: 29
Face 57: A:28 B:33 C:34 AB:1 BC:1 CA:0
Smoothing: 29
Face 58: A:29 B:30 C:25 AB:0 BC:1 CA:1
Smoothing: 30
Face 59: A:29 B:34 C:30 AB:1 BC:1 CA:0
Smoothing: 30
Face 60: A:30 B:36 C:31 AB:0 BC:1 CA:1
Smoothing: 31
Face 61: A:30 B:35 C:36 AB:1 BC:1 CA:0
Smoothing: 31
Face 62: A:31 B:37 C:32 AB:0 BC:1 CA:1
Smoothing: 32
Face 63: A:31 B:36 C:37 AB:1 BC:1 CA:0
Smoothing: 32
Face 64: A:32 B:38 C:33 AB:0 BC:1 CA:1
Smoothing: 1
Face 65: A:32 B:37 C:38 AB:1 BC:1 CA:0
Smoothing: 1
Face 66: A:33 B:39 C:34 AB:0 BC:1 CA:1
Smoothing: 2
Face 67: A:33 B:38 C:39 AB:1 BC:1 CA:0
Smoothing: 2
Face 68: A:34 B:35 C:30 AB:0 BC:1 CA:1
Page 3
Smoothing: 3
Face 69: A:34 B:39 C:35 AB:1 BC:1 CA:0
Smoothing: 3
Face 70: A:35 B:1 C:36 AB:0 BC:1 CA:1
Smoothing: 4
Face 71: A:35 B:0 C:1 AB:1 BC:1 CA:0
Smoothing: 4
Face 72: A:36 B:2 C:37 AB:0 BC:1 CA:1
Smoothing: 5
Face 73: A:36 B:1 C:2 AB:1 BC:1 CA:0
Smoothing: 5
Face 74: A:37 B:3 C:38 AB:0 BC:1 CA:1
Smoothing: 6
Face 75: A:37 B:2 C:3 AB:1 BC:1 CA:0
Smoothing: 6
Face 76: A:38 B:4 C:39 AB:0 BC:1 CA:1
Smoothing: 7
Face 77: A:38 B:3 C:4 AB:1 BC:1 CA:0
Smoothing: 7
Face 78: A:39 B:0 C:35 AB:0 BC:1 CA:1
Smoothing: 8
Face 79: A:39 B:4 C:0 AB:1 BC:1 CA:0
Smoothing: 8
Page 4

396
progs/ggi/tube.asc Normal file
View File

@@ -0,0 +1,396 @@
Ambient light color: Red=0.039216 Green=0.039216 Blue=0.039216
Named object: "Object01"
Tri-mesh, Vertices: 64 Faces: 128
Vertex list:
Vertex 0: X: 61.483898 Y: 37.836231 Z: -70.94294
Vertex 1: X: 82.867447 Y: 37.836235 Z: -41.288902
Vertex 2: X: 91.275154 Y: 37.836239 Z: -5.70901
Vertex 3: X: 85.427025 Y: 37.836243 Z: 30.380013
Vertex 4: X: 66.213379 Y: 37.836243 Z: 61.483936
Vertex 5: X: 36.559322 Y: 37.836246 Z: 82.86747
Vertex 6: X: 0.979424 Y: 37.836246 Z: 91.275154
Vertex 7: X: -35.109554 Y: 37.836246 Z: 85.42701
Vertex 8: X: -66.213478 Y: 37.836246 Z: 66.213356
Vertex 9: X: -87.597 Y: 37.836243 Z: 36.559303
Vertex 10: X: -96.004677 Y: 37.836239 Z: 0.979406
Vertex 11: X: -90.156517 Y: 37.836235 Z: -35.109615
Vertex 12: X: -70.942848 Y: 37.836235 Z: -66.213516
Vertex 13: X: -41.288776 Y: 37.836231 Z: -87.597023
Vertex 14: X: -5.708872 Y: 37.836231 Z: -96.004692
Vertex 15: X: 30.380142 Y: 37.836231 Z: -90.156502
Vertex 16: X: 61.483898 Y: -38.14529 Z: -70.942932
Vertex 17: X: 82.867447 Y: -38.145287 Z: -41.288895
Vertex 18: X: 91.275154 Y: -38.145283 Z: -5.709003
Vertex 19: X: 85.427025 Y: -38.145279 Z: 30.38002
Vertex 20: X: 66.213379 Y: -38.145279 Z: 61.483944
Vertex 21: X: 36.559322 Y: -38.145275 Z: 82.867477
Vertex 22: X: 0.979424 Y: -38.145275 Z: 91.275162
Vertex 23: X: -35.109554 Y: -38.145275 Z: 85.427017
Vertex 24: X: -66.213478 Y: -38.145275 Z: 66.213364
Vertex 25: X: -87.597 Y: -38.145279 Z: 36.559311
Vertex 26: X: -96.004677 Y: -38.145283 Z: 0.979412
Vertex 27: X: -90.156517 Y: -38.145287 Z: -35.109608
Vertex 28: X: -70.942848 Y: -38.145287 Z: -66.213516
Vertex 29: X: -41.288776 Y: -38.14529 Z: -87.597015
Vertex 30: X: -5.708872 Y: -38.14529 Z: -96.004684
Vertex 31: X: 30.380142 Y: -38.14529 Z: -90.156494
Vertex 32: X: 29.53923 Y: 37.836235 Z: -36.632011
Vertex 33: X: 40.224194 Y: 37.836239 Z: -21.814436
Vertex 34: X: 44.425369 Y: 37.836239 Z: -4.035822
Vertex 35: X: 41.503166 Y: 37.836239 Z: 13.997195
Vertex 36: X: 31.902466 Y: 37.836243 Z: 29.539249
Vertex 37: X: 17.084883 Y: 37.836243 Z: 40.224201
Vertex 38: X: -0.693734 Y: 37.836243 Z: 44.425365
Vertex 39: X: -18.726728 Y: 37.836243 Z: 41.503159
Vertex 40: X: -34.26878 Y: 37.836243 Z: 31.902454
Vertex 41: X: -44.953732 Y: 37.836239 Z: 17.084871
Vertex 42: X: -49.154892 Y: 37.836239 Z: -0.693745
Vertex 43: X: -46.232677 Y: 37.836239 Z: -18.726759
Vertex 44: X: -36.631962 Y: 37.836235 Z: -34.268806
Vertex 45: X: -21.814371 Y: 37.836235 Z: -44.953747
Vertex 46: X: -4.035751 Y: 37.836235 Z: -49.1549
Vertex 47: X: 13.997261 Y: 37.836235 Z: -46.23267
Vertex 48: X: 29.53923 Y: -38.145287 Z: -36.632004
Vertex 49: X: 40.224194 Y: -38.145283 Z: -21.814428
Vertex 50: X: 44.425369 Y: -38.145283 Z: -4.035816
Vertex 51: X: 41.503166 Y: -38.145283 Z: 13.997201
Vertex 52: X: 31.902466 Y: -38.145279 Z: 29.539257
Vertex 53: X: 17.084883 Y: -38.145279 Z: 40.224209
Vertex 54: X: -0.693734 Y: -38.145279 Z: 44.425373
Vertex 55: X: -18.726728 Y: -38.145279 Z: 41.503166
Page 1
Vertex 56: X: -34.26878 Y: -38.145279 Z: 31.902462
Vertex 57: X: -44.953732 Y: -38.145283 Z: 17.084879
Vertex 58: X: -49.154892 Y: -38.145283 Z: -0.693738
Vertex 59: X: -46.232677 Y: -38.145283 Z: -18.726751
Vertex 60: X: -36.631962 Y: -38.145287 Z: -34.268799
Vertex 61: X: -21.814371 Y: -38.145287 Z: -44.953739
Vertex 62: X: -4.035751 Y: -38.145287 Z: -49.154892
Vertex 63: X: 13.997261 Y: -38.145287 Z: -46.232662
Face list:
Face 0: A:0 B:1 C:17 AB:1 BC:1 CA:0
Smoothing: 1
Face 1: A:0 B:17 C:16 AB:0 BC:1 CA:1
Smoothing: 1
Face 2: A:1 B:2 C:18 AB:1 BC:1 CA:0
Smoothing: 2
Face 3: A:1 B:18 C:17 AB:0 BC:1 CA:1
Smoothing: 2
Face 4: A:2 B:3 C:19 AB:1 BC:1 CA:0
Smoothing: 3
Face 5: A:2 B:19 C:18 AB:0 BC:1 CA:1
Smoothing: 3
Face 6: A:3 B:4 C:20 AB:1 BC:1 CA:0
Smoothing: 4
Face 7: A:3 B:20 C:19 AB:0 BC:1 CA:1
Smoothing: 4
Face 8: A:4 B:5 C:21 AB:1 BC:1 CA:0
Smoothing: 5
Face 9: A:4 B:21 C:20 AB:0 BC:1 CA:1
Smoothing: 5
Face 10: A:5 B:6 C:22 AB:1 BC:1 CA:0
Smoothing: 6
Face 11: A:5 B:22 C:21 AB:0 BC:1 CA:1
Smoothing: 6
Face 12: A:6 B:7 C:23 AB:1 BC:1 CA:0
Smoothing: 7
Face 13: A:6 B:23 C:22 AB:0 BC:1 CA:1
Smoothing: 7
Face 14: A:7 B:8 C:24 AB:1 BC:1 CA:0
Smoothing: 8
Face 15: A:7 B:24 C:23 AB:0 BC:1 CA:1
Smoothing: 8
Face 16: A:8 B:9 C:25 AB:1 BC:1 CA:0
Smoothing: 9
Face 17: A:8 B:25 C:24 AB:0 BC:1 CA:1
Smoothing: 9
Face 18: A:9 B:10 C:26 AB:1 BC:1 CA:0
Smoothing: 10
Face 19: A:9 B:26 C:25 AB:0 BC:1 CA:1
Smoothing: 10
Face 20: A:10 B:11 C:27 AB:1 BC:1 CA:0
Smoothing: 11
Face 21: A:10 B:27 C:26 AB:0 BC:1 CA:1
Smoothing: 11
Face 22: A:11 B:12 C:28 AB:1 BC:1 CA:0
Smoothing: 12
Face 23: A:11 B:28 C:27 AB:0 BC:1 CA:1
Smoothing: 12
Face 24: A:12 B:13 C:29 AB:1 BC:1 CA:0
Smoothing: 13
Face 25: A:12 B:29 C:28 AB:0 BC:1 CA:1
Smoothing: 13
Page 2
Face 26: A:13 B:14 C:30 AB:1 BC:1 CA:0
Smoothing: 14
Face 27: A:13 B:30 C:29 AB:0 BC:1 CA:1
Smoothing: 14
Face 28: A:14 B:15 C:31 AB:1 BC:1 CA:0
Smoothing: 15
Face 29: A:14 B:31 C:30 AB:0 BC:1 CA:1
Smoothing: 15
Face 30: A:15 B:0 C:16 AB:1 BC:1 CA:0
Smoothing: 16
Face 31: A:15 B:16 C:31 AB:0 BC:1 CA:1
Smoothing: 16
Face 32: A:32 B:49 C:33 AB:0 BC:1 CA:1
Smoothing: 17
Face 33: A:32 B:48 C:49 AB:1 BC:1 CA:0
Smoothing: 17
Face 34: A:33 B:50 C:34 AB:0 BC:1 CA:1
Smoothing: 18
Face 35: A:33 B:49 C:50 AB:1 BC:1 CA:0
Smoothing: 18
Face 36: A:34 B:51 C:35 AB:0 BC:1 CA:1
Smoothing: 19
Face 37: A:34 B:50 C:51 AB:1 BC:1 CA:0
Smoothing: 19
Face 38: A:35 B:52 C:36 AB:0 BC:1 CA:1
Smoothing: 20
Face 39: A:35 B:51 C:52 AB:1 BC:1 CA:0
Smoothing: 20
Face 40: A:36 B:53 C:37 AB:0 BC:1 CA:1
Smoothing: 21
Face 41: A:36 B:52 C:53 AB:1 BC:1 CA:0
Smoothing: 21
Face 42: A:37 B:54 C:38 AB:0 BC:1 CA:1
Smoothing: 22
Face 43: A:37 B:53 C:54 AB:1 BC:1 CA:0
Smoothing: 22
Face 44: A:38 B:55 C:39 AB:0 BC:1 CA:1
Smoothing: 23
Face 45: A:38 B:54 C:55 AB:1 BC:1 CA:0
Smoothing: 23
Face 46: A:39 B:56 C:40 AB:0 BC:1 CA:1
Smoothing: 24
Face 47: A:39 B:55 C:56 AB:1 BC:1 CA:0
Smoothing: 24
Face 48: A:40 B:57 C:41 AB:0 BC:1 CA:1
Smoothing: 25
Face 49: A:40 B:56 C:57 AB:1 BC:1 CA:0
Smoothing: 25
Face 50: A:41 B:58 C:42 AB:0 BC:1 CA:1
Smoothing: 26
Face 51: A:41 B:57 C:58 AB:1 BC:1 CA:0
Smoothing: 26
Face 52: A:42 B:59 C:43 AB:0 BC:1 CA:1
Smoothing: 27
Face 53: A:42 B:58 C:59 AB:1 BC:1 CA:0
Smoothing: 27
Face 54: A:43 B:60 C:44 AB:0 BC:1 CA:1
Smoothing: 28
Face 55: A:43 B:59 C:60 AB:1 BC:1 CA:0
Smoothing: 28
Face 56: A:44 B:61 C:45 AB:0 BC:1 CA:1
Page 3
Smoothing: 29
Face 57: A:44 B:60 C:61 AB:1 BC:1 CA:0
Smoothing: 29
Face 58: A:45 B:62 C:46 AB:0 BC:1 CA:1
Smoothing: 30
Face 59: A:45 B:61 C:62 AB:1 BC:1 CA:0
Smoothing: 30
Face 60: A:46 B:63 C:47 AB:0 BC:1 CA:1
Smoothing: 31
Face 61: A:46 B:62 C:63 AB:1 BC:1 CA:0
Smoothing: 31
Face 62: A:47 B:48 C:32 AB:0 BC:1 CA:1
Smoothing: 32
Face 63: A:47 B:63 C:48 AB:1 BC:1 CA:0
Smoothing: 32
Face 64: A:0 B:32 C:33 AB:0 BC:1 CA:0
Smoothing: 1
Face 65: A:0 B:33 C:1 AB:0 BC:0 CA:1
Smoothing: 1
Face 66: A:1 B:33 C:34 AB:0 BC:1 CA:0
Smoothing: 1
Face 67: A:1 B:34 C:2 AB:0 BC:0 CA:1
Smoothing: 1
Face 68: A:2 B:34 C:35 AB:0 BC:1 CA:0
Smoothing: 1
Face 69: A:2 B:35 C:3 AB:0 BC:0 CA:1
Smoothing: 1
Face 70: A:3 B:35 C:36 AB:0 BC:1 CA:0
Smoothing: 1
Face 71: A:3 B:36 C:4 AB:0 BC:0 CA:1
Smoothing: 1
Face 72: A:4 B:36 C:37 AB:0 BC:1 CA:0
Smoothing: 1
Face 73: A:4 B:37 C:5 AB:0 BC:0 CA:1
Smoothing: 1
Face 74: A:5 B:37 C:38 AB:0 BC:1 CA:0
Smoothing: 1
Face 75: A:5 B:38 C:6 AB:0 BC:0 CA:1
Smoothing: 1
Face 76: A:6 B:38 C:39 AB:0 BC:1 CA:0
Smoothing: 1
Face 77: A:6 B:39 C:7 AB:0 BC:0 CA:1
Smoothing: 1
Face 78: A:7 B:39 C:40 AB:0 BC:1 CA:0
Smoothing: 1
Face 79: A:7 B:40 C:8 AB:0 BC:0 CA:1
Smoothing: 1
Face 80: A:8 B:40 C:41 AB:0 BC:1 CA:0
Smoothing: 1
Face 81: A:8 B:41 C:9 AB:0 BC:0 CA:1
Smoothing: 1
Face 82: A:9 B:41 C:42 AB:0 BC:1 CA:0
Smoothing: 1
Face 83: A:9 B:42 C:10 AB:0 BC:0 CA:1
Smoothing: 1
Face 84: A:10 B:42 C:43 AB:0 BC:1 CA:0
Smoothing: 1
Face 85: A:10 B:43 C:11 AB:0 BC:0 CA:1
Smoothing: 1
Face 86: A:11 B:43 C:44 AB:0 BC:1 CA:0
Smoothing: 1
Page 4
Face 87: A:11 B:44 C:12 AB:0 BC:0 CA:1
Smoothing: 1
Face 88: A:12 B:44 C:45 AB:0 BC:1 CA:0
Smoothing: 1
Face 89: A:12 B:45 C:13 AB:0 BC:0 CA:1
Smoothing: 1
Face 90: A:13 B:45 C:46 AB:0 BC:1 CA:0
Smoothing: 1
Face 91: A:13 B:46 C:14 AB:0 BC:0 CA:1
Smoothing: 1
Face 92: A:14 B:46 C:47 AB:0 BC:1 CA:0
Smoothing: 1
Face 93: A:14 B:47 C:15 AB:0 BC:0 CA:1
Smoothing: 1
Face 94: A:15 B:47 C:32 AB:0 BC:1 CA:0
Smoothing: 1
Face 95: A:15 B:32 C:0 AB:0 BC:0 CA:1
Smoothing: 1
Face 96: A:16 B:17 C:49 AB:1 BC:0 CA:0
Smoothing: 2
Face 97: A:16 B:49 C:48 AB:0 BC:1 CA:0
Smoothing: 2
Face 98: A:17 B:18 C:50 AB:1 BC:0 CA:0
Smoothing: 2
Face 99: A:17 B:50 C:49 AB:0 BC:1 CA:0
Smoothing: 2
Face 100: A:18 B:19 C:51 AB:1 BC:0 CA:0
Smoothing: 2
Face 101: A:18 B:51 C:50 AB:0 BC:1 CA:0
Smoothing: 2
Face 102: A:19 B:20 C:52 AB:1 BC:0 CA:0
Smoothing: 2
Face 103: A:19 B:52 C:51 AB:0 BC:1 CA:0
Smoothing: 2
Face 104: A:20 B:21 C:53 AB:1 BC:0 CA:0
Smoothing: 2
Face 105: A:20 B:53 C:52 AB:0 BC:1 CA:0
Smoothing: 2
Face 106: A:21 B:22 C:54 AB:1 BC:0 CA:0
Smoothing: 2
Face 107: A:21 B:54 C:53 AB:0 BC:1 CA:0
Smoothing: 2
Face 108: A:22 B:23 C:55 AB:1 BC:0 CA:0
Smoothing: 2
Face 109: A:22 B:55 C:54 AB:0 BC:1 CA:0
Smoothing: 2
Face 110: A:23 B:24 C:56 AB:1 BC:0 CA:0
Smoothing: 2
Face 111: A:23 B:56 C:55 AB:0 BC:1 CA:0
Smoothing: 2
Face 112: A:24 B:25 C:57 AB:1 BC:0 CA:0
Smoothing: 2
Face 113: A:24 B:57 C:56 AB:0 BC:1 CA:0
Smoothing: 2
Face 114: A:25 B:26 C:58 AB:1 BC:0 CA:0
Smoothing: 2
Face 115: A:25 B:58 C:57 AB:0 BC:1 CA:0
Smoothing: 2
Face 116: A:26 B:27 C:59 AB:1 BC:0 CA:0
Smoothing: 2
Face 117: A:26 B:59 C:58 AB:0 BC:1 CA:0
Page 5
Smoothing: 2
Face 118: A:27 B:28 C:60 AB:1 BC:0 CA:0
Smoothing: 2
Face 119: A:27 B:60 C:59 AB:0 BC:1 CA:0
Smoothing: 2
Face 120: A:28 B:29 C:61 AB:1 BC:0 CA:0
Smoothing: 2
Face 121: A:28 B:61 C:60 AB:0 BC:1 CA:0
Smoothing: 2
Face 122: A:29 B:30 C:62 AB:1 BC:0 CA:0
Smoothing: 2
Face 123: A:29 B:62 C:61 AB:0 BC:1 CA:0
Smoothing: 2
Face 124: A:30 B:31 C:63 AB:1 BC:0 CA:0
Smoothing: 2
Face 125: A:30 B:63 C:62 AB:0 BC:1 CA:0
Smoothing: 2
Face 126: A:31 B:16 C:48 AB:1 BC:0 CA:0
Smoothing: 2
Face 127: A:31 B:48 C:63 AB:0 BC:1 CA:0
Smoothing: 2
Page 6

View File

@@ -1,10 +1,13 @@
# $Id: Makefile.BeOS-R4,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $
# $Id: Makefile.BeOS-R4,v 1.2 1999/09/17 00:08:31 brianp Exp $
# Makefile for OpenGL Programming Guide programs for BeOS R4
# This file is in the public domain.
# $Log: Makefile.BeOS-R4,v $
# Revision 1.2 1999/09/17 00:08:31 brianp
# link with -lGLU -lGL instead of -lMesaGLU -lMesaGL
#
# Revision 1.1.1.1 1999/08/19 00:55:40 jtg
# Imported sources
#
@@ -18,7 +21,7 @@
INCDIR = ../include
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -L/boot/home/config/lib -Xlinker -rpath $(LIBDIR) -lbe -lglut -lMesaGLU -lMesaGL $(XLIBS)
GL_LIBS = -L$(LIBDIR) -L/boot/home/config/lib -Xlinker -rpath $(LIBDIR) -lbe -lglut -lGLU -lGL $(XLIBS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.X11,v 1.1.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

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -57,7 +57,7 @@ void myinit(void)
glMaterialf(GL_FRONT, GL_SHININESS, 50.0);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lm_ambient);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glDepthFunc(GL_LESS);
@@ -68,25 +68,25 @@ void myinit(void)
glClearAccum(0.0, 0.0, 0.0, 0.0);
}
void displayObjects(void)
void displayObjects(void)
{
GLfloat torus_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
GLfloat cube_diffuse[] = { 0.0, 0.7, 0.7, 1.0 };
GLfloat sphere_diffuse[] = { 0.7, 0.0, 0.7, 1.0 };
GLfloat octa_diffuse[] = { 0.7, 0.4, 0.4, 1.0 };
glPushMatrix ();
glRotatef (30.0, 1.0, 0.0, 0.0);
glPushMatrix ();
glTranslatef (-0.80, 0.35, 0.0);
glTranslatef (-0.80, 0.35, 0.0);
glRotatef (100.0, 1.0, 0.0, 0.0);
glMaterialfv(GL_FRONT, GL_DIFFUSE, torus_diffuse);
glutSolidTorus (0.275, 0.85, 16, 16);
glPopMatrix ();
glPushMatrix ();
glTranslatef (-0.75, -0.50, 0.0);
glTranslatef (-0.75, -0.50, 0.0);
glRotatef (45.0, 0.0, 0.0, 1.0);
glRotatef (45.0, 1.0, 0.0, 0.0);
glMaterialfv(GL_FRONT, GL_DIFFUSE, cube_diffuse);
@@ -94,14 +94,14 @@ void displayObjects(void)
glPopMatrix ();
glPushMatrix ();
glTranslatef (0.75, 0.60, 0.0);
glTranslatef (0.75, 0.60, 0.0);
glRotatef (30.0, 1.0, 0.0, 0.0);
glMaterialfv(GL_FRONT, GL_DIFFUSE, sphere_diffuse);
glutSolidSphere (1.0, 16, 16);
glPopMatrix ();
glPushMatrix ();
glTranslatef (0.70, -0.90, 0.25);
glTranslatef (0.70, -0.90, 0.25);
glMaterialfv(GL_FRONT, GL_DIFFUSE, octa_diffuse);
glutSolidOctahedron ();
glPopMatrix ();
@@ -124,7 +124,7 @@ void display(void)
glPushMatrix ();
/* Note that 4.5 is the distance in world space between
* left and right and bottom and top.
* This formula converts fractional pixel movement to
* This formula converts fractional pixel movement to
* world coordinates.
*/
glTranslatef (j8[jitter].x*4.5/viewport[2],
@@ -142,15 +142,28 @@ void myReshape(int w, int h)
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= h)
if (w <= h)
glOrtho (-2.25, 2.25, -2.25*h/w, 2.25*h/w, -10.0, 10.0);
else
else
glOrtho (-2.25*w/h, 2.25*w/h, -2.25, 2.25, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -163,6 +176,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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,8 +45,8 @@
#include <stdio.h>
#include <GL/glut.h>
/* Initialize antialiasing for RGBA mode, including alpha
* blending, hint, and line width. Print out implementation
/* Initialize antialiasing for RGBA mode, including alpha
* blending, hint, and line width. Print out implementation
* specific info on line width granularity and width.
*/
void myinit(void)
@@ -56,7 +56,7 @@ void myinit(void)
printf ("GL_LINE_WIDTH_GRANULARITY value is %3.1f\n", values[0]);
glGetFloatv (GL_LINE_WIDTH_RANGE, values);
printf ("GL_LINE_WIDTH_RANGE values are %3.1f %3.1f\n",
printf ("GL_LINE_WIDTH_RANGE values are %3.1f %3.1f\n",
values[0], values[1]);
glEnable (GL_LINE_SMOOTH);
@@ -93,8 +93,21 @@ void myReshape(int w, int h)
glTranslatef (0.0, 0.0, -4.0); /* move object into view */
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -105,7 +118,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/**
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -68,7 +68,7 @@ GLfloat ctrlpoints[4][4][3] =
{1.5, 1.5, -1.0}}
};
void
void
initlights(void)
{
GLfloat ambient[] =
@@ -93,7 +93,7 @@ initlights(void)
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
}
void
void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -104,7 +104,7 @@ display(void)
glFlush();
}
void
void
myinit(void)
{
glClearColor(0.0, 0.0, 0.0, 1.0);
@@ -118,7 +118,7 @@ myinit(void)
initlights(); /* for lighted version only */
}
void
void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
@@ -134,7 +134,20 @@ myReshape(int w, int h)
glLoadIdentity();
}
int
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
int
main(int argc, char **argv)
{
glutInit(&argc, argv);
@@ -143,6 +156,7 @@ main(int argc, char **argv)
myinit();
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -52,10 +52,10 @@ GLubyte checkImage[checkImageWidth][checkImageHeight][3];
void makeCheckImage(void)
{
int i, j, c;
for (i = 0; i < checkImageWidth; i++) {
for (j = 0; j < checkImageHeight; j++) {
c = ((((i&0x8)==0)^((j&0x8))==0))*255;
c = ((((i&0x8)==0)^((j&0x8)==0)))*255;
checkImage[i][j][0] = (GLubyte) c;
checkImage[i][j][1] = (GLubyte) c;
checkImage[i][j][2] = (GLubyte) c;
@@ -64,15 +64,15 @@ void makeCheckImage(void)
}
void myinit(void)
{
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
makeCheckImage();
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, 3, checkImageWidth,
checkImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE,
glTexImage2D(GL_TEXTURE_2D, 0, 3, checkImageWidth,
checkImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE,
&checkImage[0][0][0]);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
@@ -111,6 +111,19 @@ void myReshape(int w, int h)
glTranslatef(0.0, 0.0, -3.6);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
int
main(int argc, char** argv)
{
@@ -120,6 +133,7 @@ main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -39,7 +39,7 @@
*/
/*
* depthcue.c
* This program draws a wireframe model, which uses
* This program draws a wireframe model, which uses
* intensity (brightness) to give clues to distance.
* Fog is used to achieve this effect.
*/
@@ -86,6 +86,19 @@ void myReshape(int w, int h)
glTranslatef (0.0, 0.0, -4.0); /* move object into view */
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
*/
int main(int argc, char** argv)
@@ -96,7 +109,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -55,35 +55,35 @@
/* accFrustum()
* The first 6 arguments are identical to the glFrustum() call.
*
* pixdx and pixdy are anti-alias jitter in pixels.
*
* pixdx and pixdy are anti-alias jitter in pixels.
* Set both equal to 0.0 for no anti-alias jitter.
* eyedx and eyedy are depth-of field jitter in pixels.
* eyedx and eyedy are depth-of field jitter in pixels.
* Set both equal to 0.0 for no depth of field effects.
*
* focus is distance from eye to plane in focus.
* focus is distance from eye to plane in focus.
* focus must be greater than, but not equal to 0.0.
*
* Note that accFrustum() calls glTranslatef(). You will
* probably want to insure that your ModelView matrix has been
* Note that accFrustum() calls glTranslatef(). You will
* probably want to insure that your ModelView matrix has been
* initialized to identity before calling accFrustum().
*/
void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
GLdouble top, GLdouble nnear, GLdouble ffar, GLdouble pixdx,
void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
GLdouble top, GLdouble nnear, GLdouble ffar, GLdouble pixdx,
GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus)
{
GLdouble xwsize, ywsize;
GLdouble xwsize, ywsize;
GLdouble dx, dy;
GLint viewport[4];
glGetIntegerv (GL_VIEWPORT, viewport);
xwsize = right - left;
ywsize = top - bottom;
dx = -(pixdx*xwsize/(GLdouble) viewport[2] + eyedx*nnear/focus);
dy = -(pixdy*ywsize/(GLdouble) viewport[3] + eyedy*nnear/focus);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum (left + dx, right + dx, bottom + dy, top + dy, nnear, ffar);
@@ -93,20 +93,20 @@ void accFrustum(GLdouble left, GLdouble right, GLdouble bottom,
}
/* accPerspective()
*
*
* The first 4 arguments are identical to the gluPerspective() call.
* pixdx and pixdy are anti-alias jitter in pixels.
* pixdx and pixdy are anti-alias jitter in pixels.
* Set both equal to 0.0 for no anti-alias jitter.
* eyedx and eyedy are depth-of field jitter in pixels.
* eyedx and eyedy are depth-of field jitter in pixels.
* Set both equal to 0.0 for no depth of field effects.
*
* focus is distance from eye to plane in focus.
* focus is distance from eye to plane in focus.
* focus must be greater than, but not equal to 0.0.
*
* Note that accPerspective() calls accFrustum().
*/
void accPerspective(GLdouble fovy, GLdouble aspect,
GLdouble nnear, GLdouble ffar, GLdouble pixdx, GLdouble pixdy,
void accPerspective(GLdouble fovy, GLdouble aspect,
GLdouble nnear, GLdouble ffar, GLdouble pixdx, GLdouble pixdy,
GLdouble eyedx, GLdouble eyedy, GLdouble focus)
{
GLdouble fov2,left,right,bottom,top;
@@ -128,7 +128,7 @@ void myinit(void)
GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat position[] = { 0.0, 3.0, 3.0, 0.0 };
GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 };
GLfloat local_view[] = { 0.0 };
@@ -138,7 +138,7 @@ void myinit(void)
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
glLightfv(GL_LIGHT0, GL_POSITION, position);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view);
@@ -155,18 +155,18 @@ void myinit(void)
glClearAccum(0.0, 0.0, 0.0, 0.0);
}
void renderTeapot (GLfloat x, GLfloat y, GLfloat z,
GLfloat ambr, GLfloat ambg, GLfloat ambb,
GLfloat difr, GLfloat difg, GLfloat difb,
void renderTeapot (GLfloat x, GLfloat y, GLfloat z,
GLfloat ambr, GLfloat ambg, GLfloat ambb,
GLfloat difr, GLfloat difg, GLfloat difb,
GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine)
{
float mat[4];
glPushMatrix();
glTranslatef (x, y, z);
mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0;
mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0;
glMaterialfv (GL_FRONT, GL_AMBIENT, mat);
mat[0] = difr; mat[1] = difg; mat[2] = difb;
mat[0] = difr; mat[1] = difg; mat[2] = difb;
glMaterialfv (GL_FRONT, GL_DIFFUSE, mat);
mat[0] = specr; mat[1] = specg; mat[2] = specb;
glMaterialfv (GL_FRONT, GL_SPECULAR, mat);
@@ -175,9 +175,9 @@ void renderTeapot (GLfloat x, GLfloat y, GLfloat z,
glPopMatrix();
}
/* display() draws 5 teapots into the accumulation buffer
/* display() draws 5 teapots into the accumulation buffer
* several times; each time with a jittered perspective.
* The focal point is at z = 5.0, so the gold teapot will
* The focal point is at z = 5.0, so the gold teapot will
* stay in focus. The amount of jitter is adjusted by the
* magnitude of the accPerspective() jitter; in this example, 0.33.
* In this example, the teapots are drawn 8 times. See jitter.h
@@ -192,8 +192,8 @@ void display(void)
for (jitter = 0; jitter < 8; jitter++) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
accPerspective (45.0,
(GLdouble) viewport[2]/(GLdouble) viewport[3],
accPerspective (45.0,
(GLdouble) viewport[2]/(GLdouble) viewport[3],
1.0, 15.0, 0.0, 0.0,
0.33*j8[jitter].x, 0.33*j8[jitter].y, 5.0);
/* ruby, gold, silver, emerald, and cyan teapots */
@@ -203,9 +203,9 @@ void display(void)
0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4);
renderTeapot (0.2, -0.5, -5.5, 0.19225, 0.19225, 0.19225,
0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4);
renderTeapot (1.0, -0.5, -6.0, 0.0215, 0.1745, 0.0215,
renderTeapot (1.0, -0.5, -6.0, 0.0215, 0.1745, 0.0215,
0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6);
renderTeapot (1.8, -0.5, -6.5, 0.0, 0.1, 0.06, 0.0, 0.50980392,
renderTeapot (1.8, -0.5, -6.5, 0.0, 0.1, 0.06, 0.0, 0.50980392,
0.50980392, 0.50196078, 0.50196078, 0.50196078, .25);
glAccum (GL_ACCUM, 0.125);
}
@@ -219,8 +219,21 @@ void myReshape(int w, int h)
glViewport(0, 0, w, h);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, depth buffer, and handle input events.
*/
int main(int argc, char** argv)
@@ -232,7 +245,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

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
@@ -66,7 +66,7 @@ void spinDisplay(void)
glutPostRedisplay();
}
void init(void)
void init(void)
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
@@ -83,7 +83,7 @@ void reshape(int w, int h)
}
/* ARGSUSED2 */
void mouse(int button, int state, int x, int y)
void mouse(int button, int state, int x, int y)
{
switch (button) {
case GLUT_LEFT_BUTTON:
@@ -98,8 +98,21 @@ void mouse(int button, int state, int x, int y)
break;
}
}
/*
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/*
* Request double buffer display mode.
* Register mouse input callback functions
*/
@@ -107,13 +120,14 @@ int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize (250, 250);
glutInitWindowSize (250, 250);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
init ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMouseFunc(mouse);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/**
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -39,11 +39,11 @@
*/
/*
* fog.c
* This program draws 5 red teapots, each at a different
* z distance from the eye, in different types of fog.
* Pressing the left mouse button chooses between 3 types of
* fog: exponential, exponential squared, and linear.
* In this program, there is a fixed density value, as well
* This program draws 5 red teapots, each at a different
* z distance from the eye, in different types of fog.
* Pressing the left mouse button chooses between 3 types of
* fog: exponential, exponential squared, and linear.
* In this program, there is a fixed density value, as well
* as fixed start and end values for the linear fog.
*/
#include <stdlib.h>
@@ -52,7 +52,7 @@
GLint fogMode;
void
void
selectFog(int mode)
{
switch(mode) {
@@ -70,10 +70,10 @@ selectFog(int mode)
}
}
/* Initialize z-buffer, projection matrix, light source,
/* Initialize z-buffer, projection matrix, light source,
* and lighting model. Do not specify a material property here.
*/
void
void
myinit(void)
{
GLfloat position[] =
@@ -106,7 +106,7 @@ myinit(void)
}
}
void
void
renderRedTeapot(GLfloat x, GLfloat y, GLfloat z)
{
float mat[4];
@@ -133,7 +133,7 @@ renderRedTeapot(GLfloat x, GLfloat y, GLfloat z)
/* display() draws 5 teapots at different z positions.
*/
void
void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -145,7 +145,7 @@ display(void)
glFlush();
}
void
void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
@@ -161,11 +161,24 @@ myReshape(int w, int h)
glLoadIdentity();
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, depth buffer, and handle input events.
*/
int
int
main(int argc, char **argv)
{
glutInit(&argc, argv);
@@ -181,6 +194,7 @@ main(int argc, char **argv)
glutAddMenuEntry("Fog LINEAR", GL_LINEAR);
glutAddMenuEntry("Quit", 0);
glutAttachMenu(GLUT_RIGHT_BUTTON);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -39,21 +39,21 @@
*/
/*
* fogindex.c
* This program demonstrates fog in color index mode.
* Three cones are drawn at different z values in a linear
* fog. 32 contiguous colors (from 16 to 47) are loaded
* This program demonstrates fog in color index mode.
* Three cones are drawn at different z values in a linear
* fog. 32 contiguous colors (from 16 to 47) are loaded
* with a color ramp.
*/
#include <stdlib.h>
#include <GL/glut.h>
/* Initialize color map and fog. Set screen clear color
/* Initialize color map and fog. Set screen clear color
* to end of color ramp.
*/
#define NUM_COLORS 32
#define RAMPSTART 16
void
void
myinit(void)
{
int i;
@@ -77,7 +77,7 @@ myinit(void)
/* display() renders 3 cones at different z positions.
*/
void
void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -104,7 +104,7 @@ display(void)
glFlush();
}
void
void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
@@ -120,11 +120,24 @@ myReshape(int w, int h)
glLoadIdentity();
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, depth buffer, and handle input events.
*/
int
int
main(int argc, char **argv)
{
glutInit(&argc, argv);
@@ -133,6 +146,7 @@ main(int argc, char **argv)
myinit();
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

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
@@ -47,7 +47,7 @@ void display(void)
glClear (GL_COLOR_BUFFER_BIT);
/* draw white polygon (rectangle) with corners at
* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)
* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)
*/
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
@@ -57,13 +57,13 @@ void display(void)
glVertex3f (0.25, 0.75, 0.0);
glEnd();
/* don't wait!
* start processing buffered OpenGL routines
/* don't wait!
* start processing buffered OpenGL routines
*/
glFlush ();
}
void init (void)
void init (void)
{
/* select clearing color */
glClearColor (0.0, 0.0, 0.0, 0.0);
@@ -74,7 +74,20 @@ void init (void)
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}
/*
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/*
* Declare initial window size, position, and display mode
* (single buffer and RGBA). Open window with "hello"
* in its title bar. Call initialization routines.
@@ -85,11 +98,12 @@ int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (250, 250);
glutInitWindowSize (250, 250);
glutInitWindowPosition (100, 100);
glutCreateWindow ("hello");
init ();
glutDisplayFunc(display);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -64,7 +64,7 @@ void makeCheckImage(void)
for (i = 0; i < checkImageHeight; i++) {
for (j = 0; j < checkImageWidth; j++) {
c = ((((i&0x8)==0)^((j&0x8))==0))*255;
c = (((i&0x8)==0)^((j&0x8)==0))*255;
checkImage[i][j][0] = (GLubyte) c;
checkImage[i][j][1] = (GLubyte) c;
checkImage[i][j][2] = (GLubyte) c;

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -46,7 +46,7 @@
#include <stdlib.h>
#include <GL/glut.h>
/* Initialize z-buffer, projection matrix, light source,
/* Initialize z-buffer, projection matrix, light source,
* and lighting model. Do not specify a material property here.
*/
void myinit(void)
@@ -72,7 +72,7 @@ void myinit(void)
glClearColor(0.0, 0.1, 0.1, 0.0);
}
/* Draw twelve spheres in 3 rows with 4 columns.
/* Draw twelve spheres in 3 rows with 4 columns.
* The spheres in the first row have materials with no ambient reflection.
* The second row has materials with significant ambient reflection.
* The third row has materials with colored ambient reflection.
@@ -102,7 +102,7 @@ void display(void)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* draw sphere in first row, first column
* diffuse reflection only; no ambient or specular
* diffuse reflection only; no ambient or specular
*/
glPushMatrix();
glTranslatef (-3.75, 3.0, 0.0);
@@ -154,7 +154,7 @@ void display(void)
glPopMatrix();
/* draw sphere in second row, first column
* ambient and diffuse reflection; no specular
* ambient and diffuse reflection; no specular
*/
glPushMatrix();
glTranslatef (-3.75, 0.0, 0.0);
@@ -206,7 +206,7 @@ void display(void)
glPopMatrix();
/* draw sphere in third row, first column
* colored ambient and diffuse reflection; no specular
* colored ambient and diffuse reflection; no specular
*/
glPushMatrix();
glTranslatef (-3.75, -3.0, 0.0);
@@ -266,16 +266,29 @@ void myReshape(int w, int h)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= (h * 2))
glOrtho (-6.0, 6.0, -3.0*((GLfloat)h*2)/(GLfloat)w,
glOrtho (-6.0, 6.0, -3.0*((GLfloat)h*2)/(GLfloat)w,
3.0*((GLfloat)h*2)/(GLfloat)w, -10.0, 10.0);
else
glOrtho (-6.0*(GLfloat)w/((GLfloat)h*2),
glOrtho (-6.0*(GLfloat)w/((GLfloat)h*2),
6.0*(GLfloat)w/((GLfloat)h*2), -3.0, 3.0, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -287,7 +300,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -57,7 +57,7 @@ GLubyte mipmapImage1[1][1][3];
void makeImages(void)
{
int i, j;
for (i = 0; i < 32; i++) {
for (j = 0; j < 32; j++) {
mipmapImage32[i][j][0] = 255;
@@ -99,7 +99,7 @@ void makeImages(void)
}
void myinit(void)
{
{
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glShadeModel(GL_FLAT);
@@ -122,7 +122,7 @@ void myinit(void)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST_MIPMAP_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glEnable(GL_TEXTURE_2D);
@@ -150,6 +150,19 @@ void myReshape(int w, int h)
glLoadIdentity();
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
@@ -159,7 +172,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -46,10 +46,10 @@
#include <GL/glut.h>
#define S_NUMPOINTS 13
#define S_ORDER 3
#define S_ORDER 3
#define S_NUMKNOTS (S_NUMPOINTS + S_ORDER)
#define T_NUMPOINTS 3
#define T_ORDER 3
#define T_ORDER 3
#define T_NUMKNOTS (T_NUMPOINTS + T_ORDER)
#define SQRT2 1.41421356237309504880
@@ -86,7 +86,7 @@ GLfloat ctlpoints[S_NUMPOINTS][T_NUMPOINTS][4] = {
GLUnurbsObj *theNurb;
/* Initialize material property, light source, lighting model,
/* Initialize material property, light source, lighting model,
* and depth buffer.
*/
void myinit(void)
@@ -133,12 +133,12 @@ void display(void)
glTranslatef (-4., -4.5, -2.5);
gluBeginSurface(theNurb);
gluNurbsSurface(theNurb,
gluNurbsSurface(theNurb,
S_NUMKNOTS, sknots,
T_NUMKNOTS, tknots,
4 * T_NUMPOINTS,
4,
&ctlpoints[0][0][0],
&ctlpoints[0][0][0],
S_ORDER, T_ORDER,
GL_MAP2_VERTEX_4);
gluEndSurface(theNurb);
@@ -159,8 +159,21 @@ void myReshape(int w, int h)
gluLookAt(7.0,4.5,4.0, 4.5,4.5,2.0, 6.0,-3.0,2.0);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -171,6 +184,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -39,19 +39,19 @@
*/
/*
* pickdepth.c
* Picking is demonstrated in this program. In
* rendering mode, three overlapping rectangles are
* drawn. When the left mouse button is pressed,
* selection mode is entered with the picking matrix.
* Picking is demonstrated in this program. In
* rendering mode, three overlapping rectangles are
* drawn. When the left mouse button is pressed,
* selection mode is entered with the picking matrix.
* Rectangles which are drawn under the cursor position
* are "picked." Pay special attention to the depth
* are "picked." Pay special attention to the depth
* value range, which is returned.
*/
#include <stdlib.h>
#include <stdio.h>
#include <GL/glut.h>
void
void
myinit(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
@@ -61,11 +61,11 @@ myinit(void)
glDepthRange(0.0, 1.0); /* The default z mapping */
}
/* The three rectangles are drawn. In selection mode,
* each rectangle is given the same name. Note that
/* The three rectangles are drawn. In selection mode,
* each rectangle is given the same name. Note that
* each rectangle is drawn with a different z value.
*/
void
void
drawRects(GLenum mode)
{
if (mode == GL_SELECT)
@@ -97,10 +97,10 @@ drawRects(GLenum mode)
glEnd();
}
/* processHits() prints out the contents of the
/* processHits() prints out the contents of the
* selection array.
*/
void
void
processHits(GLint hits, GLuint buffer[])
{
unsigned int i, j;
@@ -125,13 +125,13 @@ processHits(GLint hits, GLuint buffer[])
}
}
/* pickRects() sets up selection mode, name stack,
* and projection matrix for picking. Then the objects
/* pickRects() sets up selection mode, name stack,
* and projection matrix for picking. Then the objects
* are drawn.
*/
#define BUFSIZE 512
void
void
pickRects(int button, int state, int x, int y)
{
GLuint selectBuf[BUFSIZE];
@@ -164,7 +164,7 @@ pickRects(int button, int state, int x, int y)
processHits(hits, selectBuf);
}
void
void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -172,7 +172,7 @@ display(void)
glutSwapBuffers();
}
void
void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
@@ -183,8 +183,21 @@ myReshape(int w, int h)
glLoadIdentity();
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, depth buffer, and handle input events.
*/
int
@@ -198,6 +211,7 @@ main(int argc, char **argv)
glutMouseFunc(pickRects);
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -39,7 +39,7 @@
*/
/*
* plane.c
* This program demonstrates the use of local versus
* This program demonstrates the use of local versus
* infinite lighting on a flat plane.
*/
#include <stdlib.h>
@@ -130,17 +130,30 @@ void myReshape(int w, int h)
glViewport (0, 0, w, h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
if (w <= h)
glOrtho (-1.5, 1.5, -1.5*(GLdouble)h/(GLdouble)w,
if (w <= h)
glOrtho (-1.5, 1.5, -1.5*(GLdouble)h/(GLdouble)w,
1.5*(GLdouble)h/(GLdouble)w, -10.0, 10.0);
else
glOrtho (-1.5*(GLdouble)w/(GLdouble)h,
else
glOrtho (-1.5*(GLdouble)w/(GLdouble)h,
1.5*(GLdouble)w/(GLdouble)h, -1.5, 1.5, -10.0, 10.0);
glMatrixMode (GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -152,6 +165,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

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
@@ -89,7 +89,7 @@ void display (void)
}
/* specify initial properties
* create display list with sphere
* create display list with sphere
* initialize lighting and depth buffer
*/
void gfxinit (void)
@@ -137,7 +137,7 @@ void mouse(int button, int state, int x, int y) {
case GLUT_LEFT_BUTTON:
switch (state) {
case GLUT_DOWN:
spinx = (spinx + 5) % 360;
spinx = (spinx + 5) % 360;
glutPostRedisplay();
break;
default:
@@ -147,7 +147,7 @@ void mouse(int button, int state, int x, int y) {
case GLUT_MIDDLE_BUTTON:
switch (state) {
case GLUT_DOWN:
spiny = (spiny + 5) % 360;
spiny = (spiny + 5) % 360;
glutPostRedisplay();
break;
default:
@@ -209,8 +209,21 @@ void keyboard (unsigned char key, int x, int y)
}
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -223,6 +236,7 @@ int main(int argc, char** argv)
glutMouseFunc(mouse);
glutKeyboardFunc(keyboard);
gfxinit();
glutKeyboardFunc(key);
glutMainLoop();
return 0;
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -76,7 +76,7 @@ void display(void)
/* draw all polygons in white */
glColor3f (1.0, 1.0, 1.0);
/* draw one solid, unstippled rectangle, */
/* draw one solid, unstippled rectangle, */
/* then two stippled rectangles */
glRectf (25.0, 25.0, 125.0, 125.0);
glEnable (GL_POLYGON_STIPPLE);
@@ -89,11 +89,11 @@ void display(void)
glFlush ();
}
void myinit (void)
void myinit (void)
{
/* clear background to black */
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT);
glShadeModel (GL_FLAT);
}
static void reshape(GLsizei w, GLsizei h)
@@ -106,8 +106,21 @@ static void reshape(GLsizei w, GLsizei h)
glLoadIdentity();
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -119,6 +132,7 @@ int main(int argc, char** argv)
myinit ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -39,9 +39,9 @@
*/
/*
* sccolorlight.c
* This program demonstrates the use of a colored
* (magenta, in this example) light source. Objects
* are drawn using a grey material characteristic.
* This program demonstrates the use of a colored
* (magenta, in this example) light source. Objects
* are drawn using a grey material characteristic.
* A single light source illuminates the objects.
*/
#include <stdlib.h>
@@ -61,7 +61,7 @@ void myinit(void)
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glDepthFunc(GL_LESS);
@@ -75,19 +75,19 @@ void display(void)
glRotatef (20.0, 1.0, 0.0, 0.0);
glPushMatrix ();
glTranslatef (-0.75, 0.5, 0.0);
glTranslatef (-0.75, 0.5, 0.0);
glRotatef (90.0, 1.0, 0.0, 0.0);
glutSolidTorus (0.275, 0.85, 20, 20);
glPopMatrix ();
glPushMatrix ();
glTranslatef (-0.75, -0.5, 0.0);
glTranslatef (-0.75, -0.5, 0.0);
glRotatef (270.0, 1.0, 0.0, 0.0);
glutSolidCone (1.0, 2.0, 20, 20);
glPopMatrix ();
glPushMatrix ();
glTranslatef (0.75, 0.0, -1.0);
glTranslatef (0.75, 0.0, -1.0);
glutSolidSphere (1.0, 20, 20);
glPopMatrix ();
@@ -100,17 +100,30 @@ void myReshape(int w, int h)
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= h)
glOrtho (-2.5, 2.5, -2.5*(GLfloat)h/(GLfloat)w,
if (w <= h)
glOrtho (-2.5, 2.5, -2.5*(GLfloat)h/(GLfloat)w,
2.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
else
glOrtho (-2.5*(GLfloat)w/(GLfloat)h,
else
glOrtho (-2.5*(GLfloat)w/(GLfloat)h,
2.5*(GLfloat)w/(GLfloat)h, -2.5, 2.5, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -122,6 +135,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -40,7 +40,7 @@
/*
* scene.c
* This program demonstrates the use of the GL lighting model.
* Objects are drawn using a grey material characteristic.
* Objects are drawn using a grey material characteristic.
* A single light source illuminates the objects.
*/
#include <stdlib.h>
@@ -60,7 +60,7 @@ void myinit (void)
glLightfv (GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv (GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv (GL_LIGHT0, GL_POSITION, light_position);
glEnable (GL_LIGHTING);
glEnable (GL_LIGHT0);
glDepthFunc(GL_LESS);
@@ -75,19 +75,19 @@ void display (void)
glRotatef (20.0, 1.0, 0.0, 0.0);
glPushMatrix ();
glTranslatef (-0.75, 0.5, 0.0);
glTranslatef (-0.75, 0.5, 0.0);
glRotatef (90.0, 1.0, 0.0, 0.0);
glutSolidTorus (0.275, 0.85, 15, 15);
glPopMatrix ();
glPushMatrix ();
glTranslatef (-0.75, -0.5, 0.0);
glTranslatef (-0.75, -0.5, 0.0);
glRotatef (270.0, 1.0, 0.0, 0.0);
glutSolidCone (1.0, 2.0, 15, 15);
glPopMatrix ();
glPushMatrix ();
glTranslatef (0.75, 0.0, -1.0);
glTranslatef (0.75, 0.0, -1.0);
glutSolidSphere (1.0, 15, 15);
glPopMatrix ();
@@ -100,17 +100,30 @@ void myReshape(int w, int h)
glViewport (0, 0, w, h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
if (w <= h)
glOrtho (-2.5, 2.5, -2.5*(GLfloat)h/(GLfloat)w,
if (w <= h)
glOrtho (-2.5, 2.5, -2.5*(GLfloat)h/(GLfloat)w,
2.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
else
glOrtho (-2.5*(GLfloat)w/(GLfloat)h,
else
glOrtho (-2.5*(GLfloat)w/(GLfloat)h,
2.5*(GLfloat)w/(GLfloat)h, -2.5, 2.5, -10.0, 10.0);
glMatrixMode (GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -122,6 +135,7 @@ int main(int argc, char** argv)
myinit ();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -39,7 +39,7 @@
*/
/*
* scenebamb.c
* This program demonstrates use of a blue ambient light
* This program demonstrates use of a blue ambient light
* source.
*/
#include <stdlib.h>
@@ -59,7 +59,7 @@ void myinit(void)
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glDepthFunc(GL_LESS);
@@ -74,19 +74,19 @@ void display(void)
glRotatef (20.0, 1.0, 0.0, 0.0);
glPushMatrix ();
glTranslatef (-0.75, 0.5, 0.0);
glTranslatef (-0.75, 0.5, 0.0);
glRotatef (90.0, 1.0, 0.0, 0.0);
glutSolidTorus (0.275, 0.85, 15, 15);
glPopMatrix ();
glPushMatrix ();
glTranslatef (-0.75, -0.5, 0.0);
glTranslatef (-0.75, -0.5, 0.0);
glRotatef (270.0, 1.0, 0.0, 0.0);
glutSolidCone (1.0, 2.0, 15, 15);
glPopMatrix ();
glPushMatrix ();
glTranslatef (0.75, 0.0, -1.0);
glTranslatef (0.75, 0.0, -1.0);
glutSolidSphere (1.0, 15, 15);
glPopMatrix ();
@@ -99,17 +99,30 @@ void myReshape(int w, int h)
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= h)
glOrtho (-2.5, 2.5, -2.5*(GLfloat)h/(GLfloat)w,
if (w <= h)
glOrtho (-2.5, 2.5, -2.5*(GLfloat)h/(GLfloat)w,
2.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
else
glOrtho (-2.5*(GLfloat)w/(GLfloat)h,
else
glOrtho (-2.5*(GLfloat)w/(GLfloat)h,
2.5*(GLfloat)w/(GLfloat)h, -2.5, 2.5, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -121,6 +134,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -58,7 +58,7 @@ void myinit(void)
glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glDepthFunc(GL_LESS);
@@ -74,19 +74,19 @@ void display(void)
glRotatef (20.0, 1.0, 0.0, 0.0);
glPushMatrix ();
glTranslatef (-0.75, 0.5, 0.0);
glTranslatef (-0.75, 0.5, 0.0);
glRotatef (90.0, 1.0, 0.0, 0.0);
glutSolidTorus (0.275, 0.85, 15, 15);
glPopMatrix ();
glPushMatrix ();
glTranslatef (-0.75, -0.5, 0.0);
glTranslatef (-0.75, -0.5, 0.0);
glRotatef (270.0, 1.0, 0.0, 0.0);
glutSolidCone (1.0, 2.0, 15, 15);
glPopMatrix ();
glPushMatrix ();
glTranslatef (0.75, 0.0, -1.0);
glTranslatef (0.75, 0.0, -1.0);
glutSolidSphere (1.0, 15, 15);
glPopMatrix ();
@@ -99,17 +99,30 @@ void myReshape(int w, int h)
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= h)
glOrtho (-2.5, 2.5, -2.5*(GLfloat)h/(GLfloat)w,
if (w <= h)
glOrtho (-2.5, 2.5, -2.5*(GLfloat)h/(GLfloat)w,
2.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
else
glOrtho (-2.5*(GLfloat)w/(GLfloat)h,
else
glOrtho (-2.5*(GLfloat)w/(GLfloat)h,
2.5*(GLfloat)w/(GLfloat)h, -2.5, 2.5, -10.0, 10.0);
glMatrixMode(GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -121,6 +134,7 @@ int main(int argc, char** argv)
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -38,9 +38,9 @@
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
/* stencil.c
* This program draws two rotated tori in a window.
* A diamond in the center of the window masks out part
* of the scene. Within this mask, a different model
* This program draws two rotated tori in a window.
* A diamond in the center of the window masks out part
* of the scene. Within this mask, a different model
* (a sphere) is drawn in a different color.
*/
#include <stdlib.h>
@@ -49,7 +49,7 @@
#define YELLOWMAT 1
#define BLUEMAT 2
void myinit (void)
void myinit (void)
{
GLfloat yellow_diffuse[] = { 0.7, 0.7, 0.0, 1.0 };
GLfloat yellow_specular[] = { 1.0, 1.0, 1.0, 1.0 };
@@ -112,7 +112,7 @@ void display(void)
glFlush();
}
/* Whenever the window is reshaped, redefine the
/* Whenever the window is reshaped, redefine the
* coordinate system and redraw the stencil area.
*/
void myReshape(int w, int h)
@@ -144,8 +144,21 @@ void myReshape(int w, int h)
glTranslatef(0.0, 0.0, -5.0);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -157,6 +170,7 @@ int main(int argc, char** argv)
myinit ();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/*
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -38,10 +38,10 @@
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
/*
* stroke.c
* This program demonstrates some characters of a
* stroke.c
* This program demonstrates some characters of a
* stroke (vector) font. The characters are represented
* by display lists, which are given numbers which
* by display lists, which are given numbers which
* correspond to the ASCII values of the characters.
* Use of glCallLists() is demonstrated.
*/
@@ -59,7 +59,7 @@ typedef struct charpoint {
} CP;
CP Adata[] = {
{ 0, 0, PT}, {0, 9, PT}, {1, 10, PT}, {4, 10, PT},
{ 0, 0, PT}, {0, 9, PT}, {1, 10, PT}, {4, 10, PT},
{5, 9, PT}, {5, 0, STROKE}, {0, 5, PT}, {5, 5, END}
};
@@ -69,18 +69,18 @@ CP Edata[] = {
};
CP Pdata[] = {
{0, 0, PT}, {0, 10, PT}, {4, 10, PT}, {5, 9, PT}, {5, 6, PT},
{0, 0, PT}, {0, 10, PT}, {4, 10, PT}, {5, 9, PT}, {5, 6, PT},
{4, 5, PT}, {0, 5, END}
};
CP Rdata[] = {
{0, 0, PT}, {0, 10, PT}, {4, 10, PT}, {5, 9, PT}, {5, 6, PT},
{0, 0, PT}, {0, 10, PT}, {4, 10, PT}, {5, 9, PT}, {5, 6, PT},
{4, 5, PT}, {0, 5, STROKE}, {3, 5, PT}, {5, 0, END}
};
CP Sdata[] = {
{0, 1, PT}, {1, 0, PT}, {4, 0, PT}, {5, 1, PT}, {5, 4, PT},
{4, 5, PT}, {1, 5, PT}, {0, 6, PT}, {0, 9, PT}, {1, 10, PT},
{0, 1, PT}, {1, 0, PT}, {4, 0, PT}, {5, 1, PT}, {5, 4, PT},
{4, 5, PT}, {1, 5, PT}, {0, 6, PT}, {0, 9, PT}, {1, 10, PT},
{4, 10, PT}, {5, 9, END}
};
@@ -163,8 +163,21 @@ static void reshape(GLsizei w, GLsizei h)
glLoadIdentity();
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int main(int argc, char** argv)
@@ -176,6 +189,7 @@ int main(int argc, char** argv)
myinit ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -2,14 +2,14 @@
/**
* (c) Copyright 1993, 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,
@@ -23,8 +23,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
@@ -38,7 +38,7 @@
*/
/**
* surface.c
* This program draws a NURBS surface in the shape of a
* This program draws a NURBS surface in the shape of a
* symmetrical hill.
*/
#include <GL/glut.h>
@@ -65,9 +65,9 @@ void init_surface(void)
else
ctlpoints[u][v][2] = -3.0;
}
}
}
}
}
/* Initialize material property and depth buffer.
*/
void myinit(void)
@@ -111,12 +111,12 @@ void display(void)
glScalef (0.25, 0.25, 0.25);
gluBeginSurface(theNurb);
gluNurbsSurface(theNurb,
gluNurbsSurface(theNurb,
8, knots,
8, knots,
4 * 3,
3,
&ctlpoints[0][0][0],
&ctlpoints[0][0][0],
4, 4,
GL_MAP2_VERTEX_3);
gluEndSurface(theNurb);
@@ -134,7 +134,7 @@ void display(void)
glEnd();
glEnable(GL_LIGHTING);
}
glPopMatrix();
glutSwapBuffers();
}
@@ -194,6 +194,19 @@ mouse(int button, int state, int x, int y)
}
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop */
int
main(int argc, char** argv)
@@ -212,6 +225,7 @@ main(int argc, char** argv)
glutAttachMenu(GLUT_RIGHT_BUTTON);
glutMouseFunc(mouse);
glutMotionFunc(motion);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -3,14 +3,14 @@
/**
* (c) Copyright 1993, 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,
@@ -24,8 +24,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
@@ -47,7 +47,7 @@
/* Initialize light source and lighting model.
*/
void
void
myinit(void)
{
GLfloat light_ambient[] =
@@ -78,7 +78,7 @@ myinit(void)
glEnable(GL_DEPTH_TEST);
}
void
void
display(void)
{
GLfloat low_ambient[] =
@@ -114,7 +114,7 @@ display(void)
glFlush();
}
void
void
myReshape(int w, int h)
{
glViewport(0, 0, w, h);
@@ -129,8 +129,21 @@ myReshape(int w, int h)
glMatrixMode(GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/* Main Loop
* Open window with initial window size, title bar,
* Open window with initial window size, title bar,
* RGBA display mode, and handle input events.
*/
int
@@ -143,6 +156,7 @@ main(int argc, char **argv)
myinit();
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

View File

@@ -188,6 +188,19 @@ myReshape(int w, int h)
glMatrixMode(GL_MODELVIEW);
}
static void
key(unsigned char k, int x, int y)
{
switch (k) {
case 27: /* Escape */
exit(0);
break;
default:
return;
}
glutPostRedisplay();
}
/*
* Main Loop Open window with initial window size, title bar, RGBA display
* mode, and handle input events.
@@ -201,6 +214,7 @@ main(int argc, char **argv)
myinit();
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
glutKeyboardFunc(key);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}

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

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