Compare commits

..

131 Commits

Author SHA1 Message Date
Brian Paul
2005348110 updated a few of the issues in appendix A 2003-01-20 17:55:55 +00:00
Brian Paul
634a7b2f00 describe libGL 2003-01-20 15:01:39 +00:00
Brian Paul
d73e21620a new Makefiles for miniglx 2003-01-20 14:54:50 +00:00
Keith Whitwell
d5cfbef5ad Remove -C option to install 2003-01-20 14:50:18 +00:00
Jose Fonseca
1d08fddfe6 Tell CVS to ignore Doxygen tag files and output directories. 2003-01-20 14:34:41 +00:00
Jose Fonseca
447ea351dd Some spellchecking fixes. 2003-01-20 14:30:04 +00:00
Keith Whitwell
0ebc838481 Add USE_MINIGLX flags. Build as a miniglx application. 2003-01-20 11:26:30 +00:00
Keith Whitwell
14a7a05251 Make more demanding 2003-01-20 11:25:50 +00:00
Keith Whitwell
c2edc07196 Fix typo 2003-01-20 11:24:17 +00:00
Keith Whitwell
222a212569 Build radeon.o from toplevel makefile.
Add comments to example.miniglx.conf.
Install a minglx.conf in lib directory.
Remove unused 'drmModuleName' config option
2003-01-20 10:53:34 +00:00
Keith Whitwell
78469e6e3d Notes on setting up a machine to run MiniGLX apps and a list of
available demos in the source tree.
2003-01-20 10:51:04 +00:00
Brian Paul
63d0a9055c minor fixes (remove some \internal attributes) 2003-01-19 23:48:32 +00:00
Keith Whitwell
27834f06b8 Some documentation updates relating to recent changes 2003-01-19 20:11:26 +00:00
Jose Fonseca
c262531518 Fixed several typos from spell-checking. 2003-01-19 18:47:53 +00:00
Jose Fonseca
1b2c02ae98 Some documentation fixes that were left out of previous commits 2003-01-19 14:23:45 +00:00
Jose Fonseca
fb5f90d71b Rewriten some of the detail documentation to improve readability.
Several fixes.
2003-01-19 14:08:20 +00:00
Jose Fonseca
4fb1eb7be2 Add the missing detailed documentation bits on miniglx.c and xf86drm.c.
Several updates and fixes to the documentation.
2003-01-19 12:18:08 +00:00
Jose Fonseca
cf119744c3 More detailed documentation. 2003-01-19 01:57:45 +00:00
Keith Whitwell
b07ed0113a Use frontbuffer if GLUT_DOUBLE not requested 2003-01-18 19:59:27 +00:00
Jose Fonseca
d6d8d1dfce Detailed documention for glapi.c. Brief description of the structures in sarea.h. Minor fix in drm.h. 2003-01-18 13:42:06 +00:00
Jose Fonseca
f483ebddeb Enable the documentation of static functions and also the internal documentation. 2003-01-18 13:01:17 +00:00
Keith Whitwell
35fe61ce7b Remove debug printf 2003-01-18 12:41:55 +00:00
Keith Whitwell
c3b1d1e63c Restore registers clobbered by radeonfb.o -- prevents slowdown to 200fps
of mesa demos.
2003-01-18 12:41:34 +00:00
Keith Whitwell
38bfead7d3 Remove some unused members from RADEONInfoRec, add saved value for
crtc_offset_cntl
2003-01-18 12:38:40 +00:00
Keith Whitwell
56f57500b9 Add PostValidateMode hook to allow drivers to restore registers after
fbdev has finished clobbering them.
2003-01-18 12:25:56 +00:00
Keith Whitwell
2ce0615ef1 Remove chipset line from example miniglx.conf 2003-01-18 12:17:02 +00:00
Keith Whitwell
559af8ace4 Probe for chipset if one isn't supplied 2003-01-18 12:16:16 +00:00
Keith Whitwell
f73e37e154 A standalone build environment for radeonfb.o, incorporating necessary
fixes from Ani Joshi and others.  This is probably the only version of
radeonfb that we can run against at the moment, so include it here.
2003-01-18 11:15:47 +00:00
Brian Paul
ec5b054b8f fix up loose ends 2003-01-17 21:45:04 +00:00
Brian Paul
8a63d4bc99 new Makefiles for subset 2003-01-17 21:21:57 +00:00
Keith Whitwell
f58e67787f Get colors working in 16bpp 2003-01-17 19:01:22 +00:00
Keith Whitwell
deb4d4de47 add support for 16bpp modes, disabled 2003-01-17 16:19:15 +00:00
Keith Whitwell
1449a2f759 Take stride properly into account when setting up window members. 2003-01-17 00:56:14 +00:00
Keith Whitwell
f0b66442e8 Clear framebuffer at startup 2003-01-17 00:36:05 +00:00
Keith Whitwell
8830b0a941 Make miniglut exit() on error, like real glut. 2003-01-17 00:32:50 +00:00
Keith Whitwell
deb5fe3b68 use a fixed resolution defined in a config file 2003-01-16 23:39:30 +00:00
Brian Paul
1e1e71e3a7 lots of updates, practically finished 2003-01-16 23:15:28 +00:00
Keith Whitwell
53362d8858 get conform working 2003-01-14 16:52:40 +00:00
Keith Whitwell
af82796ed1 Remove debug printf 2003-01-14 11:39:11 +00:00
Jose Fonseca
6ded963ac6 Documentation for most of the DRM ioctls argument structures in drm.h.
Fixes to the xf86drm.c documentation.
2003-01-13 16:02:32 +00:00
Keith Whitwell
b4f35d5191 example miniglx.conf 2003-01-13 15:34:00 +00:00
Keith Whitwell
0b9434aafd Add config file facility and remove hardwired options from minglx.c
Move functionality for setting up glx configs into the drivers.
Allow the driver to tweak modes (eg for pitch) before setting up fbdev.
2003-01-13 15:31:31 +00:00
Jose Fonseca
fb02d9f4eb Big chunk of documention of xf86drm.c. Some oddities left to document, and still needs a review to catch typos. 2003-01-13 14:36:40 +00:00
Brian Paul
2b83583994 s/union/enum/ 2003-01-11 14:13:25 +00:00
Brian Paul
76415ea859 tweaks to Doxygen config files 2003-01-10 21:57:59 +00:00
Brian Paul
10d05983ef documentation updates 2003-01-10 21:57:41 +00:00
Brian Paul
7c35ac6e82 doc updates, new PixelFormat enum 2003-01-10 21:56:04 +00:00
Keith Whitwell
ca9cccd81c Fix GLUT_ELAPSED_TIME query 2003-01-10 17:47:49 +00:00
Jose Fonseca
ea9f98b04b Enable internal documentation in doxy/miniglx.doxy.
Enable private and static documention in doxy/core.doxy (necessary now for src/glapi.c and others later).
2003-01-09 20:37:02 +00:00
Brian Paul
8b4a34dcdb Initial check in. 2003-01-09 18:24:46 +00:00
Keith Whitwell
267bc32309 Add documentation for GLX_DEPTH_SIZE 2003-01-09 16:54:49 +00:00
Keith Whitwell
8618425250 Remove some more unused functions 2003-01-09 15:16:57 +00:00
Keith Whitwell
24259ec2d0 Bump window sizes up to next supported size when choosing modes.
Recognize the GLX_DEPTH_SIZE attrib.
2003-01-09 15:16:35 +00:00
Keith Whitwell
97aa6f3734 Initialize lastStamp to 1, so that drivers know they need to update
(ie initialize) their internal data.
2003-01-09 15:15:33 +00:00
Keith Whitwell
6b723c7720 Add section on porting apps glx->miniglx 2003-01-09 15:14:24 +00:00
Keith Whitwell
211f26ca95 more cleanups 2003-01-09 15:13:49 +00:00
Keith Whitwell
df7cbe873e Remove earlier workaround 2003-01-09 15:12:38 +00:00
Keith Whitwell
da8a7e15a6 Build the full driver for now 2003-01-09 15:12:04 +00:00
Keith Whitwell
f6546f8384 Barebones glut-alike - just enough to get the mesa demos working 2003-01-09 12:43:40 +00:00
Keith Whitwell
cd22e4b78c Remove some debug 2003-01-03 11:37:10 +00:00
Keith Whitwell
5ff65a62df Require radeon.o 1.8.x 2003-01-02 19:02:23 +00:00
Keith Whitwell
fd55975710 Take advantage of the fact that the kernel module can now shut itself
down cleanly
2003-01-02 18:49:34 +00:00
Keith Whitwell
c83b869ed2 Cleanups 2003-01-02 18:47:05 +00:00
Keith Whitwell
592250e9fc Add a bit of compile-time flexibility 2003-01-02 18:44:41 +00:00
Keith Whitwell
cdb267a918 Allow the standard radeon driver to be built without the swrast and swtnl
modules.  This effectively merges the radeon-es driver back into the
radeon driver as a compile-time option.
2002-12-30 17:24:05 +00:00
Keith Whitwell
2c2bcf8268 Lay ground work for cut-down radeon driver.
NOTE: commented out a couple of places where core mesa calls directly into
      the swrast module.
2002-12-30 15:20:35 +00:00
Keith Whitwell
695b197cb2 Bring some more initialization code from the 2d driver. 2d accels now
work (glClear).  Pageflip now works for swapbuffers.
2002-12-30 13:15:55 +00:00
Keith Whitwell
e17d611067 Remove dead code 2002-12-27 13:17:53 +00:00
Keith Whitwell
9df9883a7a Do a better job of initializing the __DRIdrawablePrivate in driCreateDrawable 2002-12-27 13:07:11 +00:00
Keith Whitwell
22477c050e Turn off stereo flag in visual configs. 2002-12-27 11:25:08 +00:00
Keith Whitwell
39afeb7cf0 Resolve stability issues starting & stopping radeon driver.
Add drmtest program to exercise the drm without the added complications of
a full driver.

Bring fb driver uptodate with changes for hw drivers.
2002-12-25 12:51:21 +00:00
Keith Whitwell
9363bd862f missing files 2002-12-23 12:18:14 +00:00
Jose Fonseca
83b936adb3 Better documentation to the data structures of miniglx.h and miniglxP.h.
Document the implementation details of most of the public functions in
miniglx.c. These details are under the doxygen's \internal tag so their
presence in the output documentation is controlled by the INTERNAL_DOCS =
YES|NO variable in the doxygen configurations files.
2002-12-22 17:11:04 +00:00
Jose Fonseca
5134d4a98b Apply the doxygen treatment to some [big] files. Some enhancements. 2002-12-21 19:06:06 +00:00
Jose Fonseca
2481eda853 Give the doxygen treatment to include/GL/miniglx.h and src/miniglx/miniglxP.h.
More documentation fixes and enhancements to src/miniglx/miniglx.c.
2002-12-21 02:47:26 +00:00
Jose Fonseca
6b31afc236 Enable documentation for private and static members.
Disable the included file listing.
2002-12-21 02:43:09 +00:00
Jose Fonseca
8fd39b4e8c Added caller documentation to the remaining public API functions.
Renamed some function arguments to match the original Xlib and GLX documentation.
2002-12-20 19:41:41 +00:00
Keith Whitwell
094eed79c2 miniglxtest runs to completion and exits with radeon driver,
but produces no graphical output.
2002-12-20 15:07:56 +00:00
Jose Fonseca
d20f1768a6 Added documentation to some functions plus a main page with introduction and references to Mini GLX. 2002-12-20 01:28:15 +00:00
Keith Whitwell
3e06eed70a Move dri initialization into XCreateWindow 2002-12-19 13:48:27 +00:00
Keith Whitwell
3e13551969 eliminate unresolved symbols 2002-12-19 12:26:15 +00:00
Keith Whitwell
3af2be61fd Radeon driver and hw init code compiles. 2002-12-19 10:16:18 +00:00
Keith Whitwell
eb7eb6e171 restore some 'drmFree' strings previously clobbered 2002-12-18 15:34:22 +00:00
Keith Whitwell
e931e819f9 Remove references to ScrnInfoPtr 2002-12-18 14:52:58 +00:00
Jose Fonseca
95936ee9ba Added doxy/miniglx.doxy based on doxy/core.doxy.
Fixed typo in doxy/README.
2002-12-18 14:31:51 +00:00
Keith Whitwell
157d9a5ac6 remove some more unused functions 2002-12-16 18:55:42 +00:00
Keith Whitwell
134930b627 remove old comment 2002-12-16 18:38:29 +00:00
Keith Whitwell
a97ce86232 Dumb framebuffer driver now in pretty good shape, though some operations
(like swapbuffers) are quite slow because the backbuffer lives in video
ram.
2002-12-16 13:40:44 +00:00
Keith Whitwell
5ca95653c4 miniglxtest.c works against swrast driver 2002-12-13 15:18:09 +00:00
Keith Whitwell
1f01a4b3b6 miniglx test will run with fb_dri.so (ie. swrast) driver, but output is
garbled.
2002-12-12 14:22:02 +00:00
Keith Whitwell
8645472e00 new files 2002-12-11 14:44:09 +00:00
Keith Whitwell
1929cacdbf more cleanups 2002-12-11 14:41:20 +00:00
Brian Paul
65e30ac06a minor tweaks 2002-12-09 22:34:40 +00:00
Brian Paul
941efe8eda added XGetVisualInfo, glXGetConfig plus misc comments and clean-ups 2002-12-09 22:33:09 +00:00
Keith Whitwell
ea4b887ef7 readded 2002-12-06 16:24:07 +00:00
Keith Whitwell
ba8e63f05b Get rid of the 'proper' glx files -- glxclient.h, glxext.c
Move the interface lines for dri drivers -- the __driUtil functions which
know a lot about glx internals now live here.
2002-12-06 16:19:45 +00:00
Keith Whitwell
117a2d76b6 Remove -lX11 from miniglx link libraries... 2002-12-04 16:03:49 +00:00
Keith Whitwell
ce75913702 Caught a couple of things after a clean build on rh 7.3 2002-12-04 16:00:05 +00:00
Keith Whitwell
cbc41d4332 Remove the USE_DRI=0 case -- this is now in drv/fb/fb_dri.c 2002-12-04 15:33:12 +00:00
Keith Whitwell
40af4d7662 A full radeon driver, seems to build ok, haven't run yet 2002-12-04 15:31:04 +00:00
Brian Paul
702b2802a0 added XFree() and glXQueryVersion() 2002-12-04 15:25:37 +00:00
Keith Whitwell
44e4e437a0 new file 2002-12-04 13:09:17 +00:00
Keith Whitwell
366ca58ea6 new makefiles to build modules as .a files 2002-12-04 12:48:09 +00:00
Keith Whitwell
90925c9777 ignore .d files 2002-12-03 22:30:41 +00:00
Brian Paul
f6b40da9a7 *** empty log message *** 2002-12-03 21:27:54 +00:00
Keith Whitwell
80798c8eab minor changes from the end of last week 2002-12-03 17:38:19 +00:00
Brian Paul
65a7a3852d miniglx.c now loads DRI drivers. glxext.c and glxclient.h no longer needed.
Many functions in XF86DRI.c are #ifdef'd out and need new implementations.
2002-11-29 16:07:51 +00:00
Brian Paul
cf8aede714 mask is always non-null in write_rgba_pixels and write_monorgba_pixels 2002-11-28 15:55:41 +00:00
Brian Paul
1e27ca69f8 fixed breakage from last check-in, more clean-ups 2002-11-28 00:24:04 +00:00
Brian Paul
9fcd566e60 added DRI awareness (incomplete, disabled by default) 2002-11-28 00:03:07 +00:00
Brian Paul
78b5f5f44f remove resize() function 2002-11-27 21:04:18 +00:00
Brian Paul
8a82d9db15 support more screen sizes, more clean-ups 2002-11-27 21:03:33 +00:00
Brian Paul
fa747cdb0a miniglx layered on fbdev works now. 2002-11-27 17:02:39 +00:00
Keith Whitwell
fa50fae202 Narrow down the missing bits of information 2002-11-27 16:31:27 +00:00
Keith Whitwell
0fb48dba7c pull in more server code, particularly for radeon init 2002-11-27 15:52:13 +00:00
Keith Whitwell
2f3585d4f1 Auto-dependency generating makefile 2002-11-27 13:58:53 +00:00
Brian Paul
7c7789c029 do some simple MMIO register reads for sanity testing 2002-11-27 00:26:59 +00:00
Brian Paul
56ad63958b set timing values explicitly. new debugging info 2002-11-26 21:20:45 +00:00
Brian Paul
aa0109bf96 move WindowExists() code into glxext.c (effectively out of the driver) 2002-11-26 18:18:54 +00:00
Keith Whitwell
0201db5a22 Added two files which should (with much tweaking) eventually allow
the radeon_dri.so driver from the dri project to be loaded and run
against an fbdev environment.
2002-11-26 17:39:32 +00:00
Brian Paul
1a1069c7e9 more trimming / hacking 2002-11-25 21:38:08 +00:00
Brian Paul
fc88680a39 more tweaks 2002-11-22 16:13:49 +00:00
Brian Paul
ff89f4b639 fix some bugs, add colormap initialization 2002-11-22 15:26:56 +00:00
Brian Paul
7d5b5c0438 added glfbdevtest and miniglxtest 2002-11-22 00:19:31 +00:00
Brian Paul
6ccaeaaa16 from DRI CVS - hacked to some extent 2002-11-21 16:42:51 +00:00
Brian Paul
e4e72da501 from Mesa 5.1 2002-11-21 16:00:27 +00:00
Brian Paul
67f87d2463 disable thread safety for now 2002-11-21 15:45:55 +00:00
Brian Paul
431c1740d5 compile glfbdev.c and miniglx.c 2002-11-21 14:59:05 +00:00
Brian Paul
fa3f447234 fixed cube texture auto-mipmap generation bug (641363) 2002-11-20 21:40:02 +00:00
Brian Paul
3a08052714 stripped, subsetted DRI-capable libGL 2002-11-20 18:09:51 +00:00
Brian Paul
424096d581 prototype interfaces and tests 2002-11-20 02:10:37 +00:00
277 changed files with 46323 additions and 9329 deletions

View File

@@ -1,13 +1,13 @@
# $Id: Make-config,v 1.67.2.1 2003/03/27 18:35:55 brianp Exp $
# $Id: Make-config,v 1.67 2002/11/12 02:49:14 brianp Exp $
MESA_MAJOR=5
MESA_MINOR=0
MESA_TINY=1
MESA_TINY=0
VERSION=$(MESA_MAJOR).$(MESA_MINOR)
# Mesa 3-D graphics library
#
# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
# Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),

View File

@@ -1,9 +1,9 @@
# $Id: Makefile.X11,v 1.69.2.4 2003/03/11 15:34:29 brianp Exp $
# $Id: Makefile.X11,v 1.69 2002/11/13 15:33:51 brianp Exp $
# Mesa 3-D graphics library
# Version: 5.0.1
# Version: 5.0
#
# Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
# Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
@@ -330,10 +330,10 @@ realclean: clean
cd samples && $(MAKE) -f Makefile.X11 realclean || true
DIRECTORY = Mesa-5.0.1
LIB_NAME = MesaLib-5.0.1
DEMO_NAME = MesaDemos-5.0.1
GLU_NAME = MesaGLU-5.0.1
DIRECTORY = Mesa-5.0
LIB_NAME = MesaLib-5.0
DEMO_NAME = MesaDemos-5.0
GLU_NAME = MesaGLU-5.0
GLUT_NAME = GLUT-3.7
@@ -429,7 +429,7 @@ LIB_FILES = \
$(DIRECTORY)/src/windml/man3/*.3 \
$(DIRECTORY)/src/windml/man3/*.html \
$(DIRECTORY)/src/DOS/*.[chS] \
$(DIRECTORY)/src/DOS/mga/*.[ch] \
$(DIRECTORY)/src/DOS/vesa/*.[ch] \
$(DIRECTORY)/src/BeOS/*.cpp \
$(DIRECTORY)/src/FX/Makefile.am \
$(DIRECTORY)/src/FX/Makefile.in \
@@ -486,7 +486,6 @@ LIB_FILES = \
$(DIRECTORY)/si-glu/Makefile.in \
$(DIRECTORY)/si-glu/Makefile.X11 \
$(DIRECTORY)/si-glu/Makefile.win \
$(DIRECTORY)/si-glu/Makefile.DJ \
$(DIRECTORY)/si-glu/glu.def \
$(DIRECTORY)/si-glu/dummy.cc \
$(DIRECTORY)/si-glu/descrip.mms \
@@ -706,31 +705,33 @@ OBSOLETE_GLUT_FILES = \
$(DIRECTORY)/src-glut.beos/*.h
lib_gz:
lib_tar:
cp Makefile.X11 Makefile ; \
cd .. ; \
tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \
gzip $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.gz $(DIRECTORY)
demo_gz:
demo_tar:
cd .. ; \
tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) ; \
gzip $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.gz $(DIRECTORY)
lib_bz2:
glu_tar:
cp Makefile.X11 Makefile ; \
cd .. ; \
tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \
bzip2 $(LIB_NAME).tar ; \
mv $(LIB_NAME).tar.bz2 $(DIRECTORY)
tar -cvf $(GLU_NAME).tar $(GLU_FILES) ; \
gzip $(GLU_NAME).tar ; \
mv $(GLU_NAME).tar.gz $(DIRECTORY)
demo_bz2:
glut_tar:
cp Makefile.X11 Makefile ; \
cd .. ; \
tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) ; \
bzip2 $(DEMO_NAME).tar ; \
mv $(DEMO_NAME).tar.bz2 $(DIRECTORY)
tar -cvf $(GLUT_NAME).tar $(GLUT_FILES) ; \
gzip $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
lib_zip:
-rm $(LIB_NAME).zip ; \
@@ -745,29 +746,20 @@ demo_zip:
zip -r $(DEMO_NAME).zip $(DEMO_FILES) ; \
mv $(DEMO_NAME).zip $(DIRECTORY)
md5:
@-md5sum $(LIB_NAME).tar.gz
@-md5sum $(LIB_NAME).tar.bz2
@-md5sum $(LIB_NAME).zip
@-md5sum $(DEMO_NAME).tar.gz
@-md5sum $(DEMO_NAME).tar.bz2
@-md5sum $(DEMO_NAME).zip
# Everything for new Mesa release:
tarballs: lib_gz demo_gz lib_bz2 demo_bz2 lib_zip demo_zip md5
# not used
glu_gz:
cp Makefile.X11 Makefile ; \
cd .. ; \
tar -cvf $(GLU_NAME).tar $(GLU_FILES) ; \
gzip $(GLU_NAME).tar ; \
mv $(GLU_NAME).tar.gz $(DIRECTORY)
SRC_FILES = \
RELNOTES \
src/Makefile* \
src/depend \
src/*.[chS] \
src/*/*.[ch] \
include/GL/*.h
glut_gz:
cp Makefile.X11 Makefile ; \
cd .. ; \
tar -cvf $(GLUT_NAME).tar $(GLUT_FILES) ; \
gzip $(GLUT_NAME).tar ; \
mv $(GLUT_NAME).tar.gz $(DIRECTORY)
srctar:
tar -cvf src.tar $(SRC_FILES) ; \
gzip src.tar
srctar.zip:
-rm src.zip
zip -r src.zip $(SRC_FILES) ; \

View File

@@ -1,12 +1,12 @@
Mesa 5.0.1 DOS/DJGPP Port v1.3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mesa 4.1 DOS/DJGPP Port v1.2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Description:
~~~~~~~~~~~~
Well, guess what... this is the DOS port of Mesa 5.0.1, for DJGPP fans... Whoa!
Well, guess what... this is the DOS port of Mesa 4.1, for DJGPP fans... Whoa!
The driver has its origins in ddsample.c, written by Brian Paul and found by me
in Mesa 3.4.2.
@@ -32,24 +32,20 @@ Available options:
Environment variables:
CPU optimize for the given processor.
default = k6
GLU=[src|si] specify GLU directory; can be `src' (src-glu = Mesa)
or `si' (si-glu = SGI's GLU -- requires GNU/C++).
default = src
GLIDE path to Glide3 SDK include files; used with FX.
default = $(TOP)/include/glide3
FX=1 build for 3dfx Glide3. Note that this disables
compilation of most DMesa code and requires fxMesa.
As a consequence, you'll need the DJGPP Glide3
library to build any application.
BIG_OPT=1 crazy optimizations; not very useful, though...
default = no
MATROX=1 build for Matrox Millennium I (MGA2064W) cards.
This is experimental and not intensively tested.
GLIDE absolute path to Glide library; used with FX.
default = $(TOP)/include/glide3
FX=1 build for 3dfx Glide3; use it if you have the Glide
SDK (designed for your platform), and, of course, a
3dfx card... Note that this disables compilation of
actual DMesa code, as Glide does all the stuff!
default = no
HAVE_X86=1 optimize for i386.
default = no
HAVE_MMX=1 allow MMX specializations, provided your assembler
supports MMX instruction set. However, the true CPU
capabilities are checked at run-time to avoid crashes.
HAVE_MMX=1 MMX instructions; use only if you assembler/compiler
supports MMX instruction set; backwards compatibility
with older processors is still preserved.
default = no
HAVE_SSE=1 (see HAVE_MMX)
default = no
@@ -69,9 +65,8 @@ Available options:
Tested on:
CPU: K6-2 (CXT) @500(412.5) MHz
Mainboard: ViA Apollo VP2/97 w/ 128 MB SDRAM
Video card: PowerColor EvilKing3 (Voodoo3 3000 PCI) w/ 16 MB SDRAM
DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.79.1
OS: DOS and Win9x
Video card: PowerColor Evil King3 (Voodoo3 3000) w/ 16384 kB SDRAM
DJGPP: djdev 2.04 + gcc v3.2 + make v3.79.1
@@ -85,135 +80,124 @@ FAQ:
A) You need LFN support.
A) When compiling for Glide (FX=1), pay attention to Glide path.
Q) Libraries built OK, but linker complains about `vsnprintf' every time I
compile some demo.
A) Upgrade to DJGPP 2.04.
A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!).
A) The following hack should be safe in 90% of the cases, but if anything
goes wrong, don't come back to me crying. Anyway, patch `src/imports.c'
with the following line:
#define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg)
2. Dynamic modules
Q) `make' complains about DXE3 or something, yet it builds the libraries.
A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest
DJGPP distro, or download the separate package from my web page. Read the
DXE3 documentation on how to use them. Hint: build your export object
file; then link it with your application. For example:
dxe3res -o dxe3tbl.c gl.dxe glu.dxe glut.dxe
gcc -o dxe3tbl.o -c dxe3tbl.c
gcc -o OUT.exe dxe3tbl.o IN.c -liglut -liglu -ligl -ldl
Q) What are you mumbling about dynamic modules?
A) You must have the DXE2 package (available on SimTel.Net, courtesy of
Andrew Zabolotny) installed in order to build the dynamic modules.
2. Using Mesa for DJGPP
Q) I have DXE2, but I couldn't build the `dxe2gen.exe'.
Q) I built `dxe2gen.exe', but it doesn't do the job right.
A) There is a patched version on my web page.
Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky (the
Glide port is on my web page). If you have a Matrox Millennium I card,
you just MIGHT be lucky... If you haven't, sorry; everything is done in
software. Suggestions?
Q) DXE2 modules give me headaches...
A) The DXE2 modules are not compulsory. The static libraries are still built
and you can use them in the old-fashioned, classic way... and learn to
live with your ~2MB executable size. For example:
gcc -o OUT.exe IN.c -lglut -lglu -lgl
Q) I tried to set refresh rate w/ DMesa, but without success.
A) Refresh rate control works only for VESA 3.0. If you were compiling for
Glide, see Glide info. If not, sorry!
Q) Okay, DXE2 modules are built. How can I use them?
A) Build your export object file; then link it with your application.
For example:
dxe2res -o dmesadxe.c gl.dxe glu.dxe glut.dxe
gcc -o dmesadxe.o dmesadxe.c
gcc -o OUT.exe dmesadxe.o IN.c -liglut -liglu -ligl -ldl
Q) What is that `dxe2res.exe' thing?
A) That is an utility that generates the export file for a given set of
modules. If you can't find it in the DXE2 package, you must be looking at
the wrong archive :)
3. Using Mesa for DJGPP
Q) Does this build work in Win9x?
A) Yes.
Q) Does it work under NT (W2k, XP) core?
A) Uh... probably not!
Q) I made a simple application and it does nothing. It exits right away. Not
even a blank screen.
A) The pure software drivers (VESA/VGA) support only double-buffered modes.
A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
A) The current version supports only RGB[A] modes, for it made no sense to
me to endorse color-index (aka palette) modes.
A) Single-buffered is not allowed at all. Until I can find a way to use
*REAL* hardware acceleration, it won't get implemented.
A) Another weird "feature" is that buffer width must be multiple of 4 (I'm a
lazy programmer and I found that the easiest way to keep buffer handling
at peak performance ;-).
Q) My demo doesn't display text. I know I used the GLUT font routines!
Q) My demo doesn't display text. I know I used the glut font routines!
A) Then you probably use GLUT as a DXE. Well, there is no direct access to
variables due to the way DXE works. Read the documentation. The author of
GLUT took this into account for _WIN32 DLL's only; I don't want to modify
his headers. The only workaround is to link GLUT the old way :-(
Q) The GLUT is incomplete.
A) See below.
Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much
better...
A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The
Glide port is on my web page. If you haven't, sorry; everything is done
in software. Suggestions?
Q) I have a super/mega/ultra monitor and all you can do is 60Hz? My eyes are
leaking from the orbits...
A) If you were compiling for Glide, see Glide info. If not, be aware that
refresh rate control works only for VESA 3.0. The environment variable
DMESA_REFRESH sets the default screen refresh. For example:
set DMESA_REFRESH=75
libGLUT (the toolkit):
~~~~~~~~~~~~~~~~~~~~~~
Well, this "skeletal" GLUT implementation was taken from AllegGL project and
heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian
Paul and probably others (or probably not ;-). GLUT functionality will be
extended only on an "as needed" basis.
Well, this "skeletal" GLUT implementation is not mine. Thanks should go to
Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably
not ;-). I only changed it to be self-standing (Allegro-free). The keyboard,
mouse and timer drivers were inspired from an old project of mine (D3Xl) and
fixed with many Allegro "infusions"; I deeply thank to Shawn Hargreaves et co.
GLUT talks to hardware via PC_HW package which was put together from various
pieces I wrote long time ago. It consists from the keyboard, mouse and timer
drivers.
My keyboard driver used only scancodes, but since GLUT requires ASCII values
for keys, I borrowed the translation tables (and maybe more) from Allegro.
Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) will shut down the GLUT
engine unconditionally: it will raise SIGINT, which in turn will call the
destructors (let's hope), thus cleaning up your/my mess ;-) NB: since the
DJGPP guys ensured signal handlers won't go beyond program's space (and since
dynamic modules shall) the SIGINT can't be hooked (well, it can, but it is
useless), therefore you must live with the 'Exiting due to signal SIGINT'
message...
My keyboard driver used only scancodes; as GLUT requires ASCII values for keys,
I borrowed the translation tables (and maybe more) from Allegro -- many thanks
to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users)
will shut down the GLUT engine unconditionally: it will raise SIGINT, which in
turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-)
NB: since the DJGPP guys ensured signal handlers won't go beyond program's
space (and since dynamic modules shall) the SIGINT can't be hooked (well, it
can, but it is useless), therefore you must live with the 'Exiting due to
signal SIGINT' message...
The mouse driver is far from complete (lack of drawing, etc), but is enough to
make almost all the demos work. Supports the CuteMouse WheelAPI.
The mouse driver is far from complete (lack of positioning, drawing, etc),
but is enough to make almost all the demos work.
The timer is pretty versatile for it supports multiple timers with different
frequencies. While not being the most accurate timer in the known universe, I
think it's OK. Take this example: you have timer A with a very high rate, and
then you have timer B with very low rate compared to A; now, A ticks OK, but
timer B will probably loose precision!
frequencies. It may not be the most accurate timer in the known universe, but
I think it's OK. Take this example: you have timer A with a very high rate,
and then you have timer B with very low rate compared to A; now, A ticks OK,
but timer B will probably loose precision!
As an addition, stdout and stderr are redirected and dumped upon exit. This
means that `printf' can be safely called during graphics. A bit of a hack, I
know, because all messages come in bulk, but I think it's better than nothing.
"Borrowed" from LIBRHUTI (Robert Hoehne).
means that printf can be safely called during graphics, but all messages come
in bulk! A bit of a hack, I know, but I think it's better than to miss them
at all. "Borrowed" from RHIDE (Robert Hoehne) or SETEDIT (Salvador Eduardo
Tropea)... I'm not sure.
Window creating defaults: 300x300x16 at (0,0), 16-bit depth, 16-bit accum,
8-bit stencil. However, the video mode is chosen in such a way that first
window will fit. If you need high resolution with small windows, set initial
position far to the right (or way down); then you can move them back to any
position right before the main loop.
The following environment variables can customize GLUT behaviour:
DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3)
DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8)
GLUT_FPS - print frames/second statistics to stderr
Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum.
However, the video mode is chosen in such a way that first window will fit.
History:
~~~~~~~~
v1.0 (mar-2002)
initial release
v1.0 mar-2002 initial release
v1.1 (sep-2002)
+ added 3dfx Glide3 support
+ added refresh rate control
+ added fonts in GLUT
* lots of minor changes
v1.1 sep-2002 + added 3dfx Glide3 support
+ added refresh rate control
+ added fonts in glut
* lots of minor changes
v1.2 (nov-2002)
* synced w/ Mesa-4.1
- removed dmesadxe.h
v1.3 (mar-2003)
+ enabled OpenGL 1.4 support
+ added MMX clear/blit routines
+ enabled SGI's GLU compilation
+ added samples makefile
+ added new GLUT functions
+ added color-index modes
+ added Matrox Millennium MGA2064W driver
+ added 8bit FakeColor (thanks to Neil Funk)
+ added VGA support (to keep Ben Decker happy)
! fixed some compilation errors (reported by Chan Kar Heng)
* optimized driver for faster callback access... yeah, right :)
* overhauled virtual buffer and internal video drivers
* better fxMesa integration
* revamped GLUT
* switched to DXE3
v1.2 nov-2002 * synced w/ Mesa-4.1
- removed dmesadxe.h

View File

@@ -1,46 +0,0 @@
Mesa 5.0.1 release notes
March 30, 2003
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Even-numbered versions (such as 5.0.x) designate stable releases.
Odd-numbered versions (such as 4.1.x) designate new developmental releases.
Mesa 5.0.1 just fixes bugs found since the 5.0 release. See the VERSIONS
file for details.
Device Driver Status
--------------------
A number of Mesa's software drivers haven't been actively maintained for
some time. We rely on volunteers to maintain many of these drivers.
Here's the current status of all included drivers:
Driver Status
---------------------- ---------------------
XMesa (Xlib) implements OpenGL 1.4
OSMesa (off-screen) implements OpenGL 1.4
FX (3dfx Voodoo1/2) implements OpenGL 1.3
SVGA implements OpenGL 1.3
Wind River UGL implements OpenGL 1.3
Windows/Win32 implements OpenGL 1.4
DJGPP implements OpenGL 1.4
GGI implements OpenGL 1.3
BeOS implements OpenGL 1.4
Allegro needs updating
D3D needs updating
Note: supporting OpenGL 1.4 (vs. 1.3 or 1.2) usually only requires that the
driver call the _mesa_enable_1_4_extensions() function.
----------------------------------------------------------------------
$Id: RELNOTES-5.0.1,v 1.1.2.4 2003/03/30 16:07:16 brianp Exp $

View File

@@ -1,4 +1,4 @@
$Id: VERSIONS,v 1.118.2.25 2003/03/29 16:11:22 brianp Exp $
$Id: VERSIONS,v 1.118 2002/11/13 15:33:50 brianp Exp $
Mesa Version History
@@ -1080,41 +1080,3 @@ Mesa Version History
- fixed one-bit error in point/line fragment Z calculation
- fixed potential segfault in fakeglx code
- fixed color overflow problem in DOT3 texture env mode
5.0.1 March 30, 2003
New:
- DOS driver updates from Daniel Borca
- updated GL/gl_mangle.h file (Bill Hoffman)
Bug fixes:
- auto mipmap generation for cube maps was broken (bug 641363)
- writing/clearing software alpha channels was unreliable
- minor compilation fixes for OS/2 (Evgeny Kotsuba)
- fixed some bad assertions found with shadowtex demo
- fixed error checking bug in glCopyTexSubImage2D (bug 659020)
- glRotate(angle, -x, 0, 0) was incorrect (bug 659677)
- fixed potential segfault in texture object validation (bug 659012)
- fixed some bogus code in _mesa_test_os_sse_exception_support (Linus)
- fix fog stride bug in tnl code for h/w drivers (Michel Danzer)
- fixed glActiveTexture / glMatrixMode(GL_TEXTURE) bug (#669080)
- glGet(GL_CURRENT_SECONDARY_COLOR) should return 4 values, not 3
- fixed compilation problem on Solaris7/x86 (bug 536406)
- fixed prefetch bug in 3DNow! code (Felix Kuhling)
- fixed NeXT build problem (FABSF macro)
- glDrawPixels Z values when glPixelZoom!=1 were invalid (bug 687811)
- zoomed glDraw/CopyPixels with clipping sometimes failed (bug 689964)
- AA line and triangle Z values are now rounded, not truncated
- fixed color interpolation bug when GLchan==GLfloat (bug 694461)
- glArePrograms/TexturesResident() wasn't 100% correct (Jose Fonseca)
- fixed a minor GL_COLOR_MATERIAL bug
- NV vertex program EXP instruction was broken
- glColorMask misbehaved with X window / pixmap rendering
- fix autoconf/libtool GLU C++ linker problem on Linux (a total hack)
- attempt to fix GGI compilation problem when MesaDemos not present
- NV vertex program ARL-relative fetches didn't work
Changes:
- use glPolygonOffset in gloss demo to avoid z-fighting artifacts
- updated winpos and pointblast demos to use ARB extensions
- disable SPARC normal transformation code (bug 673938)
- GLU fixes for OS/2 (Evgeny Kotsuba)

View File

@@ -42,7 +42,6 @@ Be warned, some of these files may be very out of date.
<H1>Release Notes</H1>
<UL>
<LI><A HREF="RELNOTES-5.0.1">RELNOTES-5.0.1</A>
<LI><A HREF="RELNOTES-5.0">RELNOTES-5.0</A>
<LI><A HREF="RELNOTES-4.1">RELNOTES-4.1</A>
<LI><A HREF="RELNOTES-4.0.3">RELNOTES-4.0.3</A>

3586
docs/subset.html Normal file

File diff suppressed because it is too large Load Diff

9
doxygen/.cvsignore Normal file
View File

@@ -0,0 +1,9 @@
*.tag
array_cache
core
math
miniglx
swrast
swrast_setup
tnl
tnl_dd

View File

@@ -6,4 +6,4 @@ See http://www.doxygen.org/ for more info.
Either run 'make' (Unix) or 'doxy.bat' (Windows) to run doxygen
and generate souce code documentation.
Then, load doxy/core.index.html into your web browser.
Then, load doxy/core/index.html into your web browser.

View File

@@ -4,10 +4,10 @@
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa array_cache"
PROJECT_NUMBER = 4.1
OUTPUT_DIRECTORY = .
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
@@ -38,14 +38,14 @@ GENERATE_BUGLIST = YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO
WARN_FORMAT =
WARN_LOGFILE =
#---------------------------------------------------------------------------

View File

@@ -4,12 +4,12 @@
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa Core"
PROJECT_NUMBER = 4.1
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
@@ -19,7 +19,7 @@ ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
INTERNAL_DOCS = NO
INTERNAL_DOCS = YES
STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES
SHORT_NAMES = NO
@@ -38,21 +38,21 @@ GENERATE_BUGLIST = YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO
WARN_FORMAT =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/
FILE_PATTERNS = *.h *.c
FILE_PATTERNS = *.c *.h
RECURSIVE = NO
EXCLUDE = ../src/glapitemp.h ../src/glapioffsets.h
EXCLUDE_PATTERNS =
@@ -65,16 +65,16 @@ FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX = _
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
@@ -149,7 +149,7 @@ TAGFILES = tnl_dd.tag=../tnl_dd \
swrast.tag=../swrast \
swrast_setup.tag=../swrast_setup \
tnl.tag=../tnl \
array_cache.tag=array_cache
miniglx.tag=../miniglx
GENERATE_TAGFILE = core.tag
ALLEXTERNALS = NO
PERL_PATH =

View File

@@ -1,9 +1,10 @@
<html><head><title>Mesa API docs</title>
<html><head><title>Mesa Source Code Documentation</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body><center>
<a href="../core/index.html">Mesa Core</a>&nbsp;
<a href="../miniglx/index.html">MiniGLX</a>&nbsp;
<a href="../array_cache/index.html">array_cache</a>&nbsp;
<a href="../core/index.html">core</a>&nbsp;
<a href="../math/index.html">math</a>&nbsp;
<a href="../swrast/index.html">swrast</a>&nbsp;
<a href="../swrast_setup/index.html">swrast_setup</a>&nbsp;

View File

@@ -5,6 +5,7 @@ default:
doxygen swrast.doxy
doxygen swrast_setup.doxy
doxygen tnl.doxy
doxygen miniglx.doxy
doxygen core.doxy
echo "Building again, to resolve tags"
doxygen tnl_dd.doxy
@@ -13,9 +14,10 @@ default:
doxygen swrast.doxy
doxygen swrast_setup.doxy
doxygen tnl.doxy
doxygen miniglx.doxy
clean:
rm -rf array_cache core math swrast swrast_setup tnl_dd tnl
rm -rf array_cache core math swrast swrast_setup tnl_dd tnl miniglx
rm -rf *.tag

View File

@@ -3,8 +3,8 @@
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa math"
PROJECT_NUMBER = 4.1
PROJECT_NAME = "Mesa math module"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = .
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
@@ -73,7 +73,7 @@ REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------

184
doxygen/miniglx.doxy Normal file
View File

@@ -0,0 +1,184 @@
# Doxyfile 0.1
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "MiniGLX"
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
INTERNAL_DOCS = YES
STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES
SHORT_NAMES = NO
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = NO
SHOW_INCLUDE_FILES = NO
JAVADOC_AUTOBRIEF = NO
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = NO
WARN_FORMAT =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/miniglx/ ../include/GL/miniglx.h
FILE_PATTERNS = *.h *.c
RECURSIVE = NO
EXCLUDE =
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = miniglx
HTML_HEADER = header.html
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT =
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT =
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT =
MAN_EXTENSION =
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH = ../include/
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES = core.tag=../core \
tnl_dd.tag=../tnl_dd \
array_cache.tag=../array_cache \
math.tag=../math \
swrast.tag=../swrast \
swrast_setup.tag=../swrast_setup \
tnl.tag=../tnl \
array_cache.tag=array_cache
GENERATE_TAGFILE = miniglx.tag
ALLEXTERNALS = NO
PERL_PATH =
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
TEMPLATE_RELATIONS = YES
HIDE_UNDOC_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME =
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH =
EXT_DOC_PATHS =

View File

@@ -3,8 +3,8 @@
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa swrast"
PROJECT_NUMBER = 4.1
PROJECT_NAME = "Mesa Software Rasterization (swrast)"
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = NO
@@ -19,7 +19,7 @@ ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
INTERNAL_DOCS = NO
INTERNAL_DOCS = YES
STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES
SHORT_NAMES = NO
@@ -38,22 +38,21 @@ GENERATE_BUGLIST = YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_FOR_C = YES
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO
WARN_FORMAT =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/swrast/
FILE_PATTERNS = *.c \
*.h
FILE_PATTERNS = *.c *.h
RECURSIVE = NO
EXCLUDE =
EXCLUDE_PATTERNS =
@@ -136,7 +135,7 @@ ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_PATH = ../include/
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
@@ -156,7 +155,7 @@ PERL_PATH =
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
CLASS_DIAGRAMS = NO
HAVE_DOT = NO
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES

View File

@@ -4,7 +4,7 @@
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa swrast_setup"
PROJECT_NUMBER = 4.1
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES

View File

@@ -3,8 +3,8 @@
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa tnl"
PROJECT_NUMBER = 4.1
PROJECT_NAME = "Mesa Transform and Lighting (tnl)"
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES

View File

@@ -4,7 +4,7 @@
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = "Mesa tnl_dd"
PROJECT_NUMBER = 4.1
PROJECT_NUMBER =
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
@@ -52,7 +52,7 @@ WARN_LOGFILE =
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/tnl_dd/
FILE_PATTERNS = *.h
FILE_PATTERNS = *.c *.h
RECURSIVE = YES
EXCLUDE =
EXCLUDE_PATTERNS =

View File

@@ -23,7 +23,7 @@
*/
/*
* DOS/DJGPP device driver v1.3 for Mesa
* DOS/DJGPP device driver v1.2 for Mesa 4.1
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -37,17 +37,6 @@
#define DMESA_MAJOR_VERSION 5
#define DMESA_MINOR_VERSION 0
/* Sample Usage:
*
* 1. Call DMesaCreateVisual() to initialize graphics.
* 2. Call DMesaCreateContext() to create a DMesa rendering context.
* 3. Call DMesaCreateBuffer() to define the window.
* 4. Call DMesaMakeCurrent() to bind the DMesaBuffer to a DMesaContext.
* 5. Make gl* calls to render your graphics.
* 6. Use DMesaSwapBuffers() when double buffering to swap front/back buffers.
* 7. Before exiting, destroy DMesaBuffer, DMesaContext and DMesaVisual.
*/
typedef struct dmesa_context *DMesaContext;
typedef struct dmesa_visual *DMesaVisual;
typedef struct dmesa_buffer *DMesaBuffer;
@@ -56,89 +45,32 @@ typedef struct dmesa_buffer *DMesaBuffer;
extern "C" {
#endif
/*
* Create a new Visual and set graphics mode.
*/
DMesaVisual DMesaCreateVisual (GLint width, /* X res */
GLint height, /* Y res */
GLint colDepth, /* BPP */
GLint refresh, /* refresh rate: 0=default */
GLboolean dbFlag, /* double-buffered */
GLboolean rgbFlag, /* RGB mode */
GLboolean alphaFlag,/* alpha buffer requested */
GLint depthSize, /* requested bits/depth */
GLint stencilSize, /* requested bits/stencil */
GLint accumSize); /* requested bits/accum */
DMesaVisual DMesaCreateVisual (GLint width, GLint height,
GLint colDepth,
GLboolean dbFlag,
GLint depthSize,
GLint stencilSize,
GLint accumSize);
/*
* Destroy Visual and restore screen.
*/
void DMesaDestroyVisual (DMesaVisual v);
/*
* Create a new Context for rendering.
*/
DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
/*
* Destroy Context.
*/
void DMesaDestroyContext (DMesaContext c);
/*
* Return a handle to the current context.
*/
DMesaContext DMesaGetCurrentContext (void);
/*
* Create a new Buffer (window).
*/
DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
GLint xpos, GLint ypos,
GLint width, GLint height);
/*
* Destroy Buffer.
*/
void DMesaDestroyBuffer (DMesaBuffer b);
/*
* Swap the front and back buffers for the given Buffer.
* No action is taken if the buffer is not double buffered.
*/
void DMesaSwapBuffers (DMesaBuffer b);
DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
void DMesaDestroyContext (DMesaContext c);
GLboolean DMesaViewport (DMesaBuffer b,
GLint xpos, GLint ypos,
GLint width, GLint height);
/*
* Bind Buffer to Context and make the Context the current one.
*/
GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
/*
* Move/Resize current Buffer.
*/
GLboolean DMesaMoveBuffer (GLint xpos, GLint ypos);
GLboolean DMesaResizeBuffer (GLint width, GLint height);
/*
* Set palette index, using normalized values.
*/
void DMesaSetCI (int ndx, GLfloat red, GLfloat green, GLfloat blue);
/*
* DMesa state retrieval.
*/
#define DMESA_GET_SCREEN_SIZE 0x0100
#define DMESA_GET_DRIVER_CAPS 0x0200
#define DMESA_DRIVER_SWDB_BIT 0x1 /* software double-buffered */
#define DMESA_DRIVER_LLWO_BIT 0x2 /* lower-left window origin */
int DMesaGetIntegerv (GLenum pname, GLint *params);
void DMesaSwapBuffers (DMesaBuffer b);
#ifdef __cplusplus
}

View File

@@ -1,10 +1,10 @@
/* $Id: gl.h,v 1.72.2.1 2003/02/28 16:29:05 brianp Exp $ */
/* $Id: gl.h,v 1.72 2002/10/17 19:39:31 kschultz Exp $ */
/*
* Mesa 3-D graphics library
* Version: 5.0.1
* Version: 4.1
*
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -2646,13 +2646,6 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid
#endif /* GL_APPLE_ycbcr_422 */
#ifndef GL_ATI_texture_env_combine3
#define GL_ATI_texture_env_combine3 1
#define GL_MODULATE_ADD_ATI 0x8744
#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
#define GL_MODULATE_SUBTRACT_ATI 0x8746
#endif
/**********************************************************************
* Begin system-specific stuff

View File

@@ -1,14 +1,15 @@
#if 0 /* $Id: gl_mangle.h,v 1.11.4.1 2003/02/04 02:29:45 brianp Exp $ */
#define GL_MANGLE_C1 "DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN SHELL (/bin/sh) and save the output"
#define GL_MANGLE_C2 "This file is used to create GL function protypes and aliases for the function names"
#if 0 /* $Id: gl_mangle.h,v 1.11 2002/01/18 14:55:40 brianp Exp $ */
# DO NOT EDIT!!! - TO REGENERATE from gl.h, EXECUTE THIS FILE IN KORN SHELL and save the output
# This file is used to create GL function protypes and aliases for the function names
files="gl.h glext.h"
#define GL_MANGLE_C3 "get regeneration header - copy everything in this file above the 'REGENERATE_TO_END' line"
#get regeneration header - copy everything in this file above the "REGENERATE_TO_END" line
awk '!done; /^\/\*REGENERATE_TO_END/ {done=1}' $0
echo ""
#define GL_MANGLE_C4 get aliases
echo "\n"
#get aliases
grep '^GLAPI' $files | sed -e 's/.*ENTRY gl\([^( ]*\).*$/#define gl\1 MANGLE(\1)/' | sort | uniq
echo ""
echo "#endif /* GL_MANGLE_H */"
echo "\n#endif /* GL_MANGLE_H */"
exit
#endif /* REGENERATION */
@@ -33,8 +34,8 @@
/*REGENERATE_TO_END-----------ALL LINES BELOW HERE GET REPLACED ON REGENERATION */
#define glAccum MANGLE(Accum)
#define glActiveStencilFaceEXT MANGLE(ActiveStencilFaceEXT)
#define glActiveTexture MANGLE(ActiveTexture)
#define glActiveTextureARB MANGLE(ActiveTextureARB)
#define glAlphaFragmentOp1ATI MANGLE(AlphaFragmentOp1ATI)
@@ -51,13 +52,11 @@
#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX)
#define glBegin MANGLE(Begin)
#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI)
#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
#define glBindParameterEXT MANGLE(BindParameterEXT)
#define glBindProgramARB MANGLE(BindProgramARB)
#define glBindProgramNV MANGLE(BindProgramNV)
#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
#define glBindTexture MANGLE(BindTexture)
@@ -81,7 +80,6 @@
#define glBlendEquation MANGLE(BlendEquation)
#define glBlendEquationEXT MANGLE(BlendEquationEXT)
#define glBlendFunc MANGLE(BlendFunc)
#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
#define glBlendFuncSeparateEXT MANGLE(BlendFuncSeparateEXT)
#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
#define glCallList MANGLE(CallList)
@@ -94,7 +92,7 @@
#define glClearStencil MANGLE(ClearStencil)
#define glClientActiveTexture MANGLE(ClientActiveTexture)
#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB)
#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
#define glClientActiveVertexStream MANGLE(ClientActiveVertexStream)
#define glClipPlane MANGLE(ClipPlane)
#define glColor3b MANGLE(Color3b)
#define glColor3bv MANGLE(Color3bv)
@@ -216,8 +214,6 @@
#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
#define glDeleteLists MANGLE(DeleteLists)
#define glDeleteObjectBufferATI MANGLE(DeleteObjectBufferATI)
#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
#define glDeleteProgramsARB MANGLE(DeleteProgramsARB)
#define glDeleteProgramsNV MANGLE(DeleteProgramsNV)
#define glDeleteTextures MANGLE(DeleteTextures)
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
@@ -230,15 +226,11 @@
#define glDisableClientState MANGLE(DisableClientState)
#define glDisableTraceMESA MANGLE(DisableTraceMESA)
#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDrawArrays MANGLE(DrawArrays)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
#define glDrawBuffer MANGLE(DrawBuffer)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
#define glDrawElements MANGLE(DrawElements)
#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN)
#define glDrawPixels MANGLE(DrawPixels)
#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
#define glDrawRangeElements MANGLE(DrawRangeElements)
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glEdgeFlag MANGLE(EdgeFlag)
@@ -246,16 +238,13 @@
#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
#define glEdgeFlagv MANGLE(EdgeFlagv)
#define glElementPointerATI MANGLE(ElementPointerATI)
#define glEnable MANGLE(Enable)
#define glEnableClientState MANGLE(EnableClientState)
#define glEnableTraceMESA MANGLE(EnableTraceMESA)
#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
#define glEnd MANGLE(End)
#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI)
#define glEndList MANGLE(EndList)
#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
#define glEndTraceMESA MANGLE(EndTraceMESA)
#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
#define glEvalCoord1d MANGLE(EvalCoord1d)
@@ -282,16 +271,11 @@
#define glFlush MANGLE(Flush)
#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
#define glFlushVertexArrayRangeNV MANGLE(FlushVertexArrayRangeNV)
#define glFogCoordPointer MANGLE(FogCoordPointer)
#define glFogCoordPointerEXT MANGLE(FogCoordPointerEXT)
#define glFogCoordPointerListIBM MANGLE(FogCoordPointerListIBM)
#define glFogCoordd MANGLE(FogCoordd)
#define glFogCoorddEXT MANGLE(FogCoorddEXT)
#define glFogCoorddv MANGLE(FogCoorddv)
#define glFogCoorddvEXT MANGLE(FogCoorddvEXT)
#define glFogCoordf MANGLE(FogCoordf)
#define glFogCoordfEXT MANGLE(FogCoordfEXT)
#define glFogCoordfv MANGLE(FogCoordfv)
#define glFogCoordfvEXT MANGLE(FogCoordfvEXT)
#define glFogFuncSGIS MANGLE(FogFuncSGIS)
#define glFogf MANGLE(Fogf)
@@ -318,8 +302,6 @@
#define glGenFencesNV MANGLE(GenFencesNV)
#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
#define glGenLists MANGLE(GenLists)
#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
#define glGenProgramsARB MANGLE(GenProgramsARB)
#define glGenProgramsNV MANGLE(GenProgramsNV)
#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
#define glGenTextures MANGLE(GenTextures)
@@ -401,8 +383,6 @@
#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetOcclusionQueryivNV MANGLE(GetOcclusionQueryivNV)
#define glGetOcclusionQueryuivNV MANGLE(GetOcclusionQueryuivNV)
#define glGetPixelMapfv MANGLE(GetPixelMapfv)
#define glGetPixelMapuiv MANGLE(GetPixelMapuiv)
#define glGetPixelMapusv MANGLE(GetPixelMapusv)
@@ -411,15 +391,9 @@
#define glGetPointerv MANGLE(GetPointerv)
#define glGetPointervEXT MANGLE(GetPointervEXT)
#define glGetPolygonStipple MANGLE(GetPolygonStipple)
#define glGetProgramEnvParameterdvARB MANGLE(GetProgramEnvParameterdvARB)
#define glGetProgramEnvParameterfvARB MANGLE(GetProgramEnvParameterfvARB)
#define glGetProgramLocalParameterdvARB MANGLE(GetProgramLocalParameterdvARB)
#define glGetProgramLocalParameterfvARB MANGLE(GetProgramLocalParameterfvARB)
#define glGetProgramParameterdvNV MANGLE(GetProgramParameterdvNV)
#define glGetProgramParameterfvNV MANGLE(GetProgramParameterfvNV)
#define glGetProgramStringARB MANGLE(GetProgramStringARB)
#define glGetProgramStringNV MANGLE(GetProgramStringNV)
#define glGetProgramivARB MANGLE(GetProgramivARB)
#define glGetProgramivNV MANGLE(GetProgramivNV)
#define glGetSeparableFilter MANGLE(GetSeparableFilter)
#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
@@ -445,13 +419,9 @@
#define glGetVariantFloatvEXT MANGLE(GetVariantFloatvEXT)
#define glGetVariantIntegervEXT MANGLE(GetVariantIntegervEXT)
#define glGetVariantPointervEXT MANGLE(GetVariantPointervEXT)
#define glGetVertexAttribPointervARB MANGLE(GetVertexAttribPointervARB)
#define glGetVertexAttribPointervNV MANGLE(GetVertexAttribPointervNV)
#define glGetVertexAttribdvARB MANGLE(GetVertexAttribdvARB)
#define glGetVertexAttribdvNV MANGLE(GetVertexAttribdvNV)
#define glGetVertexAttribfvARB MANGLE(GetVertexAttribfvARB)
#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV)
#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
#define glGlobalAlphaFactorbSUN MANGLE(GlobalAlphaFactorbSUN)
#define glGlobalAlphaFactordSUN MANGLE(GlobalAlphaFactordSUN)
@@ -495,8 +465,6 @@
#define glIsFenceNV MANGLE(IsFenceNV)
#define glIsList MANGLE(IsList)
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
#define glIsProgramARB MANGLE(IsProgramARB)
#define glIsProgramNV MANGLE(IsProgramNV)
#define glIsTexture MANGLE(IsTexture)
#define glIsTextureEXT MANGLE(IsTextureEXT)
@@ -557,9 +525,7 @@
#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB)
#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB)
#define glMultiDrawArrays MANGLE(MultiDrawArrays)
#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
#define glMultiDrawElements MANGLE(MultiDrawElements)
#define glMultiDrawElementsEXT MANGLE(MultiDrawElementsEXT)
#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM)
#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM)
@@ -646,16 +612,16 @@
#define glNormalPointerEXT MANGLE(NormalPointerEXT)
#define glNormalPointerListIBM MANGLE(NormalPointerListIBM)
#define glNormalPointervINTEL MANGLE(NormalPointervINTEL)
#define glNormalStream3bATI MANGLE(NormalStream3bATI)
#define glNormalStream3bvATI MANGLE(NormalStream3bvATI)
#define glNormalStream3dATI MANGLE(NormalStream3dATI)
#define glNormalStream3dvATI MANGLE(NormalStream3dvATI)
#define glNormalStream3fATI MANGLE(NormalStream3fATI)
#define glNormalStream3fvATI MANGLE(NormalStream3fvATI)
#define glNormalStream3iATI MANGLE(NormalStream3iATI)
#define glNormalStream3ivATI MANGLE(NormalStream3ivATI)
#define glNormalStream3sATI MANGLE(NormalStream3sATI)
#define glNormalStream3svATI MANGLE(NormalStream3svATI)
#define glNormalStream3b MANGLE(NormalStream3b)
#define glNormalStream3bv MANGLE(NormalStream3bv)
#define glNormalStream3d MANGLE(NormalStream3d)
#define glNormalStream3dv MANGLE(NormalStream3dv)
#define glNormalStream3f MANGLE(NormalStream3f)
#define glNormalStream3fv MANGLE(NormalStream3fv)
#define glNormalStream3i MANGLE(NormalStream3i)
#define glNormalStream3iv MANGLE(NormalStream3iv)
#define glNormalStream3s MANGLE(NormalStream3s)
#define glNormalStream3sv MANGLE(NormalStream3sv)
#define glOrtho MANGLE(Ortho)
#define glPNTrianglesfATI MANGLE(PNTrianglesfATI)
#define glPNTrianglesiATI MANGLE(PNTrianglesiATI)
@@ -678,18 +644,12 @@
#define glPixelTransformParameteriEXT MANGLE(PixelTransformParameteriEXT)
#define glPixelTransformParameterivEXT MANGLE(PixelTransformParameterivEXT)
#define glPixelZoom MANGLE(PixelZoom)
#define glPointParameterf MANGLE(PointParameterf)
#define glPointParameterfARB MANGLE(PointParameterfARB)
#define glPointParameterfEXT MANGLE(PointParameterfEXT)
#define glPointParameterfSGIS MANGLE(PointParameterfSGIS)
#define glPointParameterfv MANGLE(PointParameterfv)
#define glPointParameterfvARB MANGLE(PointParameterfvARB)
#define glPointParameterfvEXT MANGLE(PointParameterfvEXT)
#define glPointParameterfvSGIS MANGLE(PointParameterfvSGIS)
#define glPointParameteri MANGLE(PointParameteri)
#define glPointParameteriNV MANGLE(PointParameteriNV)
#define glPointParameteriv MANGLE(PointParameteriv)
#define glPointParameterivNV MANGLE(PointParameterivNV)
#define glPointSize MANGLE(PointSize)
#define glPollAsyncSGIX MANGLE(PollAsyncSGIX)
#define glPollInstrumentsSGIX MANGLE(PollInstrumentsSGIX)
@@ -703,21 +663,12 @@
#define glPopName MANGLE(PopName)
#define glPrioritizeTextures MANGLE(PrioritizeTextures)
#define glPrioritizeTexturesEXT MANGLE(PrioritizeTexturesEXT)
#define glProgramEnvParameter4dARB MANGLE(ProgramEnvParameter4dARB)
#define glProgramEnvParameter4dvARB MANGLE(ProgramEnvParameter4dvARB)
#define glProgramEnvParameter4fARB MANGLE(ProgramEnvParameter4fARB)
#define glProgramEnvParameter4fvARB MANGLE(ProgramEnvParameter4fvARB)
#define glProgramLocalParameter4dARB MANGLE(ProgramLocalParameter4dARB)
#define glProgramLocalParameter4dvARB MANGLE(ProgramLocalParameter4dvARB)
#define glProgramLocalParameter4fARB MANGLE(ProgramLocalParameter4fARB)
#define glProgramLocalParameter4fvARB MANGLE(ProgramLocalParameter4fvARB)
#define glProgramParameter4dNV MANGLE(ProgramParameter4dNV)
#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV)
#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV)
#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
#define glPushAttrib MANGLE(PushAttrib)
#define glPushClientAttrib MANGLE(PushClientAttrib)
#define glPushMatrix MANGLE(PushMatrix)
@@ -795,44 +746,28 @@
#define glSampleMapATI MANGLE(SampleMapATI)
#define glSampleMaskEXT MANGLE(SampleMaskEXT)
#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
#define glSamplePass MANGLE(SamplePass)
#define glSamplePatternEXT MANGLE(SamplePatternEXT)
#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
#define glScaled MANGLE(Scaled)
#define glScalef MANGLE(Scalef)
#define glScissor MANGLE(Scissor)
#define glSecondaryColor3b MANGLE(SecondaryColor3b)
#define glSecondaryColor3bEXT MANGLE(SecondaryColor3bEXT)
#define glSecondaryColor3bv MANGLE(SecondaryColor3bv)
#define glSecondaryColor3bvEXT MANGLE(SecondaryColor3bvEXT)
#define glSecondaryColor3d MANGLE(SecondaryColor3d)
#define glSecondaryColor3dEXT MANGLE(SecondaryColor3dEXT)
#define glSecondaryColor3dv MANGLE(SecondaryColor3dv)
#define glSecondaryColor3dvEXT MANGLE(SecondaryColor3dvEXT)
#define glSecondaryColor3f MANGLE(SecondaryColor3f)
#define glSecondaryColor3fEXT MANGLE(SecondaryColor3fEXT)
#define glSecondaryColor3fv MANGLE(SecondaryColor3fv)
#define glSecondaryColor3fvEXT MANGLE(SecondaryColor3fvEXT)
#define glSecondaryColor3i MANGLE(SecondaryColor3i)
#define glSecondaryColor3iEXT MANGLE(SecondaryColor3iEXT)
#define glSecondaryColor3iv MANGLE(SecondaryColor3iv)
#define glSecondaryColor3ivEXT MANGLE(SecondaryColor3ivEXT)
#define glSecondaryColor3s MANGLE(SecondaryColor3s)
#define glSecondaryColor3sEXT MANGLE(SecondaryColor3sEXT)
#define glSecondaryColor3sv MANGLE(SecondaryColor3sv)
#define glSecondaryColor3svEXT MANGLE(SecondaryColor3svEXT)
#define glSecondaryColor3ub MANGLE(SecondaryColor3ub)
#define glSecondaryColor3ubEXT MANGLE(SecondaryColor3ubEXT)
#define glSecondaryColor3ubv MANGLE(SecondaryColor3ubv)
#define glSecondaryColor3ubvEXT MANGLE(SecondaryColor3ubvEXT)
#define glSecondaryColor3ui MANGLE(SecondaryColor3ui)
#define glSecondaryColor3uiEXT MANGLE(SecondaryColor3uiEXT)
#define glSecondaryColor3uiv MANGLE(SecondaryColor3uiv)
#define glSecondaryColor3uivEXT MANGLE(SecondaryColor3uivEXT)
#define glSecondaryColor3us MANGLE(SecondaryColor3us)
#define glSecondaryColor3usEXT MANGLE(SecondaryColor3usEXT)
#define glSecondaryColor3usv MANGLE(SecondaryColor3usv)
#define glSecondaryColor3usvEXT MANGLE(SecondaryColor3usvEXT)
#define glSecondaryColorPointer MANGLE(SecondaryColorPointer)
#define glSecondaryColorPointerEXT MANGLE(SecondaryColorPointerEXT)
#define glSecondaryColorPointerListIBM MANGLE(SecondaryColorPointerListIBM)
#define glSelectBuffer MANGLE(SelectBuffer)
@@ -1000,69 +935,32 @@
#define glVertex4s MANGLE(Vertex4s)
#define glVertex4sv MANGLE(Vertex4sv)
#define glVertexArrayRangeNV MANGLE(VertexArrayRangeNV)
#define glVertexAttrib1dARB MANGLE(VertexAttrib1dARB)
#define glVertexAttrib1dNV MANGLE(VertexAttrib1dNV)
#define glVertexAttrib1dvARB MANGLE(VertexAttrib1dvARB)
#define glVertexAttrib1dvNV MANGLE(VertexAttrib1dvNV)
#define glVertexAttrib1fARB MANGLE(VertexAttrib1fARB)
#define glVertexAttrib1fNV MANGLE(VertexAttrib1fNV)
#define glVertexAttrib1fvARB MANGLE(VertexAttrib1fvARB)
#define glVertexAttrib1fvNV MANGLE(VertexAttrib1fvNV)
#define glVertexAttrib1sARB MANGLE(VertexAttrib1sARB)
#define glVertexAttrib1sNV MANGLE(VertexAttrib1sNV)
#define glVertexAttrib1svARB MANGLE(VertexAttrib1svARB)
#define glVertexAttrib1svNV MANGLE(VertexAttrib1svNV)
#define glVertexAttrib2dARB MANGLE(VertexAttrib2dARB)
#define glVertexAttrib2dNV MANGLE(VertexAttrib2dNV)
#define glVertexAttrib2dvARB MANGLE(VertexAttrib2dvARB)
#define glVertexAttrib2dvNV MANGLE(VertexAttrib2dvNV)
#define glVertexAttrib2fARB MANGLE(VertexAttrib2fARB)
#define glVertexAttrib2fNV MANGLE(VertexAttrib2fNV)
#define glVertexAttrib2fvARB MANGLE(VertexAttrib2fvARB)
#define glVertexAttrib2fvNV MANGLE(VertexAttrib2fvNV)
#define glVertexAttrib2sARB MANGLE(VertexAttrib2sARB)
#define glVertexAttrib2sNV MANGLE(VertexAttrib2sNV)
#define glVertexAttrib2svARB MANGLE(VertexAttrib2svARB)
#define glVertexAttrib2svNV MANGLE(VertexAttrib2svNV)
#define glVertexAttrib3dARB MANGLE(VertexAttrib3dARB)
#define glVertexAttrib3dNV MANGLE(VertexAttrib3dNV)
#define glVertexAttrib3dvARB MANGLE(VertexAttrib3dvARB)
#define glVertexAttrib3dvNV MANGLE(VertexAttrib3dvNV)
#define glVertexAttrib3fARB MANGLE(VertexAttrib3fARB)
#define glVertexAttrib3fNV MANGLE(VertexAttrib3fNV)
#define glVertexAttrib3fvARB MANGLE(VertexAttrib3fvARB)
#define glVertexAttrib3fvNV MANGLE(VertexAttrib3fvNV)
#define glVertexAttrib3sARB MANGLE(VertexAttrib3sARB)
#define glVertexAttrib3sNV MANGLE(VertexAttrib3sNV)
#define glVertexAttrib3svARB MANGLE(VertexAttrib3svARB)
#define glVertexAttrib3svNV MANGLE(VertexAttrib3svNV)
#define glVertexAttrib4NbvARB MANGLE(VertexAttrib4NbvARB)
#define glVertexAttrib4NivARB MANGLE(VertexAttrib4NivARB)
#define glVertexAttrib4NsvARB MANGLE(VertexAttrib4NsvARB)
#define glVertexAttrib4NubARB MANGLE(VertexAttrib4NubARB)
#define glVertexAttrib4NubvARB MANGLE(VertexAttrib4NubvARB)
#define glVertexAttrib4NuivARB MANGLE(VertexAttrib4NuivARB)
#define glVertexAttrib4NusvARB MANGLE(VertexAttrib4NusvARB)
#define glVertexAttrib4bvARB MANGLE(VertexAttrib4bvARB)
#define glVertexAttrib4dARB MANGLE(VertexAttrib4dARB)
#define glVertexAttrib4dNV MANGLE(VertexAttrib4dNV)
#define glVertexAttrib4dvARB MANGLE(VertexAttrib4dvARB)
#define glVertexAttrib4dvNV MANGLE(VertexAttrib4dvNV)
#define glVertexAttrib4fARB MANGLE(VertexAttrib4fARB)
#define glVertexAttrib4fNV MANGLE(VertexAttrib4fNV)
#define glVertexAttrib4fvARB MANGLE(VertexAttrib4fvARB)
#define glVertexAttrib4fvNV MANGLE(VertexAttrib4fvNV)
#define glVertexAttrib4ivARB MANGLE(VertexAttrib4ivARB)
#define glVertexAttrib4sARB MANGLE(VertexAttrib4sARB)
#define glVertexAttrib4sNV MANGLE(VertexAttrib4sNV)
#define glVertexAttrib4svARB MANGLE(VertexAttrib4svARB)
#define glVertexAttrib4svNV MANGLE(VertexAttrib4svNV)
#define glVertexAttrib4ubNV MANGLE(VertexAttrib4ubNV)
#define glVertexAttrib4ubvARB MANGLE(VertexAttrib4ubvARB)
#define glVertexAttrib4ubvNV MANGLE(VertexAttrib4ubvNV)
#define glVertexAttrib4uivARB MANGLE(VertexAttrib4uivARB)
#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB)
#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
#define glVertexAttribs1dvNV MANGLE(VertexAttribs1dvNV)
#define glVertexAttribs1fvNV MANGLE(VertexAttribs1fvNV)
@@ -1078,44 +976,44 @@
#define glVertexAttribs4svNV MANGLE(VertexAttribs4svNV)
#define glVertexAttribs4ubvNV MANGLE(VertexAttribs4ubvNV)
#define glVertexBlendARB MANGLE(VertexBlendARB)
#define glVertexBlendEnvfATI MANGLE(VertexBlendEnvfATI)
#define glVertexBlendEnviATI MANGLE(VertexBlendEnviATI)
#define glVertexBlendEnvf MANGLE(VertexBlendEnvf)
#define glVertexBlendEnvi MANGLE(VertexBlendEnvi)
#define glVertexPointer MANGLE(VertexPointer)
#define glVertexPointerEXT MANGLE(VertexPointerEXT)
#define glVertexPointerListIBM MANGLE(VertexPointerListIBM)
#define glVertexPointervINTEL MANGLE(VertexPointervINTEL)
#define glVertexStream1dATI MANGLE(VertexStream1dATI)
#define glVertexStream1dvATI MANGLE(VertexStream1dvATI)
#define glVertexStream1fATI MANGLE(VertexStream1fATI)
#define glVertexStream1fvATI MANGLE(VertexStream1fvATI)
#define glVertexStream1iATI MANGLE(VertexStream1iATI)
#define glVertexStream1ivATI MANGLE(VertexStream1ivATI)
#define glVertexStream1sATI MANGLE(VertexStream1sATI)
#define glVertexStream1svATI MANGLE(VertexStream1svATI)
#define glVertexStream2dATI MANGLE(VertexStream2dATI)
#define glVertexStream2dvATI MANGLE(VertexStream2dvATI)
#define glVertexStream2fATI MANGLE(VertexStream2fATI)
#define glVertexStream2fvATI MANGLE(VertexStream2fvATI)
#define glVertexStream2iATI MANGLE(VertexStream2iATI)
#define glVertexStream2ivATI MANGLE(VertexStream2ivATI)
#define glVertexStream2sATI MANGLE(VertexStream2sATI)
#define glVertexStream2svATI MANGLE(VertexStream2svATI)
#define glVertexStream3dATI MANGLE(VertexStream3dATI)
#define glVertexStream3dvATI MANGLE(VertexStream3dvATI)
#define glVertexStream3fATI MANGLE(VertexStream3fATI)
#define glVertexStream3fvATI MANGLE(VertexStream3fvATI)
#define glVertexStream3iATI MANGLE(VertexStream3iATI)
#define glVertexStream3ivATI MANGLE(VertexStream3ivATI)
#define glVertexStream3sATI MANGLE(VertexStream3sATI)
#define glVertexStream3svATI MANGLE(VertexStream3svATI)
#define glVertexStream4dATI MANGLE(VertexStream4dATI)
#define glVertexStream4dvATI MANGLE(VertexStream4dvATI)
#define glVertexStream4fATI MANGLE(VertexStream4fATI)
#define glVertexStream4fvATI MANGLE(VertexStream4fvATI)
#define glVertexStream4iATI MANGLE(VertexStream4iATI)
#define glVertexStream4ivATI MANGLE(VertexStream4ivATI)
#define glVertexStream4sATI MANGLE(VertexStream4sATI)
#define glVertexStream4svATI MANGLE(VertexStream4svATI)
#define glVertexStream1d MANGLE(VertexStream1d)
#define glVertexStream1dv MANGLE(VertexStream1dv)
#define glVertexStream1f MANGLE(VertexStream1f)
#define glVertexStream1fv MANGLE(VertexStream1fv)
#define glVertexStream1i MANGLE(VertexStream1i)
#define glVertexStream1iv MANGLE(VertexStream1iv)
#define glVertexStream1s MANGLE(VertexStream1s)
#define glVertexStream1sv MANGLE(VertexStream1sv)
#define glVertexStream2d MANGLE(VertexStream2d)
#define glVertexStream2dv MANGLE(VertexStream2dv)
#define glVertexStream2f MANGLE(VertexStream2f)
#define glVertexStream2fv MANGLE(VertexStream2fv)
#define glVertexStream2i MANGLE(VertexStream2i)
#define glVertexStream2iv MANGLE(VertexStream2iv)
#define glVertexStream2s MANGLE(VertexStream2s)
#define glVertexStream2sv MANGLE(VertexStream2sv)
#define glVertexStream3d MANGLE(VertexStream3d)
#define glVertexStream3dv MANGLE(VertexStream3dv)
#define glVertexStream3f MANGLE(VertexStream3f)
#define glVertexStream3fv MANGLE(VertexStream3fv)
#define glVertexStream3i MANGLE(VertexStream3i)
#define glVertexStream3iv MANGLE(VertexStream3iv)
#define glVertexStream3s MANGLE(VertexStream3s)
#define glVertexStream3sv MANGLE(VertexStream3sv)
#define glVertexStream4d MANGLE(VertexStream4d)
#define glVertexStream4dv MANGLE(VertexStream4dv)
#define glVertexStream4f MANGLE(VertexStream4f)
#define glVertexStream4fv MANGLE(VertexStream4fv)
#define glVertexStream4i MANGLE(VertexStream4i)
#define glVertexStream4iv MANGLE(VertexStream4iv)
#define glVertexStream4s MANGLE(VertexStream4s)
#define glVertexStream4sv MANGLE(VertexStream4sv)
#define glVertexWeightPointerEXT MANGLE(VertexWeightPointerEXT)
#define glVertexWeightfEXT MANGLE(VertexWeightfEXT)
#define glVertexWeightfvEXT MANGLE(VertexWeightfvEXT)
@@ -1129,53 +1027,21 @@
#define glWeightubvARB MANGLE(WeightubvARB)
#define glWeightuivARB MANGLE(WeightuivARB)
#define glWeightusvARB MANGLE(WeightusvARB)
#define glWindowPos2d MANGLE(WindowPos2d)
#define glWindowPos2dARB MANGLE(WindowPos2dARB)
#define glWindowPos2dMESA MANGLE(WindowPos2dMESA)
#define glWindowPos2dv MANGLE(WindowPos2dv)
#define glWindowPos2dvARB MANGLE(WindowPos2dvARB)
#define glWindowPos2dvMESA MANGLE(WindowPos2dvMESA)
#define glWindowPos2f MANGLE(WindowPos2f)
#define glWindowPos2fARB MANGLE(WindowPos2fARB)
#define glWindowPos2fMESA MANGLE(WindowPos2fMESA)
#define glWindowPos2fv MANGLE(WindowPos2fv)
#define glWindowPos2fvARB MANGLE(WindowPos2fvARB)
#define glWindowPos2fvMESA MANGLE(WindowPos2fvMESA)
#define glWindowPos2i MANGLE(WindowPos2i)
#define glWindowPos2iARB MANGLE(WindowPos2iARB)
#define glWindowPos2iMESA MANGLE(WindowPos2iMESA)
#define glWindowPos2iv MANGLE(WindowPos2iv)
#define glWindowPos2ivARB MANGLE(WindowPos2ivARB)
#define glWindowPos2ivMESA MANGLE(WindowPos2ivMESA)
#define glWindowPos2s MANGLE(WindowPos2s)
#define glWindowPos2sARB MANGLE(WindowPos2sARB)
#define glWindowPos2sMESA MANGLE(WindowPos2sMESA)
#define glWindowPos2sv MANGLE(WindowPos2sv)
#define glWindowPos2svARB MANGLE(WindowPos2svARB)
#define glWindowPos2svMESA MANGLE(WindowPos2svMESA)
#define glWindowPos3d MANGLE(WindowPos3d)
#define glWindowPos3dARB MANGLE(WindowPos3dARB)
#define glWindowPos3dMESA MANGLE(WindowPos3dMESA)
#define glWindowPos3dv MANGLE(WindowPos3dv)
#define glWindowPos3dvARB MANGLE(WindowPos3dvARB)
#define glWindowPos3dvMESA MANGLE(WindowPos3dvMESA)
#define glWindowPos3f MANGLE(WindowPos3f)
#define glWindowPos3fARB MANGLE(WindowPos3fARB)
#define glWindowPos3fMESA MANGLE(WindowPos3fMESA)
#define glWindowPos3fv MANGLE(WindowPos3fv)
#define glWindowPos3fvARB MANGLE(WindowPos3fvARB)
#define glWindowPos3fvMESA MANGLE(WindowPos3fvMESA)
#define glWindowPos3i MANGLE(WindowPos3i)
#define glWindowPos3iARB MANGLE(WindowPos3iARB)
#define glWindowPos3iMESA MANGLE(WindowPos3iMESA)
#define glWindowPos3iv MANGLE(WindowPos3iv)
#define glWindowPos3ivARB MANGLE(WindowPos3ivARB)
#define glWindowPos3ivMESA MANGLE(WindowPos3ivMESA)
#define glWindowPos3s MANGLE(WindowPos3s)
#define glWindowPos3sARB MANGLE(WindowPos3sARB)
#define glWindowPos3sMESA MANGLE(WindowPos3sMESA)
#define glWindowPos3sv MANGLE(WindowPos3sv)
#define glWindowPos3svARB MANGLE(WindowPos3svARB)
#define glWindowPos3svMESA MANGLE(WindowPos3svMESA)
#define glWindowPos4dMESA MANGLE(WindowPos4dMESA)
#define glWindowPos4dvMESA MANGLE(WindowPos4dvMESA)
@@ -1186,4 +1052,5 @@
#define glWindowPos4sMESA MANGLE(WindowPos4sMESA)
#define glWindowPos4svMESA MANGLE(WindowPos4svMESA)
#define glWriteMaskEXT MANGLE(WriteMaskEXT)
#endif /* GL_MANGLE_H */

View File

@@ -260,9 +260,6 @@ extern "C" {
#ifndef GLX_MESA_release_buffers
#endif
#ifndef GLX_MESA_agp_offset
#endif
#ifndef GLX_MESA_set_3dfx_mode
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
@@ -571,14 +568,6 @@ extern Bool glXSet3DfxModeMESA (int);
typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
#endif
#ifndef GLX_MESA_agp_offset
#define GLX_MESA_agp_offset 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern GLuint glXGetAGPOffsetMESA (const GLvoid *);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef GLuint ( * PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *);
#endif
#ifndef GLX_SGIX_visual_select_group
#define GLX_SGIX_visual_select_group 1
#endif

View File

@@ -58,12 +58,12 @@ typedef struct __GLinterfaceRec __GLinterface;
** and used by the "operating system".
*/
/*
** Mode and limit information for a context. This information is
** kept around in the context so that values can be used during
** command execution, and for returning information about the
** context to the application.
*/
/**
* Mode and limit information for a context. This information is
* kept around in the context so that values can be used during
* command execution, and for returning information about the
* context to the application.
*/
typedef struct __GLcontextModesRec {
GLboolean rgbMode;
GLboolean colorIndexMode;

24
progs/demos/Makefile Normal file
View File

@@ -0,0 +1,24 @@
PROGS = gears \
glinfo \
morph3d \
texobj
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
# make executable from .c file:
.c: $(LIB_DEP)
gcc -I../include -g $< -L../lib -lglut -lGL -lm -o $@
default: $(PROGS)
clean:
-rm *.o *~

View File

@@ -1,4 +1,4 @@
/* $Id: gloss.c,v 1.6.6.1 2002/11/28 15:52:11 brianp Exp $ */
/* $Id: gloss.c,v 1.6 2000/12/24 22:53:54 pesco Exp $ */
/*
* Specular reflection demo. The specular highlight is modulated by
@@ -85,9 +85,9 @@ static void Display( void )
glCallList(Object);
/* Second pass: specular lighting with reflection texture */
glEnable(GL_POLYGON_OFFSET_FILL);
glBlendFunc(GL_ONE, GL_ONE); /* add */
glEnable(GL_BLEND);
glDepthFunc(GL_LEQUAL);
glMaterialfv(GL_FRONT, GL_DIFFUSE, Black);
glMaterialfv(GL_FRONT, GL_SPECULAR, White);
if (DoSpecTexture) {
@@ -102,7 +102,6 @@ static void Display( void )
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_BLEND);
glDisable(GL_POLYGON_OFFSET_FILL);
glPopMatrix();
@@ -342,8 +341,6 @@ static void Init( int argc, char *argv[] )
glEnable(GL_DEPTH_TEST);
glEnable(GL_NORMALIZE);
glPolygonOffset( -1, -1 );
if (argc > 1 && strcmp(argv[1], "-info")==0) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));

View File

@@ -1,4 +1,4 @@
/* $Id: osdemo.c,v 1.9.4.1 2003/03/03 03:14:55 brianp Exp $ */
/* $Id: osdemo.c,v 1.9 2002/07/12 15:54:19 brianp Exp $ */
/*
* Demo of off-screen Mesa rendering
@@ -139,11 +139,6 @@ static void render_image( void )
glPopMatrix();
/* This is very important!!!
* Make sure buffered commands are finished!!!
*/
glFinish();
Frames++;
if (perf) {
GLint t = glutGet(GLUT_ELAPSED_TIME);

View File

@@ -18,7 +18,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
#define GL_GLEXT_PROTOTYPES
#define GL_GLEXT_LEGACY
#include <GL/glut.h>
/* Some <math.h> files do not define M_PI... */
@@ -264,15 +264,15 @@ menu(int option)
case 0:
makePointList();
break;
#if GL_ARB_point_parameters
#if GL_EXT_point_parameters
case 1:
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, constant);
glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, constant);
break;
case 2:
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, linear);
glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, linear);
break;
case 3:
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, theQuad);
glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, theQuad);
break;
#endif
case 4:
@@ -281,12 +281,12 @@ menu(int option)
case 5:
blend = 0;
break;
#if GL_ARB_point_parameters
#if GL_EXT_point_parameters
case 6:
glPointParameterfARB(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 1.0);
glPointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT, 1.0);
break;
case 7:
glPointParameterfARB(GL_POINT_FADE_THRESHOLD_SIZE_ARB, 10.0);
glPointParameterfEXT(GL_POINT_FADE_THRESHOLD_SIZE_EXT, 10.0);
break;
#endif
case 8:
@@ -468,8 +468,8 @@ main(int argc, char **argv)
glEnable(GL_POINT_SMOOTH);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPointSize(8.0);
#if GL_ARB_point_parameters
glPointParameterfvARB(GL_POINT_DISTANCE_ATTENUATION_ARB, theQuad);
#if GL_EXT_point_parameters
glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, theQuad);
#endif
glMatrixMode(GL_PROJECTION);
gluPerspective( /* field of view in degree */ 40.0,

View File

@@ -1,4 +1,4 @@
/* $Id: winpos.c,v 1.5.4.2 2003/02/28 18:03:45 kschultz Exp $ */
/* $Id: winpos.c,v 1.5 2002/04/22 16:03:37 brianp Exp $ */
/*
* Example of how to use the GL_MESA_window_pos extension.
@@ -12,7 +12,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
#define GL_GLEXT_PROTOTYPES
#define GL_GLEXT_LEGACY
#include "GL/glut.h"
#include "readtex.c" /* a hack, I know */
@@ -30,13 +30,18 @@ static GLubyte *Image;
static int ImgWidth, ImgHeight;
static GLenum ImgFormat;
typedef void (APIENTRY * PFNWINDOWPOSFUNC)(GLfloat x, GLfloat y);
static PFNWINDOWPOSFUNC WindowPosFunc;
static void draw( void )
{
GLfloat angle;
char *extensions;
extensions = (char *) glGetString( GL_EXTENSIONS );
if (strstr( extensions, "GL_MESA_window_pos")==NULL) {
printf("Sorry, GL_MESA_window_pos extension not available.\n");
return;
}
glClear( GL_COLOR_BUFFER_BIT );
@@ -45,14 +50,16 @@ static void draw( void )
GLfloat y = 50.0 + 200.0 * sin( angle * M_PI / 180.0 );
/* Don't need to worry about the modelview or projection matrices!!! */
(*WindowPosFunc)( x, y );
#ifdef GL_MESA_window_pos
glWindowPos2fMESA( x, y );
#endif
glDrawPixels( ImgWidth, ImgHeight, ImgFormat, GL_UNSIGNED_BYTE, Image );
}
glFinish();
}
static void key( unsigned char key, int x, int y )
{
(void) x;
@@ -64,6 +71,7 @@ static void key( unsigned char key, int x, int y )
}
/* new window size or exposure */
static void reshape( int width, int height )
{
@@ -73,24 +81,6 @@ static void reshape( int width, int height )
static void init( void )
{
#ifdef GL_ARB_window_pos
if (glutExtensionSupported("GL_ARB_window_pos")) {
printf("Using GL_ARB_window_pos\n");
WindowPosFunc = &glWindowPos2fARB;
}
else
#elif defined(GL_ARB_window_pos)
if (glutExtensionSupported("GL_MESA_window_pos")) {
printf("Using GL_MESA_window_pos\n");
WindowPosFunc = &glWindowPos2fMESA;
}
else
#endif
{
printf("Sorry, GL_ARB/MESA_window_pos extension not available.\n");
exit(1);
}
Image = LoadRGBImage( IMAGE_FILE, &ImgWidth, &ImgHeight, &ImgFormat );
if (!Image) {
printf("Couldn't read %s\n", IMAGE_FILE);
@@ -100,6 +90,7 @@ static void init( void )
}
int main( int argc, char *argv[] )
{
glutInitWindowPosition(0, 0);

View File

@@ -1,86 +1,36 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP samples makefile v1.3 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@yahoo.com
# Web : http://www.geocities.com/dborca
#
# Available options:
#
# Environment variables:
# CPU optimize for the given processor.
# default = k6
# GLIDE path to Glide3 SDK library files; used with FX.
# default = $(TOP)/lib/glide3
# FX=1 build for 3dfx Glide3. Note that this disables
# compilation of most DMesa code and requires fxMesa.
# As a consequence, you'll need the DJGPP Glide3
# library to build any application.
# default = no
# DXE=1 use DXE modules. The resolution object file must be
# present in the `lib' directory in order to use this
# option (see README.DJ for details).
# default = no
#
# Targets:
# <file.exe> build a specific file
#
.PHONY : all
.SUFFIXES : .c .o .exe
TOP = ..
CPU ?= k6
GLIDE ?= $(TOP)/lib/glide3
CC = gcc
CFLAGS = -Wall -W -pedantic
CFLAGS += -O2 -ffast-math -mcpu=$(CPU)
CFLAGS += -I$(TOP)/include
LD = gxx
LDFLAGS = -s -L$(TOP)/lib
ifeq ($(DXE),1)
DXE3TABLE = $(TOP)/lib/dxe3tbl.o
LDLIBS += -liglut -liglu -ligl -ldl
else
LDLIBS = -lglut -lglu -lgl
ifeq ($(FX),1)
LDFLAGS += -L$(GLIDE)
LDLIBS += -lglid3
endif
endif
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.o.exe:
$(LD) -o $@ $(LDFLAGS) $(DXE3TABLE) $< $(LDLIBS)
all:
$(error Must specify <filename.exe> to build)
# $Id: Makefile.DJ,v 1.1 1999/08/19 00:55:41 jtg Exp $
# Makefile for sample programs for MS-DOS with DJGPP
##### MACROS #####
INCDIR = ../include
GL_LIBS = ../lib/dosglut.a ../lib/dosglub.a ../lib/dosmesa.a
LIB_DEP = $(GL_LIBS)
PROGS = accum bitmap1 bitmap2 blendeq blendxor copy depth \
eval fog font line logo nurb olympic \
point prim quad select shape \
sphere star stencil stretch texture \
tri wave
##### RULES #####
.c: $(LIB_DEP)
gcc -I$(INCDIR) $(CFLAGS) $< $(LIB_DEP) -o $@
##### TARGETS #####
default: $(PROGS)
clean:
del *.
realclean: clean
del *.exe

View File

@@ -256,30 +256,18 @@ int main(int argc, char **argv)
{
int width, height;
GLubyte *data;
char buff[32];
int n;
FILE *fo;
if (argc != 3)
if (argc != 2)
{
fprintf(stderr, "usage: %s <infile.rgb> <outfile.p6>\n", argv[0]);
fprintf(stderr, "usage: %s <filename>\n", argv[0]);
return 1;
}
data = read_rgb_texture(argv[1], &width, &height);
n = sprintf(buff, "P6\n%d %d\n255\n", width, height);
/* [dBorca] avoid LF to CRLF conversion */
if ((fo = fopen(argv[2], "wb")) == NULL) {
fprintf(stderr, "Cannot open output file!\n");
exit(1);
}
fwrite(buff, n, 1, fo);
fwrite(data, width * 3, height, fo);
fclose(fo);
printf("P6\n%d %d\n255\n", width, height);
fwrite(data, width * 3, height, stdout);
return 0;
}

View File

@@ -6,26 +6,9 @@
CC = gcc
CFLAGS = -g -I../include
LIBS = -L../lib -lglut -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXext -lm
LIBS = -L../lib -lGL -lm
PROGS = antialias \
cva \
dinoshade \
fogcoord \
getprocaddress \
manytex \
multipal \
projtex \
seccolor \
sharedtex \
stencilwrap \
texline \
texwrap \
vptest1 \
vptest2 \
vptest3 \
vptorus \
vpwarpmesh
PROGS = miniglxtest miniglxsample
##### RULES #####
@@ -45,10 +28,3 @@ clean:
rm -f $(PROGS)
rm -f *.o
# auto code generation
getprocaddress: getprocaddress.c getproclist.h
getproclist.h: ../bin/APIspec getprocaddress.c getprocaddress.py
python getprocaddress.py > getproclist.h

View File

@@ -1,4 +1,4 @@
/* $Id: cva.c,v 1.4.4.1 2003/01/28 15:31:49 brianp Exp $ */
/* $Id: cva.c,v 1.4 2002/01/16 01:03:25 kschultz Exp $ */
/*
* Trivial CVA test, good for testing driver fastpaths (especially
@@ -133,9 +133,7 @@ int main( int argc, char **argv )
*/
string = (char *) glGetString( GL_VERSION );
if ( !strstr(string, "1.2") &&
!strstr(string, "1.3") &&
!strstr(string, "1.4")) {
if ( (!strstr( string, "1.2" ))&&(!strstr(string,"1.3"))) {
fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" );
exit( -1 );
}

478
progs/tests/glfbdevtest.c Normal file
View File

@@ -0,0 +1,478 @@
/* $Id: glfbdevtest.c,v 1.1.4.5 2002/11/27 00:26:59 brianp Exp $ */
/*
* Test the GLFBDev interface. Only tested with radeonfb driver!!!!
*/
#include <assert.h>
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <linux/fb.h>
#include <linux/kd.h>
#include <linux/vt.h>
#include <GL/glut.h>
#include "GL/glfbdev.h"
#define DEFAULT_DEPTH 8
static struct fb_fix_screeninfo FixedInfo;
static struct fb_var_screeninfo VarInfo, OrigVarInfo;
static int DesiredDepth = 0;
static int OriginalVT = -1;
static int ConsoleFD = -1;
static int FrameBufferFD = -1;
static caddr_t FrameBuffer = (caddr_t) -1;
static caddr_t MMIOAddress = (caddr_t) -1;
static void
print_fixed_info(const struct fb_fix_screeninfo *fixed, const char *s)
{
static const char *visuals[] = {
"MONO01", "MONO10", "TRUECOLOR", "PSEUDOCOLOR",
"DIRECTCOLOR", "STATIC_PSEUDOCOLOR"
};
printf("%s info -----------------------\n", s);
printf("id = %16s\n", fixed->id);
printf("smem_start = 0x%x\n", fixed->smem_start);
printf("smem_len = %d (0x%x)\n", fixed->smem_len, fixed->smem_len);
printf("type = 0x%x\n", fixed->type);
printf("type_aux = 0x%x\n", fixed->type_aux);
printf("visual = 0x%x (%s)\n", fixed->visual, visuals[fixed->visual]);
printf("xpanstep = %d\n", fixed->xpanstep);
printf("ypanstep = %d\n", fixed->ypanstep);
printf("ywrapstep = %d\n", fixed->ywrapstep);
printf("line_length = %d\n", fixed->line_length);
printf("mmio_start = 0x%x\n", fixed->mmio_start);
printf("mmio_len = %d (0x%x)\n", fixed->mmio_len, fixed->mmio_len);
printf("accel = 0x%x\n", fixed->accel);
}
static void
print_var_info(const struct fb_var_screeninfo *var, const char *s)
{
printf("%s info -----------------------\n", s);
printf("xres = %d\n", var->xres);
printf("yres = %d\n", var->yres);
printf("xres_virtual = %d\n", var->xres_virtual);
printf("yres_virtual = %d\n", var->yres_virtual);
printf("xoffset = %d\n", var->xoffset);
printf("yoffset = %d\n", var->yoffset);
printf("bits_per_pixel = %d\n", var->bits_per_pixel);
printf("grayscale = %d\n", var->grayscale);
printf("red.offset = %d length = %d msb_right = %d\n",
var->red.offset, var->red.length, var->red.msb_right);
printf("green.offset = %d length = %d msb_right = %d\n",
var->green.offset, var->green.length, var->green.msb_right);
printf("blue.offset = %d length = %d msb_right = %d\n",
var->blue.offset, var->blue.length, var->blue.msb_right);
printf("transp.offset = %d length = %d msb_right = %d\n",
var->transp.offset, var->transp.length, var->transp.msb_right);
printf("nonstd = %d\n", var->nonstd);
printf("activate = %d\n", var->activate);
printf("height = %d mm\n", var->height);
printf("width = %d mm\n", var->width);
printf("accel_flags = 0x%x\n", var->accel_flags);
printf("pixclock = %d\n", var->pixclock);
printf("left_margin = %d\n", var->left_margin);
printf("right_margin = %d\n", var->right_margin);
printf("upper_margin = %d\n", var->upper_margin);
printf("lower_margin = %d\n", var->lower_margin);
printf("hsync_len = %d\n", var->hsync_len);
printf("vsync_len = %d\n", var->vsync_len);
printf("sync = %d\n", var->sync);
printf("vmode = %d\n", var->vmode);
}
static void
signal_handler(int signumber)
{
signal(signumber, SIG_IGN); /* prevent recursion! */
fprintf(stderr, "error: got signal %d (exiting)\n", signumber);
exit(1);
}
static void
initialize_fbdev( void )
{
char ttystr[1000];
int fd, vtnumber, ttyfd;
int sz;
if (geteuid()) {
fprintf(stderr, "error: you need to be root\n");
exit(1);
}
#if 1
/* open the framebuffer device */
FrameBufferFD = open("/dev/fb0", O_RDWR);
if (FrameBufferFD < 0) {
fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
exit(1);
}
#endif
/* open /dev/tty0 and get the vt number */
if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) {
fprintf(stderr, "error opening /dev/tty0\n");
exit(1);
}
if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) {
fprintf(stderr, "error: couldn't get a free vt\n");
exit(1);
}
close(fd);
/* open the console tty */
sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */
ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0);
if (ConsoleFD < 0) {
fprintf(stderr, "error couldn't open console fd\n");
exit(1);
}
/* save current vt number */
{
struct vt_stat vts;
if (ioctl(ConsoleFD, VT_GETSTATE, &vts) == 0)
OriginalVT = vts.v_active;
}
/* disconnect from controlling tty */
ttyfd = open("/dev/tty", O_RDWR);
if (ttyfd >= 0) {
ioctl(ttyfd, TIOCNOTTY, 0);
close(ttyfd);
}
/* some magic to restore the vt when we exit */
{
struct vt_mode vt;
if (ioctl(ConsoleFD, VT_ACTIVATE, vtnumber) != 0)
printf("ioctl VT_ACTIVATE: %s\n", strerror(errno));
if (ioctl(ConsoleFD, VT_WAITACTIVE, vtnumber) != 0)
printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno));
if (ioctl(ConsoleFD, VT_GETMODE, &vt) < 0) {
fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno));
exit(1);
}
vt.mode = VT_PROCESS;
vt.relsig = SIGUSR1;
vt.acqsig = SIGUSR1;
if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) {
fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n",
strerror(errno));
exit(1);
}
}
/* go into graphics mode */
if (ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) {
fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n",
strerror(errno));
exit(1);
}
#if 0
/* open the framebuffer device */
FrameBufferFD = open("/dev/fb0", O_RDWR);
if (FrameBufferFD < 0) {
fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
exit(1);
}
#endif
/* Get the fixed screen info */
if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) {
fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
strerror(errno));
exit(1);
}
print_fixed_info(&FixedInfo, "Fixed");
/* get the variable screen info */
if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) {
fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
strerror(errno));
exit(1);
}
print_var_info(&OrigVarInfo, "Orig Var");
/* operate on a copy */
VarInfo = OrigVarInfo;
/* set the depth, resolution, etc */
DesiredDepth = 32;
if (DesiredDepth)
VarInfo.bits_per_pixel = DesiredDepth;
if (VarInfo.bits_per_pixel == 16) {
VarInfo.red.offset = 11;
VarInfo.green.offset = 5;
VarInfo.blue.offset = 0;
VarInfo.red.length = 5;
VarInfo.green.length = 6;
VarInfo.blue.length = 5;
VarInfo.transp.offset = 0;
VarInfo.transp.length = 0;
}
else if (VarInfo.bits_per_pixel == 32) {
VarInfo.red.offset = 16;
VarInfo.green.offset = 8;
VarInfo.blue.offset = 0;
VarInfo.transp.offset = 24;
VarInfo.red.length = 8;
VarInfo.green.length = 8;
VarInfo.blue.length = 8;
VarInfo.transp.length = 8;
}
/* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */
VarInfo.xres_virtual = VarInfo.xres = 1280;
VarInfo.yres_virtual = VarInfo.yres = 1024;
VarInfo.pixclock = 7408;
VarInfo.left_margin = 248;
VarInfo.right_margin = 16;
VarInfo.upper_margin = 38;
VarInfo.lower_margin = 1;
VarInfo.hsync_len = 144;
VarInfo.vsync_len = 3;
VarInfo.xoffset = 0;
VarInfo.yoffset = 0;
VarInfo.nonstd = 0;
VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */
/* set new variable screen info */
if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) {
fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
strerror(errno));
exit(1);
}
print_var_info(&VarInfo, "New Var");
if (FixedInfo.visual != FB_VISUAL_TRUECOLOR &&
FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) {
fprintf(stderr, "non-TRUE/DIRECT-COLOR visuals (0x%x) not supported by this demo.\n", FixedInfo.visual);
exit(1);
}
/* initialize colormap */
if (FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) {
struct fb_cmap cmap;
unsigned short red[256], green[256], blue[256];
int i;
/* we're assuming 256 entries here */
printf("initializing directcolor colormap\n");
cmap.start = 0;
cmap.len = 256;
cmap.red = red;
cmap.green = green;
cmap.blue = blue;
cmap.transp = NULL;
for (i = 0; i < cmap.len; i++) {
red[i] = green[i] = blue[i] = (i << 8) | i;
}
if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) {
fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i);
}
}
/*
* fbdev says the frame buffer is at offset zero, and the mmio region
* is immediately after.
*/
/* mmap the framebuffer into our address space */
FrameBuffer = (caddr_t) mmap(0, /* start */
FixedInfo.smem_len, /* bytes */
PROT_READ | PROT_WRITE, /* prot */
MAP_SHARED, /* flags */
FrameBufferFD, /* fd */
0 /* offset */);
if (FrameBuffer == (caddr_t) - 1) {
fprintf(stderr, "error: unable to mmap framebuffer: %s\n",
strerror(errno));
exit(1);
}
printf("FrameBuffer = %p\n", FrameBuffer);
#if 1
/* mmap the MMIO region into our address space */
MMIOAddress = (caddr_t) mmap(0, /* start */
FixedInfo.mmio_len, /* bytes */
PROT_READ | PROT_WRITE, /* prot */
MAP_SHARED, /* flags */
FrameBufferFD, /* fd */
FixedInfo.smem_len /* offset */);
if (MMIOAddress == (caddr_t) - 1) {
fprintf(stderr, "error: unable to mmap mmio region: %s\n",
strerror(errno));
}
printf("MMIOAddress = %p\n", MMIOAddress);
/* try out some simple MMIO register reads */
if (1)
{
typedef unsigned int CARD32;
typedef unsigned char CARD8;
#define RADEON_CONFIG_MEMSIZE 0x00f8
#define RADEON_MEM_SDRAM_MODE_REG 0x0158
#define MMIO_IN32(base, offset) \
*(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset))
#define INREG(addr) MMIO_IN32(MMIOAddress, addr)
int sz, type;
const char *typeStr[] = {"SDR", "DDR", "64-bit SDR"};
sz = INREG(RADEON_CONFIG_MEMSIZE);
type = INREG(RADEON_MEM_SDRAM_MODE_REG);
printf("RADEON_CONFIG_MEMSIZE = %d (%d MB)\n", sz, sz / 1024 / 1024);
printf("RADEON_MEM_SDRAM_MODE_REG >> 30 = %d (%s)\n",
type >> 30, typeStr[type>>30]);
}
#endif
}
static void
shutdown_fbdev( void )
{
struct vt_mode VT;
printf("cleaning up...\n");
/* restore original variable screen info */
if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) {
fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
strerror(errno));
exit(1);
}
munmap(MMIOAddress, FixedInfo.mmio_len);
munmap(FrameBuffer, FixedInfo.smem_len);
close(FrameBufferFD);
/* restore text mode */
ioctl(ConsoleFD, KDSETMODE, KD_TEXT);
/* set vt */
if (ioctl(ConsoleFD, VT_GETMODE, &VT) != -1) {
VT.mode = VT_AUTO;
ioctl(ConsoleFD, VT_SETMODE, &VT);
}
/* restore original vt */
if (OriginalVT >= 0) {
ioctl(ConsoleFD, VT_ACTIVATE, OriginalVT);
OriginalVT = -1;
}
close(ConsoleFD);
}
static void
gltest( void )
{
static const int attribs[] = {
GLFBDEV_DOUBLE_BUFFER,
GLFBDEV_DEPTH_SIZE, 16,
GLFBDEV_NONE
};
GLFBDevContextPtr ctx;
GLFBDevBufferPtr buf;
GLFBDevVisualPtr vis;
int bytes, r, g, b, a;
float ang;
printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR));
printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION));
/* framebuffer size */
bytes = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8;
vis = glFBDevCreateVisual( &FixedInfo, &VarInfo, attribs );
assert(vis);
buf = glFBDevCreateBuffer( &FixedInfo, &VarInfo, vis, FrameBuffer, NULL, bytes );
assert(buf);
ctx = glFBDevCreateContext( vis, NULL );
assert(buf);
b = glFBDevMakeCurrent( ctx, buf, buf );
assert(b);
/*printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));*/
glGetIntegerv(GL_RED_BITS, &r);
glGetIntegerv(GL_GREEN_BITS, &g);
glGetIntegerv(GL_BLUE_BITS, &b);
glGetIntegerv(GL_ALPHA_BITS, &a);
printf("RED_BITS=%d GREEN_BITS=%d BLUE_BITS=%d ALPHA_BITS=%d\n",
r, g, b, a);
glClearColor(0.5, 0.5, 1.0, 0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1, 1, -1, 1, 2, 30);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0, 0, -15);
glViewport(0, 0, VarInfo.xres_virtual, VarInfo.yres_virtual);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
for (ang = 0; ang <= 180; ang += 15) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glRotatef(ang, 1, 0, 0);
glutSolidTorus(1, 3, 40, 20);
glPopMatrix();
glFBDevSwapBuffers(buf);
}
/* clean up */
b = glFBDevMakeCurrent( NULL, NULL, NULL);
assert(b);
glFBDevDestroyContext(ctx);
glFBDevDestroyBuffer(buf);
glFBDevDestroyVisual(vis);
}
int
main( int argc, char *argv[] )
{
signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */
signal(SIGSEGV, signal_handler); /* catch segfaults */
initialize_fbdev();
gltest();
shutdown_fbdev();
return 0;
}

184
progs/tests/miniglxtest.c Normal file
View File

@@ -0,0 +1,184 @@
/* $Id: miniglxtest.c,v 1.1.4.6 2003/01/20 11:25:50 keithw Exp $ */
/*
* Test the mini GLX interface.
*/
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#define USE_MINI_GLX 1
#if USE_MINI_GLX
#include <GL/miniglx.h>
#else
#include <GL/glx.h>
#endif
#define FRONTBUFFER 1
#define NR 6
#define DO_SLEEPS 1
#define NR_DISPLAYS 2
GLXContext ctx;
static void redraw( Display *dpy, Window w, int rot )
{
printf("Redraw event\n");
#if FRONTBUFFER
glDrawBuffer( GL_FRONT );
#else
/* glDrawBuffer( GL_BACK ); */
#endif
glClearColor( rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX,
1);
glClear( GL_COLOR_BUFFER_BIT );
#if 1
glColor3f( rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX );
glPushMatrix();
glRotatef(rot, 0, 0, 1);
glScalef(.5, .5, .5);
glRectf( -1, -1, 1, 1 );
glPopMatrix();
#endif
#if FRONTBUFFER
glFlush();
#else
glXSwapBuffers( dpy, w );
#endif
glFinish();
}
static Window make_rgb_db_window( Display *dpy,
unsigned int width, unsigned int height )
{
int attrib[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
#if !FRONT_BUFFER
GLX_DOUBLEBUFFER,
#endif
None };
int scrnum;
XSetWindowAttributes attr;
unsigned long mask;
Window root;
Window win;
XVisualInfo *visinfo;
scrnum = 0;
root = RootWindow( dpy, scrnum );
visinfo = glXChooseVisual( dpy, scrnum, attrib );
if (!visinfo) {
printf("Error: couldn't get an RGB, Double-buffered visual\n");
exit(1);
}
ctx = glXCreateContext( dpy, visinfo, NULL, True );
if (!ctx) {
printf("Error: glXCreateContext failed\n");
exit(1);
}
/* window attributes */
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr );
if (!win) {
printf("Error: XCreateWindow failed\n");
exit(1);
}
glXMakeCurrent( dpy, win, ctx );
return win;
}
static void event_loop( Display *dpy, Window win )
{
int i;
printf("Hang on... drawing %d frames\n", NR);
for (i = 0; i < NR; i++) {
redraw( dpy, win, i*10 );
if (DO_SLEEPS) {
printf("sleep(1)\n");
sleep(1);
}
}
}
int foo( )
{
Display *dpy;
Window win;
dpy = XOpenDisplay(NULL);
if (!dpy) {
printf("Error: XOpenDisplay failed\n");
return 1;
}
win = make_rgb_db_window( dpy, 800, 600);
srand(getpid());
glShadeModel( GL_FLAT );
glClearColor( 0.5, 0.5, 0.5, 1.0 );
XMapWindow( dpy, win );
#if !USE_MINI_GLX
{
XEvent e;
while (1) {
XNextEvent( dpy, &e );
if (e.type == MapNotify && e.xmap.window == win) {
break;
}
}
}
#endif
event_loop( dpy, win );
glXDestroyContext( dpy, ctx );
XDestroyWindow( dpy, win );
XCloseDisplay( dpy );
return 0;
}
int main()
{
int i;
for (i = 0 ; i < NR_DISPLAYS ; i++) {
if (foo() != 0)
break;
}
return 0;
}

View File

@@ -1,4 +1,4 @@
/* $Id: texwrap.c,v 1.4.2.1 2003/02/04 02:34:42 brianp Exp $ */
/* $Id: texwrap.c,v 1.4 2002/10/18 17:47:36 kschultz Exp $ */
/*
* Test texture wrap modes.
@@ -119,7 +119,7 @@ static void Display( void )
#if 0
/* draw texture as image */
glDisable(GL_TEXTURE_2D);
glWindowPos2iARB(1, 1);
glWindowPos2iMESA(1, 1);
glDrawPixels(6, 6, GL_RGBA, GL_UNSIGNED_BYTE, (void *) TexImage);
#endif
@@ -183,7 +183,7 @@ static void Display( void )
offset = 0;
for (i = 0; i < modes[i].mode != 0; i++) {
if ( modes[i].supported ) {
glWindowPos2iARB( offset * 150 + 10, 5 + ((offset & 1) * 15) );
glWindowPos2iMESA( offset * 150 + 10, 5 + ((offset & 1) * 15) );
PrintString(modes[i].name);
offset++;
}

35
progs/xdemos/Makefile Normal file
View File

@@ -0,0 +1,35 @@
# Simple makefile for compiling test programs on Linux
# These programs aren't intended to be included with the normal
# distro. They're not too interesting but they're good for testing.
CC = gcc
CFLAGS = -g -I../include
LIBS = -L../lib -lGL -lm
PROGS = glxgears
##### RULES #####
.SUFFIXES:
.SUFFIXES: .c
.c:
$(CC) $(CFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
default: $(PROGS)
clean:
rm -f $(PROGS)
rm -f *.o

View File

@@ -33,10 +33,16 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/gl.h>
#define USE_MINI_GLX 1
#if USE_MINI_GLX
#include <GL/miniglx.h>
#else
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <GL/gl.h>
#include <GL/glx.h>
#endif
#define BENCHMARK
@@ -346,13 +352,18 @@ make_window( Display *dpy, const char *name,
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
attr.event_mask = StructureNotifyMask | ExposureMask
#if !USE_MINI_GLX
| KeyPressMask
#endif
;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr );
#if !USE_MINI_GLX
/* set hints and properties */
{
XSizeHints sizehints;
@@ -365,6 +376,7 @@ make_window( Display *dpy, const char *name,
XSetStandardProperties(dpy, win, name, name,
None, (char **)NULL, 0, &sizehints);
}
#endif
ctx = glXCreateContext( dpy, visinfo, NULL, True );
if (!ctx) {
@@ -382,7 +394,12 @@ make_window( Display *dpy, const char *name,
static void
event_loop(Display *dpy, Window win)
{
#if USE_MINI_GLX
reshape(300, 300);
#endif
while (1) {
#if !USE_MINI_GLX
while (XPending(dpy) > 0) {
XEvent event;
XNextEvent(dpy, &event);
@@ -421,6 +438,7 @@ event_loop(Display *dpy, Window win)
}
}
}
#endif
/* next frame */
angle += 2.0;

View File

@@ -20,7 +20,7 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glu makefile v1.3 for Mesa
# DOS/DJGPP glu makefile v1.1 for Mesa 4.0
#
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@yahoo.com
@@ -52,16 +52,14 @@ CC = gcc
CFLAGS += -I$(TOP)/include
AR = ar
ARFLAGS = rus
ARFLAGS = ru
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
ifneq ($(wildcard $(DJDIR)/lib/dxe2.ld),)
DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH))))
endif
RM = del
CORE_SOURCES = \
glu.c \
mipmap.c \
@@ -80,7 +78,7 @@ SOURCES = $(CORE_SOURCES)
OBJECTS = $(SOURCES:.c=.o)
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
$(CC) -o $@ -c $(CFLAGS) $<
all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
@@ -88,13 +86,14 @@ $(LIBDIR)/$(GLU_LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS)
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLU_DXE))
ifeq ($(DXE2GEN),)
$(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
$(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
else
-dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU DJGPP" -E _glu -P gl.dxe -U $(OBJECTS)
-dxe2gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) $(OBJECTS) -E djgpp_ -E glu -D "Mesa DJGPP GLU" -U
endif
clean:
-$(call UNLINK,*.o)
-$(RM) $(subst /,\,*.o)
-include depend

View File

@@ -1,188 +0,0 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glu makefile v1.3 for Mesa
#
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@yahoo.com
# Web : http://www.geocities.com/dborca
#
# Available options:
#
# Environment variables:
# CFLAGS
#
# Targets:
# all: build GLU
# clean: remove object files
#
.PHONY: all clean
TOP = ..
LIBDIR = $(TOP)/lib
GLU_LIB = libglu.a
GLU_DXE = glu.dxe
GLU_IMP = libiglu.a
CC = gcc
CFLAGS += -DNDEBUG -DLIBRARYBUILD -I$(TOP)/include -Iinclude
CXX = gpp
CXXFLAGS = $(CFLAGS) -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess
AR = ar
ARFLAGS = rus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
endif
C_SOURCES = \
libutil/error.c \
libutil/glue.c \
libutil/mipmap.c \
libutil/project.c \
libutil/quad.c \
libutil/registry.c \
libtess/dict.c \
libtess/geom.c \
libtess/memalloc.c \
libtess/mesh.c \
libtess/normal.c \
libtess/priorityq.c \
libtess/render.c \
libtess/sweep.c \
libtess/tess.c \
libtess/tessmono.c
CC_SOURCES = \
libnurbs/interface/bezierEval.cc \
libnurbs/interface/bezierPatch.cc \
libnurbs/interface/bezierPatchMesh.cc \
libnurbs/interface/glcurveval.cc \
libnurbs/interface/glinterface.cc \
libnurbs/interface/glrenderer.cc \
libnurbs/interface/glsurfeval.cc \
libnurbs/interface/incurveeval.cc \
libnurbs/interface/insurfeval.cc \
libnurbs/internals/arc.cc \
libnurbs/internals/arcsorter.cc \
libnurbs/internals/arctess.cc \
libnurbs/internals/backend.cc \
libnurbs/internals/basiccrveval.cc \
libnurbs/internals/basicsurfeval.cc \
libnurbs/internals/bin.cc \
libnurbs/internals/bufpool.cc \
libnurbs/internals/cachingeval.cc \
libnurbs/internals/ccw.cc \
libnurbs/internals/coveandtiler.cc \
libnurbs/internals/curve.cc \
libnurbs/internals/curvelist.cc \
libnurbs/internals/curvesub.cc \
libnurbs/internals/dataTransform.cc \
libnurbs/internals/displaylist.cc \
libnurbs/internals/flist.cc \
libnurbs/internals/flistsorter.cc \
libnurbs/internals/hull.cc \
libnurbs/internals/intersect.cc \
libnurbs/internals/knotvector.cc \
libnurbs/internals/mapdesc.cc \
libnurbs/internals/mapdescv.cc \
libnurbs/internals/maplist.cc \
libnurbs/internals/mesher.cc \
libnurbs/internals/monoTriangulationBackend.cc \
libnurbs/internals/monotonizer.cc \
libnurbs/internals/mycode.cc \
libnurbs/internals/nurbsinterfac.cc \
libnurbs/internals/nurbstess.cc \
libnurbs/internals/patch.cc \
libnurbs/internals/patchlist.cc \
libnurbs/internals/quilt.cc \
libnurbs/internals/reader.cc \
libnurbs/internals/renderhints.cc \
libnurbs/internals/slicer.cc \
libnurbs/internals/sorter.cc \
libnurbs/internals/splitarcs.cc \
libnurbs/internals/subdivider.cc \
libnurbs/internals/tobezier.cc \
libnurbs/internals/trimline.cc \
libnurbs/internals/trimregion.cc \
libnurbs/internals/trimvertpool.cc \
libnurbs/internals/uarray.cc \
libnurbs/internals/varray.cc \
libnurbs/nurbtess/directedLine.cc \
libnurbs/nurbtess/gridWrap.cc \
libnurbs/nurbtess/monoChain.cc \
libnurbs/nurbtess/monoPolyPart.cc \
libnurbs/nurbtess/monoTriangulation.cc \
libnurbs/nurbtess/partitionX.cc \
libnurbs/nurbtess/partitionY.cc \
libnurbs/nurbtess/polyDBG.cc \
libnurbs/nurbtess/polyUtil.cc \
libnurbs/nurbtess/primitiveStream.cc \
libnurbs/nurbtess/quicksort.cc \
libnurbs/nurbtess/rectBlock.cc \
libnurbs/nurbtess/sampleComp.cc \
libnurbs/nurbtess/sampleCompBot.cc \
libnurbs/nurbtess/sampleCompRight.cc \
libnurbs/nurbtess/sampleCompTop.cc \
libnurbs/nurbtess/sampleMonoPoly.cc \
libnurbs/nurbtess/sampledLine.cc \
libnurbs/nurbtess/searchTree.cc
SOURCES = $(C_SOURCES) $(CC_SOURCES)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.cc.o:
$(CXX) -o $@ $(CXXFLAGS) -c $<
all: $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP)
$(LIBDIR)/$(GLU_LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $(LIBDIR)/$(GLU_LIB) $(OBJECTS)
$(LIBDIR)/$(GLU_DXE) $(LIBDIR)/$(GLU_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLU_DXE))
else
-dxe3gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) -D "MesaGLU/SGI DJGPP" -E _glu -P gl.dxe -U $(OBJECTS)
endif
clean:
-$(call UNLINK,libutil/*.o)
-$(call UNLINK,libtess/*.o)
-$(call UNLINK,libnurbs/interface/*.o)
-$(call UNLINK,libnurbs/internals/*.o)
-$(call UNLINK,libnurbs/nurbtess/*.o)
-include depend

View File

@@ -1,7 +1,7 @@
/*
** gluos.h - operating system dependencies for GLU
**
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/include/gluos.h,v 1.4.4.1 2003/02/12 16:04:45 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/include/gluos.h,v 1.4 2002/10/04 15:58:33 kschultz Exp $
*/
#ifdef __VMS
#ifdef __cplusplus
@@ -37,13 +37,6 @@
#pragma comment(linker, "/OPT:NOWIN98")
#endif
#elif defined(__OS2__)
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#define WINGDIAPI
#else
/* Disable Microsoft-specific keywords */

View File

@@ -20,7 +20,7 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glut makefile v1.3 for Mesa
# DOS/DJGPP glut makefile v1.1 for Mesa 4.0
#
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@yahoo.com
@@ -33,7 +33,14 @@
# Environment variables:
# CFLAGS
#
# MKGLUT absolute path to original GLUT.
# GLIDE absolute path to Glide SDK; used with FX.
# default = $(TOP)/include/glide3
# FX=1 build for 3dfx Glide3; use it if you have the glide
# SDK (designed for your platform), and, of course, a
# 3dfx card... Note that this disables compilation of
# actual DMesa code, as Glide does all the stuff!
# default = no
# MARK absolute path to original GLUT.
# default = $(TOP)/src-glut
#
# Targets:
@@ -47,35 +54,38 @@
TOP = ..
GLIDE ?= $(TOP)/include/glide3
MKGLUT ?= $(TOP)/src-glut
MARK ?= $(TOP)/src-glut
LIBDIR = $(TOP)/lib
GLUT_LIB = libglut.a
GLUT_DXE = glut.dxe
GLUT_IMP = libiglut.a
CC = gcc
CFLAGS += -I- -I$(TOP)/include -I. -I$(MKGLUT) -IPC_HW
AR = ar
ARFLAGS = rus
HAVEDXE3 = $(wildcard $(DJDIR)/bin/dxe3gen.exe)
ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),)
UNLINK = del $(subst /,\,$(1))
else
UNLINK = $(RM) $(1)
CFLAGS += -I$(TOP)/include -I$(MARK)
ifdef FX
CFLAGS += -D__DOS__ -I$(GLIDE) -DFX -DFX_GLIDE3 -DFXMESA_USE_ARGB
endif
AR = ar
ARFLAGS = ru
ifneq ($(wildcard $(DJDIR)/lib/dxe2.ld),)
DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH))))
endif
RM = del
CORE_SOURCES = \
bitmap.c \
callback.c \
color.c \
extens.c \
globals.c \
init.c \
menu.c \
mouse.c \
models.c \
overlay.c \
state.c \
teapot.c \
window.c
PC_HW_SOURCES = \
@@ -85,34 +95,25 @@ PC_HW_SOURCES = \
PC_HW/pc_timer.c \
PC_HW/pc_irq.S
MKGLUT_SOURCES = \
$(MKGLUT)/glut_bitmap.c \
$(MKGLUT)/glut_bwidth.c \
$(MKGLUT)/glut_stroke.c \
$(MKGLUT)/glut_swidth.c \
$(MKGLUT)/glut_shapes.c \
$(MKGLUT)/glut_teapot.c \
$(MKGLUT)/glut_8x13.c \
$(MKGLUT)/glut_9x15.c \
$(MKGLUT)/glut_hel10.c \
$(MKGLUT)/glut_hel12.c \
$(MKGLUT)/glut_hel18.c \
$(MKGLUT)/glut_tr10.c \
$(MKGLUT)/glut_tr24.c \
$(MKGLUT)/glut_roman.c \
$(MKGLUT)/glut_mroman.c \
$(MKGLUT)/glut_util.c
MARK_SOURCES = \
$(MARK)/glut_8x13.c \
$(MARK)/glut_9x15.c \
$(MARK)/glut_hel10.c \
$(MARK)/glut_hel12.c \
$(MARK)/glut_hel18.c \
$(MARK)/glut_tr10.c \
$(MARK)/glut_tr24.c
SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MKGLUT_SOURCES)
SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES) $(MARK_SOURCES)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
$(CC) -o $@ -c $(CFLAGS) $<
.S.o:
$(CC) -o $@ $(CFLAGS) -c $<
$(CC) -o $@ -c $(CFLAGS) $<
.s.o:
$(CC) -o $@ $(CFLAGS) -x assembler-with-cpp -c $<
$(CC) -o $@ -c $(CFLAGS) -x assembler-with-cpp $<
all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
@@ -120,15 +121,16 @@ $(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS)
$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
ifeq ($(HAVEDXE3),)
$(warning Missing DXE3 package... Skipping $(GLUT_DXE))
ifeq ($(DXE2GEN),)
$(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
$(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
else
-dxe3gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) -D "MesaGLUT DJGPP" -E _glut -P gl.dxe -P glu.dxe -U $(OBJECTS)
-dxe2gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) $(OBJECTS) -E djgpp_ -E glut -D "Mesa DJGPP GLUT" -U
endif
clean:
-$(call UNLINK,*.o)
-$(call UNLINK,PC_HW/*.o)
-$(call UNLINK,$(MKGLUT)/*.o)
-$(RM) $(subst /,\,*.o)
-$(RM) $(subst /,\,PC_HW/*.o)
-$(RM) $(subst /,\,$(MARK)/*.o)
-include depend

View File

@@ -1,5 +1,5 @@
/*
* PC/HW routine collection v1.3 for DOS/DJGPP
* PC/HW routine collection v1.2 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -73,22 +73,21 @@ void *pc_malloc (size_t size)
/*
* standard redirection
*/
static char outname[L_tmpnam];
static int h_out, h_outbak;
static char errname[L_tmpnam];
static int h_err, h_errbak;
static int h_out, h_outbak, h_err, h_errbak;
int pc_open_stdout (void)
{
tmpnam(outname);
if ((h_out=open(outname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) {
h_outbak = dup(STDOUT_FILENO);
fflush(stdout);
dup2(h_out, STDOUT_FILENO);
if ((h_out=open(tmpnam(NULL), O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_TEMPORARY, S_IRUSR | S_IWUSR)) >= 0) {
if ((h_outbak=dup(1)) != -1) {
fflush(stdout);
if (dup2(h_out, 1) != -1) {
return 0;
}
close(h_outbak);
}
close(h_out);
}
return h_out;
return (h_out = -1);
}
void pc_close_stdout (void)
@@ -96,32 +95,35 @@ void pc_close_stdout (void)
FILE *f;
char *line = alloca(512);
if (h_out > 0) {
dup2(h_outbak, STDOUT_FILENO);
close(h_out);
if (h_out >= 0) {
dup2(h_outbak, 1);
close(h_outbak);
f = fopen(outname, "rt");
while (fgets(line, 512, f)) {
fputs(line, stdout);
if ((f=fdopen(h_out, "r")) != NULL) {
fseek(f, 0, SEEK_SET);
while (fgets(line, 512, f)) {
fputs(line, stdout);
}
fclose(f);
} else {
close(h_out);
}
fclose(f);
remove(outname);
}
}
int pc_open_stderr (void)
{
tmpnam(errname);
if ((h_err=open(errname, O_WRONLY | O_CREAT | O_TEXT | O_TRUNC, S_IREAD | S_IWRITE)) > 0) {
h_errbak = dup(STDERR_FILENO);
fflush(stderr);
dup2(h_err, STDERR_FILENO);
if ((h_err=open(tmpnam(NULL), O_WRONLY | O_CREAT | O_TRUNC | O_TEXT | O_TEMPORARY, S_IRUSR | S_IWUSR)) >= 0) {
if ((h_errbak=dup(2)) != -1) {
fflush(stderr);
if (dup2(h_err, 2) != -1) {
return 0;
}
close(h_errbak);
}
close(h_err);
}
return h_err;
return (h_err = -1);
}
void pc_close_stderr (void)
@@ -129,17 +131,18 @@ void pc_close_stderr (void)
FILE *f;
char *line = alloca(512);
if (h_err > 0) {
dup2(h_errbak, STDERR_FILENO);
close(h_err);
if (h_err >= 0) {
dup2(h_errbak, 2);
close(h_errbak);
f = fopen(errname, "rt");
while (fgets(line, 512, f)) {
fputs(line, stderr);
if ((f=fdopen(h_err, "r")) != NULL) {
fseek(f, 0, SEEK_SET);
while (fgets(line, 512, f)) {
fputs(line, stderr);
}
fclose(f);
} else {
close(h_err);
}
fclose(f);
remove(errname);
}
}

View File

@@ -1,5 +1,5 @@
/*
* PC/HW routine collection v1.3 for DOS/DJGPP
* PC/HW routine collection v1.2 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -25,7 +25,7 @@
typedef void (*VFUNC) (void);
typedef void (*PFUNC) (void *);
typedef void (*MFUNC) (int x, int y, int z, int b);
typedef void (*MFUNC) (int x, int y, int b);
/*
* atexit
@@ -39,7 +39,6 @@ int pc_clexit (VFUNC f);
#define ENDOFUNC(x) static void x##_end() { }
#define LOCKFUNC(x) _go32_dpmi_lock_code((void *)x, (long)x##_end - (long)x)
#define LOCKDATA(x) _go32_dpmi_lock_data((void *)&x, sizeof(x))
#define LOCKBUFF(x, l) _go32_dpmi_lock_data((void *)x, l)
void *pc_malloc (size_t size);
@@ -195,7 +194,6 @@ void pc_remove_keyb (void);
int pc_keypressed (void);
int pc_readkey (void);
int pc_keydown (int code);
int pc_keyshifts (void);
/*
* timer
@@ -211,8 +209,10 @@ void pc_remove_mouse (void);
MFUNC pc_install_mouse_handler (MFUNC handler);
void pc_mouse_area (int x1, int y1, int x2, int y2);
void pc_mouse_speed (int xspeed, int yspeed);
int pc_query_mouse (int *x, int *y, int *z);
void pc_warp_mouse (int x, int y);
int pc_query_mouse (int *x, int *y);
void pc_show_mouse (void);
void pc_scare_mouse (void);
void pc_unscare_mouse (void);
/*
* standard redirection

View File

@@ -1,5 +1,5 @@
/*
* PC/HW routine collection v1.3 for DOS/DJGPP
* PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -74,9 +74,6 @@ _pc_install_irq:
addl %edx, %eax
movl %eax, IRQ_STACK(%edi)
movl ___djgpp_ds_alias, %eax
movl %eax, IRQ_STACK+4(%edi)
movl %ss:12(%ebp), %eax
movl %eax, IRQ_HOOK(%edi)
@@ -134,7 +131,8 @@ __irq_wrapper_##x: ; \
pushl %gs ; \
movl %ss, %ebx ; \
movl %esp, %esi ; \
lss %cs:__irq_stack_##x, %esp ; \
movl %cs:___djgpp_ds_alias, %ss ; \
movl %cs:__irq_stack_##x, %esp ; \
pushl %ss ; \
pushl %ss ; \
popl %es ; \
@@ -162,7 +160,7 @@ __irq_old_##x: ; \
__irq_hook_##x: ; \
.long 0 ; \
__irq_stack_##x: ; \
.long 0, 0
.long 0
WRAPPER(0);
WRAPPER(1);

View File

@@ -1,5 +1,5 @@
/*
* PC/HW routine collection v1.3 for DOS/DJGPP
* PC/HW routine collection v1.1 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -357,6 +357,20 @@ static void handle_code (int scancode, int keycode)
in_a_terrupt--;
} ENDOFUNC(handle_code)
static __inline void satisfy (void)
{
__asm("\n\
inb $0x61, %%al \n\
movb %%al, %%ah \n\
orb $0x80, %%al \n\
outb %%al, $0x61 \n\
xchgb %%al, %%ah \n\
outb %%al, $0x61 \n\
movb $0x20, %%al \n\
outb %%al, $0x20 \n\
":::"%eax");
}
static int keyboard ()
{
unsigned char temp, scancode;
@@ -396,16 +410,7 @@ static int keyboard ()
":::"%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
}
__asm("\n\
inb $0x61, %%al \n\
movb %%al, %%ah \n\
orb $0x80, %%al \n\
outb %%al, $0x61 \n\
xchgb %%al, %%ah \n\
outb %%al, $0x61 \n\
movb $0x20, %%al \n\
outb %%al, $0x20 \n\
":::"%eax");
satisfy();
return 0;
} ENDOFUNC(keyboard)
@@ -420,9 +425,8 @@ int pc_readkey (void)
if (keyboard_installed) {
int key;
while (key_buffer.start==key_buffer.end) {
__dpmi_yield();
}
do {
} while (key_buffer.start==key_buffer.end);
DISABLE();
key = key_buffer.key[key_buffer.start++];
@@ -441,11 +445,6 @@ int pc_keydown (int code)
return pc_key[code];
}
int pc_keyshifts (void)
{
return key_shifts;
}
void pc_remove_keyb (void)
{
if (keyboard_installed) {

View File

@@ -1,5 +1,5 @@
/*
* PC/HW routine collection v1.3 for DOS/DJGPP
* PC/HW routine collection v1.2 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -8,15 +8,11 @@
#include <dpmi.h>
#include <sys/exceptn.h>
#include <sys/segments.h>
#include "pc_hw.h"
#define PC_CUTE_WHEEL 1 /* CuteMouse WheelAPI */
#define MOUSE_STACK_SIZE 16384
#define CLEAR_MICKEYS() \
@@ -25,23 +21,20 @@
ox = oy = 0; \
} while (0)
extern void mouse_wrap (void);
extern int mouse_wrap_end[];
extern void mouse_wrapper (void);
extern void mouse_wrapper_end (void);
static MFUNC mouse_func;
static void *mouse_stack;
static long mouse_callback;
static __dpmi_regs mouse_regs;
static volatile struct {
volatile int x, y, z, b;
} pc_mouse;
static volatile int pc_mouse_x, pc_mouse_y, pc_mouse_b;
static int minx = 0;
static int maxx = 319;
static int miny = 0;
static int maxy = 199;
static int minz = 0;
static int maxz = 255;
static int sx = 2;
static int sy = 2;
@@ -50,34 +43,27 @@ static int emulat3 = FALSE;
static int ox, oy;
static void mouse (__dpmi_regs *r)
{
int nx = (signed short)r->x.si / sx;
int ny = (signed short)r->x.di / sy;
int dx = nx - ox;
int dy = ny - oy;
#if PC_CUTE_WHEEL
int dz = (signed char)r->h.bh;
#endif
ox = nx;
oy = ny;
pc_mouse.b = r->h.bl;
pc_mouse.x = MID(minx, pc_mouse.x + dx, maxx);
pc_mouse.y = MID(miny, pc_mouse.y + dy, maxy);
#if PC_CUTE_WHEEL
pc_mouse.z = MID(minz, pc_mouse.z + dz, maxz);
#endif
pc_mouse_b = r->x.bx;
pc_mouse_x = MID(minx, pc_mouse_x + dx, maxx);
pc_mouse_y = MID(miny, pc_mouse_y + dy, maxy);
if (emulat3) {
if ((pc_mouse.b&3)==3) {
pc_mouse.b = 4;
if ((pc_mouse_b&3)==3) {
pc_mouse_b = 4;
}
}
if (mouse_func) {
mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b);
mouse_func(pc_mouse_x, pc_mouse_y, pc_mouse_b);
}
} ENDOFUNC(mouse)
@@ -97,7 +83,7 @@ void pc_remove_mouse (void)
mouse_callback = 0;
free((void *)(mouse_wrap_end[0] - MOUSE_STACK_SIZE));
free((void *)((unsigned long)mouse_stack-MOUSE_STACK_SIZE));
}
}
@@ -123,26 +109,26 @@ int pc_install_mouse (void)
/* lock wrapper */
LOCKDATA(mouse_func);
LOCKDATA(mouse_stack);
LOCKDATA(mouse_callback);
LOCKDATA(mouse_regs);
LOCKDATA(pc_mouse);
LOCKDATA(pc_mouse_x);
LOCKDATA(pc_mouse_y);
LOCKDATA(pc_mouse_b);
LOCKDATA(minx);
LOCKDATA(maxx);
LOCKDATA(miny);
LOCKDATA(maxy);
LOCKDATA(minz);
LOCKDATA(maxz);
LOCKDATA(sx);
LOCKDATA(sy);
LOCKDATA(emulat3);
LOCKDATA(ox);
LOCKDATA(oy);
LOCKFUNC(mouse);
LOCKFUNC(mouse_wrap);
LOCKFUNC(mouse_wrapper);
mouse_wrap_end[1] = __djgpp_ds_alias;
/* grab a locked stack */
if ((mouse_wrap_end[0] = (int)pc_malloc(MOUSE_STACK_SIZE)) == NULL) {
if ((mouse_stack=pc_malloc(MOUSE_STACK_SIZE))==NULL) {
return 0;
}
@@ -164,23 +150,19 @@ int pc_install_mouse (void)
movl %%ecx, %0 \n\
0: \n\
":"=g"(mouse_callback)
:"S" (mouse_wrap), "D"(&mouse_regs)
:"S" (mouse_wrapper), "D"(&mouse_regs)
:"%eax", "%ecx", "%edx");
if (!mouse_callback) {
free((void *)mouse_wrap_end[0]);
free(mouse_stack);
return 0;
}
/* adjust stack */
mouse_wrap_end[0] += MOUSE_STACK_SIZE;
mouse_stack = (void *)((unsigned long)mouse_stack + MOUSE_STACK_SIZE);
/* install the handler */
mouse_regs.x.ax = 0x000c;
#if PC_CUTE_WHEEL
mouse_regs.x.cx = 0x7f | 0x80;
#else
mouse_regs.x.cx = 0x7f;
#endif
mouse_regs.x.cx = 0x007f;
mouse_regs.x.dx = mouse_callback&0xffff;
mouse_regs.x.es = mouse_callback>>16;
__dpmi_int(0x33, &mouse_regs);
@@ -223,56 +205,54 @@ void pc_mouse_speed (int xspeed, int yspeed)
ENABLE();
}
int pc_query_mouse (int *x, int *y, int *z)
int pc_query_mouse (int *x, int *y)
{
*x = pc_mouse.x;
*y = pc_mouse.y;
*z = pc_mouse.z;
return pc_mouse.b;
*x = pc_mouse_x;
*y = pc_mouse_y;
return pc_mouse_b;
}
void pc_warp_mouse (int x, int y)
void pc_show_mouse (void)
{
CLEAR_MICKEYS();
pc_mouse.x = MID(minx, x, maxx);
pc_mouse.y = MID(miny, y, maxy);
if (mouse_func) {
mouse_func(pc_mouse.x, pc_mouse.y, pc_mouse.z, pc_mouse.b);
}
/* not implemented */
}
void pc_scare_mouse (void)
{
/* not implemented */
}
void pc_unscare_mouse (void)
{
/* not implemented */
}
/* Hack alert:
* `mouse_wrap_end' actually holds the
* address of stack in a safe data selector.
*/
__asm("\n\
.text \n\
.p2align 5,,31 \n\
.global _mouse_wrap \n\
_mouse_wrap: \n\
cld \n\
lodsl \n\
movl %eax, %es:42(%edi) \n\
addw $4, %es:46(%edi) \n\
pushl %es \n\
movl %ss, %ebx \n\
movl %esp, %esi \n\
lss %cs:_mouse_wrap_end, %esp\n\
pushl %ss \n\
pushl %ss \n\
popl %es \n\
popl %ds \n\
movl ___djgpp_dos_sel, %fs \n\
pushl %fs \n\
popl %gs \n\
pushl %edi \n\
call _mouse \n\
popl %edi \n\
movl %ebx, %ss \n\
movl %esi, %esp \n\
popl %es \n\
iret \n\
.global _mouse_wrap_end \n\
_mouse_wrap_end:.long 0, 0");
.text \n\
.balign 4 \n\
.global _mouse_wrapper \n\
_mouse_wrapper: \n\
cld \n\
lodsl \n\
movl %eax, %es:42(%edi) \n\
addw $4, %es:46(%edi) \n\
pushl %es \n\
movl %ss, %ebx \n\
movl %esp, %esi \n\
movl %cs:___djgpp_ds_alias, %ss \n\
movl %cs:_mouse_stack, %esp \n\
pushl %ss \n\
pushl %ss \n\
popl %es \n\
popl %ds \n\
movl ___djgpp_dos_sel, %fs \n\
pushl %fs \n\
popl %gs \n\
pushl %edi \n\
call _mouse \n\
popl %edi \n\
movl %ebx, %ss \n\
movl %esi, %esp \n\
popl %es \n\
iret \n\
.balign 4 \n\
.global _mouse_wrapper_end \n\
_mouse_wrapper_end:");

View File

@@ -1,5 +1,5 @@
/*
* PC/HW routine collection v1.3 for DOS/DJGPP
* PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -27,7 +27,7 @@ typedef struct {
volatile void *parm;
} TIMER;
static TIMER timer_main, timer_func[MAX_TIMERS];
TIMER timer_main, timer_func[MAX_TIMERS];
static int timer ()
{

56
src/glut/dos/bitmap.c Normal file
View File

@@ -0,0 +1,56 @@
/* Copyright (c) Mark J. Kilgard, 1994. */
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
#include "glutbitmap.h"
void APIENTRY
glutBitmapCharacter(GLUTbitmapFont font, int c)
{
const BitmapCharRec *ch;
BitmapFontPtr fontinfo;
GLint swapbytes, lsbfirst, rowlength;
GLint skiprows, skippixels, alignment;
#if defined(_WIN32)
fontinfo = (BitmapFontPtr) __glutFont(font);
#else
fontinfo = (BitmapFontPtr) font;
#endif
if (c < fontinfo->first ||
c >= fontinfo->first + fontinfo->num_chars)
return;
ch = fontinfo->ch[c - fontinfo->first];
if (ch) {
/* Save current modes. */
glGetIntegerv(GL_UNPACK_SWAP_BYTES, &swapbytes);
glGetIntegerv(GL_UNPACK_LSB_FIRST, &lsbfirst);
glGetIntegerv(GL_UNPACK_ROW_LENGTH, &rowlength);
glGetIntegerv(GL_UNPACK_SKIP_ROWS, &skiprows);
glGetIntegerv(GL_UNPACK_SKIP_PIXELS, &skippixels);
glGetIntegerv(GL_UNPACK_ALIGNMENT, &alignment);
/* Little endian machines (DEC Alpha for example) could
benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE
instead of GL_FALSE, but this would require changing the
generated bitmaps too. */
glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE);
glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glBitmap(ch->width, ch->height, ch->xorig, ch->yorig,
ch->advance, 0, ch->bitmap);
/* Restore saved modes. */
glPixelStorei(GL_UNPACK_SWAP_BYTES, swapbytes);
glPixelStorei(GL_UNPACK_LSB_FIRST, lsbfirst);
glPixelStorei(GL_UNPACK_ROW_LENGTH, rowlength);
glPixelStorei(GL_UNPACK_SKIP_ROWS, skiprows);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, skippixels);
glPixelStorei(GL_UNPACK_ALIGNMENT, alignment);
}
}

View File

@@ -19,7 +19,7 @@
*/
/*
* DOS/DJGPP glut driver v1.3 for Mesa
* DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -27,138 +27,126 @@
*/
#include "glutint.h"
#include "GL/glut.h"
#include "internal.h"
GLUTidleCB g_idle_func = NULL;
void APIENTRY glutDisplayFunc (GLUTdisplayCB func)
void APIENTRY glutDisplayFunc (void (GLUTCALLBACK *func) (void))
{
g_curwin->display = func;
display_func = func;
}
void APIENTRY glutReshapeFunc (GLUTreshapeCB func)
void APIENTRY glutReshapeFunc (void (GLUTCALLBACK *func) (int width, int height))
{
g_curwin->reshape = func;
reshape_func = func;
}
void APIENTRY glutKeyboardFunc (GLUTkeyboardCB func)
void APIENTRY glutKeyboardFunc (void (GLUTCALLBACK *func) (unsigned char key, int x, int y))
{
g_curwin->keyboard = func;
keyboard_func = func;
}
void APIENTRY glutMouseFunc (GLUTmouseCB func)
void APIENTRY glutMouseFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y))
{
g_curwin->mouse = func;
mouse_func = func;
}
void APIENTRY glutMotionFunc (GLUTmotionCB func)
void APIENTRY glutMotionFunc (void (GLUTCALLBACK *func) (int x, int y))
{
g_curwin->motion = func;
motion_func = func;
}
void APIENTRY glutPassiveMotionFunc (GLUTpassiveCB func)
void APIENTRY glutPassiveMotionFunc (void (GLUTCALLBACK *func) (int x, int y))
{
g_curwin->passive = func;
passive_motion_func = func;
}
void APIENTRY glutEntryFunc (GLUTentryCB func)
void APIENTRY glutEntryFunc (void (GLUTCALLBACK *func) (int state))
{
g_curwin->entry = func;
entry_func = func;
}
void APIENTRY glutVisibilityFunc (GLUTvisibilityCB func)
void APIENTRY glutVisibilityFunc (void (GLUTCALLBACK *func) (int state))
{
g_curwin->visibility = func;
visibility_func = func;
}
void APIENTRY glutIdleFunc (void (GLUTCALLBACK *func) (void))
{
idle_func = func;
}
void APIENTRY glutWindowStatusFunc (GLUTwindowStatusCB func)
void APIENTRY glutTimerFunc (unsigned int millis, void (GLUTCALLBACK *func) (int value), int value)
{
}
void APIENTRY glutIdleFunc (GLUTidleCB func)
void APIENTRY glutMenuStateFunc (void (GLUTCALLBACK *func) (int state))
{
g_idle_func = func;
menu_state_func = func;
}
void APIENTRY glutSpecialFunc (void (GLUTCALLBACK *func) (int key, int x, int y))
{
special_func = func;
}
void APIENTRY glutTimerFunc (unsigned int millis, GLUTtimerCB func, int value)
void APIENTRY glutSpaceballMotionFunc (void (GLUTCALLBACK *func) (int x, int y, int z))
{
}
void APIENTRY glutSpecialFunc (GLUTspecialCB func)
{
g_curwin->special = func;
}
void APIENTRY glutSpaceballMotionFunc (GLUTspaceMotionCB func)
void APIENTRY glutSpaceballRotateFunc (void (GLUTCALLBACK *func) (int x, int y, int z))
{
}
void APIENTRY glutSpaceballRotateFunc (GLUTspaceRotateCB func)
void APIENTRY glutSpaceballButtonFunc (void (GLUTCALLBACK *func) (int button, int state))
{
}
void APIENTRY glutSpaceballButtonFunc (GLUTspaceButtonCB func)
void APIENTRY glutButtonBoxFunc (void (GLUTCALLBACK *func) (int button, int state))
{
}
void APIENTRY glutDialsFunc (GLUTdialsCB func)
void APIENTRY glutDialsFunc (void (GLUTCALLBACK *func) (int dial, int value))
{
}
void APIENTRY glutButtonBoxFunc (GLUTbuttonBoxCB func)
void APIENTRY glutTabletMotionFunc (void (GLUTCALLBACK *func) (int x, int y))
{
}
void APIENTRY glutTabletMotionFunc (GLUTtabletMotionCB func)
void APIENTRY glutTabletButtonFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y))
{
}
void APIENTRY glutTabletButtonFunc (GLUTtabletButtonCB func)
void APIENTRY glutMenuStatusFunc (void (GLUTCALLBACK *func) (int status, int x, int y))
{
}
void APIENTRY glutJoystickFunc (GLUTjoystickCB func, int interval)
void APIENTRY glutOverlayDisplayFunc (void (GLUTCALLBACK *func) (void))
{
}
void APIENTRY glutWindowStatusFunc (void (GLUTCALLBACK *func) (int state))
{
}

View File

@@ -19,7 +19,7 @@
*/
/*
* DOS/DJGPP glut driver v1.3 for Mesa
* DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -27,33 +27,20 @@
*/
#include "glutint.h"
#include "GL/dmesa.h"
#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i)))
#include "GL/glut.h"
void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue)
{
if (g_display_mode & GLUT_INDEX) {
if ((ndx >= 0) && (ndx < (256 - RESERVED_COLORS))) {
DMesaSetCI(ndx, CLAMP(red), CLAMP(green), CLAMP(blue));
}
}
}
GLfloat APIENTRY glutGetColor (int ndx, int component)
{
return 0.0;
}
void APIENTRY glutCopyColormap (int win)
{
}

61
src/glut/dos/globals.c Normal file
View File

@@ -0,0 +1,61 @@
/*
* Mesa 3-D graphics library
* Version: 3.4
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#include "GL/glut.h"
#include "internal.h"
GLenum g_display_mode = 0;
GLuint g_width = DEFAULT_WIDTH;
GLuint g_height = DEFAULT_HEIGHT;
GLint g_mouse = GL_FALSE;
GLboolean g_redisplay = GL_FALSE;
GLint g_xpos = 0;
GLint g_ypos = 0;
void (GLUTCALLBACK *display_func) (void) = NULL;
void (GLUTCALLBACK *reshape_func) (int width, int height) = NULL;
void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y) = NULL;
void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y) = NULL;
void (GLUTCALLBACK *motion_func) (int x, int y) = NULL;
void (GLUTCALLBACK *passive_motion_func) (int x, int y) = NULL;
void (GLUTCALLBACK *entry_func) (int state) = NULL;
void (GLUTCALLBACK *visibility_func) (int state) = NULL;
void (GLUTCALLBACK *idle_func) (void) = NULL;
void (GLUTCALLBACK *menu_state_func) (int state) = NULL;
void (GLUTCALLBACK *special_func) (int key, int x, int y) = NULL;
void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z) = NULL;
void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z) = NULL;
void (GLUTCALLBACK *spaceball_button_func) (int button, int state) = NULL;
void (GLUTCALLBACK *button_box_func) (int button, int state) = NULL;
void (GLUTCALLBACK *dials_func) (int dial, int value) = NULL;
void (GLUTCALLBACK *tablet_motion_func) (int x, int y) = NULL;
void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y) = NULL;
void (GLUTCALLBACK *menu_status_func) (int status, int x, int y) = NULL;
void (GLUTCALLBACK *overlay_display_func) (void) = NULL;
void (GLUTCALLBACK *window_status_func) (int state) = NULL;

View File

@@ -1,150 +0,0 @@
/*
* Mesa 3-D graphics library
* Version: 4.0
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* DOS/DJGPP glut driver v1.3 for Mesa
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#ifndef __glutint_h__
#define __glutint_h__
#include <GL/glut.h>
#include "GL/dmesa.h"
/* GLUT function types */
typedef void (GLUTCALLBACK *GLUTdisplayCB) (void);
typedef void (GLUTCALLBACK *GLUTreshapeCB) (int, int);
typedef void (GLUTCALLBACK *GLUTkeyboardCB) (unsigned char, int, int);
typedef void (GLUTCALLBACK *GLUTmouseCB) (int, int, int, int);
typedef void (GLUTCALLBACK *GLUTmotionCB) (int, int);
typedef void (GLUTCALLBACK *GLUTpassiveCB) (int, int);
typedef void (GLUTCALLBACK *GLUTentryCB) (int);
typedef void (GLUTCALLBACK *GLUTvisibilityCB) (int);
typedef void (GLUTCALLBACK *GLUTwindowStatusCB) (int);
typedef void (GLUTCALLBACK *GLUTidleCB) (void);
typedef void (GLUTCALLBACK *GLUTtimerCB) (int);
typedef void (GLUTCALLBACK *GLUTmenuStateCB) (int); /* DEPRECATED. */
typedef void (GLUTCALLBACK *GLUTmenuStatusCB) (int, int, int);
typedef void (GLUTCALLBACK *GLUTselectCB) (int);
typedef void (GLUTCALLBACK *GLUTspecialCB) (int, int, int);
typedef void (GLUTCALLBACK *GLUTspaceMotionCB) (int, int, int);
typedef void (GLUTCALLBACK *GLUTspaceRotateCB) (int, int, int);
typedef void (GLUTCALLBACK *GLUTspaceButtonCB) (int, int);
typedef void (GLUTCALLBACK *GLUTdialsCB) (int, int);
typedef void (GLUTCALLBACK *GLUTbuttonBoxCB) (int, int);
typedef void (GLUTCALLBACK *GLUTtabletMotionCB) (int, int);
typedef void (GLUTCALLBACK *GLUTtabletButtonCB) (int, int, int, int);
typedef void (GLUTCALLBACK *GLUTjoystickCB) (unsigned int, int, int, int);
typedef struct GLUTwindow {
int num; /* window id */
DMesaBuffer buffer;
int show_mouse;
/* GLUT settable or visible window state. */
int xpos;
int ypos;
int width; /* window width in pixels */
int height; /* window height in pixels */
/* Per-window callbacks. */
GLUTdisplayCB display; /* redraw */
GLUTreshapeCB reshape; /* resize (width,height) */
GLUTmouseCB mouse; /* mouse (button,state,x,y) */
GLUTmotionCB motion; /* motion (x,y) */
GLUTpassiveCB passive; /* passive motion (x,y) */
GLUTentryCB entry; /* window entry/exit (state) */
GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */
GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */
GLUTwindowStatusCB windowStatus; /* window status */
GLUTvisibilityCB visibility; /* visibility */
GLUTspecialCB special; /* special key */
GLUTspecialCB specialUp; /* special up key */
GLUTbuttonBoxCB buttonBox; /* button box */
GLUTdialsCB dials; /* dials */
GLUTspaceMotionCB spaceMotion; /* Spaceball motion */
GLUTspaceRotateCB spaceRotate; /* Spaceball rotate */
GLUTspaceButtonCB spaceButton; /* Spaceball button */
GLUTtabletMotionCB tabletMotion; /* tablet motion */
GLUTtabletButtonCB tabletButton; /* tablet button */
GLUTjoystickCB joystick; /* joystick */
} GLUTwindow;
extern GLUTidleCB g_idle_func;
extern GLUTmenuStatusCB g_menu_status_func;
extern GLboolean g_redisplay;
extern GLuint g_bpp; /* HW: bits per pixel */
extern GLuint g_refresh; /* HW: vertical refresh rate */
extern GLuint g_screen_w, g_screen_h; /* HW: physical screen size */
extern GLint g_driver_caps;
extern GLuint g_fps;
extern GLuint g_display_mode; /* display bits */
extern int g_init_x, g_init_y; /* initial window position */
extern GLuint g_init_w, g_init_h; /* initial window size */
extern int g_mouse; /* non-zero if mouse installed */
extern int g_mouse_x, g_mouse_y; /* mouse coords, relative to current win */
extern GLUTwindow *g_curwin; /* current window */
extern char *__glutProgramName; /* program name */
extern void __glutInitMouse (void);
/* private routines from glut_util.c */
extern char * __glutStrdup(const char *string);
extern void __glutWarning(char *format,...);
extern void __glutFatalError(char *format,...);
extern void __glutFatalUsage(char *format,...);
/* hmmm... */
#include "pc_hw/pc_hw.h"
#define MAX_WINDOWS 2
#define DEFAULT_WIDTH 300
#define DEFAULT_HEIGHT 300
#define DEFAULT_BPP 16
#define DEPTH_SIZE 16
#define STENCIL_SIZE 8
#define ACCUM_SIZE 16
#define RESERVED_COLORS 0
#endif /* __glutint_h__ */

View File

@@ -19,7 +19,7 @@
*/
/*
* DOS/DJGPP glut driver v1.3 for Mesa
* DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -27,86 +27,39 @@
*/
#include <string.h>
#include "glutint.h"
#include "GL/glut.h"
#include "internal.h"
GLboolean g_redisplay = GL_FALSE;
GLuint g_bpp = DEFAULT_BPP;
GLuint g_refresh = 0;
GLuint g_screen_w, g_screen_h;
GLint g_driver_caps;
GLuint g_fps = 0;
GLuint g_display_mode = 0;
int g_init_x = 0, g_init_y = 0;
GLuint g_init_w = DEFAULT_WIDTH, g_init_h = DEFAULT_HEIGHT;
char *__glutProgramName = NULL;
void APIENTRY glutInit (int *argc, char **argv)
void APIENTRY glutInit (int *argcp, char **argv)
{
char *str;
const char *env;
if ((env = getenv("DMESA_GLUT_BPP")) != NULL) {
g_bpp = atoi(env);
}
if ((env = getenv("DMESA_GLUT_REFRESH")) != NULL) {
g_refresh = atoi(env);
}
/* Determine program name. */
str = strrchr(argv[0], '/');
if (str == NULL) {
str = argv[0];
} else {
str++;
}
__glutProgramName = __glutStrdup(str);
/* check if GLUT_FPS env var is set */
if ((env = getenv("GLUT_FPS")) != NULL) {
if ((g_fps = atoi(env)) <= 0) {
g_fps = 5000; /* 5000 milliseconds */
}
}
/* Initialize timer */
glutGet(GLUT_ELAPSED_TIME);
}
void APIENTRY glutInitDisplayMode (unsigned int mode)
{
g_display_mode = mode;
}
pc_install_keyb();
g_mouse = pc_install_mouse();
}
void APIENTRY glutInitWindowPosition (int x, int y)
{
g_init_x = x;
g_init_y = y;
g_xpos = x;
g_ypos = y;
}
void APIENTRY glutInitWindowSize (int width, int height)
{
g_init_w = width;
g_init_h = height;
g_width = width;
g_height = height;
}
void APIENTRY glutMainLoop (void)
{
GLboolean idle;
@@ -114,141 +67,94 @@ void APIENTRY glutMainLoop (void)
static int old_mouse_y = 0;
static int old_mouse_b = 0;
{
GLint screen_size[2];
DMesaGetIntegerv(DMESA_GET_SCREEN_SIZE, screen_size);
g_screen_w = screen_size[0];
g_screen_h = screen_size[1];
DMesaGetIntegerv(DMESA_GET_DRIVER_CAPS, &g_driver_caps);
}
pc_install_keyb();
__glutInitMouse();
glutPostRedisplay();
if (g_curwin->reshape) {
g_curwin->reshape(g_curwin->width, g_curwin->height);
}
if (g_curwin->visibility) {
g_curwin->visibility(GLUT_VISIBLE);
}
if (reshape_func) reshape_func(g_width, g_height);
if (visibility_func) visibility_func(GLUT_VISIBLE);
if (g_mouse) pc_show_mouse();
while (GL_TRUE) {
idle = GL_TRUE;
if (g_redisplay && g_curwin->display) {
if (g_redisplay && display_func) {
idle = GL_FALSE;
g_redisplay = GL_FALSE;
if (g_curwin->show_mouse && !(g_display_mode & GLUT_DOUBLE)) {
/* XXX scare mouse */
g_curwin->display();
/* XXX unscare mouse */
} else {
g_curwin->display();
if (g_mouse && !(g_display_mode & GLUT_DOUBLE)) pc_scare_mouse();
display_func();
if (g_mouse && !(g_display_mode & GLUT_DOUBLE)) pc_unscare_mouse();
}
if (pc_keypressed()) {
int key;
idle = GL_FALSE;
key = pc_readkey();
switch (key>>16) {
case KEY_F1: if (special_func) special_func(GLUT_KEY_F1, 0, 0); break;
case KEY_F2: if (special_func) special_func(GLUT_KEY_F2, 0, 0); break;
case KEY_F3: if (special_func) special_func(GLUT_KEY_F3, 0, 0); break;
case KEY_F4: if (special_func) special_func(GLUT_KEY_F4, 0, 0); break;
case KEY_F5: if (special_func) special_func(GLUT_KEY_F5, 0, 0); break;
case KEY_F6: if (special_func) special_func(GLUT_KEY_F6, 0, 0); break;
case KEY_F7: if (special_func) special_func(GLUT_KEY_F7, 0, 0); break;
case KEY_F8: if (special_func) special_func(GLUT_KEY_F8, 0, 0); break;
case KEY_F9: if (special_func) special_func(GLUT_KEY_F9, 0, 0); break;
case KEY_F10: if (special_func) special_func(GLUT_KEY_F10, 0, 0); break;
case KEY_F11: if (special_func) special_func(GLUT_KEY_F11, 0, 0); break;
case KEY_F12: if (special_func) special_func(GLUT_KEY_F12, 0, 0); break;
case KEY_LEFT: if (special_func) special_func(GLUT_KEY_LEFT, 0, 0); break;
case KEY_UP: if (special_func) special_func(GLUT_KEY_UP, 0, 0); break;
case KEY_RIGHT: if (special_func) special_func(GLUT_KEY_RIGHT, 0, 0); break;
case KEY_DOWN: if (special_func) special_func(GLUT_KEY_DOWN, 0, 0); break;
case KEY_PGUP: if (special_func) special_func(GLUT_KEY_PAGE_UP, 0, 0); break;
case KEY_PGDN: if (special_func) special_func(GLUT_KEY_PAGE_DOWN, 0, 0); break;
case KEY_HOME: if (special_func) special_func(GLUT_KEY_HOME, 0, 0); break;
case KEY_END: if (special_func) special_func(GLUT_KEY_END, 0, 0); break;
case KEY_INSERT: if (special_func) special_func(GLUT_KEY_INSERT, 0, 0); break;
default: if (keyboard_func) keyboard_func(key & 0xFF, 0, 0);
}
}
if (g_mouse) {
int mouse_x;
int mouse_y;
int mouse_z;
int mouse_b;
/* query mouse */
mouse_b = pc_query_mouse(&mouse_x, &mouse_y, &mouse_z);
/* relative to window coordinates */
g_mouse_x = mouse_x - g_curwin->xpos;
g_mouse_y = mouse_y - g_curwin->ypos;
/* mouse was moved? */
if ((mouse_x != old_mouse_x) || (mouse_y != old_mouse_y)) {
mouse_b = pc_query_mouse(&mouse_x, &mouse_y);
if (motion_func && ((mouse_x != old_mouse_x) || (mouse_y != old_mouse_y))) {
idle = GL_FALSE;
old_mouse_x = mouse_x;
old_mouse_y = mouse_y;
if (mouse_b) {
/* any button pressed */
if (g_curwin->motion) {
g_curwin->motion(g_mouse_x, g_mouse_y);
}
} else {
/* no button pressed */
if (g_curwin->passive) {
g_curwin->passive(g_mouse_x, g_mouse_y);
}
}
motion_func(old_mouse_x, old_mouse_y);
}
/* button state changed? */
if (mouse_b != old_mouse_b) {
GLUTmouseCB mouse_func;
if ((mouse_func = g_curwin->mouse)) {
if ((old_mouse_b & 1) && !(mouse_b & 1))
mouse_func(GLUT_LEFT_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y);
else if (!(old_mouse_b & 1) && (mouse_b & 1))
mouse_func(GLUT_LEFT_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y);
if ((old_mouse_b & 2) && !(mouse_b & 2))
mouse_func(GLUT_RIGHT_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y);
else if (!(old_mouse_b & 2) && (mouse_b & 2))
mouse_func(GLUT_RIGHT_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y);
if ((old_mouse_b & 4) && !(mouse_b & 4))
mouse_func(GLUT_MIDDLE_BUTTON, GLUT_UP, g_mouse_x, g_mouse_y);
else if (!(old_mouse_b & 3) && (mouse_b & 4))
mouse_func(GLUT_MIDDLE_BUTTON, GLUT_DOWN, g_mouse_x, g_mouse_y);
}
if (mouse_func && (mouse_b != old_mouse_b)) {
int new_mouse_b = mouse_b;
if ((old_mouse_b & 1) && !(new_mouse_b & 1))
mouse_func(GLUT_LEFT_BUTTON, GLUT_UP, mouse_x, mouse_y);
else if (!(old_mouse_b & 1) && (new_mouse_b & 1))
mouse_func(GLUT_LEFT_BUTTON, GLUT_DOWN, mouse_x, mouse_y);
if ((old_mouse_b & 2) && !(new_mouse_b & 2))
mouse_func(GLUT_RIGHT_BUTTON, GLUT_UP, mouse_x, mouse_y);
else if (!(old_mouse_b & 2) && (new_mouse_b & 2))
mouse_func(GLUT_RIGHT_BUTTON, GLUT_DOWN, mouse_x, mouse_y);
if ((old_mouse_b & 4) && !(new_mouse_b & 4))
mouse_func(GLUT_MIDDLE_BUTTON, GLUT_UP, mouse_x, mouse_y);
else if (!(old_mouse_b & 3) && (new_mouse_b & 4))
mouse_func(GLUT_MIDDLE_BUTTON, GLUT_DOWN, mouse_x, mouse_y);
idle = GL_FALSE;
old_mouse_b = mouse_b;
old_mouse_b = new_mouse_b;
}
}
if (pc_keypressed()) {
int key;
int glut_key;
idle = GL_FALSE;
key = pc_readkey();
switch (key>>16) {
case KEY_F1: glut_key = GLUT_KEY_F1; goto special;
case KEY_F2: glut_key = GLUT_KEY_F2; goto special;
case KEY_F3: glut_key = GLUT_KEY_F3; goto special;
case KEY_F4: glut_key = GLUT_KEY_F4; goto special;
case KEY_F5: glut_key = GLUT_KEY_F5; goto special;
case KEY_F6: glut_key = GLUT_KEY_F6; goto special;
case KEY_F7: glut_key = GLUT_KEY_F7; goto special;
case KEY_F8: glut_key = GLUT_KEY_F8; goto special;
case KEY_F9: glut_key = GLUT_KEY_F9; goto special;
case KEY_F10: glut_key = GLUT_KEY_F10; goto special;
case KEY_F11: glut_key = GLUT_KEY_F11; goto special;
case KEY_F12: glut_key = GLUT_KEY_F12; goto special;
case KEY_LEFT: glut_key = GLUT_KEY_LEFT; goto special;
case KEY_UP: glut_key = GLUT_KEY_UP; goto special;
case KEY_RIGHT: glut_key = GLUT_KEY_RIGHT; goto special;
case KEY_DOWN: glut_key = GLUT_KEY_DOWN; goto special;
case KEY_PGUP: glut_key = GLUT_KEY_PAGE_UP; goto special;
case KEY_PGDN: glut_key = GLUT_KEY_PAGE_DOWN; goto special;
case KEY_HOME: glut_key = GLUT_KEY_HOME; goto special;
case KEY_END: glut_key = GLUT_KEY_END; goto special;
case KEY_INSERT: glut_key = GLUT_KEY_INSERT; goto special;
special:
if (g_curwin->special) {
g_curwin->special(glut_key, g_mouse_x, g_mouse_y);
}
break;
default:
if (g_curwin->keyboard) {
g_curwin->keyboard(key & 0xFF, g_mouse_x, g_mouse_y);
}
}
}
if (idle && g_idle_func)
g_idle_func();
if (idle && idle_func)
idle_func();
}
}

78
src/glut/dos/internal.h Normal file
View File

@@ -0,0 +1,78 @@
/*
* Mesa 3-D graphics library
* Version: 4.0
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#ifndef INTERNAL_H_included
#define INTERNAL_H_included
#include "GL/glut.h"
#include "pc_hw/pc_hw.h"
#define MAX_WINDOWS 4
#define DEFAULT_WIDTH 640
#define DEFAULT_HEIGHT 480
#define DEFAULT_BPP 16
#define DEPTH_SIZE 16
#define STENCIL_SIZE 8
#define ACCUM_SIZE 16
extern GLenum g_display_mode;
extern GLuint g_width;
extern GLuint g_height;
extern GLint g_mouse;
extern GLboolean g_redisplay;
extern GLint g_xpos;
extern GLint g_ypos;
extern void (GLUTCALLBACK *display_func) (void);
extern void (GLUTCALLBACK *reshape_func) (int width, int height);
extern void (GLUTCALLBACK *keyboard_func) (unsigned char key, int x, int y);
extern void (GLUTCALLBACK *mouse_func) (int button, int state, int x, int y);
extern void (GLUTCALLBACK *motion_func) (int x, int y);
extern void (GLUTCALLBACK *passive_motion_func) (int x, int y);
extern void (GLUTCALLBACK *entry_func) (int state);
extern void (GLUTCALLBACK *visibility_func) (int state);
extern void (GLUTCALLBACK *idle_func) (void);
extern void (GLUTCALLBACK *menu_state_func) (int state);
extern void (GLUTCALLBACK *special_func) (int key, int x, int y);
extern void (GLUTCALLBACK *spaceball_motion_func) (int x, int y, int z);
extern void (GLUTCALLBACK *spaceball_rotate_func) (int x, int y, int z);
extern void (GLUTCALLBACK *spaceball_button_func) (int button, int state);
extern void (GLUTCALLBACK *button_box_func) (int button, int state);
extern void (GLUTCALLBACK *dials_func) (int dial, int value);
extern void (GLUTCALLBACK *tablet_motion_func) (int x, int y);
extern void (GLUTCALLBACK *tabled_button_func) (int button, int state, int x, int y);
extern void (GLUTCALLBACK *menu_status_func) (int status, int x, int y);
extern void (GLUTCALLBACK *overlay_display_func) (void);
extern void (GLUTCALLBACK *window_status_func) (int state);
#endif

View File

@@ -19,7 +19,7 @@
*/
/*
* DOS/DJGPP glut driver v1.3 for Mesa
* DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -27,90 +27,60 @@
*/
#include "glutint.h"
#include "GL/glut.h"
GLUTmenuStatusCB g_menu_status_func = NULL;
void APIENTRY glutMenuStateFunc (GLUTmenuStateCB func)
{
g_menu_status_func = (GLUTmenuStatusCB)func;
}
void APIENTRY glutMenuStatusFunc (GLUTmenuStatusCB func)
{
g_menu_status_func = func;
}
int APIENTRY glutCreateMenu (GLUTselectCB func)
int APIENTRY glutCreateMenu (void (GLUTCALLBACK *func) (int))
{
return 0;
}
void APIENTRY glutDestroyMenu (int menu)
{
}
int APIENTRY glutGetMenu (void)
{
return 0;
}
void APIENTRY glutSetMenu (int menu)
{
}
void APIENTRY glutAddMenuEntry (const char *label, int value)
{
}
void APIENTRY glutAddSubMenu (const char *label, int submenu)
{
}
void APIENTRY glutChangeToMenuEntry (int item, const char *label, int value)
{
}
void APIENTRY glutChangeToSubMenu (int item, const char *label, int submenu)
{
}
void APIENTRY glutRemoveMenuItem (int item)
{
}
void APIENTRY glutAttachMenu (int button)
{
}
void APIENTRY glutDetachMenu (int button)
{
}

598
src/glut/dos/models.c Normal file
View File

@@ -0,0 +1,598 @@
/* Copyright (c) Mark J. Kilgard, 1994, 1997. */
/**
(c) Copyright 1993, Silicon Graphics, Inc.
ALL RIGHTS RESERVED
Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice appear in
supporting documentation, and that the name of Silicon
Graphics, Inc. not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission.
THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU
"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR
OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE
ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER,
INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE,
SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR
NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR
PERFORMANCE OF THIS SOFTWARE.
US Government Users Restricted Rights
Use, duplication, or disclosure by the Government is subject to
restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 252.227-7013 and/or in similar or
successor clauses in the FAR or the DOD or NASA FAR
Supplement. Unpublished-- rights reserved under the copyright
laws of the United States. Contractor/manufacturer is Silicon
Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA
94039-7311.
OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
#include <math.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "GL/glut.h"
/* Some <math.h> files do not define M_PI... */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
static GLUquadricObj *quadObj;
#define QUAD_OBJ_INIT() { if(!quadObj) initQuadObj(); }
static void
initQuadObj(void)
{
quadObj = gluNewQuadric();
/* if (!quadObj)
__glutFatalError("out of memory."); */
}
/* CENTRY */
void APIENTRY
glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_LINE);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere(quadObj, radius, slices, stacks);
}
void APIENTRY
glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_FILL);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere(quadObj, radius, slices, stacks);
}
void APIENTRY
glutWireCone(GLdouble base, GLdouble height,
GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_LINE);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluCylinder(quadObj, base, 0.0, height, slices, stacks);
}
void APIENTRY
glutSolidCone(GLdouble base, GLdouble height,
GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_FILL);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we'd need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluCylinder(quadObj, base, 0.0, height, slices, stacks);
}
/* ENDCENTRY */
static void
drawBox(GLfloat size, GLenum type)
{
static GLfloat n[6][3] =
{
{-1.0, 0.0, 0.0},
{0.0, 1.0, 0.0},
{1.0, 0.0, 0.0},
{0.0, -1.0, 0.0},
{0.0, 0.0, 1.0},
{0.0, 0.0, -1.0}
};
static GLint faces[6][4] =
{
{0, 1, 2, 3},
{3, 2, 6, 7},
{7, 6, 5, 4},
{4, 5, 1, 0},
{5, 6, 2, 1},
{7, 4, 0, 3}
};
GLfloat v[8][3];
GLint i;
v[0][0] = v[1][0] = v[2][0] = v[3][0] = -size / 2;
v[4][0] = v[5][0] = v[6][0] = v[7][0] = size / 2;
v[0][1] = v[1][1] = v[4][1] = v[5][1] = -size / 2;
v[2][1] = v[3][1] = v[6][1] = v[7][1] = size / 2;
v[0][2] = v[3][2] = v[4][2] = v[7][2] = -size / 2;
v[1][2] = v[2][2] = v[5][2] = v[6][2] = size / 2;
for (i = 5; i >= 0; i--) {
glBegin(type);
glNormal3fv(&n[i][0]);
glVertex3fv(&v[faces[i][0]][0]);
glVertex3fv(&v[faces[i][1]][0]);
glVertex3fv(&v[faces[i][2]][0]);
glVertex3fv(&v[faces[i][3]][0]);
glEnd();
}
}
/* CENTRY */
void APIENTRY
glutWireCube(GLdouble size)
{
drawBox(size, GL_LINE_LOOP);
}
void APIENTRY
glutSolidCube(GLdouble size)
{
drawBox(size, GL_QUADS);
}
/* ENDCENTRY */
static void
doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
{
int i, j;
GLfloat theta, phi, theta1;
GLfloat cosTheta, sinTheta;
GLfloat cosTheta1, sinTheta1;
GLfloat ringDelta, sideDelta;
ringDelta = 2.0 * M_PI / rings;
sideDelta = 2.0 * M_PI / nsides;
theta = 0.0;
cosTheta = 1.0;
sinTheta = 0.0;
for (i = rings - 1; i >= 0; i--) {
theta1 = theta + ringDelta;
cosTheta1 = cos(theta1);
sinTheta1 = sin(theta1);
glBegin(GL_QUAD_STRIP);
phi = 0.0;
for (j = nsides; j >= 0; j--) {
GLfloat cosPhi, sinPhi, dist;
phi += sideDelta;
cosPhi = cos(phi);
sinPhi = sin(phi);
dist = R + r * cosPhi;
glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
}
glEnd();
theta = theta1;
cosTheta = cosTheta1;
sinTheta = sinTheta1;
}
}
/* CENTRY */
void APIENTRY
glutWireTorus(GLdouble innerRadius, GLdouble outerRadius,
GLint nsides, GLint rings)
{
glPushAttrib(GL_POLYGON_BIT);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
doughnut(innerRadius, outerRadius, nsides, rings);
glPopAttrib();
}
void APIENTRY
glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius,
GLint nsides, GLint rings)
{
doughnut(innerRadius, outerRadius, nsides, rings);
}
/* ENDCENTRY */
static GLfloat dodec[20][3];
static void
initDodecahedron(void)
{
GLfloat alpha, beta;
alpha = sqrt(2.0 / (3.0 + sqrt(5.0)));
beta = 1.0 + sqrt(6.0 / (3.0 + sqrt(5.0)) -
2.0 + 2.0 * sqrt(2.0 / (3.0 + sqrt(5.0))));
/* *INDENT-OFF* */
dodec[0][0] = -alpha; dodec[0][1] = 0; dodec[0][2] = beta;
dodec[1][0] = alpha; dodec[1][1] = 0; dodec[1][2] = beta;
dodec[2][0] = -1; dodec[2][1] = -1; dodec[2][2] = -1;
dodec[3][0] = -1; dodec[3][1] = -1; dodec[3][2] = 1;
dodec[4][0] = -1; dodec[4][1] = 1; dodec[4][2] = -1;
dodec[5][0] = -1; dodec[5][1] = 1; dodec[5][2] = 1;
dodec[6][0] = 1; dodec[6][1] = -1; dodec[6][2] = -1;
dodec[7][0] = 1; dodec[7][1] = -1; dodec[7][2] = 1;
dodec[8][0] = 1; dodec[8][1] = 1; dodec[8][2] = -1;
dodec[9][0] = 1; dodec[9][1] = 1; dodec[9][2] = 1;
dodec[10][0] = beta; dodec[10][1] = alpha; dodec[10][2] = 0;
dodec[11][0] = beta; dodec[11][1] = -alpha; dodec[11][2] = 0;
dodec[12][0] = -beta; dodec[12][1] = alpha; dodec[12][2] = 0;
dodec[13][0] = -beta; dodec[13][1] = -alpha; dodec[13][2] = 0;
dodec[14][0] = -alpha; dodec[14][1] = 0; dodec[14][2] = -beta;
dodec[15][0] = alpha; dodec[15][1] = 0; dodec[15][2] = -beta;
dodec[16][0] = 0; dodec[16][1] = beta; dodec[16][2] = alpha;
dodec[17][0] = 0; dodec[17][1] = beta; dodec[17][2] = -alpha;
dodec[18][0] = 0; dodec[18][1] = -beta; dodec[18][2] = alpha;
dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha;
/* *INDENT-ON* */
}
#define DIFF3(_a,_b,_c) { \
(_c)[0] = (_a)[0] - (_b)[0]; \
(_c)[1] = (_a)[1] - (_b)[1]; \
(_c)[2] = (_a)[2] - (_b)[2]; \
}
static void
crossprod(GLfloat v1[3], GLfloat v2[3], GLfloat prod[3])
{
GLfloat p[3]; /* in case prod == v1 or v2 */
p[0] = v1[1] * v2[2] - v2[1] * v1[2];
p[1] = v1[2] * v2[0] - v2[2] * v1[0];
p[2] = v1[0] * v2[1] - v2[0] * v1[1];
prod[0] = p[0];
prod[1] = p[1];
prod[2] = p[2];
}
static void
normalize(GLfloat v[3])
{
GLfloat d;
d = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
if (d == 0.0) {
// __glutWarning("normalize: zero length vector");
v[0] = d = 1.0;
}
d = 1 / d;
v[0] *= d;
v[1] *= d;
v[2] *= d;
}
static void
pentagon(int a, int b, int c, int d, int e, GLenum shadeType)
{
GLfloat n0[3], d1[3], d2[3];
DIFF3(dodec[a], dodec[b], d1);
DIFF3(dodec[b], dodec[c], d2);
crossprod(d1, d2, n0);
normalize(n0);
glBegin(shadeType);
glNormal3fv(n0);
glVertex3fv(&dodec[a][0]);
glVertex3fv(&dodec[b][0]);
glVertex3fv(&dodec[c][0]);
glVertex3fv(&dodec[d][0]);
glVertex3fv(&dodec[e][0]);
glEnd();
}
static void
dodecahedron(GLenum type)
{
static int inited = 0;
if (inited == 0) {
inited = 1;
initDodecahedron();
}
pentagon(0, 1, 9, 16, 5, type);
pentagon(1, 0, 3, 18, 7, type);
pentagon(1, 7, 11, 10, 9, type);
pentagon(11, 7, 18, 19, 6, type);
pentagon(8, 17, 16, 9, 10, type);
pentagon(2, 14, 15, 6, 19, type);
pentagon(2, 13, 12, 4, 14, type);
pentagon(2, 19, 18, 3, 13, type);
pentagon(3, 0, 5, 12, 13, type);
pentagon(6, 15, 8, 10, 11, type);
pentagon(4, 17, 8, 15, 14, type);
pentagon(4, 12, 5, 16, 17, type);
}
/* CENTRY */
void APIENTRY
glutWireDodecahedron(void)
{
dodecahedron(GL_LINE_LOOP);
}
void APIENTRY
glutSolidDodecahedron(void)
{
dodecahedron(GL_TRIANGLE_FAN);
}
/* ENDCENTRY */
static void
recorditem(GLfloat * n1, GLfloat * n2, GLfloat * n3,
GLenum shadeType)
{
GLfloat q0[3], q1[3];
DIFF3(n1, n2, q0);
DIFF3(n2, n3, q1);
crossprod(q0, q1, q1);
normalize(q1);
glBegin(shadeType);
glNormal3fv(q1);
glVertex3fv(n1);
glVertex3fv(n2);
glVertex3fv(n3);
glEnd();
}
static void
subdivide(GLfloat * v0, GLfloat * v1, GLfloat * v2,
GLenum shadeType)
{
int depth;
GLfloat w0[3], w1[3], w2[3];
GLfloat l;
int i, j, k, n;
depth = 1;
for (i = 0; i < depth; i++) {
for (j = 0; i + j < depth; j++) {
k = depth - i - j;
for (n = 0; n < 3; n++) {
w0[n] = (i * v0[n] + j * v1[n] + k * v2[n]) / depth;
w1[n] = ((i + 1) * v0[n] + j * v1[n] + (k - 1) * v2[n])
/ depth;
w2[n] = (i * v0[n] + (j + 1) * v1[n] + (k - 1) * v2[n])
/ depth;
}
l = sqrt(w0[0] * w0[0] + w0[1] * w0[1] + w0[2] * w0[2]);
w0[0] /= l;
w0[1] /= l;
w0[2] /= l;
l = sqrt(w1[0] * w1[0] + w1[1] * w1[1] + w1[2] * w1[2]);
w1[0] /= l;
w1[1] /= l;
w1[2] /= l;
l = sqrt(w2[0] * w2[0] + w2[1] * w2[1] + w2[2] * w2[2]);
w2[0] /= l;
w2[1] /= l;
w2[2] /= l;
recorditem(w1, w0, w2, shadeType);
}
}
}
static void
drawtriangle(int i, GLfloat data[][3], int ndx[][3],
GLenum shadeType)
{
GLfloat *x0, *x1, *x2;
x0 = data[ndx[i][0]];
x1 = data[ndx[i][1]];
x2 = data[ndx[i][2]];
subdivide(x0, x1, x2, shadeType);
}
/* octahedron data: The octahedron produced is centered at the
origin and has radius 1.0 */
static GLfloat odata[6][3] =
{
{1.0, 0.0, 0.0},
{-1.0, 0.0, 0.0},
{0.0, 1.0, 0.0},
{0.0, -1.0, 0.0},
{0.0, 0.0, 1.0},
{0.0, 0.0, -1.0}
};
static int ondex[8][3] =
{
{0, 4, 2},
{1, 2, 4},
{0, 3, 4},
{1, 4, 3},
{0, 2, 5},
{1, 5, 2},
{0, 5, 3},
{1, 3, 5}
};
static void
octahedron(GLenum shadeType)
{
int i;
for (i = 7; i >= 0; i--) {
drawtriangle(i, odata, ondex, shadeType);
}
}
/* CENTRY */
void APIENTRY
glutWireOctahedron(void)
{
octahedron(GL_LINE_LOOP);
}
void APIENTRY
glutSolidOctahedron(void)
{
octahedron(GL_TRIANGLES);
}
/* ENDCENTRY */
/* icosahedron data: These numbers are rigged to make an
icosahedron of radius 1.0 */
#define X .525731112119133606
#define Z .850650808352039932
static GLfloat idata[12][3] =
{
{-X, 0, Z},
{X, 0, Z},
{-X, 0, -Z},
{X, 0, -Z},
{0, Z, X},
{0, Z, -X},
{0, -Z, X},
{0, -Z, -X},
{Z, X, 0},
{-Z, X, 0},
{Z, -X, 0},
{-Z, -X, 0}
};
static int index[20][3] =
{
{0, 4, 1},
{0, 9, 4},
{9, 5, 4},
{4, 5, 8},
{4, 8, 1},
{8, 10, 1},
{8, 3, 10},
{5, 3, 8},
{5, 2, 3},
{2, 7, 3},
{7, 10, 3},
{7, 6, 10},
{7, 11, 6},
{11, 0, 6},
{0, 1, 6},
{6, 1, 10},
{9, 0, 11},
{9, 11, 2},
{9, 2, 5},
{7, 2, 11},
};
static void
icosahedron(GLenum shadeType)
{
int i;
for (i = 19; i >= 0; i--) {
drawtriangle(i, idata, index, shadeType);
}
}
/* CENTRY */
void APIENTRY
glutWireIcosahedron(void)
{
icosahedron(GL_LINE_LOOP);
}
void APIENTRY
glutSolidIcosahedron(void)
{
icosahedron(GL_TRIANGLES);
}
/* ENDCENTRY */
/* tetrahedron data: */
#define T 1.73205080756887729
static GLfloat tdata[4][3] =
{
{T, T, T},
{T, -T, -T},
{-T, T, -T},
{-T, -T, T}
};
static int tndex[4][3] =
{
{0, 1, 3},
{2, 1, 0},
{3, 2, 0},
{1, 2, 3}
};
static void
tetrahedron(GLenum shadeType)
{
int i;
for (i = 3; i >= 0; i--)
drawtriangle(i, tdata, tndex, shadeType);
}
/* CENTRY */
void APIENTRY
glutWireTetrahedron(void)
{
tetrahedron(GL_LINE_LOOP);
}
void APIENTRY
glutSolidTetrahedron(void)
{
tetrahedron(GL_TRIANGLES);
}
/* ENDCENTRY */

View File

@@ -19,7 +19,7 @@
*/
/*
* DOS/DJGPP glut driver v1.3 for Mesa
* DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -27,33 +27,7 @@
*/
#include "glutint.h"
int APIENTRY glutLayerGet (GLenum info)
{
switch (info) {
case GLUT_OVERLAY_POSSIBLE:
case GLUT_HAS_OVERLAY:
return GL_FALSE;
case GLUT_LAYER_IN_USE:
return GLUT_NORMAL;
case GLUT_NORMAL_DAMAGED:
return GL_FALSE;
case GLUT_OVERLAY_DAMAGED:
case GLUT_TRANSPARENT_INDEX:
default:
return -1;
}
}
void APIENTRY glutOverlayDisplayFunc (GLUTdisplayCB func)
{
}
#include "GL/glut.h"
void APIENTRY glutEstablishOverlay (void)
@@ -61,31 +35,26 @@ void APIENTRY glutEstablishOverlay (void)
}
void APIENTRY glutRemoveOverlay (void)
{
}
void APIENTRY glutUseLayer (GLenum layer)
{
}
void APIENTRY glutPostOverlayRedisplay (void)
{
}
void APIENTRY glutShowOverlay (void)
{
}
void APIENTRY glutHideOverlay (void)
{
}

View File

@@ -19,7 +19,7 @@
*/
/*
* DOS/DJGPP glut driver v1.3 for Mesa
* DOS/DJGPP glut driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -27,19 +27,16 @@
*/
#include "glutint.h"
#include "GL/glut.h"
#include "internal.h"
#define FREQUENCY 100
static int timer_installed;
static volatile int ticks;
static void ticks_timer (void *p)
{
(void)p;
@@ -51,92 +48,23 @@ static void ticks_timer (void *p)
int APIENTRY glutGet (GLenum type)
{
switch (type) {
case GLUT_WINDOW_X:
return g_curwin->xpos;
case GLUT_WINDOW_Y:
return g_curwin->ypos;
case GLUT_WINDOW_WIDTH:
return g_curwin->width;
case GLUT_WINDOW_HEIGHT:
return g_curwin->height;
case GLUT_WINDOW_STENCIL_SIZE:
return STENCIL_SIZE;
case GLUT_WINDOW_DEPTH_SIZE:
return DEPTH_SIZE;
case GLUT_WINDOW_RGBA:
return !(g_display_mode & GLUT_INDEX);
case GLUT_WINDOW_COLORMAP_SIZE:
return (g_display_mode & GLUT_INDEX) ? (256 - RESERVED_COLORS) : 0;
case GLUT_SCREEN_WIDTH:
return g_screen_w;
case GLUT_SCREEN_HEIGHT:
return g_screen_h;
case GLUT_INIT_WINDOW_X:
return g_init_x;
case GLUT_INIT_WINDOW_Y:
return g_init_y;
case GLUT_INIT_WINDOW_WIDTH:
return g_init_w;
case GLUT_INIT_WINDOW_HEIGHT:
return g_init_h;
case GLUT_INIT_DISPLAY_MODE:
return g_display_mode;
return 1;
case GLUT_ELAPSED_TIME:
if (!timer_installed) {
timer_installed = GL_TRUE;
timer_installed = !timer_installed;
LOCKDATA(ticks);
LOCKFUNC(ticks_timer);
pc_install_int(ticks_timer, NULL, FREQUENCY);
}
return ticks*1000/FREQUENCY;
default:
return -1;
return 0;
}
}
int APIENTRY glutDeviceGet (GLenum type)
{
switch (type) {
case GLUT_HAS_KEYBOARD:
return GL_TRUE;
case GLUT_HAS_MOUSE:
return (g_mouse != 0);
case GLUT_NUM_MOUSE_BUTTONS:
return g_mouse;
case GLUT_HAS_SPACEBALL:
case GLUT_HAS_DIAL_AND_BUTTON_BOX:
case GLUT_HAS_TABLET:
return GL_FALSE;
case GLUT_NUM_SPACEBALL_BUTTONS:
case GLUT_NUM_BUTTON_BOX_BUTTONS:
case GLUT_NUM_DIALS:
case GLUT_NUM_TABLET_BUTTONS:
return 0;
default:
return -1;
}
}
int APIENTRY glutGetModifiers (void)
{
int mod = 0;
int shifts = pc_keyshifts();
if (shifts & (KB_SHIFT_FLAG | KB_CAPSLOCK_FLAG)) {
mod |= GLUT_ACTIVE_SHIFT;
}
if (shifts & KB_ALT_FLAG) {
mod |= GLUT_ACTIVE_ALT;
}
if (shifts & KB_CTRL_FLAG) {
mod |= GLUT_ACTIVE_CTRL;
}
return mod;
return 0;
}

212
src/glut/dos/teapot.c Normal file
View File

@@ -0,0 +1,212 @@
/* Copyright (c) Mark J. Kilgard, 1994. */
/**
(c) Copyright 1993, Silicon Graphics, Inc.
ALL RIGHTS RESERVED
Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice appear in
supporting documentation, and that the name of Silicon
Graphics, Inc. not be used in advertising or publicity
pertaining to distribution of the software without specific,
written prior permission.
THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU
"AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR
OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO
EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE
ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER,
INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE,
SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR
NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR
PERFORMANCE OF THIS SOFTWARE.
US Government Users Restricted Rights
Use, duplication, or disclosure by the Government is subject to
restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 252.227-7013 and/or in similar or
successor clauses in the FAR or the DOD or NASA FAR
Supplement. Unpublished-- rights reserved under the copyright
laws of the United States. Contractor/manufacturer is Silicon
Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA
94039-7311.
OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
#include <GL/gl.h>
#include <GL/glu.h>
#include "GL/glut.h"
/* Rim, body, lid, and bottom data must be reflected in x and
y; handle and spout data across the y axis only. */
static int patchdata[][16] =
{
/* rim */
{102, 103, 104, 105, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15},
/* body */
{12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27},
{24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40},
/* lid */
{96, 96, 96, 96, 97, 98, 99, 100, 101, 101, 101,
101, 0, 1, 2, 3,},
{0, 1, 2, 3, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117},
/* bottom */
{118, 118, 118, 118, 124, 122, 119, 121, 123, 126,
125, 120, 40, 39, 38, 37},
/* handle */
{41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
53, 54, 55, 56},
{53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
28, 65, 66, 67},
/* spout */
{68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83},
{80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
92, 93, 94, 95}
};
/* *INDENT-OFF* */
static float cpdata[][3] =
{
{0.2, 0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0,
-0.2, 2.7}, {1.3375, 0, 2.53125}, {1.3375, -0.749, 2.53125},
{0.749, -1.3375, 2.53125}, {0, -1.3375, 2.53125}, {1.4375,
0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375,
2.53125}, {0, -1.4375, 2.53125}, {1.5, 0, 2.4}, {1.5, -0.84,
2.4}, {0.84, -1.5, 2.4}, {0, -1.5, 2.4}, {1.75, 0, 1.875},
{1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0, -1.75,
1.875}, {2, 0, 1.35}, {2, -1.12, 1.35}, {1.12, -2, 1.35},
{0, -2, 1.35}, {2, 0, 0.9}, {2, -1.12, 0.9}, {1.12, -2,
0.9}, {0, -2, 0.9}, {-2, 0, 0.9}, {2, 0, 0.45}, {2, -1.12,
0.45}, {1.12, -2, 0.45}, {0, -2, 0.45}, {1.5, 0, 0.225},
{1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0, -1.5, 0.225},
{1.5, 0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0,
-1.5, 0.15}, {-1.6, 0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5,
-0.3, 2.25}, {-1.5, 0, 2.25}, {-2.3, 0, 2.025}, {-2.3, -0.3,
2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0, 2.25}, {-2.7, 0,
2.025}, {-2.7, -0.3, 2.025}, {-3, -0.3, 2.25}, {-3, 0,
2.25}, {-2.7, 0, 1.8}, {-2.7, -0.3, 1.8}, {-3, -0.3, 1.8},
{-3, 0, 1.8}, {-2.7, 0, 1.575}, {-2.7, -0.3, 1.575}, {-3,
-0.3, 1.35}, {-3, 0, 1.35}, {-2.5, 0, 1.125}, {-2.5, -0.3,
1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0, 0.9375}, {-2,
-0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0, 0.6}, {1.7, 0,
1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0,
0.6}, {2.6, 0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66,
0.825}, {3.1, 0, 0.825}, {2.3, 0, 2.1}, {2.3, -0.25, 2.1},
{2.4, -0.25, 2.025}, {2.4, 0, 2.025}, {2.7, 0, 2.4}, {2.7,
-0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0, 2.4}, {2.8, 0,
2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375},
{3.525, 0, 2.49375}, {2.9, 0, 2.475}, {2.9, -0.15, 2.475},
{3.45, -0.15, 2.5125}, {3.45, 0, 2.5125}, {2.8, 0, 2.4},
{2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0, 2.4}, {0, 0,
3.15}, {0.8, 0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8,
3.15}, {0, -0.8, 3.15}, {0, 0, 2.85}, {1.4, 0, 2.4}, {1.4,
-0.784, 2.4}, {0.784, -1.4, 2.4}, {0, -1.4, 2.4}, {0.4, 0,
2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0, -0.4,
2.55}, {1.3, 0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3,
2.55}, {0, -1.3, 2.55}, {1.3, 0, 2.4}, {1.3, -0.728, 2.4},
{0.728, -1.3, 2.4}, {0, -1.3, 2.4}, {0, 0, 0}, {1.425,
-0.798, 0}, {1.5, 0, 0.075}, {1.425, 0, 0}, {0.798, -1.425,
0}, {0, -1.5, 0.075}, {0, -1.425, 0}, {1.5, -0.84, 0.075},
{0.84, -1.5, 0.075}
};
static float tex[2][2][2] =
{
{ {0, 0},
{1, 0}},
{ {0, 1},
{1, 1}}
};
/* *INDENT-ON* */
static void
teapot(GLint grid, GLdouble scale, GLenum type)
{
float p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3];
long i, j, k, l;
glPushAttrib(GL_ENABLE_BIT | GL_EVAL_BIT);
glEnable(GL_AUTO_NORMAL);
glEnable(GL_NORMALIZE);
glEnable(GL_MAP2_VERTEX_3);
glEnable(GL_MAP2_TEXTURE_COORD_2);
glPushMatrix();
glRotatef(270.0, 1.0, 0.0, 0.0);
glScalef(0.5 * scale, 0.5 * scale, 0.5 * scale);
glTranslatef(0.0, 0.0, -1.5);
for (i = 0; i < 10; i++) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
for (l = 0; l < 3; l++) {
p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
if (l == 1)
q[j][k][l] *= -1.0;
if (i < 6) {
r[j][k][l] =
cpdata[patchdata[i][j * 4 + (3 - k)]][l];
if (l == 0)
r[j][k][l] *= -1.0;
s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
if (l == 0)
s[j][k][l] *= -1.0;
if (l == 1)
s[j][k][l] *= -1.0;
}
}
}
}
glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, 0, 1, 4, 2,
&tex[0][0][0]);
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
&p[0][0][0]);
glMapGrid2f(grid, 0.0, 1.0, grid, 0.0, 1.0);
glEvalMesh2(type, 0, grid, 0, grid);
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
&q[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
if (i < 6) {
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
&r[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4,
&s[0][0][0]);
glEvalMesh2(type, 0, grid, 0, grid);
}
}
glPopMatrix();
glPopAttrib();
}
/* CENTRY */
void APIENTRY
glutSolidTeapot(GLdouble scale)
{
teapot(7, scale, GL_FILL);
}
void APIENTRY
glutWireTeapot(GLdouble scale)
{
teapot(10, scale, GL_LINE);
}
/* ENDCENTRY */

View File

@@ -19,7 +19,7 @@
*/
/*
* DOS/DJGPP glut driver v1.3 for Mesa
* DOS/DJGPP glut driver v1.2 for Mesa 4.1
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
@@ -27,19 +27,27 @@
*/
#include <stdio.h>
#include "glutint.h"
#include "GL/glut.h"
#ifndef FX
#include "GL/dmesa.h"
#else
#include "GL/fxmesa.h"
#endif
#include "internal.h"
GLUTwindow *g_curwin;
static GLuint swaptime, swapcount;
static int window;
#ifndef FX
static DMesaVisual visual = NULL;
static DMesaContext context = NULL;
static GLUTwindow *windows[MAX_WINDOWS];
static DMesaBuffer buffer[MAX_WINDOWS];
#else
static void *visual = NULL;
static fxMesaContext context = NULL;
static int fx_attrib[32];
#endif
@@ -47,11 +55,15 @@ static void clean (void)
{
int i;
for (i=1; i<=MAX_WINDOWS; i++) {
glutDestroyWindow(i);
for (i=0; i<MAX_WINDOWS; i++) {
glutDestroyWindow(i+1);
}
#ifndef FX
if (context) DMesaDestroyContext(context);
if (visual) DMesaDestroyVisual(visual);
#else
if (context) fxMesaDestroyContext(context);
#endif
pc_close_stdout();
pc_close_stderr();
@@ -62,64 +74,81 @@ static void clean (void)
int APIENTRY glutCreateWindow (const char *title)
{
int i;
int m8width = (g_init_w + 7) & ~7;
if (!visual) {
if ((visual=DMesaCreateVisual(g_init_x + m8width, g_init_y + g_init_h, g_bpp, g_refresh,
int screen_w = DEFAULT_WIDTH;
int screen_h = DEFAULT_HEIGHT;
if ((g_width<=640) && (g_height<=480)) {
screen_w = 640;
screen_h = 480;
} else if ((g_width<=800) && (g_height<=600)) {
screen_w = 800;
screen_h = 600;
} else if ((g_width<=1024) && (g_height<=768)) {
screen_w = 1024;
screen_h = 768;
}
#ifndef FX
if ((visual=DMesaCreateVisual(screen_w, screen_h, DEFAULT_BPP,
g_display_mode & GLUT_DOUBLE,
!(g_display_mode & GLUT_INDEX),
g_display_mode & GLUT_ALPHA,
g_display_mode & GLUT_DEPTH ?DEPTH_SIZE :0,
g_display_mode & GLUT_STENCIL?STENCIL_SIZE:0,
g_display_mode & GLUT_ACCUM ?ACCUM_SIZE :0))==NULL) {
return 0;
}
if ((context=DMesaCreateContext(visual, NULL))==NULL) {
DMesaDestroyVisual(visual);
return 0;
}
#else
i = 0;
if (g_display_mode & GLUT_DOUBLE) fx_attrib[i++] = FXMESA_DOUBLEBUFFER;
if (g_display_mode & GLUT_DEPTH) { fx_attrib[i++] = FXMESA_DEPTH_SIZE; fx_attrib[i++] = DEPTH_SIZE; }
if (g_display_mode & GLUT_STENCIL) { fx_attrib[i++] = FXMESA_STENCIL_SIZE; fx_attrib[i++] = STENCIL_SIZE; }
if (g_display_mode & GLUT_ACCUM) { fx_attrib[i++] = FXMESA_ACCUM_SIZE; fx_attrib[i++] = ACCUM_SIZE; }
fx_attrib[i] = FXMESA_NONE;
if ((context=fxMesaCreateBestContext(-1, screen_w, screen_h, fx_attrib))==NULL) {
return 0;
}
visual = context;
#endif
pc_open_stdout();
pc_open_stderr();
pc_atexit(clean);
}
#ifndef FX
for (i=0; i<MAX_WINDOWS; i++) {
if (windows[i] == NULL) {
if (!buffer[i]) {
DMesaBuffer b;
GLUTwindow *w;
if ((w=(GLUTwindow *)calloc(1, sizeof(GLUTwindow))) == NULL) {
return 0;
}
if ((b=DMesaCreateBuffer(visual, g_init_x, g_init_y, m8width, g_init_h))==NULL) {
free(w);
if ((b=DMesaCreateBuffer(visual, g_xpos, g_ypos, g_width, g_height))==NULL) {
return 0;
}
if (!DMesaMakeCurrent(context, b)) {
DMesaDestroyBuffer(b);
free(w);
return 0;
}
if (g_mouse) {
pc_mouse_area(g_xpos, g_ypos, g_xpos + g_width - 1, g_ypos + g_height - 1);
}
g_curwin = windows[i] = w;
w->num = ++i;
w->xpos = g_init_x;
w->ypos = g_init_y;
w->width = m8width;
w->height = g_init_h;
w->buffer = b;
return i;
buffer[window = i] = b;
return i+1;
}
}
return 0;
}
#else
fxMesaMakeCurrent(context);
return 1;
#endif
}
int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height)
@@ -128,133 +157,104 @@ int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height)
}
void APIENTRY glutDestroyWindow (int win)
{
if (windows[--win]) {
DMesaDestroyBuffer(windows[win]->buffer);
free(windows[win]);
windows[win] = NULL;
#ifndef FX
if (buffer[win-1]) {
DMesaDestroyBuffer(buffer[win-1]);
buffer[win-1] = NULL;
}
#endif
}
void APIENTRY glutPostRedisplay (void)
{
g_redisplay = GL_TRUE;
}
void APIENTRY glutSwapBuffers (void)
{
if (g_curwin->show_mouse) {
/* XXX scare mouse */
DMesaSwapBuffers(g_curwin->buffer);
/* XXX unscare mouse */
} else {
DMesaSwapBuffers(g_curwin->buffer);
}
if (g_fps) {
GLint t = glutGet(GLUT_ELAPSED_TIME);
swapcount++;
if (swaptime == 0)
swaptime = t;
else if (t - swaptime > g_fps) {
double time = 0.001 * (t - swaptime);
double fps = (double)swapcount / time;
fprintf(stderr, "GLUT: %d frames in %.2f seconds = %.2f FPS\n", swapcount, time, fps);
swaptime = t;
swapcount = 0;
}
}
if (g_mouse) pc_scare_mouse();
#ifndef FX
DMesaSwapBuffers(buffer[window]);
#else
fxMesaSwapBuffers();
#endif
if (g_mouse) pc_unscare_mouse();
}
int APIENTRY glutGetWindow (void)
{
return g_curwin->num;
return window + 1;
}
void APIENTRY glutSetWindow (int win)
{
g_curwin = windows[win - 1];
window = win - 1;
}
void APIENTRY glutSetWindowTitle (const char *title)
{
}
void APIENTRY glutSetIconTitle (const char *title)
{
}
void APIENTRY glutPositionWindow (int x, int y)
{
if (DMesaMoveBuffer(x, y)) {
g_curwin->xpos = x;
g_curwin->ypos = y;
#ifndef FX
if (DMesaViewport(buffer[window], x, y, g_width, g_height)) {
g_xpos = x;
g_ypos = y;
}
#endif
}
void APIENTRY glutReshapeWindow (int width, int height)
{
if (DMesaResizeBuffer(width, height)) {
g_curwin->width = width;
g_curwin->height = height;
if (g_curwin->reshape) {
g_curwin->reshape(width, height);
{
#ifndef FX
if (DMesaViewport(buffer[window], g_xpos, g_ypos, width, height)) {
g_width = width;
g_height = height;
if (reshape_func) {
reshape_func(width, height);
} else {
glViewport(0, 0, width, height);
}
}
#endif
}
void APIENTRY glutFullScreen (void)
{
}
void APIENTRY glutPopWindow (void)
{
}
void APIENTRY glutPushWindow (void)
{
}
void APIENTRY glutIconifyWindow (void)
{
}
void APIENTRY glutShowWindow (void)
{
}
void APIENTRY glutHideWindow (void)
{
}

View File

@@ -121,11 +121,6 @@ EXPORTS
glutWireTeapot
glutWireTetrahedron
glutWireTorus
glutStrokeRoman
glutBitmap9By15
glutBitmapHelvetica10
glutBitmapHelvetica18
glutBitmapTimesRoman24
; __glutSetFCB
; __glutGetFCB

View File

@@ -8,7 +8,7 @@
#include "glutint.h"
#include "glutbitmap.h"
void GLUTAPIENTRY
void APIENTRY
glutBitmapCharacter(GLUTbitmapFont font, int c)
{
const BitmapCharRec *ch;

View File

@@ -9,7 +9,7 @@
#include "glutbitmap.h"
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutBitmapWidth(GLUTbitmapFont font, int c)
{
BitmapFontPtr fontinfo;
@@ -30,7 +30,7 @@ glutBitmapWidth(GLUTbitmapFont font, int c)
return 0;
}
int GLUTAPIENTRY
int APIENTRY
glutBitmapLength(GLUTbitmapFont font, const unsigned char *string)
{
int c, length;

View File

@@ -11,7 +11,7 @@
#define CLAMP(i) ((i) > 1.0 ? 1.0 : ((i) < 0.0 ? 0.0 : (i)))
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue)
{
GLUTcolormap *cmap, *newcmap;
@@ -126,7 +126,7 @@ glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue)
XStoreColor(__glutDisplay, cmap->cmap, &color);
}
GLfloat GLUTAPIENTRY
GLfloat APIENTRY
glutGetColor(int ndx, int comp)
{
GLUTcolormap *colormap;
@@ -161,7 +161,7 @@ glutGetColor(int ndx, int comp)
return colormap->cells[ndx].component[comp];
}
void GLUTAPIENTRY
void APIENTRY
glutCopyColormap(int winnum)
{
GLUTwindow *window = __glutWindowList[winnum - 1];

View File

@@ -180,7 +180,7 @@ __glutSetCursor(GLUTwindow *window)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutSetCursor(int cursor)
{
#ifdef _WIN32

View File

@@ -7,7 +7,7 @@
#include "glutint.h"
void GLUTAPIENTRY
void APIENTRY
glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc)
{
__glutCurrentWindow->buttonBox = buttonBoxFunc;
@@ -16,7 +16,7 @@ glutButtonBoxFunc(GLUTbuttonBoxCB buttonBoxFunc)
GLUT_DEVICE_MASK_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutDialsFunc(GLUTdialsCB dialsFunc)
{
__glutCurrentWindow->dials = dialsFunc;

View File

@@ -1478,7 +1478,7 @@ getVisualInfoFromString(char *string, Bool * treatAsSingle,
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutInitDisplayString(const char *string)
{
#ifdef _WIN32

View File

@@ -103,13 +103,13 @@ Atom __glutMotifHints = None;
unsigned int __glutModifierMask = (unsigned int) ~0;
int __glutWindowDamaged = 0;
void GLUTAPIENTRY
void APIENTRY
glutIdleFunc(GLUTidleCB idleFunc)
{
__glutIdleFunc = idleFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value)
{
GLUTtimer *timer, *other;
@@ -215,7 +215,7 @@ __glutPostRedisplay(GLUTwindow * window, int layerMask)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutPostRedisplay(void)
{
__glutPostRedisplay(__glutCurrentWindow, GLUT_REDISPLAY_WORK);
@@ -225,7 +225,7 @@ glutPostRedisplay(void)
glutSetWindow call (entailing an expensive OpenGL context switch),
particularly useful when multiple windows need redisplays posted at
the same times. See also glutPostWindowOverlayRedisplay. */
void GLUTAPIENTRY
void APIENTRY
glutPostWindowRedisplay(int win)
{
__glutPostRedisplay(__glutWindowList[win - 1], GLUT_REDISPLAY_WORK);
@@ -1351,7 +1351,7 @@ __glutProcessWindowWorkLists(void)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutMainLoop(void)
{
#if !defined(_WIN32)

View File

@@ -11,7 +11,7 @@
#include "glutint.h"
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutExtensionSupported(const char *extension)
{
static const GLubyte *extensions = NULL;
@@ -177,7 +177,7 @@ static struct name_address_pair glut_functions[] = {
/* XXX This isn't an official GLUT function, yet */
void * GLUTAPIENTRY
void * APIENTRY
glutGetProcAddress(const char *procName)
{
/* Try GLUT functions first */

View File

@@ -18,7 +18,7 @@
/* Set a Fortran callback function. */
void GLUTAPIENTRY
void APIENTRY
__glutSetFCB(int which, void *func)
{
#ifdef SUPPORT_FORTRAN
@@ -100,7 +100,7 @@ __glutSetFCB(int which, void *func)
/* Get a Fortran callback function. */
void* GLUTAPIENTRY
void* APIENTRY
__glutGetFCB(int which)
{
#ifdef SUPPORT_FORTRAN

View File

@@ -28,7 +28,7 @@
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutFullScreen(void)
{
assert(!__glutCurrentWindow->parent);

View File

@@ -45,7 +45,7 @@ static char *capstr[] =
};
#endif
void
void __cdecl
__glutCloseDownGameMode(void)
{
if (__glutDisplaySettingsChanged) {
@@ -59,7 +59,7 @@ __glutCloseDownGameMode(void)
__glutGameModeWindow = NULL;
}
void GLUTAPIENTRY
void APIENTRY
glutLeaveGameMode(void)
{
if (__glutGameModeWindow == NULL) {
@@ -548,7 +548,7 @@ parseDisplayString(const char *display, int *ncriteria)
return criteria;
}
void GLUTAPIENTRY
void APIENTRY
glutGameModeString(const char *string)
{
Criterion *criteria;
@@ -560,7 +560,7 @@ glutGameModeString(const char *string)
free(criteria);
}
int GLUTAPIENTRY
int APIENTRY
glutEnterGameMode(void)
{
GLUTwindow *window;
@@ -654,7 +654,7 @@ glutEnterGameMode(void)
return window->num + 1;
}
int GLUTAPIENTRY
int APIENTRY
glutGameModeGet(GLenum mode)
{
switch (mode) {

View File

@@ -10,7 +10,7 @@
#include "glutint.h"
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutGet(GLenum param)
{
Window win, root;

View File

@@ -186,7 +186,7 @@ removeArgs(int *argcp, char **argv, int numToRemove)
*argcp -= numToRemove;
}
void GLUTAPIENTRY
void APIENTRY
glutInit(int *argcp, char **argv)
{
char *display = NULL;
@@ -344,7 +344,7 @@ glutInit(int *argcp, char **argv)
}
#ifdef _WIN32
void GLUTAPIENTRY
void APIENTRY
__glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int))
{
__glutExitFunc = exitfunc;
@@ -353,7 +353,7 @@ __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int))
#endif
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutInitWindowPosition(int x, int y)
{
__glutInitX = x;
@@ -367,7 +367,7 @@ glutInitWindowPosition(int x, int y)
}
}
void GLUTAPIENTRY
void APIENTRY
glutInitWindowSize(int width, int height)
{
__glutInitWidth = width;
@@ -381,7 +381,7 @@ glutInitWindowSize(int width, int height)
}
}
void GLUTAPIENTRY
void APIENTRY
glutInitDisplayMode(unsigned int mask)
{
__glutDisplayMode = mask;

View File

@@ -581,7 +581,7 @@ __glutUpdateInputDeviceMask(GLUTwindow * window)
}
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutDeviceGet(GLenum param)
{
probeDevices();

View File

@@ -15,7 +15,7 @@
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutJoystickFunc(GLUTjoystickCB joystickFunc, int pollInterval)
{
#ifdef _WIN32
@@ -48,7 +48,7 @@ glutJoystickFunc(GLUTjoystickCB joystickFunc, int pollInterval)
#endif
}
void GLUTAPIENTRY
void APIENTRY
glutForceJoystickFunc(void)
{
#ifdef _WIN32

View File

@@ -10,7 +10,7 @@
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutKeyboardFunc(GLUTkeyboardCB keyboardFunc)
{
__glutChangeWindowEventMask(KeyPressMask,
@@ -18,7 +18,7 @@ glutKeyboardFunc(GLUTkeyboardCB keyboardFunc)
__glutCurrentWindow->keyboard = keyboardFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutSpecialFunc(GLUTspecialCB specialFunc)
{
__glutChangeWindowEventMask(KeyPressMask,

View File

@@ -8,13 +8,13 @@
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutIgnoreKeyRepeat(int ignore)
{
__glutCurrentWindow->ignoreKeyRepeat = ignore;
}
void GLUTAPIENTRY
void APIENTRY
glutSetKeyRepeat(int repeatMode)
{
#if !defined(_WIN32)

View File

@@ -10,7 +10,7 @@
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutKeyboardUpFunc(GLUTkeyboardCB keyboardUpFunc)
{
__glutChangeWindowEventMask(KeyReleaseMask,
@@ -18,7 +18,7 @@ glutKeyboardUpFunc(GLUTkeyboardCB keyboardUpFunc)
__glutCurrentWindow->keyboardUp = keyboardUpFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutSpecialUpFunc(GLUTspecialCB specialUpFunc)
{
__glutChangeWindowEventMask(KeyReleaseMask,

View File

@@ -831,7 +831,7 @@ installMenuCallbacks(void)
__glutGetMenuItem = getMenuItem;
}
int GLUTAPIENTRY
int APIENTRY
glutCreateMenu(GLUTselectCB selectFunc)
{
XSetWindowAttributes wa;
@@ -890,7 +890,7 @@ glutCreateMenu(GLUTselectCB selectFunc)
}
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutGetMenu(void)
{
if (__glutCurrentMenu) {
@@ -900,7 +900,7 @@ glutGetMenu(void)
}
}
void GLUTAPIENTRY
void APIENTRY
glutSetMenu(int menuid)
{
GLUTmenu *menu;
@@ -940,7 +940,7 @@ __glutSetMenuItem(GLUTmenuItem * item, const char *label,
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutAddMenuEntry(const char *label, int value)
{
XSetWindowAttributes wa;
@@ -968,7 +968,7 @@ glutAddMenuEntry(const char *label, int value)
__glutCurrentMenu->list = entry;
}
void GLUTAPIENTRY
void APIENTRY
glutAddSubMenu(const char *label, int menu)
{
XSetWindowAttributes wa;
@@ -997,7 +997,7 @@ glutAddSubMenu(const char *label, int menu)
__glutCurrentMenu->list = submenu;
}
void GLUTAPIENTRY
void APIENTRY
glutAttachMenu(int button)
{
if (__glutMappedMenu) {

View File

@@ -29,19 +29,19 @@
/* CENTRY */
/* DEPRICATED, use glutMenuStatusFunc instead. */
void GLUTAPIENTRY
void APIENTRY
glutMenuStateFunc(GLUTmenuStateCB menuStateFunc)
{
__glutMenuStatusFunc = (GLUTmenuStatusCB) menuStateFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc)
{
__glutMenuStatusFunc = menuStatusFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutDestroyMenu(int menunum)
{
GLUTmenu *menu = __glutGetMenuByNum(menunum);
@@ -68,7 +68,7 @@ glutDestroyMenu(int menunum)
free(menu);
}
void GLUTAPIENTRY
void APIENTRY
glutChangeToMenuEntry(int num, const char *label, int value)
{
GLUTmenuItem *item;
@@ -95,7 +95,7 @@ glutChangeToMenuEntry(int num, const char *label, int value)
__glutWarning("Current menu has no %d item.", num);
}
void GLUTAPIENTRY
void APIENTRY
glutChangeToSubMenu(int num, const char *label, int menu)
{
GLUTmenuItem *item;
@@ -122,7 +122,7 @@ glutChangeToSubMenu(int num, const char *label, int menu)
__glutWarning("Current menu has no %d item.", num);
}
void GLUTAPIENTRY
void APIENTRY
glutRemoveMenuItem(int num)
{
GLUTmenuItem *item, **prev, *remaining;
@@ -173,7 +173,7 @@ glutRemoveMenuItem(int num)
__glutWarning("Current menu has no %d item.", num);
}
void GLUTAPIENTRY
void APIENTRY
glutDetachMenu(int button)
{
if (__glutMappedMenu)

View File

@@ -8,7 +8,7 @@
#include "glutint.h"
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutGetModifiers(void)
{
int modifiers;

View File

@@ -356,7 +356,7 @@ determineOverlayVisual(int *treatAsSingle, Bool * visAlloced, void **fbc)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutEstablishOverlay(void)
{
GLUToverlay *overlay;
@@ -458,7 +458,7 @@ glutEstablishOverlay(void)
}
}
void GLUTAPIENTRY
void APIENTRY
glutRemoveOverlay(void)
{
GLUTwindow *window = __glutCurrentWindow;
@@ -481,7 +481,7 @@ glutRemoveOverlay(void)
#endif
}
void GLUTAPIENTRY
void APIENTRY
glutUseLayer(GLenum layer)
{
GLUTwindow *window = __glutCurrentWindow;
@@ -511,7 +511,7 @@ glutUseLayer(GLenum layer)
__glutSetWindow(window);
}
void GLUTAPIENTRY
void APIENTRY
glutPostOverlayRedisplay(void)
{
__glutPostRedisplay(__glutCurrentWindow, GLUT_OVERLAY_REDISPLAY_WORK);
@@ -521,13 +521,13 @@ glutPostOverlayRedisplay(void)
glutSetWindow call (entailing an expensive OpenGL context
switch), particularly useful when multiple windows need
redisplays posted at the same times. */
void GLUTAPIENTRY
void APIENTRY
glutPostWindowOverlayRedisplay(int win)
{
__glutPostRedisplay(__glutWindowList[win - 1], GLUT_OVERLAY_REDISPLAY_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutOverlayDisplayFunc(GLUTdisplayCB displayFunc)
{
if (!__glutCurrentWindow->overlay) {
@@ -537,7 +537,7 @@ glutOverlayDisplayFunc(GLUTdisplayCB displayFunc)
__glutCurrentWindow->overlay->display = displayFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutHideOverlay(void)
{
if (!__glutCurrentWindow->overlay) {
@@ -548,7 +548,7 @@ glutHideOverlay(void)
__glutCurrentWindow->overlay->shownState = 0;
}
void GLUTAPIENTRY
void APIENTRY
glutShowOverlay(void)
{
if (!__glutCurrentWindow->overlay) {
@@ -559,7 +559,7 @@ glutShowOverlay(void)
__glutCurrentWindow->overlay->shownState = 1;
}
int GLUTAPIENTRY
int APIENTRY
glutLayerGet(GLenum param)
{
switch (param) {

View File

@@ -65,7 +65,7 @@ initQuadObj(void)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
@@ -77,7 +77,7 @@ glutWireSphere(GLdouble radius, GLint slices, GLint stacks)
gluSphere(quadObj, radius, slices, stacks);
}
void GLUTAPIENTRY
void APIENTRY
glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
@@ -89,7 +89,7 @@ glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
gluSphere(quadObj, radius, slices, stacks);
}
void GLUTAPIENTRY
void APIENTRY
glutWireCone(GLdouble base, GLdouble height,
GLint slices, GLint stacks)
{
@@ -102,7 +102,7 @@ glutWireCone(GLdouble base, GLdouble height,
gluCylinder(quadObj, base, 0.0, height, slices, stacks);
}
void GLUTAPIENTRY
void APIENTRY
glutSolidCone(GLdouble base, GLdouble height,
GLint slices, GLint stacks)
{
@@ -160,13 +160,13 @@ drawBox(GLfloat size, GLenum type)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutWireCube(GLdouble size)
{
drawBox(size, GL_LINE_LOOP);
}
void GLUTAPIENTRY
void APIENTRY
glutSolidCube(GLdouble size)
{
drawBox(size, GL_QUADS);
@@ -216,7 +216,7 @@ doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutWireTorus(GLdouble innerRadius, GLdouble outerRadius,
GLint nsides, GLint rings)
{
@@ -226,7 +226,7 @@ glutWireTorus(GLdouble innerRadius, GLdouble outerRadius,
glPopAttrib();
}
void GLUTAPIENTRY
void APIENTRY
glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius,
GLint nsides, GLint rings)
{
@@ -349,13 +349,13 @@ dodecahedron(GLenum type)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutWireDodecahedron(void)
{
dodecahedron(GL_LINE_LOOP);
}
void GLUTAPIENTRY
void APIENTRY
glutSolidDodecahedron(void)
{
dodecahedron(GL_TRIANGLE_FAN);
@@ -466,13 +466,13 @@ octahedron(GLenum shadeType)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutWireOctahedron(void)
{
octahedron(GL_LINE_LOOP);
}
void GLUTAPIENTRY
void APIENTRY
glutSolidOctahedron(void)
{
octahedron(GL_TRIANGLES);
@@ -537,13 +537,13 @@ icosahedron(GLenum shadeType)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutWireIcosahedron(void)
{
icosahedron(GL_LINE_LOOP);
}
void GLUTAPIENTRY
void APIENTRY
glutSolidIcosahedron(void)
{
icosahedron(GL_TRIANGLES);
@@ -581,13 +581,13 @@ tetrahedron(GLenum shadeType)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutWireTetrahedron(void)
{
tetrahedron(GL_LINE_LOOP);
}
void GLUTAPIENTRY
void APIENTRY
glutSolidTetrahedron(void)
{
tetrahedron(GL_TRIANGLES);

View File

@@ -7,7 +7,7 @@
#include "glutint.h"
void GLUTAPIENTRY
void APIENTRY
glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc)
{
__glutCurrentWindow->spaceMotion = spaceMotionFunc;
@@ -16,7 +16,7 @@ glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc)
GLUT_DEVICE_MASK_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc)
{
__glutCurrentWindow->spaceRotate = spaceRotateFunc;
@@ -25,7 +25,7 @@ glutSpaceballRotateFunc(GLUTspaceRotateCB spaceRotateFunc)
GLUT_DEVICE_MASK_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutSpaceballButtonFunc(GLUTspaceButtonCB spaceButtonFunc)
{
__glutCurrentWindow->spaceButton = spaceButtonFunc;

View File

@@ -8,7 +8,7 @@
#include "glutint.h"
#include "glutstroke.h"
void GLUTAPIENTRY
void APIENTRY
glutStrokeCharacter(GLUTstrokeFont font, int c)
{
const StrokeCharRec *ch;

View File

@@ -13,7 +13,7 @@ GLint __glutSwapCount = 0;
GLint __glutSwapTime = 0;
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutSwapBuffers(void)
{
GLUTwindow *window = __glutCurrentWindow;

View File

@@ -9,7 +9,7 @@
#include "glutstroke.h"
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutStrokeWidth(GLUTstrokeFont font, int c)
{
StrokeFontPtr fontinfo;
@@ -30,7 +30,7 @@ glutStrokeWidth(GLUTstrokeFont font, int c)
return 0;
}
int GLUTAPIENTRY
int APIENTRY
glutStrokeLength(GLUTstrokeFont font, const unsigned char *string)
{
int c, length;

View File

@@ -9,7 +9,7 @@
#include "glutint.h"
void GLUTAPIENTRY
void APIENTRY
glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc)
{
__glutCurrentWindow->tabletMotion = tabletMotionFunc;
@@ -23,7 +23,7 @@ glutTabletMotionFunc(GLUTtabletMotionCB tabletMotionFunc)
}
}
void GLUTAPIENTRY
void APIENTRY
glutTabletButtonFunc(GLUTtabletButtonCB tabletButtonFunc)
{
__glutCurrentWindow->tabletButton = tabletButtonFunc;

View File

@@ -195,13 +195,13 @@ teapot(GLint grid, GLdouble scale, GLenum type)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutSolidTeapot(GLdouble scale)
{
teapot(7, scale, GL_FILL);
}
void GLUTAPIENTRY
void APIENTRY
glutWireTeapot(GLdouble scale)
{
teapot(10, scale, GL_LINE);

View File

@@ -42,7 +42,7 @@ __glutWarning(char *format,...)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutReportErrors(void)
{
GLenum error;

View File

@@ -50,7 +50,7 @@ catchXSGIvcErrors(Display * dpy, XErrorEvent * event)
#endif
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutVideoResizeGet(GLenum param)
{
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
@@ -160,7 +160,7 @@ glutVideoResizeGet(GLenum param)
}
}
void GLUTAPIENTRY
void APIENTRY
glutSetupVideoResizing(void)
{
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
@@ -173,7 +173,7 @@ glutSetupVideoResizing(void)
__glutFatalError("glutEstablishVideoResizing: video resizing not possible.\n");
}
void GLUTAPIENTRY
void APIENTRY
glutStopVideoResizing(void)
{
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
@@ -188,7 +188,7 @@ glutStopVideoResizing(void)
}
/* ARGSUSED */
void GLUTAPIENTRY
void APIENTRY
glutVideoResize(int x, int y, int width, int height)
{
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
@@ -207,7 +207,7 @@ glutVideoResize(int x, int y, int width, int height)
}
/* ARGSUSED */
void GLUTAPIENTRY
void APIENTRY
glutVideoPan(int x, int y, int width, int height)
{
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)

View File

@@ -12,7 +12,7 @@
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutWarpPointer(int x, int y)
{
XWarpPointer(__glutDisplay, None, __glutCurrentWindow->win,

View File

@@ -130,7 +130,7 @@ __glutGetWindow(Window win)
}
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutGetWindow(void)
{
if (__glutCurrentWindow) {
@@ -177,7 +177,7 @@ __glutSetWindow(GLUTwindow * window)
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutSetWindow(int win)
{
GLUTwindow *window;
@@ -695,7 +695,7 @@ __glutCreateWindow(GLUTwindow * parent,
}
/* CENTRY */
int GLUTAPIENTRY
int APIENTRY
glutCreateWindow(const char *title)
{
static int firstWindow = 1;
@@ -742,7 +742,7 @@ glutCreateWindow(const char *title)
}
#ifdef _WIN32
int GLUTAPIENTRY
int APIENTRY
__glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int))
{
__glutExitFunc = exitfunc;
@@ -750,7 +750,7 @@ __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int))
}
#endif
int GLUTAPIENTRY
int APIENTRY
glutCreateSubWindow(int win, int x, int y, int width, int height)
{
GLUTwindow *window;
@@ -842,7 +842,7 @@ __glutDestroyWindow(GLUTwindow * window,
}
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutDestroyWindow(int win)
{
GLUTwindow *window = __glutWindowList[win - 1];
@@ -886,7 +886,7 @@ __glutChangeWindowEventMask(long eventMask, Bool add)
}
}
void GLUTAPIENTRY
void APIENTRY
glutDisplayFunc(GLUTdisplayCB displayFunc)
{
/* XXX Remove the warning after GLUT 3.0. */
@@ -895,7 +895,7 @@ glutDisplayFunc(GLUTdisplayCB displayFunc)
__glutCurrentWindow->display = displayFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutMouseFunc(GLUTmouseCB mouseFunc)
{
if (__glutCurrentWindow->mouse) {
@@ -917,7 +917,7 @@ glutMouseFunc(GLUTmouseCB mouseFunc)
__glutCurrentWindow->mouse = mouseFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutMotionFunc(GLUTmotionCB motionFunc)
{
/* Hack. Some window managers (4Dwm by default) will mask
@@ -948,7 +948,7 @@ glutMotionFunc(GLUTmotionCB motionFunc)
__glutCurrentWindow->motion = motionFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc)
{
__glutChangeWindowEventMask(PointerMotionMask,
@@ -963,7 +963,7 @@ glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc)
__glutCurrentWindow->passive = passiveMotionFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutEntryFunc(GLUTentryCB entryFunc)
{
__glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask,
@@ -974,7 +974,7 @@ glutEntryFunc(GLUTentryCB entryFunc)
}
}
void GLUTAPIENTRY
void APIENTRY
glutWindowStatusFunc(GLUTwindowStatusCB windowStatusFunc)
{
__glutChangeWindowEventMask(VisibilityChangeMask,
@@ -995,7 +995,7 @@ visibilityHelper(int status)
__glutCurrentWindow->visibility(GLUT_VISIBLE);
}
void GLUTAPIENTRY
void APIENTRY
glutVisibilityFunc(GLUTvisibilityCB visibilityFunc)
{
__glutCurrentWindow->visibility = visibilityFunc;
@@ -1005,7 +1005,7 @@ glutVisibilityFunc(GLUTvisibilityCB visibilityFunc)
glutWindowStatusFunc(NULL);
}
void GLUTAPIENTRY
void APIENTRY
glutReshapeFunc(GLUTreshapeCB reshapeFunc)
{
if (reshapeFunc) {

View File

@@ -23,7 +23,7 @@
#include "glutint.h"
/* CENTRY */
void GLUTAPIENTRY
void APIENTRY
glutSetWindowTitle(const char *title)
{
XTextProperty textprop;
@@ -39,7 +39,7 @@ glutSetWindowTitle(const char *title)
XFlush(__glutDisplay);
}
void GLUTAPIENTRY
void APIENTRY
glutSetIconTitle(const char *title)
{
XTextProperty textprop;
@@ -55,7 +55,7 @@ glutSetIconTitle(const char *title)
XFlush(__glutDisplay);
}
void GLUTAPIENTRY
void APIENTRY
glutPositionWindow(int x, int y)
{
IGNORE_IN_GAME_MODE();
@@ -65,7 +65,7 @@ glutPositionWindow(int x, int y)
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutReshapeWindow(int w, int h)
{
IGNORE_IN_GAME_MODE();
@@ -78,7 +78,7 @@ glutReshapeWindow(int w, int h)
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutPopWindow(void)
{
IGNORE_IN_GAME_MODE();
@@ -87,7 +87,7 @@ glutPopWindow(void)
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutPushWindow(void)
{
IGNORE_IN_GAME_MODE();
@@ -96,7 +96,7 @@ glutPushWindow(void)
__glutPutOnWorkList(__glutCurrentWindow, GLUT_CONFIGURE_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutIconifyWindow(void)
{
IGNORE_IN_GAME_MODE();
@@ -105,7 +105,7 @@ glutIconifyWindow(void)
__glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutShowWindow(void)
{
IGNORE_IN_GAME_MODE();
@@ -113,7 +113,7 @@ glutShowWindow(void)
__glutPutOnWorkList(__glutCurrentWindow, GLUT_MAP_WORK);
}
void GLUTAPIENTRY
void APIENTRY
glutHideWindow(void)
{
IGNORE_IN_GAME_MODE();

View File

@@ -796,7 +796,7 @@ extern void __glutUpdateInputDeviceMask(GLUTwindow * window);
extern void __glutDetermineMesaSwapHackSupport(void);
/* private routines from glut_gameglut.c */
extern void __glutCloseDownGameMode(void);
extern void GLUTAPIENTRYV __glutCloseDownGameMode(void);
/* private variables from glut_swap.c (BrianP) */
extern GLint __glutFPS;

View File

@@ -29,13 +29,13 @@ static int menuListSize = 0;
static UINT uniqueMenuHandler = 1;
/* DEPRICATED, use glutMenuStatusFunc instead. */
void GLUTAPIENTRY
void APIENTRY
glutMenuStateFunc(GLUTmenuStateCB menuStateFunc)
{
__glutMenuStatusFunc = (GLUTmenuStatusCB) menuStateFunc;
}
void GLUTAPIENTRY
void APIENTRY
glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc)
{
__glutMenuStatusFunc = menuStatusFunc;
@@ -231,7 +231,7 @@ menuModificationError(void)
__glutFatalError("menu manipulation not allowed while menus in use.");
}
int GLUTAPIENTRY
int APIENTRY
glutCreateMenu(GLUTselectCB selectFunc)
{
GLUTmenu *menu;
@@ -259,14 +259,14 @@ glutCreateMenu(GLUTselectCB selectFunc)
return menuid + 1;
}
int GLUTAPIENTRY
int APIENTRY
__glutCreateMenuWithExit(GLUTselectCB selectFunc, void (__cdecl *exitfunc)(int))
{
__glutExitFunc = exitfunc;
return glutCreateMenu(selectFunc);
}
void GLUTAPIENTRY
void APIENTRY
glutDestroyMenu(int menunum)
{
GLUTmenu *menu = __glutGetMenuByNum(menunum);
@@ -293,7 +293,7 @@ glutDestroyMenu(int menunum)
free(menu);
}
int GLUTAPIENTRY
int APIENTRY
glutGetMenu(void)
{
if (__glutCurrentMenu) {
@@ -303,7 +303,7 @@ glutGetMenu(void)
}
}
void GLUTAPIENTRY
void APIENTRY
glutSetMenu(int menuid)
{
GLUTmenu *menu;
@@ -342,7 +342,7 @@ setMenuItem(GLUTmenuItem * item, const char *label,
}
}
void GLUTAPIENTRY
void APIENTRY
glutAddMenuEntry(const char *label, int value)
{
GLUTmenuItem *entry;
@@ -361,7 +361,7 @@ glutAddMenuEntry(const char *label, int value)
__glutCurrentMenu->list = entry;
}
void GLUTAPIENTRY
void APIENTRY
glutAddSubMenu(const char *label, int menu)
{
GLUTmenuItem *submenu;
@@ -386,7 +386,7 @@ glutAddSubMenu(const char *label, int menu)
__glutCurrentMenu->list = submenu;
}
void GLUTAPIENTRY
void APIENTRY
glutChangeToMenuEntry(int num, const char *label, int value)
{
GLUTmenuItem *item;
@@ -426,7 +426,7 @@ glutChangeToMenuEntry(int num, const char *label, int value)
__glutWarning("Current menu has no %d item.", num);
}
void GLUTAPIENTRY
void APIENTRY
glutChangeToSubMenu(int num, const char *label, int menu)
{
GLUTmenu *popupmenu;
@@ -468,7 +468,7 @@ glutChangeToSubMenu(int num, const char *label, int menu)
__glutWarning("Current menu has no %d item.", num);
}
void GLUTAPIENTRY
void APIENTRY
glutRemoveMenuItem(int num)
{
GLUTmenuItem *item, **prev;
@@ -501,7 +501,7 @@ glutRemoveMenuItem(int num)
__glutWarning("Current menu has no %d item.", num);
}
void GLUTAPIENTRY
void APIENTRY
glutAttachMenu(int button)
{
if (__glutCurrentWindow == __glutGameModeWindow) {
@@ -517,7 +517,7 @@ glutAttachMenu(int button)
__glutCurrentWindow->menu[button] = __glutCurrentMenu->id + 1;
}
void GLUTAPIENTRY
void APIENTRY
glutDetachMenu(int button)
{
if (__glutMappedMenu) {

2
src/glut/mini/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
*.d
libglut.so*

98
src/glut/mini/Makefile Normal file
View File

@@ -0,0 +1,98 @@
# Mesa 3-D graphics library
# Version: 4.0
#
# Copyright (C) 1999 Brian Paul All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# DOS/DJGPP glut makefile v1.1 for Mesa 4.0
#
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@yahoo.com
# Web : http://www.geocities.com/dborca
.PHONY: all clean
TOP = ../..
MARK = $(TOP)/src-glut
LIBDIR = $(TOP)/lib
GLUT_LIB = libglut.so
CC = gcc
INCLUDES = -I$(TOP)/include -I$(MARK)
CFLAGS = -c -g $(INCLUDES) -MD
CORE_SOURCES = \
bitmap.c \
callback.c \
color.c \
globals.c \
init.c \
menu.c \
models.c \
overlay.c \
state.c \
teapot.c \
window.c
MARK_SOURCES = \
$(MARK)/glut_8x13.c \
$(MARK)/glut_9x15.c \
$(MARK)/glut_hel10.c \
$(MARK)/glut_hel12.c \
$(MARK)/glut_hel18.c \
$(MARK)/glut_tr10.c \
$(MARK)/glut_tr24.c
SOURCES = $(CORE_SOURCES) $(MARK_SOURCES)
OBJS = $(addsuffix .o,$(basename $(SOURCES)))
LIBS=-L$(TOP)/lib -lGL -lGLU -lm
.c.o:
$(CC) -o $@ -c $(CFLAGS) $<
.S.o:
$(CC) -o $@ -c $(CFLAGS) $<
default: libglut.so.3.7 install
libglut.so.3.7: $(OBJS) Makefile
gcc -shared -Wl,-soname,libglut.so -Wl,-Bsymbolic $(OBJS) $(LIBS) -o $@
install:
rm -f $(TOP)/lib/libglut.so*
install -D libglut.so.3.7 $(TOP)/lib/libglut.so.3.7
ln -s libglut.so.3.7 $(TOP)/lib/libglut.so.3
ln -s libglut.so.3 $(TOP)/lib/libglut.so
clean:
rm -f *~ .*~ *.o libglut.so* *.d
-include $(SOURCES:.c=.d)
.SUFFIXES: .c .d
.c.d:
$(CC) -M $(INCLUDES) $< > $@

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