Compare commits

..

130 Commits

Author SHA1 Message Date
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
362 changed files with 69892 additions and 3906 deletions

View File

@@ -1,8 +1,9 @@
# $Id: Make-config,v 1.1.1.1 1999/08/19 00:55:39 jtg Exp $
# $Id: Make-config,v 1.5 1999/09/15 17:02:06 brianp Exp $
MAJOR=3
MINOR=1
VERSION=$(MAJOR).$(MINOR)
MESA_MAJOR=3
MESA_MINOR=1
MESA_TINY=0
VERSION=$(MESA_MAJOR).$(MESA_MINOR)
# Mesa 3-D graphics library
#
@@ -28,8 +29,8 @@ VERSION=$(MAJOR).$(MINOR)
# The following variables are passed to each Makefile:
#
# GL_LIB the name of the Mesa "GL" library file (usually libMesaGL.a)
# GLU_LIB the name of the Mesa "GLU" library file (usually libMesaGLU.a)
# GL_LIB the name of the Mesa "GL" library file (usually libGL.a)
# GLU_LIB the name of the Mesa "GLU" library file (usually libGLU.a)
# GLUT_LIB the name of the GLUT library file (usually libglut.a)
# CC the C compiler (usually cc or gcc)
# CFLAGS flags to C compiler (usually -O)
@@ -590,6 +591,18 @@ linux-3dnow-glide:
FX/X86/fx_3dnow_fastpath.S"
# Contributed by C. Alex. North-Keys (erlkonig@talisman.org)
linux-386-pthread-shared-glide:
$(MAKE) $(MFLAGS) targets \
"GL_LIB = libGL.so" \
"GLU_LIB = libGLU.so" \
"GLUT_LIB = libglut.so" \
"CC = gcc" \
"CFLAGS = -O3 -fPIC -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DSHM -DUSE_X86_ASM -D_REENTRANT -DTHREADS -DPTHREADS -DFX -I/usr/include/glide -I/usr/local/glide/include" \
"MAKELIB = ../mklib.glide" \
"XLIBS = -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lpthread" \
"ASM_SOURCES = asm_386.S"
# Contributed by Uwe_Maurer@t-online.de
linux-ggi:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \

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.9 1999/09/20 21:06:57 keithw 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"
@@ -137,7 +138,7 @@ 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 \
irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \
linux linux-debug linux-prof linux-elf linux-elf-debug \
linux-glide linux-386-glide linux-386-opt-glide \
linux-386-opt-V2-glide \
@@ -145,7 +146,7 @@ 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 \
@@ -169,7 +170,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
@@ -313,8 +314,8 @@ realclean: clean
DIRECTORY = Mesa-3.1
LIB_NAME = MesaLib-3.1beta2
DEMO_NAME = MesaDemos-3.1beta2
LIB_NAME = MesaLib-3.1beta3
DEMO_NAME = MesaDemos-3.1beta3
LIB_FILES = \
@@ -334,18 +335,21 @@ LIB_FILES = \
$(DIRECTORY)/missing \
$(DIRECTORY)/mkinstalldirs \
$(DIRECTORY)/stamp-h.in \
$(DIRECTORY)/INSTALL \
$(DIRECTORY)/INSTALL.GNU \
$(DIRECTORY)/configure \
$(DIRECTORY)/docs/CONFIG \
$(DIRECTORY)/docs/CONFORM \
$(DIRECTORY)/docs/COPYING \
$(DIRECTORY)/docs/COPYRIGHT \
$(DIRECTORY)/docs/DEVINFO \
$(DIRECTORY)/docs/IAFA-PACKAGE \
$(DIRECTORY)/docs/LICENSE \
$(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 \
@@ -357,6 +361,8 @@ LIB_FILES = \
$(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 \
@@ -375,9 +381,12 @@ LIB_FILES = \
$(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] \
@@ -394,28 +403,53 @@ LIB_FILES = \
$(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/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/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 \
$(DIRECTORY)/src/X86/Makefile.am \
$(DIRECTORY)/src/X86/Makefile.in \
$(DIRECTORY)/src/X86/*.m4 \
$(DIRECTORY)/src/X86/*.S \
$(DIRECTORY)/src/*.dja \
@@ -430,6 +464,8 @@ LIB_FILES = \
$(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 \

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

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

@@ -40,16 +40,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 +98,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 +301,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 1999/09/15 16:39:01 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 1999/09/19 20:09:00 tanner Exp $
Mesa Version History
@@ -644,12 +644,18 @@ 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)

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,4 +1,4 @@
/* $Id: fxmesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: fxmesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,8 @@
/*
* $Log: fxmesa.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:46:31 brianp
* now using GLAPI and GLAPIENTRY keywords (Ted Jump)

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
}

View File

@@ -1,4 +1,4 @@
/* $Id: gl.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: gl.h,v 1.8 1999/09/19 02:03:18 tjump Exp $ */
/*
* Mesa 3-D graphics library
@@ -57,10 +57,13 @@
# pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
# define GLAPI __declspec(dllexport)
# define WGLAPI __declspec(dllexport)
# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
# define GLAPI __declspec(dllimport)
# define WGLAPI __declspec(dllimport)
# else /* for use with static link lib build of Win32 edition only */
# define GLAPI extern
# define WGLAPI __declspec(dllimport)
# endif /* _STATIC_MESA support */
# define GLAPIENTRY __stdcall
# define GLCALLBACK __stdcall
@@ -107,25 +110,8 @@ typedef unsigned long COLORREF;
# endif /* !UNICODE */
typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
GLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
GLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
GLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC, int);
GLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
GLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
GLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
GLAPI PROC GLAPIENTRY wglGetProcAddress(char*);
GLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
GLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
GLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
GLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
GLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
GLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
GLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
GLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
GLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
GLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
GLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
GLAPI int GLAPIENTRY SwapBuffers(HDC);
typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
#include <gl/mesa_wgl.h>
#endif
@@ -1859,7 +1845,7 @@ GLAPI void GLAPIENTRY glPopName( void );
/*
* 1.0 Extensions
* Extensions
*/
/* GL_EXT_blend_minmax */
@@ -2187,6 +2173,19 @@ GLAPI void GLAPIENTRY glLockArraysEXT( GLint first, GLsizei count );
GLAPI void GLAPIENTRY glUnlockArraysEXT( void );
/*
* GL_EXT_get_proc_address
*
* XXX this is a preliminary extension. It may change! Use at your
* own risk! Do not release code which uses this extension yet!
* If you want to try it out, #define GL_EXT_get_proc_address before
* #include <GL/gl.h>
*/
#define GL_EXT_get_proc_address 1
#ifdef GL_EXT_get_proc_address
GLAPI void (GLAPIENTRY *glGetProcAddressEXT(const GLubyte *procName))();
#endif
#if defined(__BEOS__) || defined(__QUICKDRAW__)
#pragma export off
#endif

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.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library

View File

@@ -1,4 +1,4 @@
/* $Id: glu.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: glu.h,v 1.10 1999/09/19 10:04:01 tjump Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,6 +23,32 @@
/*
* $Log: glu.h,v $
* Revision 1.10 1999/09/19 10:04:01 tjump
* Changed name 'glGetProcAddressEXT' to 'gluGetProcAddressEXT'
*
* Revision 1.8 1999/09/17 12:21:36 brianp
* glGetProcAddressEXT changes to accomodate Win32 and non-Win32
*
* Revision 1.7 1999/09/17 02:44:19 tjump
* I changed the xxxGetProcAddressEXT function declarations to be more
* MSVC friendly. Brianp - could you verify that they describe and operate
* as intended on Linux/ETC platforms?
*
* Revision 1.6 1999/09/16 16:54:22 brianp
* GLU_EXT_get_proc_address clean-up
*
* Revision 1.5 1999/09/14 03:23:08 gareth
* Fixed GLUtriangulatorObj again (spelling).
*
* Revision 1.4 1999/09/14 01:32:58 gareth
* Fixed definition of GLUtriangluatorObj for 1.3 tessellator.
*
* Revision 1.3 1999/09/11 11:34:21 brianp
* added GLU_EXT_get_proc_address
*
* Revision 1.2 1999/09/10 02:08:18 gareth
* Added GLU 1.3 tessellation (except winding rule code).
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -88,6 +114,7 @@ extern "C" {
#define GLU_VERSION_1_1 1
#define GLU_VERSION_1_2 1
#define GLU_TRUE GL_TRUE
@@ -110,30 +137,42 @@ enum {
GLU_OUTSIDE = 100020,
GLU_INSIDE = 100021,
/* Tesselator */
GLU_BEGIN = 100100,
GLU_VERTEX = 100101,
GLU_END = 100102,
GLU_ERROR = 100103,
GLU_EDGE_FLAG = 100104,
/* Tessellator */
GLU_TESS_BEGIN = 100100,
GLU_TESS_VERTEX = 100101,
GLU_TESS_END = 100102,
GLU_TESS_ERROR = 100103,
GLU_TESS_EDGE_FLAG = 100104,
GLU_TESS_COMBINE = 100105,
/* Contour types */
GLU_CW = 100120,
GLU_CCW = 100121,
GLU_INTERIOR = 100122,
GLU_EXTERIOR = 100123,
GLU_UNKNOWN = 100124,
GLU_TESS_BEGIN_DATA = 100106,
GLU_TESS_VERTEX_DATA = 100107,
GLU_TESS_END_DATA = 100108,
GLU_TESS_ERROR_DATA = 100109,
GLU_TESS_EDGE_FLAG_DATA = 100110,
GLU_TESS_COMBINE_DATA = 100111,
/* 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 */
/* Winding rules */
GLU_TESS_WINDING_ODD = 100130,
GLU_TESS_WINDING_NONZERO = 100131,
GLU_TESS_WINDING_POSITIVE = 100132,
GLU_TESS_WINDING_NEGATIVE = 100133,
GLU_TESS_WINDING_ABS_GEQ_TWO = 100134,
/* Tessellation properties */
GLU_TESS_WINDING_RULE = 100140,
GLU_TESS_BOUNDARY_ONLY = 100141,
GLU_TESS_TOLERANCE = 100142,
/* Tessellation errors */
GLU_TESS_ERROR1 = 100151, /* Missing gluBeginPolygon */
GLU_TESS_ERROR2 = 100152, /* Missing gluBeginContour */
GLU_TESS_ERROR3 = 100153, /* Missing gluEndPolygon */
GLU_TESS_ERROR4 = 100154, /* Missing gluEndContour */
GLU_TESS_ERROR5 = 100155, /* */
GLU_TESS_ERROR6 = 100156, /* */
GLU_TESS_ERROR7 = 100157, /* */
GLU_TESS_ERROR8 = 100158, /* */
/* NURBS */
GLU_AUTO_LOAD_MATRIX = 100200,
@@ -201,21 +240,40 @@ enum {
/* New in GLU 1.1 */
GLU_VERSION = 100800,
GLU_EXTENSIONS = 100801
GLU_EXTENSIONS = 100801,
/*** GLU 1.0 tessellation - obsolete! ***/
/* Contour types */
GLU_CW = 100120,
GLU_CCW = 100121,
GLU_INTERIOR = 100122,
GLU_EXTERIOR = 100123,
GLU_UNKNOWN = 100124,
/* Tessellator */
GLU_BEGIN = GLU_TESS_BEGIN,
GLU_VERTEX = GLU_TESS_VERTEX,
GLU_END = GLU_TESS_END,
GLU_ERROR = GLU_TESS_ERROR,
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
@@ -392,25 +450,49 @@ GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which,
/*
*
* 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 +505,20 @@ GLUAPI void GLAPIENTRY gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
GLUAPI const GLubyte* GLAPIENTRY gluGetString( GLenum name );
/*
* GLU_EXT_get_proc_address extension
*/
/*
* WARNING: this extension is not finalized yet! Do not release code
* which uses this extension yet! It may change!
*/
#define GLU_EXT_get_proc_address 1
#ifdef GLU_EXT_get_proc_address
GLUAPI void (GLAPIENTRY *gluGetProcAddressEXT(const GLubyte *procName))();
#endif
#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

@@ -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.3 1999/09/16 15:52:51 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -27,6 +27,12 @@
/*
* $Log: glx.h,v $
* Revision 1.3 1999/09/16 15:52:51 brianp
* added GLX_MESA_set_3dfx_mode. clean-up of glXGetProcAddress
*
* Revision 1.2 1999/09/11 11:33:45 brianp
* added GLX_EXT_get_proc_address
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -154,13 +160,13 @@ enum _GLX_CONFIGS {
/*
* Compile-time extension tests
*/
#ifdef MESA
#define GLX_EXT_visual_info 1
#define GLX_EXT_get_proc_address 1
#define GLX_MESA_pixmap_colormap 1
#define GLX_MESA_release_buffers 1
#define GLX_MESA_copy_sub_buffer 1
#define GLX_MESA_set_3dfx_mode 1
#define GLX_SGI_video_sync 1
#endif
@@ -228,29 +234,35 @@ extern const char *glXGetClientString( Display *dpy, int name );
/*
* Mesa GLX Extensions
/* GLX_EXT_get_proc_address */
/* WARNING: this extension is not finalized yet! Do not release code
* which uses this extension yet! It may change!
*/
extern void (*glXGetProcAddressEXT(const GLubyte *procName))();
#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

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

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

@@ -0,0 +1,33 @@
/* prototypes for the Mesa WGL functions */
/* relocated here so that I could make GLUT get them properly */
#ifndef GL_H
#include <gl/gl.h>
#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 SwapBuffers(HDC);
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);

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 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library
@@ -27,8 +27,8 @@
/*
* $Log: osmesa.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.4 1999/02/14 03:39:09 brianp
* new copyright

View File

@@ -1,4 +1,4 @@
/* $Id: svgamesa.h,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: svgamesa.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library
@@ -23,8 +23,8 @@
/*
* $Log: svgamesa.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.0 1998/02/20 05:07:24 brianp
* initial rev

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 1999/08/19 00:55:40 jtg Exp $ */
/*
* Mesa 3-D graphics library
@@ -27,8 +27,8 @@
/*
* $Log: xmesa.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.3 1999/02/24 22:43:27 jens
* Name changes to get XMesa to compile standalone inside XFree86

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 1999/08/19 00:55:40 jtg Exp $
*/
#ifndef _XMESA_XF86_H_

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,4 +1,4 @@
# $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:07:26 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -23,6 +23,9 @@
# $Log: Makefile.BeOS-R4,v $
# Revision 1.2 1999/09/17 00:07:26 brianp
# link with -lGLU -lGL instead of -lMesaGLU -lMesaGL
#
# Revision 1.1.1.1 1999/08/19 00:55:40 jtg
# Imported sources
#
@@ -49,7 +52,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.1 1999/08/19 00:55:40 jtg Exp $
# Mesa 3-D graphics library
# Version: 3.1

View File

@@ -20,11 +20,11 @@
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# $Id: Makefile.cygnus,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $
# $Id: Makefile.cygnus,v 1.1 1999/08/19 00:55:40 jtg Exp $
# $Log: Makefile.cygnus,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/22 12:50:29 brianp
# removed multitex demo

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.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* glDrawPixels demo/test/benchmark
@@ -8,8 +8,8 @@
/*
* $Log: drawpix.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,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,4 +1,4 @@
/* $Id: gears.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: gears.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* 3-D gear wheels. This program is in the public domain.
@@ -10,8 +10,8 @@
/*
* $Log: gears.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/06/03 17:07:36 brianp
* an extra quad was being drawn in front and back faces

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

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,34 @@
/* $Id: isosurf.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: isosurf.c,v 1.3 1999/09/08 22:14:31 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.
*
* 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.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
@@ -44,11 +63,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 +76,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 +103,14 @@ 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;
/* forward decl */
int BuildList( int mode );
static void read_surface( char *filename )
@@ -225,7 +253,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 +318,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 +338,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 +355,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 +385,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 +414,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 +440,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 +593,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]);
@@ -588,6 +646,8 @@ static void ModeMenu(int m)
static void Init(void)
{
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 +676,28 @@ 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);
}
@@ -643,45 +711,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 +772,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;
@@ -782,21 +867,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 +896,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,4 +1,4 @@
/* $Id: multiarb.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: multiarb.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* GL_ARB_multitexture demo
@@ -7,8 +7,8 @@
/*
* $Log: multiarb.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 1.3 1999/03/28 18:20:49 brianp
* minor clean-up

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,4 +1,4 @@
/* $Id: paltex.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: paltex.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Paletted texture demo. Written by Brian Paul. This file in public domain.
@@ -6,8 +6,8 @@
/*
* $Log: paltex.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:20:49 brianp
* minor clean-up

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.2 1999/09/19 20:09:00 tanner Exp $ */
/*
* A demo of the GLU polygon tesselation functions written by Bogdan Sikorski.
@@ -11,6 +11,10 @@
/*
* $Log: tessdemo.c,v $
* Revision 1.2 1999/09/19 20:09:00 tanner
*
* lots of autoconf updates
*
* Revision 1.1.1.1 1999/08/19 00:55:40 jtg
* Imported sources
*
@@ -148,7 +152,7 @@ void set_screen_wh(GLsizei w, GLsizei h)
void tesse(void)
{
GLUtriangulatorObj *tobj;
GLUtesselator *tobj;
GLdouble data[3];
GLuint i,j,point_cnt;

View File

@@ -1,4 +1,4 @@
/* $Id: texcyl.c,v 1.1.1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: texcyl.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/*
* Textured cylinder demo: lighting, texturing, reflection mapping.
@@ -7,8 +7,8 @@
/*
* $Log: texcyl.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

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.1 1999/08/19 00:55:40 jtg Exp $
# Mesa 3-D graphics library
# Version: 3.1

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
@@ -36,7 +36,7 @@
*/
/* texbind.c
* This program demonstrates using glBindTexture() by
* This program demonstrates using glBindTexture() by
* creating and managing two textures.
*/
#include <GL/glut.h>
@@ -55,15 +55,15 @@ static GLuint texName[2];
void makeCheckImages(void)
{
int i, j, c;
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;
checkImage[i][j][3] = (GLubyte) 255;
c = ((((i&0x10)==0)^((j&0x10))==0))*255;
c = ((((i&0x10)==0)^((j&0x10)==0)))*255;
otherImage[i][j][0] = (GLubyte) c;
otherImage[i][j][1] = (GLubyte) 0;
otherImage[i][j][2] = (GLubyte) 0;
@@ -73,7 +73,7 @@ void makeCheckImages(void)
}
void init(void)
{
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
glEnable(GL_DEPTH_TEST);
@@ -85,9 +85,9 @@ void init(void)
glBindTexture(GL_TEXTURE_2D, texName[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth,
checkImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
@@ -99,8 +99,8 @@ void init(void)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth,
checkImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth,
checkImageHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE,
otherImage);
glEnable(GL_TEXTURE_2D);
}
@@ -158,7 +158,7 @@ int main(int argc, char** argv)
glutDisplayFunc(display);
glutKeyboardFunc (keyboard);
glutMainLoop();
return 0;
return 0;
}
#else
int main(int argc, char** argv)
@@ -169,4 +169,3 @@ int main(int argc, char** argv)
return 0;
}
#endif

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
@@ -40,7 +40,7 @@
* two rectangles. This program clamps the texture, if
* the texture coordinates fall outside 0.0 and 1.0.
* If the s key is pressed, a texture subimage is used to
* alter the original texture. If the r key is pressed,
* alter the original texture. If the r key is pressed,
* the original texture is restored.
*/
#include <GL/glut.h>
@@ -61,10 +61,10 @@ static GLuint texName;
void makeCheckImages(void)
{
int i, j, c;
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;
@@ -73,7 +73,7 @@ void makeCheckImages(void)
}
for (i = 0; i < subImageHeight; i++) {
for (j = 0; j < subImageWidth; j++) {
c = ((((i&0x4)==0)^((j&0x4))==0))*255;
c = ((((i&0x4)==0)^((j&0x4)==0)))*255;
subImage[i][j][0] = (GLubyte) c;
subImage[i][j][1] = (GLubyte) 0;
subImage[i][j][2] = (GLubyte) 0;
@@ -83,7 +83,7 @@ void makeCheckImages(void)
}
void init(void)
{
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_FLAT);
glEnable(GL_DEPTH_TEST);
@@ -98,7 +98,7 @@ void init(void)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth, checkImageHeight,
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, checkImageWidth, checkImageHeight,
0, GL_RGBA, GL_UNSIGNED_BYTE, checkImage);
}
@@ -174,7 +174,7 @@ int main(int argc, char** argv)
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
glutMainLoop();
return 0;
return 0;
}
#else
int main(int argc, char** argv)

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,17 +47,17 @@
#include <math.h>
GLfloat ctrlpoints[4][4][3] = {
{{ -1.5, -1.5, 4.0}, { -0.5, -1.5, 2.0},
{0.5, -1.5, -1.0}, {1.5, -1.5, 2.0}},
{{ -1.5, -0.5, 1.0}, { -0.5, -0.5, 3.0},
{0.5, -0.5, 0.0}, {1.5, -0.5, -1.0}},
{{ -1.5, 0.5, 4.0}, { -0.5, 0.5, 0.0},
{0.5, 0.5, 3.0}, {1.5, 0.5, 4.0}},
{{ -1.5, 1.5, -2.0}, { -0.5, 1.5, -2.0},
{{ -1.5, -1.5, 4.0}, { -0.5, -1.5, 2.0},
{0.5, -1.5, -1.0}, {1.5, -1.5, 2.0}},
{{ -1.5, -0.5, 1.0}, { -0.5, -0.5, 3.0},
{0.5, -0.5, 0.0}, {1.5, -0.5, -1.0}},
{{ -1.5, 0.5, 4.0}, { -0.5, 0.5, 0.0},
{0.5, 0.5, 3.0}, {1.5, 0.5, 4.0}},
{{ -1.5, 1.5, -2.0}, { -0.5, 1.5, -2.0},
{0.5, 1.5, 0.0}, {1.5, 1.5, -1.0}}
};
GLfloat texpts[2][2][2] = {{{0.0, 0.0}, {0.0, 1.0}},
GLfloat texpts[2][2][2] = {{{0.0, 0.0}, {0.0, 1.0}},
{{1.0, 0.0}, {1.0, 1.0}}};
void display(void)
@@ -76,7 +76,7 @@ void makeImage(void)
{
int i, j;
float ti, tj;
for (i = 0; i < imageWidth; i++) {
ti = 2.0*3.14159265*i/imageWidth;
for (j = 0; j < imageHeight; j++) {
@@ -93,7 +93,7 @@ void myinit(void)
{
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4,
0, 1, 12, 4, &ctrlpoints[0][0][0]);
glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2,
glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2,
0, 1, 4, 2, &texpts[0][0][0]);
glEnable(GL_MAP2_TEXTURE_COORD_2);
glEnable(GL_MAP2_VERTEX_3);
@@ -118,16 +118,29 @@ void myReshape(int w, int h)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if (w <= h)
glOrtho(-4.0, 4.0, -4.0*(GLfloat)h/(GLfloat)w,
glOrtho(-4.0, 4.0, -4.0*(GLfloat)h/(GLfloat)w,
4.0*(GLfloat)h/(GLfloat)w, -4.0, 4.0);
else
glOrtho(-4.0*(GLfloat)w/(GLfloat)h,
glOrtho(-4.0*(GLfloat)w/(GLfloat)h,
4.0*(GLfloat)w/(GLfloat)h, -4.0, 4.0, -4.0, 4.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(85.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();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
@@ -136,6 +149,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,4 +1,4 @@
# $Id: Makefile.BeOS-R4,v 1.1.1.1 1999/08/19 00:55:41 jtg Exp $
# $Id: Makefile.BeOS-R4,v 1.2 1999/09/17 00:08:38 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.1
@@ -17,7 +17,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.DJ,v 1.1.1.1 1999/08/19 00:55:41 jtg Exp $
# $Id: Makefile.DJ,v 1.1 1999/08/19 00:55:41 jtg Exp $
# Makefile for sample programs for MS-DOS with DJGPP

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