Compare commits

...

171 Commits

Author SHA1 Message Date
Brian Paul
aa5698e8ed DJGPP fixes 2002-04-01 17:09:25 +00:00
Brian Paul
cf4c9ada0d another DOS driver update 2002-04-01 16:54:11 +00:00
Brian Paul
13c751a1c2 Use invert_matrix_general() instead of invert_matrix_perspective() because
the former fails for some projection matrices (ala Vis5D with Chromium).
2002-03-29 17:15:01 +00:00
Brian Paul
2af71a9acf added dmesadxe.h to tar file list 2002-03-29 14:42:29 +00:00
Brian Paul
5e0316f1a8 decrement Transform._AnyClip when clip planes are disabled 2002-03-28 22:45:50 +00:00
Brian Paul
2366fb3b89 popping of user-defined clip planes was broken 2002-03-28 22:42:34 +00:00
Karl Schultz
4ad3511865 (WIN32)Use _glapi_get_context to get the context in buffer_size() instead
of the GET_CURRENT_CONTEXT macro.  The macro tries to use the glapi_Context
variable which needs to be imported from the MesaGL DLL, which is too
problematic to do at the moment.
2002-03-25 23:52:34 +00:00
Karl Schultz
44f6191507 export _glapi_get_context for osmesa. 2002-03-25 23:41:49 +00:00
Brian Paul
aaf89c1cc7 re-adding a lost file 2002-03-23 02:36:52 +00:00
Brian Paul
7350dd7395 DOS/Mesa driver updates (Daniel Borca) 2002-03-23 02:23:06 +00:00
Brian Paul
972815c414 final? updates 2002-03-23 02:22:01 +00:00
Brian Paul
0bb0b4df73 latest extension headers from SGI 2002-03-23 01:49:09 +00:00
Brian Paul
e07b4252ad removed glSamplePass() 2002-03-20 22:06:57 +00:00
Brian Paul
b8855675ca latest bug fixes 2002-03-19 16:49:07 +00:00
Brian Paul
6bf823ac2d don't set plane mask for xm_buffer->gc, it causes an accum buffer conformance problem 2002-03-19 16:47:56 +00:00
Brian Paul
af3f3080f9 Use MESA_PBUFFER_ALLOC/FREE macros to allocate all framebuffer and texture
memory.  These can be overridden by applications which need to manage this
memory specially.  Contributed by Gerk Huisma.
2002-03-19 16:42:41 +00:00
Brian Paul
bb47715320 fix Intel C compiler warnings (Gerk Huisma) 2002-03-19 15:22:41 +00:00
Brian Paul
cef9cdf3bb undo previous check-in 2002-03-16 01:00:43 +00:00
Brian Paul
4493f41577 added XMesaResizeBuffers() 2002-03-16 00:50:36 +00:00
Brian Paul
a4f3130a7f Lots of changes related to framebuffer/window buffer resizing. Basically,
instead of passing a GLcontext* to ResizeBuffers(), pass a GLframebuffer*.
The idea is that a window can be resized without it being bound to a rendering
context.  This makes for a nice clean-up in the XFree86 server-side GLX code.
Renamed ctx->Driver.ResizeBuffersMESA() to ctx->Driver.ResizeBuffers().
2002-03-16 00:50:11 +00:00
Brian Paul
b2c3daa875 protect currentReadable reference with #ifndef GLX_BUILT_IN_XMESA 2002-03-15 19:11:37 +00:00
Brian Paul
3d6951c097 updated comments. removed dead code. 2002-03-15 18:32:54 +00:00
Brian Paul
db0ed6252b remove a debug printf 2002-03-15 18:24:34 +00:00
Brian Paul
e6c59e8d0c fixed typo in CONVERT_TEXEL_DWORD for convert_abgr8888_to_ai88 textures (Michael Fitzpatrick) 2002-03-15 17:57:42 +00:00
Brian Paul
378fcdb818 fixed pointer arithmetic error in glCopyPixels 2002-03-14 22:09:05 +00:00
Brian Paul
cd3f5d807a put lodbias loop inside test for non-NULL lambda array 2002-03-13 04:45:35 +00:00
Brian Paul
c3e908891c added thread rendering bug fix 2002-03-12 21:57:27 +00:00
Brian Paul
fdbaf407a7 Removed the xm_context field from XMesaBuffer. It was preventing N threads
from rendering into one window in parallel and wasn't really needed anyway.
2002-03-12 21:54:03 +00:00
Brian Paul
5a86d3852c tweak file list for tarballs 2002-03-11 14:59:12 +00:00
Brian Paul
96d0be5cf2 obsolete 2002-03-11 14:56:42 +00:00
Brian Paul
0bd26c3c55 fix some minor warnings 2002-03-08 19:43:36 +00:00
Brian Paul
9f7053e913 updates for 4.0.2 2002-03-08 19:28:57 +00:00
Brian Paul
9fa55ac457 DOS driver updates from Daniel Borca 2002-03-08 19:27:28 +00:00
Brian Paul
101092ea11 new DOS driver files from Daniel Borca 2002-03-08 19:24:36 +00:00
Brian Paul
da648d9afd minor patches from David Dawes 2002-03-07 21:50:53 +00:00
Brian Paul
7a3b7c9687 syntax fixes for Solaris (David Dawes) 2002-03-07 21:39:09 +00:00
Brian Paul
55f8fcba10 use -O3 for osmesa16/32 builds, disable FX and SVGA in debug builds 2002-03-01 19:38:53 +00:00
Brian Paul
7419597f2f return 'Mesa Offscreen16' or 'Mesa Offscreen32' if using deep color channels 2002-03-01 19:37:28 +00:00
Brian Paul
e784671997 silence gcc warnings (Marc La France) 2002-03-01 04:25:42 +00:00
Brian Paul
c2165e799c updated comments for CHAN_BITS=16 or 32 2002-03-01 04:23:16 +00:00
Brian Paul
40519b3eb3 DOS driver updates from Daniel Borca 2002-02-23 17:07:21 +00:00
Brian Paul
dcda68de33 Fixed out-of-bounds memory write problem (CONVERT_TEXEL_DWORD macro).
Renamed 'packing' to 'unpacking' since we're moving data from client -> GL.
Rnamed DST_ROW_WIDTH to DST_ROW_BYTES.
2002-02-21 15:11:15 +00:00
Brian Paul
8308199e5d added XMesaGarbageCollect item 2002-02-21 00:00:25 +00:00
Brian Paul
3b029b0c7d check for initialized XMesaBuffer in XMesaGarbageCollect() 2002-02-20 23:59:40 +00:00
Brian Paul
bff7677bd9 undo some debug changes mistakenly checked in earlier 2002-02-17 17:38:44 +00:00
Brian Paul
41796ecc25 added two latest bug fixes 2002-02-15 19:15:59 +00:00
Brian Paul
94865a95b1 use separate GC for SwapBuffers to avoid colormask problem 2002-02-15 19:15:08 +00:00
Karl Schultz
b8b23d4552 fix casts to quiet compiler warnings. 2002-02-15 18:50:48 +00:00
Brian Paul
3245cfdf41 obsolete 2002-02-15 14:04:57 +00:00
Brian Paul
69e043158a fixed float->int conversion. Fix conditional for 16-bit Z buffer path 2002-02-15 03:38:29 +00:00
Keith Whitwell
3ce17ffb84 Remove debug 2002-02-13 23:52:48 +00:00
Keith Whitwell
33b483f882 remove debug prints 2002-02-12 21:07:59 +00:00
Keith Whitwell
308a036114 More support for t&l drivers.
Fix reset_stipple calls.
Fix unsigned compare bugs.
2002-02-12 17:37:26 +00:00
Karl Schultz
4c97c84f7e silence compiler warning (windows) 2002-02-12 16:36:36 +00:00
Brian Paul
d7bde06097 silence compiler warnings 2002-02-12 16:07:15 +00:00
Brian Paul
a00292bcfe silence compiler warning 2002-02-12 16:06:16 +00:00
Brian Paul
7d729ffb58 release notes for 4.0.2 2002-02-12 15:54:47 +00:00
Brian Paul
aeb6c0af5e replace assertion with a test (avoid div by zero error) 2002-02-12 03:14:58 +00:00
Brian Paul
41110917d7 Prep for Mesa 4.0.2 release. 2002-02-12 03:13:41 +00:00
Brian Paul
a58b1ed0a3 Daniel Borca's GLUT for DOS/DJGPP. 2002-02-12 02:59:24 +00:00
Brian Paul
27b503cab8 Daniel Borca's new DOS/DJGPP driver. 2002-02-12 02:58:56 +00:00
Brian Paul
d38cdd33d0 removed GLUT reference 2002-01-30 21:54:47 +00:00
Brian Paul
851acc6ea7 added some handy debug code 2002-01-30 16:47:04 +00:00
Brian Paul
6115d784a7 don't use affine/persp_textured_triangle funcs when CHAN_BITS > 8 2002-01-30 16:45:29 +00:00
Brian Paul
fcca385bec replace GLushort w/ GLubyte in DEST_4US template (fixes 16-bit GLchan problem 2002-01-30 16:42:23 +00:00
Brian Paul
06743cf365 updated gl_mangle.h (Ray Tice) 2002-01-18 14:55:50 +00:00
Brian Paul
b372b40bd1 set PB->haveSpec in line functions that emit specular color 2002-01-16 18:24:31 +00:00
Karl Schultz
3e3bd40614 Fixes for 24-bit Windows devices. The old code was trying to do 3-byte
stores with a full DWORD store (yuk).  (Jeff Lewis)
2002-01-16 15:37:49 +00:00
Brian Paul
3fb6d0bfde added some missing error checks 2002-01-15 21:50:15 +00:00
Brian Paul
b36acc0423 removed API compat stuff 2002-01-15 20:17:59 +00:00
Karl Schultz
287d6127d2 Fixed pixel color component problem and clear code for 24-bit Windows
devices.  (Jeff Lewis)
2002-01-15 16:47:37 +00:00
Karl Schultz
a8290d3a95 Remove trailing CR's from most of the lines. No logical changes. 2002-01-15 16:12:15 +00:00
Brian Paul
b26f972618 don't apply scissor box in read_fast_rgba_pixels() 2002-01-12 16:12:42 +00:00
Brian Paul
5bd6bad38d fixed int->float conversion bug in _mesa_TexEnviv() 2002-01-09 02:14:50 +00:00
Brian Paul
1ae3437156 fixed GL_REPLACE / GL_RGB bug 2002-01-09 00:28:53 +00:00
Brian Paul
93665403aa texture env color wasn't used correctly in GL_BLEND mode 2002-01-09 00:12:37 +00:00
Brian Paul
04613cb0bc compile with -DNDEBUG 2002-01-08 15:58:11 +00:00
Brian Paul
e0a30e9d2d work-around for QNX compiler problem 2002-01-08 14:56:33 +00:00
Brian Paul
fd3da01ec3 fix typo (d'oh) 2002-01-04 14:36:58 +00:00
Brian Paul
40bbb8b7f3 fix bug 498555 - test for __GNUC__ 2002-01-04 14:35:34 +00:00
Brian Paul
00b7772bda fixes from Albert Chin 2002-01-03 16:29:07 +00:00
Karl Schultz
0fc4d7e46d Define finite as _finite for Windows. 2001-12-20 18:58:24 +00:00
Keith Whitwell
1261fed2c3 Further help with libGL version skew in dri drivers. 2001-12-20 15:29:15 +00:00
Keith Whitwell
4f4f542bd7 Fix clipping problem on mga 2001-12-20 09:53:57 +00:00
Brian Paul
550169ab62 added separate specular bug fix 2001-12-19 01:20:40 +00:00
Brian Paul
ad83c33a4d have to clamp color+specular in _swrast_add_spec_terms_triangle()! (fixes Chimera bug) 2001-12-19 01:13:12 +00:00
Brian Paul
a340c4f6ef disable blocks of GGI code so it at least compiles instead of bombing 2001-12-18 05:09:51 +00:00
Brian Paul
781f27575c added prototype glutGetProcAddress() function 2001-12-17 19:48:23 +00:00
Brian Paul
08e126fba6 Texture type is GLuint 2001-12-17 19:45:21 +00:00
Brian Paul
b03241a552 put the .type stuff on a separate line 2001-12-17 19:44:54 +00:00
Brian Paul
e4efc983bd minor update 2001-12-17 19:43:38 +00:00
Brian Paul
785bfd0c1e remove conditional in RESET_STIPPLE to fix conformance failure 2001-12-17 01:46:38 +00:00
Brian Paul
a0e4612f49 added normal length cache bug fix 2001-12-15 00:50:55 +00:00
Brian Paul
f6e1618f97 free the NormalLengthPtr if non-null in _tnl_free_immediate() 2001-12-15 00:48:41 +00:00
Karl Schultz
3a450fb4b0 Use $(MAKE) on the irix targets, instead of hard-coding pmake,
as suggested in SF bug 482149.  People can still use
pmake -v -f Makefile.X11 if they want to use pmake (works great for me).
Sorry, this should have been in the last check-in.
2001-12-14 17:46:20 +00:00
Karl Schultz
43daa03ac1 Add .cc as a valid suffix. 2001-12-14 17:18:08 +00:00
Karl Schultz
cb69912494 Cleanup for IRIX 6 platforms. Build src-glu instead of si-glu due
to problems with building the c++ code in the si-glu.
2001-12-14 17:11:46 +00:00
Karl Schultz
b4518ee5d4 Fix up targets for
irix6-o32, irix6-o32-dso, irix6-n32, irix6-n32-dso
2001-12-14 16:40:35 +00:00
Karl Schultz
6ef05c2817 Remove rules that were put into place to deal with compiling files that
are in subdirectories of this directory.  The list of rules that were here
was out of date for Mesa 4 and would likely get out of date again.  It is
better to have make handle it (e.g., use pmake -v on IRIX).
2001-12-14 16:33:06 +00:00
Brian Paul
26d31abd87 s/glxGetProcAddress/glXGetProcAddressARB/ 2001-12-14 11:39:39 +00:00
Brian Paul
7702362bda added GLX_SAMPLE_BUFFERS and GLX_SAMPLES 2001-12-14 03:20:57 +00:00
Karl Schultz
5141607357 Remove const from save_TexParameteri to match prototype for glTexParameteri.
Allows compilation on IRIX.
2001-12-13 19:55:00 +00:00
Brian Paul
a9e14e7bb9 added feedback bug fix item 2001-12-13 19:13:55 +00:00
Brian Paul
5196a16629 fixed errors in feedback for glDraw/CopyPixels and glBitmap 2001-12-13 19:12:30 +00:00
Karl Schultz
7f37280955 Add missing entry points 2001-12-13 19:07:28 +00:00
Brian Paul
986b7ec195 added optimized blending item 2001-12-13 16:24:28 +00:00
Brian Paul
9012185ae8 special case blend optmizations (Jeremy Fitzhardinge) 2001-12-13 16:14:17 +00:00
Brian Paul
2edf851932 added glTexParameter bug fix 2001-12-13 16:03:06 +00:00
Brian Paul
1703b67ee0 call FLUSH_VERTICES() in _mesaTexParameterfv() (bug 491832) 2001-12-13 16:02:32 +00:00
Brian Paul
9342fbe46e latest bug fixes 2001-12-13 14:18:46 +00:00
Keith Whitwell
2f88c5fbd4 fix primitive calculation in 1-line dlist immediates (molecules) 2001-12-13 10:57:55 +00:00
Keith Whitwell
dc35f387ca fix for ubyte colors 2001-12-13 10:57:41 +00:00
Keith Whitwell
597ec4040c fix glut tess lockup 2001-12-11 15:12:57 +00:00
Keith Whitwell
51aa3d2f30 Add INF_OR_NAN tests to swrast functions 2001-12-05 10:22:55 +00:00
Keith Whitwell
0c1f42ef29 further tweak to dlist change 2001-12-04 13:04:05 +00:00
Keith Whitwell
06ae58eebb remove debug 2001-12-03 17:59:36 +00:00
Keith Whitwell
d8deb468f7 guard ResetStipple calls 2001-12-03 17:49:01 +00:00
Keith Whitwell
4aac60f691 fx another place where PRIM_PARITY is calculated 2001-12-03 17:46:57 +00:00
Keith Whitwell
e20d35d74a correctly reset input after dlist execution 2001-12-03 17:44:02 +00:00
Keith Whitwell
ed26c2d950 remove debug 2001-12-03 17:40:43 +00:00
Keith Whitwell
95681b4a85 avoid side-effects in macro param 2001-12-03 17:39:09 +00:00
Karl Schultz
17a5135fee Add darwin target 2001-11-30 20:18:41 +00:00
Karl Schultz
69b71bc1ab malloc() prototype is in stdlib.h for darwin 2001-11-30 20:12:38 +00:00
Alan Hourihane
9f6957e702 Don't reset the _tnl_CurrentInput pointer on DestroyContext. 2001-11-30 15:42:32 +00:00
Karl Schultz
bf78731523 update version string to 4.0 2001-11-29 22:56:10 +00:00
Karl Schultz
c527df81df update updated date 2001-11-29 16:54:32 +00:00
Karl Schultz
ca2315d95b Update notes about si-glu NURBS code. 2001-11-29 16:53:16 +00:00
Karl Schultz
c4dd9e2a03 Fix compilation errors and warnings for NURBS support. (Robert Bergkvist) 2001-11-29 16:38:26 +00:00
Keith Whitwell
34174976c4 use smaller buffer when decomposing large drawarrays, for cache goodness 2001-11-29 15:15:11 +00:00
Brian Paul
ff23c15bdc updated comment about CHAN_BITS 2001-11-28 17:18:20 +00:00
Brian Paul
eb0ce107c7 use v2 color, not v0 in flat_ci_triangle() 2001-11-28 16:11:14 +00:00
Keith Whitwell
bfe6c71b99 update vendor string 2001-11-28 11:54:45 +00:00
Brian Paul
69f2ff5f38 added triangle parity bug fix and GLUT glXGetProcAddressARB item 2001-11-27 02:58:01 +00:00
Brian Paul
f28c19da41 use glXGetProcAddressARB to avoid extension linkage problems 2001-11-27 02:50:55 +00:00
Brian Paul
c132ca9774 don't directly call glSecondaryColor*EXT() or glFogCoord*EXT() 2001-11-26 23:45:36 +00:00
Brian Paul
8ca1772d4a fix some warnings 2001-11-26 17:21:24 +00:00
Keith Whitwell
ff5fe4836a Possible fix for vtk tristrip bug 2001-11-26 12:55:12 +00:00
Brian Paul
f88e0898a1 fixed some GLenum/GLuint mixups 2001-11-25 18:54:45 +00:00
Brian Paul
3f2eedd634 bump version to 4.0.1 2001-11-25 18:50:19 +00:00
Brian Paul
158c7413fb updates for 4.0.1 2001-11-23 20:47:25 +00:00
Brian Paul
0a96860e04 attempted fix for bug 474479 2001-11-23 20:43:32 +00:00
Keith Whitwell
37b10249e5 Fix decomposition of quads/quad-strips to indexed tris 2001-11-22 13:56:25 +00:00
Keith Whitwell
589cee71b8 Another locked drawarrays fix 2001-11-22 09:23:31 +00:00
Brian Paul
c6dcd5c4cf added CVA and glapi_sparc.S bug fixes 2001-11-20 00:08:17 +00:00
Brian Paul
e1ec4771f1 fixed Solaris/GCC compilation problems 2001-11-20 00:06:25 +00:00
Keith Whitwell
917e942fe2 3dnow normalize_normals function isn't working - disable it. 2001-11-19 13:50:35 +00:00
Keith Whitwell
f427427ca8 possible fix for cva ignore start index bug 2001-11-19 10:20:37 +00:00
Brian Paul
7ed97d4ef4 added latest bug fixes for 4.0.1 2001-11-18 23:25:35 +00:00
Brian Paul
267b9cc082 fixed a few missing entries for GetProcAddress() 2001-11-18 23:24:49 +00:00
Brian Paul
efb678da77 added missing const to glXGetContextIDEXT() prototype 2001-11-18 22:16:35 +00:00
Brian Paul
32aa05bfd6 added -Bsymbolic item 2001-11-15 19:50:24 +00:00
Brian Paul
299a71fe04 added better sub-pixel AA item 2001-11-13 00:26:07 +00:00
Brian Paul
63da26bd62 improved AA subpixel sample positions (Ray Tice) 2001-11-13 00:24:51 +00:00
Brian Paul
dfb7ebf8a0 added latest post-4.0 bug fixes 2001-11-09 22:05:10 +00:00
Brian Paul
64681c1f82 fix typedef problem found with MSDev 6.0 2001-11-09 22:03:54 +00:00
Brian Paul
8c3149f250 added GLX 1.4 function manglers 2001-11-09 22:00:26 +00:00
Brian Paul
53e284bda1 added 1.3 function manglers 2001-11-09 21:59:18 +00:00
Brian Paul
f46ce82219 define GL_VERSION_1_3 (doh!) 2001-11-09 21:54:05 +00:00
Brian Paul
4256cf0175 casts to silence warnings from gcc 2.96 2001-11-06 16:00:58 +00:00
Brian Paul
986749a4ea added GL_MAX_TEXTURE_LOD_BIAS_EXT fix 2001-11-06 15:53:25 +00:00
Brian Paul
07042d164b added missing GL_MAX_TEXTURE_LOD_BIAS_EXT query 2001-11-06 15:51:06 +00:00
Brian Paul
0739d6f158 fix error in error checking conditional (bug 476846) 2001-11-03 04:10:08 +00:00
Brian Paul
2fd7a602a7 added hash table mutex bug fix 2001-11-02 00:58:32 +00:00
Brian Paul
f97edb4ca3 init the hash table mutex in _mesa_NewHashTable (Won-Suk Chun) 2001-11-02 00:56:45 +00:00
Karl Schultz
3b0571dd5c Updates for improved DirectDraw support (Daniel Slater) 2001-11-01 22:52:18 +00:00
Brian Paul
c25f068355 added some (void *) casts to silence gcc 2.96 warnings 2001-11-01 00:38:37 +00:00
Keith Whitwell
3a05f42b28 add linux-x11-debug build target 2001-10-30 16:00:20 +00:00
Karl Schultz
2631c2a2de Change name of glut lib from glut32 to MesaGlut.
This helps avoid confusion with other gluts on the system that may be
lined with OpenGl32.dll and Glu32.dll.
2001-10-26 21:22:40 +00:00
Karl Schultz
b2728086ec Copy ../util/readtex.[ch] 2001-10-26 21:03:15 +00:00
Brian Paul
2e7644f13d bug fix: missing breaks in glGet*() 2001-10-25 23:21:52 +00:00
Brian Paul
9c3e7d2294 added a bunch of missing breaks for multisample gets 2001-10-25 23:21:11 +00:00
192 changed files with 14324 additions and 6977 deletions

View File

@@ -1,13 +1,13 @@
# $Id: Make-config,v 1.51 2001/10/22 22:45:18 brianp Exp $
# $Id: Make-config,v 1.50.2.6 2002/03/01 19:38:53 brianp Exp $
MESA_MAJOR=4
MESA_MINOR=1
MESA_TINY=0
MESA_MINOR=0
MESA_TINY=2
VERSION=$(MESA_MAJOR).$(MESA_MINOR)
# Mesa 3-D graphics library
#
# Copyright (C) 1999-2001 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"),
@@ -178,6 +178,25 @@ cygnus-linux:
"MAKELIB = ../bin/mklib.cygnus-linux" \
"WLIBS = ../lib/wing32.a -lkernel32 -luser32 -lgdi32"
darwin:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.dylib" \
"GLU_LIB = libGLU.dylib" \
"GLUT_LIB = libglut.dylib" \
"GLW_LIB = libGLw.dylib" \
"OSMESA_LIB = libOSMesa.dylib" \
"CC = cc" \
"CPLUSPLUS = cc" \
"CFLAGS = -I/usr/X11R6/include -O3 -fPIC -fno-common -ffast-math \
-funroll-loops -fexpensive-optimizations -no-cpp-precomp \
-dynamic -Ddarwin" \
"CCFLAGS = $(CFLAGS)" \
"MAKELIB = ../bin/mklib.darwin" \
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread" \
"GLU_LIB_DEPS = -L../lib -lGL -lm" \
"GLUT_LIB_DEPS = -L../lib -lGLU -lGL \
-L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm"
dgux:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
@@ -344,7 +363,7 @@ hpux10-gcc-sl:
# For IRIX 4: don't use -fullwarn because it causes too much garbage
irix4:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
@@ -357,7 +376,7 @@ irix4:
# On IRIX 5.3 -sopt causes a problem in drawpixels.c so we don't use it
irix5:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
@@ -385,7 +404,7 @@ irix5-gcc:
# IRIX 5 using Dynamic Shared Objects (DSO)
irix5-dso:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.so" \
"GLU_LIB = libGLU.so" \
"GLUT_LIB = libglut.so" \
@@ -396,34 +415,46 @@ irix5-dso:
"MAKELIB = ../bin/mklib.irix5" \
"APP_LIB_DEPS = -rpath ../lib -lX11 -lXmu -lXi -lm"
# IRIX 6 32-bit Targets
# Turn Warnings off for these errors (MIPSpro Compiler 7.30)
# 1521: A nonstandard preprocessing directive is used.
# 1552: The variable "" is set but never used.
# C++
# 3262: The variable "" was declared but never referenced.
# 3666: The variable "" is set but never used.
# Use -v if using pmake to compile files in subdirectories.
irix6-o32:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
"GLW_LIB = libGLw.a" \
"OSMESA_LIB = libOSMesa.a" \
"LIBDIR = ../lib32" \
"CC = cc" \
"CFLAGS = -32 -mips2 -O2 -ansi -DUSE_XSHM -DNO_CONST" \
"CPLUSPLUS = CC" \
"CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM" \
"CCFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm"
irix6-o32-dso:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.so" \
"GLU_LIB = libGLU.so" \
"GLUT_LIB = libglut.so" \
"GLW_LIB = libGLw.so" \
"OSMESA_LIB = libOSMesa.so" \
"LIBDIR = ../lib32" \
"CC = cc" \
"CFLAGS = -32 -mips2 -O2 -ansi -DUSE_XSHM -DNO_CONST" \
"CPLUSPLUS = CC" \
"CFLAGS = -32 -mips2 -O2 -ansi -woff 1521,1552 -DUSE_XSHM" \
"CCFLAGS = -32 -mips2 -O2 -ansi -woff 3262,3666" \
"MAKELIB = ../bin/mklib.irix6-32" \
"APP_LIB_DEPS = -rpath ../lib -lX11 -lXext -lXmu -lXi -lm"
"APP_LIB_DEPS = -rpath ../lib32 -lX11 -lXext -lXmu -lXi -lm"
# For IRIX 6: -woff:
# 1209 - controlling expression is constant
irix6-n32:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
@@ -431,20 +462,24 @@ irix6-n32:
"OSMESA_LIB = libOSMesa.a" \
"LIBDIR = ../lib32" \
"CC = cc" \
"CFLAGS = -n32 -mips3 -O3 -ansi -woff 1209,1521" \
"CPLUSPLUS = CC" \
"CFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1521,1552 -DUSE_XSHM" \
"CCFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1552" \
"MAKELIB = ../bin/mklib.ar-rcv" \
"APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm"
irix6-n32-dso:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.so" \
"GLU_LIB = libGLU.so" \
"GLUT_LIB = libglut.so" \
"GLW_LIB = libGLw.a" \
"OSMESA_LIB = libOSMesa.a" \
"GLW_LIB = libGLw.so" \
"OSMESA_LIB = libOSMesa.so" \
"LIBDIR = ../lib32" \
"CC = cc" \
"CFLAGS = -n32 -mips3 -O3 -ansi -DUSE_XSHM -woff 1185,1521" \
"CPLUSPLUS = CC" \
"CFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1521,1552 -DUSE_XSHM" \
"CCFLAGS = -n32 -mips3 -O3 -ansi -woff 1174,1552" \
"MAKELIB = ../bin/mklib.irix6-n32" \
"APP_LIB_DEPS = -rpath ../lib32 -lX11 -lXmu -lXi -lfpe -lm"
@@ -472,7 +507,7 @@ irix6-gcc-n32-sl:
# 1474 - declaring a void parameter list with a typedef is nonstandard
# 1552 - variable was set but never used
irix6-64:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
@@ -485,7 +520,7 @@ irix6-64:
"APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm"
irix6-64-dso:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.so" \
"GLU_LIB = libGLU.so" \
"GLUT_LIB = libglut.so" \
@@ -662,7 +697,7 @@ linux-386-glide:
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \
"GLU_LIB_DEPS = -L../lib -lGL -lm" \
"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \
"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lglut -lGLU -lGL"
"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lglut -lGLU -lGL -lm" \
"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \
X86/x86_xform2.S X86/x86_xform3.S X86/x86_xform4.S \
X86/x86_cliptest.S X86/x86_vertex.S"
@@ -682,7 +717,7 @@ linux-386-opt-glide:
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \
"GLU_LIB_DEPS = -L../lib -lGL -lm" \
"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \
"APP_LIB_DEPS = -lm" \
"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lglut -lGLU -lGL -lm" \
"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \
X86/x86_xform2.S X86/x86_xform3.S X86/x86_xform4.S \
X86/x86_cliptest.S X86/x86_vertex.S"
@@ -701,7 +736,7 @@ linux-x86-glide:
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -L/usr/local/glide/lib -lglide2x -lm -lpthread" \
"GLU_LIB_DEPS = -L../lib -lGL -lm" \
"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \
"APP_LIB_DEPS = -lm" \
"APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -lglut -lGLU -lGL -lm" \
"ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \
X86/x86_xform2.S X86/x86_xform3.S X86/x86_xform4.S \
X86/x86_cliptest.S X86/x86_vertex.S \
@@ -832,7 +867,7 @@ linux-osmesa16:
"OSMESA16_LIB = libOSMesa16.so" \
"CC = gcc" \
"CPLUSPLUS = g++" \
"CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
"CFLAGS = -O3 -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DCHAN_BITS=16 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
"CCFLAGS = $(CFLAGS)" \
"MAKELIB = ../bin/mklib.linux" \
"GL_LIB_DEPS = -lm -lpthread" \
@@ -844,7 +879,7 @@ linux-osmesa32:
"OSMESA16_LIB = libOSMesa32.so" \
"CC = gcc" \
"CPLUSPLUS = g++" \
"CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
"CFLAGS = -O3 -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DCHAN_BITS=32 -DDEFAULT_SOFTWARE_DEPTH_BITS=31" \
"CCFLAGS = $(CFLAGS)" \
"MAKELIB = ../bin/mklib.linux" \
"GL_LIB_DEPS = -lm -lpthread" \
@@ -1418,7 +1453,7 @@ vistra:
# -woff 1521 = "nonstandard preprocessing directive is used"
# -woff 3496 = "bitwise operator precedence"
irix-debug:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
@@ -1431,7 +1466,7 @@ irix-debug:
"APP_LIB_DEPS = -rpath ../lib32 -lX11 -lXext -lXmu -lXi -lfpe -lXext -lXmu -lXi -lm"
DEBUG:
pmake $(MFLAGS) -f Makefile.X11 targets \
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.a" \
"GLU_LIB = libGLU.a" \
"GLUT_LIB = libglut.a" \
@@ -1452,13 +1487,31 @@ linux-debug:
"OSMESA_LIB = libOSMesa.so" \
"CC = gcc" \
"CPLUSPLUS = g++" \
"CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DSVGA -I/usr/include/glide -DFX -DMESA_TRACE" \
"CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DSVGA_foo -I/usr/include/glide -DFX_foo -DMESA_TRACE" \
"CCFLAGS = $(CFLAGS)" \
"MAKELIB = ../bin/mklib.linux" \
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L/usr/local/glide/lib -lglide2x -lvga" \
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread" \
"GLU_LIB_DEPS = -L../lib -lGL -lm" \
"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \
"APP_LIB_DEPS = -lglut -lGLU -lGL -L/usr/local/glide/lib -lglide2x"
"APP_LIB_DEPS = -lglut -lGLU -lGL"
linux-x11-debug:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \
"GL_LIB = libGL.so" \
"GLU_LIB = libGLU.so" \
"GLUT_LIB = libglut.so" \
"GLW_LIB = libGLw.so" \
"OSMESA_LIB = libOSMesa.so" \
"CC = gcc" \
"CPLUSPLUS = g++" \
"CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -Wundef -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DDEBUG -DMESA_DEBUG -DMESA_TRACE" \
"CCFLAGS = $(CFLAGS)" \
"MAKELIB = ../bin/mklib.linux" \
"GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread" \
"GLU_LIB_DEPS = -L../lib -lGL -lm" \
"GLUT_LIB_DEPS = -L../lib -lGLU -lGL -L/usr/X11R6/lib -lX11 -lXmu -lXt -lXi -lm" \
"APP_LIB_DEPS = -lglut -lGLU -lGL"
linux-static-debug:
$(MAKE) $(MFLAGS) -f Makefile.X11 targets \

View File

@@ -1,9 +1,9 @@
# $Id: Makefile.X11,v 1.57 2001/10/22 22:45:18 brianp Exp $
# $Id: Makefile.X11,v 1.56.2.7 2002/03/29 14:42:29 brianp Exp $
# Mesa 3-D graphics library
# Version: 4.1
# Version: 4.0.2
#
# Copyright (C) 1999-2001 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"),
@@ -42,6 +42,7 @@ default:
@echo " make bsdos4 for BSD/OS 4.x, dynamic libraries"
@echo " make cygnus for Win95/NT using Cygnus-Win32"
@echo " make cygnus-linux for Win95/NT using Cygnus-Win32 under Linux"
@echo " make darwin for Darwin - Mac OS X"
@echo " make dgux for Data General"
@echo " make freebsd for FreeBSD systems with GCC"
@echo " make freebsd-386 for FreeBSD systems with GCC, w/ Intel assembly"
@@ -137,11 +138,11 @@ default:
# XXX we may have to split up this group of targets into those that
# have a C++ compiler and those that don't for the SI-GLU library.
aix aix-sl amix bsdos bsdos4 dgux freebsd freebsd-386 gcc \
aix aix-sl amix bsdos bsdos4 darwin dgux freebsd freebsd-386 gcc \
hpux9 hpux9-sl hpux9-gcc hpux9-gcc-sl \
hpux10 hpux10-sl hpux10-gcc hpux10-gcc-sl \
irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \
linux linux-static linux-debug linux-static-debug linux-prof \
irix4 irix5 irix5-gcc irix5-dso \
linux linux-static linux-debug linux-x11-debug linux-static-debug linux-prof \
linux-x86 linux-x86-static linux-x86-debug \
linux-glide linux-386-glide linux-386-opt-glide \
linux-x86-glide linux-glide-debug linux-glide-prof \
@@ -171,12 +172,11 @@ sunos5-x11r6-gcc-sl ultrix-gcc unicos unixware uwin vistra:
if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi
irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug:
irix6-o32 irix6-o32-dso irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug:
-mkdir lib32
if [ -d src ] ; then touch src/depend ; fi
if [ -d src-glu ] ; then touch src-glu/depend ; fi
if [ -d src-glut ] ; then touch src-glut/depend ; fi
if [ -d src-glut ] ; then touch src-glut/depend ; fi
if [ -d widgets-sgi ] ; then touch widgets-sgi/depend ; fi
if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.X11 $@ ; fi
if [ -d src-glu ] ; then cd src-glu ; $(MAKE) -f Makefile.X11 $@ ; fi
@@ -299,7 +299,6 @@ linux-osmesa16 linux-osmesa32:
-mkdir lib
if [ -d src ] ; then touch src/depend ; fi
if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.OSMesa16 $@ ; fi
# Remove .o files, emacs backup files, etc.
clean:
@@ -322,20 +321,18 @@ clean:
# Remove everything that can be remade
realclean: clean
-rm -f lib/*
-rm -fr lib lib32 lib64
cd demos && $(MAKE) -f Makefile.X11 realclean || true
cd xdemos && $(MAKE) -f Makefile.X11 realclean || true
cd book && $(MAKE) -f Makefile.X11 realclean || true
cd samples && $(MAKE) -f Makefile.X11 realclean || true
cd ggi/demos && $(MAKE) -f Makefile.X11 realclean || true
cd src/GGI/default && $(MAKE) -f Makefile.X11 realclean || true
DIRECTORY = Mesa-4.0
LIB_NAME = MesaLib-4.0
DEMO_NAME = MesaDemos-4.0
GLU_NAME = MesaGLU-4.0
DIRECTORY = Mesa-4.0.2
LIB_NAME = MesaLib-4.0.2
DEMO_NAME = MesaDemos-4.0.2
GLU_NAME = MesaGLU-4.0.2
GLUT_NAME = GLUT-3.7
@@ -380,7 +377,7 @@ LIB_FILES = \
$(DIRECTORY)/include/GL/internal/glcore.h \
$(DIRECTORY)/include/GL/Makefile.in \
$(DIRECTORY)/include/GL/Makefile.am \
$(DIRECTORY)/include/GL/dosmesa.h \
$(DIRECTORY)/include/GL/dmesa.h \
$(DIRECTORY)/include/GL/amesa.h \
$(DIRECTORY)/include/GL/fxmesa.h \
$(DIRECTORY)/include/GL/ggimesa.h \
@@ -403,6 +400,7 @@ LIB_FILES = \
$(DIRECTORY)/include/GL/xmesa_x.h \
$(DIRECTORY)/include/GL/xmesa_xf86.h \
$(DIRECTORY)/include/GLView.h \
$(DIRECTORY)/include/dmesadxe.h \
$(DIRECTORY)/include/Makefile.in \
$(DIRECTORY)/include/Makefile.am \
$(DIRECTORY)/src/Makefile* \
@@ -433,6 +431,7 @@ LIB_FILES = \
$(DIRECTORY)/src/windml/tornado/*.cdf \
$(DIRECTORY)/src/windml/man3/*.3 \
$(DIRECTORY)/src/windml/man3/*.html \
$(DIRECTORY)/src/DOS/*.[ch] \
$(DIRECTORY)/src/BeOS/*.cpp \
$(DIRECTORY)/src/FX/Makefile.am \
$(DIRECTORY)/src/FX/Makefile.in \
@@ -581,7 +580,6 @@ OBSOLETE_LIB_FILES = \
$(DIRECTORY)/src/D3D/*bat \
$(DIRECTORY)/src/D3D/*DEF \
$(DIRECTORY)/src/DOS/DEPEND.DOS \
$(DIRECTORY)/src/DOS/*.c \
$(DIRECTORY)/src/S3/*.[ch] \
$(DIRECTORY)/src/S3/*.def \
$(DIRECTORY)/src/S3/*.mak \
@@ -614,6 +612,9 @@ DEMO_FILES = \
$(DIRECTORY)/src-glut/descrip.mms \
$(DIRECTORY)/src-glut/mms_depend \
$(DIRECTORY)/src-glut/*.[ch] \
$(DIRECTORY)/src-glut.dos/*.[ch] \
$(DIRECTORY)/src-glut.dos/Makefile.DJ \
$(DIRECTORY)/src-glut.dos/PC_HW/*.[chS] \
$(DIRECTORY)/images/* \
$(DIRECTORY)/demos/Makefile* \
$(DIRECTORY)/demos/descrip.mms \

132
docs/README.DJ Normal file
View File

@@ -0,0 +1,132 @@
Mesa 4.0 DOS/DJGPP Port v1.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Description:
~~~~~~~~~~~~
Well, guess what... this is the DOS port of MESA 4.0, for DJGPP fans... Whoa!
Legal:
~~~~~~
MESA copyright applies.
Installation:
~~~~~~~~~~~~~
Type "make -f Makefile.DJ" to compile the libraries. Make accepts some options
which are passed to compiler: the target cpu (CPU=..., default=`pentium') and
X86 specific options (HAVE_X86=1, HAVE_MMX=1, HAVE_SSE=1, HAVE_3DNOW=1). The
core library (libGL) requires LFN support during compilation. Also, you must
have the DXE2 package (available on SimTel.Net, courtesy of Andrew Zabolotny)
installed in order to build the dynamic modules; if you encounter errors, you
can fetch a patched version from my web page.
The demos are not built automagically (see Pitfalls below). To make them, use
one of the following rules:
Static:
gcc -o OUT.exe IN.c -lglut -lglu -lgl
Dynamic:
gcc -o OUT.exe -include dmesadxe.h IN.c -ligl -liglu -liglut -ldl
Usage of the dynamic modules requires three things:
- include DMESADXE.H in one of the sources, so references inside
dynamic modules will get resolved (or use `-include' directive)
- link against import libraries (libIgl*.a) and LIBDL.A, which will do
the dynamic linkage job for you
- put the DXEs somewhere along the library path (LD_LIBRARY_PATH) or
in the current directory
Tested on:
CPU: Intel Pentium w/ MMX @166 MHz
Mainboard: ViA Apollo VP2 w/ 128 MB SDRAM
Video card: Matrox Millenium 2064W w/ 2048 kB WRAM, BIOS v3.0
DJGPP: djdev 2.03 + gcc v3.0.3 + make v3.79
libGL (the core):
~~~~~~~~~~~~~~~~~
Of course, MESA 4.0 core sources are required. It will probably work with
MESA 3.5, but not a chance with earlier versions due to major changes to the
MESA driver interface and the directory tree. All should compile succesfully.
The driver has its origins in ddsample.c, written by Brian Paul and found by
me in MESA 3.4.2. I touched almost all the functions, changing the coding
style :-( Sorry!
Pitfalls:
1. The current version supports only RGB[A] modes, for it made no sense to me
to endorse color-index (aka palette) modes.
2. Single-buffered is not allowed at all. Until I can find a way to use *REAL*
hardware acceleration, it won't get implemented.
3. 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 ;-).
libGLU:
~~~~~~~
Mesa GLU sources are required.
libGLUT (the toolkit):
~~~~~~~~~~~~~~~~~~~~~~
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 some Allegro "infusions"; I deeply thank to Shawn Hargreaves et co.
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...
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. 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, 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: 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
Contact:
~~~~~~~~
Name: Borca Daniel
E-mail: dborca@yahoo.com
WWW: http://www.geocities.com/dborca/

View File

@@ -1,6 +1,6 @@
File: docs/README.WIN32
Last updated: Oct 15, 2001 - Karl Schultz - kschultz@users.sourceforge.net
Last updated: Nov 29, 2001 - Karl Schultz - kschultz@users.sourceforge.net
Quick Start
@@ -52,10 +52,7 @@ Details and Notes
difficult to modify the makefiles to generate them.
- The si-glu sources are used to build the GLU libs. This was done
mainly to get the better tessellator code. However the C++ NURBS
code is not built. If you need NURBS, consider modifying the
makefiles to build the C++ code or try to build the older GLU
code in src-glu.
mainly to get the better tessellator code.
- The osmesa driver builds and should work on Windows as well as
any other platform.
@@ -68,11 +65,11 @@ Details and Notes
paths for the rasterizers. See src/osmesa/osmesa.c for some good
examples.
- There is DirectDraw support in the Windows driver, but I do not
know if it compiles or works. If you have an application that
does not draw much in a frame, but needs a higher framerate, then
it may pay to turn on the DirectDraw code, since DD often performs
the off-screen to on-screen blit faster than GDI.
- There is DirectDraw support in the Windows driver, updated by
Daniel Slater. You'll need to uncomment the #define DDRAW line
in src/Windows/wmesadef.h and add ddraw.lib to the list of libraries
in src/Makefile.win. On some systems, you will acheive significantly
higher framerates with DirectDraw.
- Some of the more specialized code like FX drivers, stereo, and
parallel support isn't compiled or tested. I left much of this

View File

@@ -1,5 +1,5 @@
Mesa 4.0 Unix/X11 Information
Mesa 4.0.2 Unix/X11 Information
@@ -25,7 +25,7 @@ There are two ways to compile Mesa on Unix/X11 systems:
The top-level makefile will execute the makefiles in a number of sub-
directories. When finished, the Mesa libraries will be in the Mesa-4.0/lib/
directories. When finished, the Mesa libraries will be in the Mesa-4.0.2/lib/
directory. A few GLUT demos in the demos/ directory should be ready to run.
If you also downloaded and unpacked the demos there should be executables
@@ -323,4 +323,4 @@ Summary of X-related environment variables:
----------------------------------------------------------------------
$Id: README.X11,v 3.8 2001/09/23 16:10:02 brianp Exp $
$Id: README.X11,v 3.8.2.2 2002/02/12 03:13:42 brianp Exp $

22
docs/RELNOTES-3.4 Normal file
View File

@@ -0,0 +1,22 @@
Mesa 3.4 release notes
November 3, 2000
PLEASE READ!!!!
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 3.3) designate new developmental releases.
Even numbered versions (such as 3.4) designate stable releases.
Mesa 3.4 simply fixes bugs found in the Mesa 3.3 release. For details,
see the VERSIONS file.
----------------------------------------------------------------------
$Id: RELNOTES-3.4,v 1.1.4.1 2002/03/23 02:36:52 brianp Exp $

22
docs/RELNOTES-4.0.1 Normal file
View File

@@ -0,0 +1,22 @@
Mesa 4.0.1 release notes
December 17, 2001
PLEASE READ!!!!
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 3.3) designate new developmental releases.
Even numbered versions (such as 3.4) designate stable releases.
Mesa 4.0.1 only contains bug fixes since version 4.0.
See the docs/VERSIONS file for the list of bug fixes.
----------------------------------------------------------------------
$Id: RELNOTES-4.0.1,v 1.1.2.2 2001/12/17 19:43:38 brianp Exp $

50
docs/RELNOTES-4.0.2 Normal file
View File

@@ -0,0 +1,50 @@
Mesa 4.0.2 release notes
April 2, 2002
PLEASE READ!!!!
Introduction
------------
Mesa uses an even/odd version number scheme like the Linux kernel.
Odd numbered versions (such as 3.3) designate new developmental releases.
Even numbered versions (such as 3.4) designate stable releases.
Mesa 4.0.2 only contains bug fixes and a new DOS driver since version 4.0.1.
See the docs/VERSIONS file for the list of bug fixes.
Device Drivers
--------------
Mesa advertises itself as either OpenGL 1.2 or OpenGL 1.3 depending on the
device driver. If the driver enables all the ARB extensions which are part
of OpenGL 1.3 then glGetString(GL_VERSION) will return "1.3". Otherwise,
it'll return "1.2".
A number of Mesa's software drivers haven't been actively maintained for
some time. We rely on volunteers to maintain many of the drivers.
Here's the current status of all included drivers:
Driver Status
---------------------- ---------------------
XMesa (Xlib) implements OpenGL 1.3
OSMesa (off-screen) implements OpenGL 1.3
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.3
DOS/DJGPP implements OpenGL 1.3 (new in Mesa 4.0.2)
GGI needs updating
BeOS needs updating
Allegro needs updating
D3D needs updating
----------------------------------------------------------------------
$Id: RELNOTES-4.0.2,v 1.1.2.3 2002/04/01 16:54:11 brianp Exp $

View File

@@ -1,4 +1,4 @@
$Id: VERSIONS,v 1.74 2001/10/22 22:45:18 brianp Exp $
$Id: VERSIONS,v 1.73.2.22 2002/04/01 16:54:11 brianp Exp $
Mesa Version History
@@ -898,9 +898,56 @@ Mesa Version History
- lighting didn't always produce the correct alpha value
- fixed 3DNow! code to not read past end of arrays (Andrew Lewycky)
4.1 Month, ??, 2002
4.0.1 December 17, 2001
New:
-
- better sub-pixel sample positions for AA triangles (Ray Tice)
- slightly faster blending for (GL_ZERO, GL_ONE) and (GL_ONE, GL_ZERO)
Bug fixes:
-
- added missing break statements in glGet*() for multisample cases
- fixed uninitialized hash table mutex bug (display lists / texobjs)
- fixed bad teximage error check conditional (bug 476846)
- fixed demos readtex.c compilation problem on Windows (Karl Schultz)
- added missing glGet() query for GL_MAX_TEXTURE_LOD_BIAS_EXT
- silence some compiler warnings (gcc 2.96)
- enable the #define GL_VERSION_1_3 in GL/gl.h
- added GL 1.3 and GLX 1.4 entries to gl_mangle.h and glx_mangle.h
- fixed glu.h typedef problem found with MSDev 6.0
- build libGL.so with -Bsymbolic (fixes bug found with Chromium)
- added missing 'const' to glXGetContextIDEXT() in glxext.h
- fixed a few glXGetProcAddress() errors (texture compression, etc)
- fixed start index bug in compiled vertex arrays (Keith)
- fixed compilation problems in src/SPARC/glapi_sparc.S
- fixed triangle strip "parity" bug found in VTK medical1 demo (Keith)
- use glXGetProcAddressARB in GLUT to avoid extension linking problems
- provoking vertex of flat-shaded, color-index triangles was wrong
- fixed a few display list bugs (GLUT walker, molecule, etc) (Keith)
- glTexParameter didn't flush the vertex buffer (Ray Tice)
- feedback attributes for glDraw/CopyPixels and glBitmap were wrong
- fixed bug in normal length caching (ParaView lighting bug)
- fixed separate_specular color bug found in Chimera (18 Dec 2001)
4.0.2 April 2, 2002
New:
- New DOS (DJGPP) driver written by Daniel Borca
- New driver interface functions for TCL drivers (such as Radeon DRI)
- GL_RENDERER string returns "Mesa Offscreen16" or "Mesa Offscreen32"
if using deep color channels
- latest GL/glext.h and GL/glxext.h headers from SGI
Bug fixes:
- GL_BLEND with non-black texture env color wasn't always correct
- GL_REPLACE with GL_RGB texture format wasn't always correct (alpha)
- glTexEnviv( pname != GL_TEXTURE_ENV_COLOR ) was broken
- glReadPixels was sometimes mistakenly clipped by the scissor box
- glDraw/ReadPixels didn't catch all the errors that they should have
- Fixed 24bpp rendering problem in Windows driver (Karl Schultz)
- 16-bit GLchan mode fixes (m_trans_tmp.h, s_triangle.c)
- Fixed 1-bit float->int conversion bug in glDrawPixels(GL_DEPTH_COMP)
- glColorMask as sometimes effecting glXSwapBuffers()
- fixed a potential bug in XMesaGarbageCollect()
- N threads rendering into one window didn't work reliably
- glCopyPixels didn't work for deep color channels
- improved 8 -> 16bit/channel texture image conversion (Gerk Huisma)
- glPopAttrib() didn't correctly restore user clip planes
- user clip planes failed for some perspective projections (Chromium)
Known bugs:
- mipmap LOD computation

77
include/GL/dmesa.h Normal file
View File

@@ -0,0 +1,77 @@
/*
* 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 device driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#ifndef DMESA_included
#define DMESA_included
#define DMESA_MAJOR_VERSION 4
#define DMESA_MINOR_VERSION 0
typedef struct dmesa_context *DMesaContext;
typedef struct dmesa_visual *DMesaVisual;
typedef struct dmesa_buffer *DMesaBuffer;
#ifdef __cplusplus
extern "C" {
#endif
DMesaVisual DMesaCreateVisual (GLint width, GLint height, GLint colDepth,
GLboolean dbFlag, GLint depthSize,
GLint stencilSize,
GLint accumSize);
void DMesaDestroyVisual (DMesaVisual v);
DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
GLint xpos, GLint ypos,
GLint width, GLint height);
void DMesaDestroyBuffer (DMesaBuffer b);
DMesaContext DMesaCreateContext (DMesaVisual visual, DMesaContext share);
void DMesaDestroyContext (DMesaContext c);
GLboolean DMesaViewport (DMesaBuffer b,
GLint xpos, GLint ypos,
GLint width, GLint height);
GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b);
void DMesaSwapBuffers (DMesaBuffer b);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,10 +1,10 @@
/* $Id: gl.h,v 1.59 2001/09/23 16:06:13 brianp Exp $ */
/* $Id: gl.h,v 1.59.2.2 2002/03/20 22:06:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 4.0
* Version: 4.0.2
*
* Copyright (C) 1999-2001 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"),
@@ -84,7 +84,7 @@ extern "C" {
#define GL_VERSION_1_1 1
#define GL_VERSION_1_2 1
/*#define GL_VERSION_1_3 1 not yet */
#define GL_VERSION_1_3 1
#define GL_ARB_imaging 1
@@ -1912,8 +1912,6 @@ GLAPI void GLAPIENTRY glMultTransposeMatrixf( const GLfloat m[16] );
GLAPI void GLAPIENTRY glSampleCoverage( GLclampf value, GLboolean invert );
GLAPI void GLAPIENTRY glSamplePass( GLenum pass );
/*
* GL_ARB_multitexture (ARB extension 1 and OpenGL 1.2.1)

File diff suppressed because it is too large Load Diff

View File

@@ -42,17 +42,16 @@ extern "C" {
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated 2001/09/26 */
#define GL_GLEXT_VERSION 9
/* glext.h last updated 2002/03/22 */
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
#define GL_GLEXT_VERSION 11
#ifndef GL_VERSION_1_2
#define GL_CONSTANT_COLOR 0x8001
@@ -465,6 +464,31 @@ extern "C" {
#define GL_DOT3_RGBA_EXT 0x86AF
#endif
#ifndef GL_ARB_texture_mirrored_repeat
#define GL_MIRRORED_REPEAT_ARB 0x8370
#endif
#ifndef GL_ARB_depth_texture
#define GL_DEPTH_COMPONENT16_ARB 0x81A5
#define GL_DEPTH_COMPONENT24_ARB 0x81A6
#define GL_DEPTH_COMPONENT32_ARB 0x81A7
#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
#endif
#ifndef GL_ARB_shadow
#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
#endif
#ifndef GL_ARB_shadow_ambient
#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
#endif
#ifndef GL_ARB_window_pos
#endif
#ifndef GL_EXT_abgr
#define GL_ABGR_EXT 0x8000
#endif
@@ -1721,30 +1745,33 @@ extern "C" {
#endif
#ifndef GL_NV_texture_shader
#define GL_TEXTURE_SHADER_NV 0x86DE
#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
#define GL_SHADER_CONSISTENT_NV 0x86DD
#define GL_TEXTURE_SHADER_NV 0x86DE
#define GL_SHADER_OPERATION_NV 0x86DF
#define GL_CULL_MODES_NV 0x86E0
#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV
#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV
#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV
#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
#define GL_CONST_EYE_NV 0x86E5
#define GL_SHADER_CONSISTENT_NV 0x86DD
#define GL_PASS_THROUGH_NV 0x86E6
#define GL_CULL_FRAGMENT_NV 0x86E7
#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
#define GL_DOT_PRODUCT_NV 0x86EC
#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
@@ -1753,8 +1780,9 @@ extern "C" {
#define GL_DSDT_NV 0x86F5
#define GL_DSDT_MAG_NV 0x86F6
#define GL_DSDT_MAG_VIB_NV 0x86F7
#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
#define GL_HILO16_NV 0x86F8
#define GL_SIGNED_HILO_NV 0x86F9
#define GL_SIGNED_HILO16_NV 0x86FA
#define GL_SIGNED_RGBA_NV 0x86FB
#define GL_SIGNED_RGBA8_NV 0x86FC
#define GL_SIGNED_RGB_NV 0x86FE
@@ -1767,15 +1795,11 @@ extern "C" {
#define GL_SIGNED_ALPHA8_NV 0x8706
#define GL_SIGNED_INTENSITY_NV 0x8707
#define GL_SIGNED_INTENSITY8_NV 0x8708
#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
#define GL_HILO16_NV 0x86F8
#define GL_SIGNED_HILO_NV 0x86F9
#define GL_SIGNED_HILO16_NV 0x86FA
#define GL_DSDT8_NV 0x8709
#define GL_DSDT8_MAG8_NV 0x870A
#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
#define GL_HI_SCALE_NV 0x870E
#define GL_LO_SCALE_NV 0x870F
#define GL_DS_SCALE_NV 0x8710
@@ -1806,28 +1830,20 @@ extern "C" {
#ifndef GL_NV_vertex_program
#define GL_VERTEX_PROGRAM_NV 0x8620
#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
#define GL_CURRENT_ATTRIB_NV 0x8626
#define GL_PROGRAM_PARAMETER_NV 0x8644
#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
#define GL_PROGRAM_TARGET_NV 0x8646
#define GL_PROGRAM_LENGTH_NV 0x8627
#define GL_PROGRAM_RESIDENT_NV 0x8647
#define GL_PROGRAM_STRING_NV 0x8628
#define GL_TRACK_MATRIX_NV 0x8648
#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
#define GL_MODELVIEW_PROJECTION_NV 0x8629
#define GL_IDENTITY_NV 0x862A
#define GL_INVERSE_NV 0x862B
#define GL_TRANSPOSE_NV 0x862C
#define GL_INVERSE_TRANSPOSE_NV 0x862D
#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
#define GL_MAX_TRACK_MATRICES_NV 0x862F
#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
#define GL_CURRENT_MATRIX_NV 0x8641
#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
#define GL_MODELVIEW_PROJECTION_NV 0x8629
#define GL_MATRIX0_NV 0x8630
#define GL_MATRIX1_NV 0x8631
#define GL_MATRIX2_NV 0x8632
@@ -1836,10 +1852,18 @@ extern "C" {
#define GL_MATRIX5_NV 0x8635
#define GL_MATRIX6_NV 0x8636
#define GL_MATRIX7_NV 0x8637
#define GL_IDENTITY_NV 0x862A
#define GL_INVERSE_NV 0x862B
#define GL_TRANSPOSE_NV 0x862C
#define GL_INVERSE_TRANSPOSE_NV 0x862D
#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
#define GL_CURRENT_MATRIX_NV 0x8641
#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
#define GL_PROGRAM_PARAMETER_NV 0x8644
#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
#define GL_PROGRAM_TARGET_NV 0x8646
#define GL_PROGRAM_RESIDENT_NV 0x8647
#define GL_TRACK_MATRIX_NV 0x8648
#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
@@ -2155,11 +2179,13 @@ extern "C" {
#define GL_Y_EXT 0x87D6
#define GL_Z_EXT 0x87D7
#define GL_W_EXT 0x87D8
#define GL_NEGEXTVE_X_EXT 0x87D9
#define GL_NEGEXTVE_Y_EXT 0x87DA
#define GL_NEGEXTVE_Z_EXT 0x87DB
#define GL_NEGEXTVE_W_EXT 0x87DC
#define GL_NEGEXTVE_ONE_EXT 0x87DF
#define GL_NEGATIVE_X_EXT 0x87D9
#define GL_NEGATIVE_Y_EXT 0x87DA
#define GL_NEGATIVE_Z_EXT 0x87DB
#define GL_NEGATIVE_W_EXT 0x87DC
#define GL_ZERO_EXT 0x87DD
#define GL_ONE_EXT 0x87DE
#define GL_NEGATIVE_ONE_EXT 0x87DF
#define GL_NORMALIZED_RANGE_EXT 0x87E0
#define GL_FULL_RANGE_EXT 0x87E1
#define GL_CURRENT_VERTEX_EXT 0x87E2
@@ -2189,6 +2215,65 @@ extern "C" {
#define GL_VERTEX_SOURCE_ATI 0x8774
#endif
#ifndef GL_ATI_element_array
#define GL_ELEMENT_ARRAY_ATI 0x8768
#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
#endif
#ifndef GL_SUN_mesh_array
#define GL_QUAD_MESH_SUN 0x8614
#define GL_TRIANGLE_MESH_SUN 0x8615
#endif
#ifndef GL_SUN_slice_accum
#define GL_SLICE_ACCUM_SUN 0x85CC
#endif
#ifndef GL_NV_multisample_filter_hint
#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
#endif
#ifndef GL_NV_depth_clamp
#define GL_DEPTH_CLAMP_NV 0x864F
#endif
#ifndef GL_NV_occlusion_query
#define GL_PIXEL_COUNTER_BITS_NV 0x8864
#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
#define GL_PIXEL_COUNT_NV 0x8866
#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
#endif
#ifndef GL_NV_point_sprite
#define GL_POINT_SPRITE_NV 0x8861
#define GL_COORD_REPLACE_NV 0x8862
#define GL_POINT_SPRITE_R_MODE_NV 0x8863
#endif
#ifndef GL_NV_texture_shader3
#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
#define GL_HILO8_NV 0x885E
#define GL_SIGNED_HILO8_NV 0x885F
#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
#endif
#ifndef GL_NV_vertex_program1_1
#endif
/*************************************************************/
@@ -2500,6 +2585,16 @@ typedef void (APIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLin
#define GL_ARB_texture_border_clamp 1
#endif
#ifndef GL_ARB_point_parameters
#define GL_ARB_point_parameters 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
#endif
#ifndef GL_ARB_vertex_blend
#define GL_ARB_vertex_blend 1
#ifdef GL_GLEXT_PROTOTYPES
@@ -2554,6 +2649,60 @@ typedef void (APIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum typ
#define GL_ARB_texture_env_dot3 1
#endif
#ifndef GL_ARB_texture_mirror_repeat
#define GL_ARB_texture_mirror_repeat 1
#endif
#ifndef GL_ARB_depth_texture
#define GL_ARB_depth_texture 1
#endif
#ifndef GL_ARB_shadow
#define GL_ARB_shadow 1
#endif
#ifndef GL_ARB_shadow_ambient
#define GL_ARB_shadow_ambient 1
#endif
#ifndef GL_ARB_window_pos
#define GL_ARB_window_pos 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *);
GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *);
GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint);
GLAPI void APIENTRY glWindowPos2ivARB (const GLint *);
GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort);
GLAPI void APIENTRY glWindowPos2svARB (const GLshort *);
GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *);
GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *);
GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint);
GLAPI void APIENTRY glWindowPos3ivARB (const GLint *);
GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort);
GLAPI void APIENTRY glWindowPos3svARB (const GLshort *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
typedef void (APIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v);
typedef void (APIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
typedef void (APIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v);
typedef void (APIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
typedef void (APIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint *v);
typedef void (APIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
typedef void (APIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v);
typedef void (APIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v);
typedef void (APIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v);
typedef void (APIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
typedef void (APIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint *v);
typedef void (APIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
typedef void (APIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v);
#endif
#ifndef GL_EXT_abgr
#define GL_EXT_abgr 1
#endif
@@ -2904,20 +3053,22 @@ typedef void (APIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GL
#define GL_SGIX_texture_multi_buffer 1
#endif
#ifndef GL_ARB_point_parameters
#define GL_ARB_point_parameters 1
#ifndef GL_EXT_point_parameters
#define GL_EXT_point_parameters 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat);
GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *);
GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat);
GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
#endif
#ifndef GL_SGIS_point_parameters
#define GL_SGIS_point_parameters 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat);
GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params);
typedef void (APIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
typedef void (APIENTRY * PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRY * PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params);
#endif
@@ -3887,21 +4038,21 @@ typedef void (APIENTRY * PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoi
#ifndef GL_NV_fence
#define GL_NV_fence 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *);
GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
GLAPI void APIENTRY glFinishFenceNV (GLuint);
GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *);
GLAPI GLboolean APIENTRY glIsFenceNV (GLuint);
GLAPI GLboolean APIENTRY glTestFenceNV (GLuint);
GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glFinishFenceNV (GLuint);
GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
typedef void (APIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
typedef void (APIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
typedef GLboolean (APIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence);
typedef void (APIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (APIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
typedef GLboolean (APIENTRY * PFNGLISFENCENVPROC) (GLuint fence);
typedef GLboolean (APIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence);
typedef void (APIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
typedef void (APIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (APIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#endif
#ifndef GL_NV_evaluators
@@ -3965,14 +4116,13 @@ typedef void (APIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage,
#ifndef GL_NV_vertex_program
#define GL_NV_vertex_program 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint);
GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *);
GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *);
GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *);
GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *);
GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *);
GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *);
GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *);
GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *);
@@ -3982,62 +4132,62 @@ GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *);
GLAPI GLboolean APIENTRY glIsProgramNV (GLuint);
GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *);
GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *);
GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *);
GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *);
GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *);
GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *);
GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum);
GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *);
GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble);
GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat);
GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort);
GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *);
GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *);
GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *);
GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *);
GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *);
GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *);
GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *);
GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *);
GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *);
GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *);
GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLboolean (APIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences);
typedef void (APIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
typedef void (APIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *ids);
typedef void (APIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
typedef void (APIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params);
typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *ids);
typedef GLboolean (APIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *ids, GLboolean *residences);
typedef void (APIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *ids);
typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs);
typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params);
typedef void (APIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params);
typedef void (APIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program);
typedef void (APIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params);
@@ -4047,53 +4197,54 @@ typedef void (APIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pna
typedef void (APIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
typedef GLboolean (APIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id);
typedef void (APIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *params);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *params);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint num, const GLdouble *params);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint num, const GLfloat *params);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v);
typedef void (APIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v);
typedef void (APIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs);
typedef void (APIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
typedef void (APIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
typedef void (APIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
typedef void (APIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
typedef void (APIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v);
typedef void (APIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v);
#endif
#ifndef GL_SGIX_texture_coordinate_clamp
@@ -4301,97 +4452,167 @@ typedef void (APIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum
#ifndef GL_ATI_vertex_streams
#define GL_ATI_vertex_streams 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glVertexStream1s (GLenum, GLshort);
GLAPI void APIENTRY glVertexStream1sv (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream1i (GLenum, GLint);
GLAPI void APIENTRY glVertexStream1iv (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream1f (GLenum, GLfloat);
GLAPI void APIENTRY glVertexStream1fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream1d (GLenum, GLdouble);
GLAPI void APIENTRY glVertexStream1dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream2s (GLenum, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream2sv (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream2i (GLenum, GLint, GLint);
GLAPI void APIENTRY glVertexStream2iv (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream2f (GLenum, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream2fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream2d (GLenum, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream2dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream3s (GLenum, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream3sv (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream3i (GLenum, GLint, GLint, GLint);
GLAPI void APIENTRY glVertexStream3iv (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream3f (GLenum, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream3fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream3d (GLenum, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream3dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream4s (GLenum, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream4sv (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream4i (GLenum, GLint, GLint, GLint, GLint);
GLAPI void APIENTRY glVertexStream4iv (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream4fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream4dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glNormalStream3b (GLenum, GLbyte, GLbyte, GLbyte);
GLAPI void APIENTRY glNormalStream3bv (GLenum, const GLbyte *);
GLAPI void APIENTRY glNormalStream3s (GLenum, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glNormalStream3sv (GLenum, const GLshort *);
GLAPI void APIENTRY glNormalStream3i (GLenum, GLint, GLint, GLint);
GLAPI void APIENTRY glNormalStream3iv (GLenum, const GLint *);
GLAPI void APIENTRY glNormalStream3f (GLenum, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glNormalStream3fv (GLenum, const GLfloat *);
GLAPI void APIENTRY glNormalStream3d (GLenum, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glNormalStream3dv (GLenum, const GLdouble *);
GLAPI void APIENTRY glClientActiveVertexStream (GLenum);
GLAPI void APIENTRY glVertexBlendEnvi (GLenum, GLint);
GLAPI void APIENTRY glVertexBlendEnvf (GLenum, GLfloat);
GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort);
GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint);
GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat);
GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble);
GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint);
GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint);
GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint);
GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte);
GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *);
GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort);
GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *);
GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint);
GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *);
GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat);
GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *);
GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble);
GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *);
GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum);
GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint);
GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLVERTEXSTREAM1SPROC) (GLenum stream, GLshort x);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1SVPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1IPROC) (GLenum stream, GLint x);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1IVPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1FPROC) (GLenum stream, GLfloat x);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1FVPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1DPROC) (GLenum stream, GLdouble x);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1DVPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2SPROC) (GLenum stream, GLshort x, GLshort y);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2SVPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2IPROC) (GLenum stream, GLint x, GLint y);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2IVPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2FPROC) (GLenum stream, GLfloat x, GLfloat y);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2FVPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2DPROC) (GLenum stream, GLdouble x, GLdouble y);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2DVPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3SPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3SVPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3IPROC) (GLenum stream, GLint x, GLint y, GLint z);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3IVPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3FPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3FVPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3DPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3DVPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4SPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4SVPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4IPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4IVPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4FPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4FVPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4DPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4DVPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3BPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3BVPROC) (GLenum stream, const GLbyte *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3SPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3SVPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3IPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3IVPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3FPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3FVPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3DPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3DVPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMPROC) (GLenum stream);
typedef void (APIENTRY * PFNGLVERTEXBLENDENVIPROC) (GLenum pname, GLint param);
typedef void (APIENTRY * PFNGLVERTEXBLENDENVFPROC) (GLenum pname, GLfloat param);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
typedef void (APIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
typedef void (APIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
typedef void (APIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
typedef void (APIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
typedef void (APIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz);
typedef void (APIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
typedef void (APIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
typedef void (APIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
typedef void (APIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
#endif
#ifndef GL_ATI_element_array
#define GL_ATI_element_array 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *);
GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei);
GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
typedef void (APIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
typedef void (APIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
#endif
#ifndef GL_SUN_mesh_array
#define GL_SUN_mesh_array 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width);
#endif
#ifndef GL_SUN_slice_accum
#define GL_SUN_slice_accum 1
#endif
#ifndef GL_NV_multisample_filter_hint
#define GL_NV_multisample_filter_hint 1
#endif
#ifndef GL_NV_depth_clamp
#define GL_NV_depth_clamp 1
#endif
#ifndef GL_NV_occlusion_query
#define GL_NV_occlusion_query 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *);
GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *);
GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint);
GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint);
GLAPI void APIENTRY glEndOcclusionQueryNV (void);
GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *);
GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids);
typedef void (APIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids);
typedef GLboolean (APIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
typedef void (APIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
typedef void (APIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void);
typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params);
typedef void (APIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params);
#endif
#ifndef GL_NV_point_sprite
#define GL_NV_point_sprite 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint);
GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
typedef void (APIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params);
#endif
#ifndef GL_NV_texture_shader3
#define GL_NV_texture_shader3 1
#endif
#ifndef GL_NV_vertex_program1_1
#define GL_NV_vertex_program1_1 1
#endif

View File

@@ -250,10 +250,10 @@ typedef struct GLUquadric GLUquadric;
typedef struct GLUtesselator GLUtesselator;
#endif
typedef struct GLUnurbs GLUnurbsObj;
typedef struct GLUquadric GLUquadricObj;
typedef struct GLUtesselator GLUtesselatorObj;
typedef struct GLUtesselator GLUtriangulatorObj;
typedef GLUnurbs GLUnurbsObj;
typedef GLUquadric GLUquadricObj;
typedef GLUtesselator GLUtesselatorObj;
typedef GLUtesselator GLUtriangulatorObj;
#define GLU_TESS_MAX_COORD 1.0e150

View File

@@ -1,4 +1,4 @@
/* $Id: glx.h,v 1.33 2001/09/24 14:15:58 brianp Exp $ */
/* $Id: glx.h,v 1.33.2.1 2001/12/14 03:20:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -172,8 +172,8 @@ extern "C" {
/*
* GLX 1.4 and later:
*/
#define GLX_SAMPLE_BUFFERS_SGIS 100000
#define GLX_SAMPLES_SGIS 100001
#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
#define GLX_SAMPLES 0x186a1 /*100001*/

View File

@@ -1,8 +1,8 @@
/* $Id: glx_mangle.h,v 1.1 1999/08/19 00:55:40 jtg Exp $ */
/* $Id: glx_mangle.h,v 1.1.1.1.8.1 2001/11/09 22:00:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.0
* Version: 4.1
* Copyright (C) 1995-1998 Brian Paul
*
* This library is free software; you can redistribute it and/or
@@ -21,25 +21,6 @@
*/
/*
* $Log: glx_mangle.h,v $
* Revision 1.1 1999/08/19 00:55:40 jtg
* Initial revision
*
* Revision 3.3 1999/06/21 22:01:00 brianp
* added #ifndef GLX_MANGLE_H stuff, video sync extension functions
*
* Revision 3.2 1998/03/26 02:44:53 brianp
* removed ^M characters
*
* Revision 3.1 1998/03/17 02:41:19 brianp
* updated by Randy Frank
*
* Revision 3.0 1998/02/20 05:04:45 brianp
* initial rev
*
*/
#ifndef GLX_MANGLE_H
#define GLX_MANGLE_H
@@ -69,4 +50,8 @@
#define glXGetVideoSyncSGI mglXGetVideoSyncSGI
#define glXWaitVideoSyncSGI mglXWaitVideoSyncSGI
/* GLX 1.4 */
#define glXGetProcAddress mglXGetProcAddress
#endif

View File

@@ -42,12 +42,16 @@ extern "C" {
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
/* glxext.h last updated 2001/09/26 */
#define GLX_GLXEXT_VERSION 3
/* glxext.h last updated 2002/03/22 */
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
#define GLX_GLXEXT_VERSION 5
#ifndef GLX_VERSION_1_3
#define GLX_WINDOW_BIT 0x00000001
@@ -113,6 +117,9 @@ extern "C" {
#define GLX_SAMPLES 100001
#endif
#ifndef GLX_ARB_get_proc_address
#endif
#ifndef GLX_ARB_multisample
#define GLX_SAMPLE_BUFFERS_ARB 100000
#define GLX_SAMPLES_ARB 100001
@@ -276,7 +283,6 @@ extern "C" {
/*************************************************************/
#ifndef GLX_ARB_get_proc_address
/* XXX Added void parameter to silence many, many warnings (BrianP) */
typedef void (*__GLXextFuncPtr)(void);
#endif
@@ -348,6 +354,14 @@ typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigne
typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
#endif
#ifndef GLX_VERSION_1_4
#define GLX_VERSION_1_4 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern __GLXextFuncPtr glXGetProcAddress (const GLubyte *);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
#endif
#ifndef GLX_ARB_get_proc_address
#define GLX_ARB_get_proc_address 1
#ifdef GLX_GLXEXT_PROTOTYPES
@@ -356,6 +370,10 @@ extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
typedef __GLXextFuncPtr ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
#endif
#ifndef GLX_ARB_multisample
#define GLX_ARB_multisample 1
#endif
#ifndef GLX_SGIS_multisample
#define GLX_SGIS_multisample 1
#endif
@@ -413,13 +431,13 @@ typedef void ( * PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSou
#ifdef GLX_GLXEXT_PROTOTYPES
extern Display * glXGetCurrentDisplayEXT (void);
extern int glXQueryContextInfoEXT (Display *, GLXContext, int, int *);
extern GLXContextID glXGetContextIDEXT (GLXContext);
extern GLXContextID glXGetContextIDEXT (const GLXContext);
extern GLXContext glXImportContextEXT (Display *, GLXContextID);
extern void glXFreeContextEXT (Display *, GLXContext);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Display * ( * PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (GLXContext context);
typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
#endif
@@ -554,14 +572,33 @@ typedef Bool ( * PFNGLXSET3DFXMODEMESAPROC) (int mode);
#define GLX_SGIX_visual_select_group 1
#endif
#ifndef GLX_GLX_OML_swap_method
#define GLX_GLX_OML_swap_method 1
#ifndef GLX_OML_swap_method
#define GLX_OML_swap_method 1
#endif
#ifndef GLX_GLX_OML_sync_control
#define GLX_GLX_OML_sync_control 1
#if defined(__STDC_VERSION__)
#if __STDC_VERSION__ >= 199901L
/* Include ISO C99 integer types for OML_sync_control; need a better test */
#include <inttypes.h>
#ifndef GLX_OML_sync_control
#define GLX_OML_sync_control 1
#ifdef GLX_GLXEXT_PROTOTYPES
extern Bool glXGetSyncValuesOML (Display *, GLXDrawable, int64_t *, int64_t *, int64_t *);
extern Bool glXGetMscRateOML (Display *, GLXDrawable, int32_t *, int32_t *);
extern int64_t glXSwapBuffersMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t);
extern Bool glXWaitForMscOML (Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *);
extern Bool glXWaitForSbcOML (Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *);
#endif /* GLX_GLXEXT_PROTOTYPES */
typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
#endif
#endif /* C99 version test */
#endif /* STDC test */
#ifdef __cplusplus
}

View File

@@ -1,10 +1,10 @@
/* $Id: xmesa.h,v 1.12 2001/09/23 16:06:13 brianp Exp $ */
/* $Id: xmesa.h,v 1.12.2.1 2002/03/16 00:50:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 4.0
* Version: 4.0.2
*
* Copyright (C) 1999-2001 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"),
@@ -365,6 +365,15 @@ extern GLboolean XMesaSetFXmode( GLint mode );
/*
* Reallocate the back/depth/stencil/accum/etc/ buffers associated with
* buffer <b> if its size has changed.
*
* New in Mesa 4.0.2
*/
extern void XMesaResizeBuffers( XMesaBuffer b );
#ifdef __cplusplus
}
#endif

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.win,v 1.5 2001/10/04 19:13:36 kschultz Exp $
# $Id: Makefile.win,v 1.5.2.1 2001/10/26 21:03:15 kschultz Exp $
# Mesa 3-D graphics library
# Version: 3.5
@@ -79,22 +79,20 @@ OSMESASRCS = osdemo.c
clean::
realclean::
clobber::
@del readtex.c readtex.h
targets: readtex.c readtex.h $(PROGS)
# remove comments when we get non-osmesa pgm working
$(EXES) : $*.obj
$(EXES) : $*.obj readtex.c readtex.h
@echo $@
$(link) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS)
$(link) -out:$@ $* /LIBPATH:$(LIBDIR) $(LIBS)
$(OSMESAEXES) : $*.obj
@echo $@
$(link) $(lcommon) -out:$@ $** /LIBPATH:$(LIBDIR) $(LIBS) $(EXTRALIBS)
$(link) $(lcommon) -out:$@ $* /LIBPATH:$(LIBDIR) $(LIBS) $(EXTRALIBS)
readtex.c:
@copy ../util/readtex.c .
-copy ..\util\readtex.c .
readtex.h:
@copy ../util/readtex.c .
-copy ..\util\readtex.h .

View File

@@ -40,7 +40,7 @@
static GLfloat Xrot = 0, Yrot = -30, Zrot = 0;
static GLboolean Anim = GL_TRUE;
static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */
static GLint BiasMin = -200, BiasMax = 500;
static GLint BiasMin = -400, BiasMax = 400;
@@ -192,6 +192,8 @@ static void SpecialKey( int key, int x, int y )
static void Init( void )
{
const char *exten = (const char *) glGetString(GL_EXTENSIONS);
GLfloat maxBias;
if (!strstr(exten, "GL_EXT_texture_lod_bias")) {
printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n");
exit(1);
@@ -207,6 +209,11 @@ static void Init( void )
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &maxBias);
printf("LOD bias range: [%g, %g]\n", -maxBias, maxBias);
BiasMin = -100 * maxBias;
BiasMax = 100 * maxBias;
}

View File

@@ -42,6 +42,7 @@
* two rectangles. This program clamps the texture, if
* the texture coordinates fall outside 0.0 and 1.0.
*/
#include <stdlib.h>
#include <GL/glut.h>
/* Create checkerboard texture */

View File

@@ -62,7 +62,7 @@ selectFog(int mode)
/* falls through */
case GL_EXP2:
case GL_EXP:
glFogi(GL_FOG_MODE, mode);
glFogiv(GL_FOG_MODE, (int *) &mode);
glutPostRedisplay();
break;
case 0:
@@ -190,7 +190,7 @@ main(int argc, char **argv)
glutDisplayFunc(display);
glutCreateMenu(selectFog);
glutAddMenuEntry("Fog EXP", GL_EXP);
glutAddMenuEntry("Fog EXP2", GL_EXP2);
glutAddMenuEntry("Fog EXP2", /*GL_EXP2*/ 0xffff);
glutAddMenuEntry("Fog LINEAR", GL_LINEAR);
glutAddMenuEntry("Quit", 0);
glutAttachMenu(GLUT_RIGHT_BUTTON);

View File

@@ -39,6 +39,7 @@
* hello.c
* This is a simple, introductory OpenGL program.
*/
#include <stdlib.h>
#include <GL/glut.h>
void display(void)

View File

@@ -44,6 +44,7 @@
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef GL_VERSION_1_1
GLuint list;
@@ -149,7 +150,7 @@ static void Benchmark( float xdiff, float ydiff )
{
int startTime, endTime;
int draws;
double seconds, fps, triPerSecond;
double seconds, fps;
printf("Benchmarking...\n");

View File

@@ -41,6 +41,7 @@
* This program draws a NURBS surface in the shape of a
* symmetrical hill.
*/
#include <stdlib.h>
#include <GL/glut.h>
GLfloat ctlpoints[4][4][3];

View File

@@ -174,7 +174,7 @@ static void DeleteTri(GLint h)
static void GrowTri(GLint h)
{
float v[2];
float *oldV;
float *oldV = NULL;
GLint i;
v[0] = objects[h].v1[0] + objects[h].v2[0] + objects[h].v3[0];

View File

@@ -1,7 +1,7 @@
# $Id: Makefile.X11,v 1.11 2001/03/23 22:48:35 brianp Exp $
# $Id: Makefile.X11,v 1.11.2.1 2002/01/30 21:54:47 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.5
# Version: 4.0.2
# Copyright (C) 1995-2001 Brian Paul
# Makefile for non-GLUT (X11, SVGA, etc) demo programs
@@ -12,9 +12,9 @@
INCDIR = ../include
LIBDIR = ../lib
GL_LIBS = -L$(LIBDIR) -lglut -lGLU -lGL $(APP_LIB_DEPS)
GL_LIBS = -L$(LIBDIR) -lGLU -lGL $(APP_LIB_DEPS)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB) $(LIBDIR)/$(GLUT_LIB)
LIB_DEP = $(LIBDIR)/$(GL_LIB) $(LIBDIR)/$(GLU_LIB)
PROGS = glthreads \
glxdemo \
@@ -43,7 +43,7 @@ PROGS = glthreads \
##### TARGETS #####
default:
@echo "Specify a target configuration"
@echo "Specify a target configuration (i.e. make -f Makefile.X11 linux)"
clean:
-rm *.o *~

View File

@@ -1,4 +1,4 @@
/* $Id: glthreads.c,v 1.1 2000/07/20 20:12:17 brianp Exp $ */
/* $Id: glthreads.c,v 1.1.4.1 2002/03/08 19:43:36 brianp Exp $ */
/*
* Copyright (C) 2000 Brian Paul All Rights Reserved.
@@ -38,6 +38,7 @@
#include <GL/glx.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>

View File

@@ -1,4 +1,4 @@
/* $Id: glxheads.c,v 1.2 2000/11/10 17:23:07 brianp Exp $ */
/* $Id: glxheads.c,v 1.2.2.1 2002/03/08 19:43:36 brianp Exp $ */
/*
* Exercise multiple GLX connections on multiple X displays.
@@ -30,6 +30,7 @@
#include <GL/glx.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -247,9 +248,9 @@ static void
PrintInfo(const struct head *h)
{
printf("Name: %s\n", h->DisplayName);
printf(" Display: 0x%x\n", h->Dpy);
printf(" Window: 0x%x\n", h->Win);
printf(" Context: 0x%x\n", h->Context);
printf(" Display: 0x%x\n", (int) h->Dpy);
printf(" Window: 0x%x\n", (int) h->Win);
printf(" Context: 0x%x\n", (int) h->Context);
printf(" GL_VERSION: %s\n", h->Version);
printf(" GL_VENDOR: %s\n", h->Vendor);
printf(" GL_RENDERER: %s\n", h->Renderer);

View File

@@ -1,4 +1,4 @@
/* $Id: glxinfo.c,v 1.14 2001/04/24 20:57:36 brianp Exp $ */
/* $Id: glxinfo.c,v 1.14.2.1 2002/03/08 19:43:36 brianp Exp $ */
/*
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
@@ -408,7 +408,7 @@ print_visual_attribs_short_header(void)
static void
print_visual_attribs_short(const struct visual_attribs *attribs)
{
char *caveat;
char *caveat = NULL;
#ifdef GLX_EXT_visual_rating
if (attribs->visualCaveat == GLX_NONE_EXT || attribs->visualCaveat == 0)
caveat = "None";

View File

@@ -1,4 +1,4 @@
/* $Id: manywin.c,v 1.4 2001/04/27 21:19:13 brianp Exp $ */
/* $Id: manywin.c,v 1.4.2.1 2001/11/26 17:21:24 brianp Exp $ */
/*
* Create N GLX windows/contexts and render to them in round-robin
@@ -29,6 +29,7 @@
#include <GL/glx.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -281,7 +282,7 @@ static void
PrintInfo(const struct head *h)
{
printf("Name: %s\n", h->DisplayName);
printf(" Display: %p\n", h->Dpy);
printf(" Display: %p\n", (void *) h->Dpy);
printf(" Window: 0x%x\n", (int) h->Win);
printf(" Context: 0x%x\n", (int) h->Context);
printf(" GL_VERSION: %s\n", h->Version);

85
src/glu/mesa/Makefile.DJ Normal file
View File

@@ -0,0 +1,85 @@
# 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.0 for Mesa 4.0
#
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@yahoo.com
# Web : http://www.geocities.com/dborca
.PHONY: all clean
TOP = ..
CC = gcc
CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=$(CPU) -ffast-math -O2
AR = ar
ARFLAGS = ruv
LIBDIR = $(TOP)/lib
ifeq ($(wildcard $(DJDIR)/lib/dxe2.ld),)
DXE2GEN =
else
DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH))))
endif
GLU_LIB = libglu.a
GLU_DXE = glu.dxe
GLU_IMP = libiglu.a
CORE_SOURCES = \
glu.c \
mipmap.c \
nurbs.c \
nurbscrv.c \
nurbssrf.c \
nurbsutl.c \
polytest.c \
project.c \
quadric.c \
tess.c \
tesselat.c
SOURCES = $(CORE_SOURCES)
OBJECTS = $(SOURCES:.c=.o)
.c.o:
gcc -o $@ -c $(CFLAGS) $<
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 ($(DXE2GEN),)
$(warning Missing DXE2GEN and/or DXE2.LD! You must have DXE2GEN)
$(warning somewhere in PATH, and DXE2.LD in DJGPP/LIB directory.)
else
dxe2gen -o $(LIBDIR)/$(GLU_DXE) -I $(LIBDIR)/$(GLU_IMP) $(OBJECTS) -D "Mesa DOS GLU" -U
endif
clean:
-$(RM) *.o
include depend

View File

@@ -1,9 +1,9 @@
/* $Id: glu.c,v 1.24 2001/03/20 17:56:10 brianp Exp $ */
/* $Id: glu.c,v 1.24.2.1 2002/02/12 03:13:42 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
* Copyright (C) 1995-2001 Brian Paul
* Version: 4.0.2
* Copyright (C) 1995-2002 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -330,7 +330,7 @@ const GLubyte *GLAPIENTRY
gluGetString(GLenum name)
{
static char *extensions = "GL_EXT_abgr";
static char *version = "1.1 Mesa 3.5";
static char *version = "1.1 Mesa 4.0.2";
switch (name) {
case GLU_EXTENSIONS:

View File

@@ -1,11 +1,12 @@
# $Id: Makefile.X11,v 1.5 2001/08/13 16:51:08 brianp Exp $
# $Id: Makefile.X11,v 1.5.2.2 2002/01/08 15:58:11 brianp Exp $
# Mesa 3-D graphics library
# Version: 3.5
# Version: 4.0.1
# Copyright (C) 1995-2001 Brian Paul
# Makefile for SGI SI GLU library
.SUFFIXES : .cc
##### MACROS #####
@@ -121,11 +122,10 @@ OBJECTS = $(C_OBJECTS) $(CC_OBJECTS)
##### RULES #####
.c.o:
$(CC) -c $(INCDIRS) $(CFLAGS) -DLIBRARYBUILD $< -o $@
$(CC) -c $(INCDIRS) $(CFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
.cc.o:
$(CPLUSPLUS) -c $(INCDIRS) $(CCFLAGS) -DLIBRARYBUILD $< -o $@
$(CPLUSPLUS) -c $(INCDIRS) $(CCFLAGS) -DNDEBUG -DLIBRARYBUILD $< -o $@
##### TARGETS #####

View File

@@ -1,14 +1,5 @@
# Makefile for Win32
#
# Sept 12, 2001
# Note: The nurbs code is not being built at this time.
# If you want to work on it, uncomment the definitions
# noted below to try to compile the sources.
# There are numerous problems, some of which may be solved
# by setting some #defines.
#
!include <win32.mak>
.SUFFIXES : .cc
@@ -116,16 +107,14 @@ all : gludll
gludll : $(GLUDLL)
CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -Iinclude -DBUILD_GL32
CFLAGS = $(cvarsdll) $(CFLAGS) -D_OPENGL32_ -Iinclude -DBUILD_GL32 -DLIBRARYBUILD
LFLAGS = $(dlllflags) $(lcommon) $(LFLAGS)
OBJS = $(GLU_SRCS:.c=.obj)
LIBS = ../lib/$(MESALIB) winmm.lib $(guilibsdll)
# Uncomment these definitions to try to compile the NURBS code.
#OBJS = $(GLU_SRCS_CC:.cc=.obj) $(GLU_SRCS:.c=.obj)
#NURBSINC = -Ilibnurbs\interface -Ilibnurbs\internals -Ilibnurbs\nurbtess
#CFLAGS = $(CFLAGS) $(NURBSINC)
OBJS = $(GLU_SRCS_CC:.cc=.obj) $(GLU_SRCS:.c=.obj)
NURBSINC = -Ilibnurbs\interface -Ilibnurbs\internals -Ilibnurbs\nurbtess
CFLAGS = $(CFLAGS) $(NURBSINC)
$(GLUDLL): $(OBJS) glu.def
$(link) $(LFLAGS) -out:$(GLUDLL) -def:glu.def $(OBJS) $(LIBS)

View File

@@ -1,8 +1,11 @@
DESCRIPTION 'Mesa GLU (OpenGL work-alike) for Win32'
VERSION 3.5
VERSION 4.0
EXPORTS
gluBeginCurve
gluBeginPolygon
gluBeginSurface
gluBeginTrim
gluBuild1DMipmapLevels
gluBuild1DMipmaps
gluBuild2DMipmapLevels
@@ -11,22 +14,36 @@ EXPORTS
gluBuild3DMipmaps
gluCheckExtension
gluCylinder
gluDeleteNurbsRenderer
gluDeleteQuadric
gluDeleteTess
gluDisk
gluEndCurve
gluEndPolygon
gluEndSurface
gluEndTrim
gluErrorString
gluGetNurbsProperty
gluGetString
gluGetTessProperty
gluLoadSamplingMatrices
gluLookAt
gluNewNurbsRenderer
gluNewQuadric
gluNewTess
gluNextContour
gluNurbsCallback
gluNurbsCallbackData
gluNurbsCallbackDataEXT
gluNurbsCurve
gluNurbsProperty
gluNurbsSurface
gluOrtho2D
gluPartialDisk
gluPerspective
gluPickMatrix
gluProject
gluPwlCurve
gluQuadricCallback
gluQuadricDrawStyle
gluQuadricNormals

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
** $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierEval.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/bezierEval.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include <stdlib.h>
@@ -72,8 +72,8 @@ void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride
{
float uprime = (u-u0)/(u1-u0);
float *ctlptr = ctlpoints;
float oneMinusX = 1.0-uprime;
float XPower = 1.0;
float oneMinusX = 1.0f-uprime;
float XPower = 1.0f;
int i,k;
for(k=0; k<dimension; k++)
@@ -171,7 +171,7 @@ void bezierCurveEvalDerGen(int der, float u0, float u1, int order, float *ctlpoi
*/
void bezierSurfEvalDerGen(int uder, int vder, float u0, float u1, int uorder, float v0, float v1, int vorder, int dimension, float *ctlpoints, int ustride, int vstride, float u, float v, float ret[])
{
int i,j,k;
int i;
float newPoints[MAX_ORDER][MAX_DIMENSION];
for(i=0; i<uorder; i++){
@@ -229,7 +229,7 @@ void bezierSurfEvalNormal(float u0, float u1, int uorder, float v0, float v1, in
/*if size is 0, then nothing is done*/
static void normalize(float vec[3])
{
float size = sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]);
float size = (float)sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]);
if(size < TOLERANCE)
{

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
** $Date: 2002/02/12 03:14:58 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/insurfeval.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/interface/insurfeval.cc,v 1.1.2.1 2002/02/12 03:14:58 brianp Exp $
*/
#include "gluos.h"
@@ -528,11 +528,11 @@ void OpenGLSurfaceEvaluator::inComputeNormal2(REAL *pu, REAL *pv, REAL *n)
mag = sqrt(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]);
assert(mag > 0.0); /*better be some threshold*/
n[0] /= mag;
n[1] /= mag;
n[2] /= mag;
if (mag > 0.0) {
n[0] /= mag;
n[1] /= mag;
n[2] /= mag;
}
}

View File

@@ -35,8 +35,8 @@
/*
* mapdesc.c++
*
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mapdesc.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
* $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mapdesc.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include <stdio.h>
@@ -372,13 +372,13 @@ Mapdesc::xformAndCullCheck(
unsigned int bits = clipbits( cpts );
outbits |= bits;
inbits &= bits;
if( ( outbits == mask ) && ( inbits != mask ) ) return CULL_ACCEPT;
if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT;
}
}
if( outbits != mask ) {
if( outbits != (unsigned int)mask ) {
return CULL_TRIVIAL_REJECT;
} else if( inbits == mask ) {
} else if( inbits == (unsigned int)mask ) {
return CULL_TRIVIAL_ACCEPT;
} else {
return CULL_ACCEPT;
@@ -404,13 +404,13 @@ Mapdesc::cullCheck( REAL *pts, int uorder, int ustride, int vorder, int vstride
unsigned int bits = clipbits( q );
outbits |= bits;
inbits &= bits;
if( ( outbits == mask ) && ( inbits != mask ) ) return CULL_ACCEPT;
if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT;
}
}
if( outbits != mask ) {
if( outbits != (unsigned int)mask ) {
return CULL_TRIVIAL_REJECT;
} else if( inbits == mask ) {
} else if( inbits == (unsigned int)mask ) {
return CULL_TRIVIAL_ACCEPT;
} else {
return CULL_ACCEPT;
@@ -434,12 +434,12 @@ Mapdesc::cullCheck( REAL *pts, int order, int stride )
unsigned int bits = clipbits( p );
outbits |= bits;
inbits &= bits;
if( ( outbits == mask ) && ( inbits != mask ) ) return CULL_ACCEPT;
if( ( outbits == (unsigned int)mask ) && ( inbits != (unsigned int)mask ) ) return CULL_ACCEPT;
}
if( outbits != mask ) {
if( outbits != (unsigned int)mask ) {
return CULL_TRIVIAL_REJECT;
} else if( inbits == mask ) {
} else if( inbits == (unsigned int)mask ) {
return CULL_TRIVIAL_ACCEPT;
} else {
return CULL_ACCEPT;

View File

@@ -35,8 +35,8 @@
/*
* mesher.c++
*
* $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mesher.cc,v 1.2 2001/08/07 17:34:11 brianp Exp $
* $Date: 2001/11/29 16:38:27 $ $Revision: 1.2.2.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/mesher.cc,v 1.2.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include "glimports.h"
@@ -82,7 +82,7 @@ Mesher::init( unsigned int npts )
inline void
Mesher::push( GridTrimVertex *gt )
{
assert( itop+1 != stacksize );
assert( itop+1 != (int)stacksize );
vdata[++itop] = gt;
}

View File

@@ -35,8 +35,8 @@
/*
* sorter.c++
*
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/sorter.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
* $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/sorter.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include "glimports.h"
@@ -84,7 +84,7 @@ Sorter::qs1( char *a, char *l )
unsigned int n;
start:
if((n=l-a) <= es)
if((n=l-a) <= (unsigned int)es)
return;
n = es * (n / (2*es));
hp = lp = a+n;

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
** $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/directedLine.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/directedLine.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include <stdlib.h>
@@ -596,7 +596,7 @@ Real directedLine::polyArea()
y2 = temp->next->head()[1];
ret += -( x2*y1-x1*y2);
}
return 0.5*ret;
return Real(0.5)*ret;
}
/*******************split or combine polygons begin********************/

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
** $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/partitionY.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include <stdlib.h>
@@ -231,7 +231,7 @@ Int sweepRangeEqual(sweepRange* src1, sweepRange* src2)
*/
inline/*static*/ Real intersectHoriz(Real x1, Real y1, Real x2, Real y2, Real y)
{
return ((y2==y1)? (x1+x2)*0.5 : x1 + ((y-y1)/(y2-y1)) * (x2-x1));
return ((y2==y1)? (x1+x2)*Real(0.5) : x1 + ((y-y1)/(y2-y1)) * (x2-x1));
/*
if(y2 == y1) return (x1+x2)*0.5;
else return x1 + ((y-y1)/(y2-y1)) * (x2-x1);
@@ -309,7 +309,7 @@ static Int compEdges(directedLine *e1, directedLine *e2)
Real Ymax = min(e1_Ymax, e2_Ymax);
Real Ymin = max(e1_Ymin, e2_Ymin);
Real y = 0.5*(Ymax + Ymin);
Real y = Real(0.5)*(Ymax + Ymin);
/* Real x1 = intersectHoriz(e1->head()[0], e1->head()[1], e1->tail()[0], e1->tail()[1], y);
Real x2 = intersectHoriz(e2->head()[0], e2->head()[1], e2->tail()[0], e2->tail()[1], y);

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
** $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyDBG.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include <stdlib.h>
@@ -395,7 +395,7 @@ poly->printList();
*/
/*for debug purpose*/
assert( (DBG_rayIntersectPoly(v,1,0,poly) % 2 )
== (DBG_rayIntersectPoly(v,1,0.1234, poly) % 2 )
== (DBG_rayIntersectPoly(v,1,Real(0.1234), poly) % 2 )
);
if(DBG_rayIntersectPoly(v, 1, 0, poly) % 2 == 1)
return 1;

View File

@@ -31,20 +31,24 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
** $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/polyUtil.h,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#ifndef _POLYUTIL_H
#define _POLYUTIL_H
#include "definitions.h"
#ifdef __cplusplus
extern "C" {
#endif
Real area(Real A[2], Real B[2], Real C[2]);
Int pointLeftLine(Real A[2], Real B[2], Real P[2]);
Int pointLeft2Lines(Real A[2], Real B[2], Real C[2], Real P[2]);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
** $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include <stdlib.h>
@@ -327,7 +327,7 @@ Int findBotSeparator(vertexArray* leftChain,
{
oldLeftI = leftCorner-1;
oldRightI = rightCorner;
leftMax = leftChain->getVertex(leftCorner)[0] - 1.0 ; //initilize to be left of leftCorner
leftMax = leftChain->getVertex(leftCorner)[0] - Real(1.0) ; //initilize to be left of leftCorner
rightMin = rightChain->getVertex(rightCorner)[0];
}
else //rightlower
@@ -335,7 +335,7 @@ Int findBotSeparator(vertexArray* leftChain,
oldLeftI = leftCorner;
oldRightI = rightCorner-1;
leftMax = leftChain->getVertex(leftCorner)[0];
rightMin = rightChain->getVertex(rightCorner)[0] + 1.0;
rightMin = rightChain->getVertex(rightCorner)[0] + Real(1.0);
}
//i: the current working leftChain Index

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
** $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include <stdlib.h>
@@ -343,7 +343,7 @@ Int findTopSeparator(vertexArray* leftChain,
{
oldLeftI = leftEndIndex+1;
oldRightI = rightEndIndex;
leftMax = leftChain->getVertex(leftEndIndex)[0] - 1.0; //initilza to left of leftU
leftMax = leftChain->getVertex(leftEndIndex)[0] - Real(1.0); //initilza to left of leftU
rightMin = rightChain->getVertex(rightEndIndex)[0];
}
else
@@ -351,7 +351,7 @@ Int findTopSeparator(vertexArray* leftChain,
oldLeftI = leftEndIndex;
oldRightI = rightEndIndex+1;
leftMax = leftChain->getVertex(leftEndIndex)[0];
rightMin = rightChain->getVertex(rightEndIndex)[0] + 1.0;
rightMin = rightChain->getVertex(rightEndIndex)[0] + Real(1.0);
}
//i: the current working leftChain index,
@@ -826,19 +826,19 @@ static void sampleCompTopSimpleOpt(gridWrap* grid,
//find l in [j, k-1] so that dec_chain[l][0] 0 is closest to
// inc_chain[i]
int l;
Real tempI = j;
Real tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
Real tempI = Real(j);
Real tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
for(l=j+1; l<= k-1; l++)
{
if(fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0])
<= tempMin)
{
tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]);
tempI = l;
tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(l)[0]);
tempI = (Real)l;
}
}
//inc_chain[i] and dec_chain[tempI] are connected.
monoTriangulationRecGenOpt(dec_chain->getVertex(tempI),
monoTriangulationRecGenOpt(dec_chain->getVertex((int)tempI),
botVertex,
inc_chain, i, inc_end,
dec_chain, (int)(tempI+1), dec_end,
@@ -866,12 +866,12 @@ static void sampleCompTopSimpleOpt(gridWrap* grid,
//inc_chain[l][0] is the closet to dec_chain[j][0]
int tempI = i;
int l;
Real tempMin = fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
Real tempMin = (Real)fabs(inc_chain->getVertex(i)[0] - dec_chain->getVertex(j)[0]);
for(l=i+1; l<=k-1; l++)
{
if(fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]) <= tempMin)
{
tempMin = fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]);
tempMin = (Real)fabs(inc_chain->getVertex(l)[0] - dec_chain->getVertex(j)[0]);
tempI = l;
}
}

View File

@@ -31,10 +31,10 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
** $Date: 2001/11/29 16:38:27 $ $Revision: 1.1.2.1 $
*/
/*
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc,v 1.1.2.1 2001/11/29 16:38:27 kschultz Exp $
*/
#include <stdlib.h>
@@ -96,7 +96,6 @@ sampledLine::sampledLine(Int n_points, Real2 pts[])
sampledLine::sampledLine(Real pt1[2], Real pt2[2])
{
int i;
npoints = 2;
points = (Real2*) malloc(sizeof(Real2) * 2);
assert(points);

View File

@@ -35,14 +35,14 @@
/*
** Author: Eric Veach, July 1994.
**
** $Date: 2001/07/20 11:20:32 $ $Revision: 1.2 $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/memalloc.h,v 1.2 2001/07/20 11:20:32 joukj Exp $
** $Date: 2001/11/30 20:12:38 $ $Revision: 1.2.2.1 $
** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libtess/memalloc.h,v 1.2.2.1 2001/11/30 20:12:38 kschultz Exp $
*/
#ifndef __memalloc_simple_h_
#define __memalloc_simple_h_
#ifdef __VMS
#if defined(__VMS) || defined(darwin)
# include <stdlib.h>
#else
# include <malloc.h>

114
src/glut/dos/Makefile.DJ Normal file
View File

@@ -0,0 +1,114 @@
# 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.0 for Mesa 4.0
#
# Copyright (C) 2002 - Borca Daniel
# Email : dborca@yahoo.com
# Web : http://www.geocities.com/dborca
.PHONY: all clean
TOP = ..
CC = gcc
CFLAGS = -I$(TOP)/include -Wall -W -Wno-unused -mcpu=$(CPU) -ffast-math -O2
AR = ar
ARFLAGS = ruv
LIBDIR = $(TOP)/lib
ifeq ($(wildcard $(DJDIR)/lib/dxe2.ld),)
DXE2GEN =
else
DXE2GEN = $(wildcard $(addsuffix /dxe2gen.exe,$(subst ;, ,$(PATH))))
endif
GLUT_LIB = libglut.a
GLUT_DXE = glut.dxe
GLUT_IMP = libiglut.a
CORE_SOURCES = \
callback.c \
color.c \
font.c \
globals.c \
init.c \
menu.c \
models.c \
overlay.c \
state.c \
teapot.c \
window.c
PC_HW_SOURCES = \
PC_HW/pc_hw.c \
PC_HW/pc_keyb.c \
PC_HW/pc_mouse.c \
PC_HW/pc_timer.c \
PC_HW/pc_irq.S
SOURCES = $(CORE_SOURCES) $(PC_HW_SOURCES)
OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
.c.o:
gcc -o $@ -c $(CFLAGS) $<
.S.o:
gcc -o $@ -c $(CFLAGS) $<
.s.o:
gcc -o $@ -c $(CFLAGS) $(<:.s=.S)
all: $(LIBDIR)/$(GLUT_LIB) $(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP)
$(LIBDIR)/$(GLUT_LIB): $(OBJECTS)
$(AR) $(ARFLAGS) $(LIBDIR)/$(GLUT_LIB) $(OBJECTS)
$(LIBDIR)/$(GLUT_DXE) $(LIBDIR)/$(GLUT_IMP): $(OBJECTS)
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
dxe2gen -o $(LIBDIR)/$(GLUT_DXE) -I $(LIBDIR)/$(GLUT_IMP) $(OBJECTS) -D "Mesa DOS GLUT" -U
endif
clean:
-$(RM) *.o
-$(RM) PC_HW\*.o
callback.o: callback.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h
color.o: color.c ../include/GL/glut.h
font.o: font.c ../include/GL/glut.h
globals.o: globals.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h
init.o: init.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h
menu.o: menu.c ../include/GL/glut.h
models.o: models.c ../include/GL/glut.h
overlay.o: overlay.c ../include/GL/glut.h
state.o: state.c ../include/GL/glut.h internal.h PC_HW/pc_hw.h
teapot.o: teapot.c ../include/GL/glut.h
window.o: window.c ../include/GL/glut.h ../include/GL/dmesa.h internal.h \
PC_HW/pc_hw.h
PC_HW/pc_hw.o: PC_HW/pc_hw.c PC_HW/pc_hw.h
PC_HW/pc_keyb.o: PC_HW/pc_keyb.c PC_HW/pc_hw.h
PC_HW/pc_mouse.o: PC_HW/pc_mouse.c PC_HW/pc_hw.h
PC_HW/pc_timer.o: PC_HW/pc_timer.c PC_HW/pc_hw.h
PC_HW/pc_irq.o: PC_HW/pc_irq.S

141
src/glut/dos/PC_HW/pc_hw.c Normal file
View File

@@ -0,0 +1,141 @@
/*
* PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#include <dpmi.h>
#include <fcntl.h>
#include <sys/stat.h> /* for mode definitions */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "pc_hw.h"
/*
* atexit
*/
#define MAX_ATEXIT 32
static volatile int atexitcnt;
static VFUNC atexittbl[MAX_ATEXIT];
static void __attribute__((destructor)) doexit (void)
{
while (atexitcnt) atexittbl[--atexitcnt]();
}
int pc_clexit (VFUNC f)
{
int i;
for (i=0;i<atexitcnt;i++) {
if (atexittbl[i]==f) {
for (atexitcnt--;i<atexitcnt;i++) atexittbl[i] = atexittbl[i+1];
atexittbl[i] = 0;
return 0;
}
}
return -1;
}
int pc_atexit (VFUNC f)
{
pc_clexit(f);
if (atexitcnt<MAX_ATEXIT) {
atexittbl[atexitcnt++] = f;
return 0;
}
return -1;
}
/*
* locked memory allocation
*/
void *pc_malloc (size_t size)
{
void *p = malloc(size);
if (p) {
if (_go32_dpmi_lock_data(p, size)) {
free(p);
return NULL;
}
}
return p;
}
/*
* standard redirection
*/
static char errname[L_tmpnam];
static char outname[L_tmpnam];
static int h_out, h_outbak;
static int h_err, h_errbak;
void pc_open_stderr (void)
{
if (tmpnam(errname)) {
h_err = open(errname, O_WRONLY |/* O_BINARY |*/ O_CREAT | O_TRUNC,
S_IREAD | S_IWRITE);
h_errbak = dup(2);
fflush(stderr);
dup2(h_err, 2);
}
}
void pc_close_stderr (void)
{
FILE *f;
char *line = alloca(512);
dup2(h_errbak, 2);
close(h_err);
close(h_errbak);
if ((f=fopen(errname, "r"))!=NULL) {
while (fgets(line, 512, f)) {
fputs(line, stderr);
}
fclose(f);
}
remove(errname);
}
void pc_open_stdout (void)
{
if (tmpnam(outname)) {
h_out = open(outname, O_WRONLY |/* O_BINARY |*/ O_CREAT | O_TRUNC,
S_IREAD | S_IWRITE);
h_outbak = dup(1);
fflush(stdout);
dup2(h_out, 1);
}
}
void pc_close_stdout (void)
{
FILE *f;
char *line = alloca(512);
dup2(h_outbak, 1);
close(h_out);
close(h_outbak);
if ((f=fopen(outname, "r"))!=NULL) {
while (fgets(line, 512, f)) {
fputs(line, stdout);
}
fclose(f);
}
remove(outname);
}

225
src/glut/dos/PC_HW/pc_hw.h Normal file
View File

@@ -0,0 +1,225 @@
/*
* PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#ifndef PC_HW_H_included
#define PC_HW_H_included
#include <dpmi.h>
#include <stdlib.h>
/*
* misc C definitions
*/
#define FALSE 0
#define TRUE !FALSE
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
#define MAX(x,y) (((x) > (y)) ? (x) : (y))
#define MID(x,y,z) MAX((x), MIN((y), (z)))
typedef void (*VFUNC) (void);
typedef void (*PFUNC) (void *);
typedef void (*MFUNC) (int x, int y, int b);
/*
* atexit
*/
int pc_atexit (VFUNC f);
int pc_clexit (VFUNC f);
/*
* locked memory
*/
#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))
void *pc_malloc (size_t size);
/*
* IRQ
*/
#define ENABLE() __asm__ __volatile__ ("sti")
#define DISABLE() __asm__ __volatile__ ("cli")
extern int pc_install_irq (int i, int (*handler) ());
extern int pc_remove_irq (int i);
/*
* keyboard
*/
#define KB_SHIFT_FLAG 0x0001
#define KB_CTRL_FLAG 0x0002
#define KB_ALT_FLAG 0x0004
#define KB_LWIN_FLAG 0x0008
#define KB_RWIN_FLAG 0x0010
#define KB_MENU_FLAG 0x0020
#define KB_SCROLOCK_FLAG 0x0100
#define KB_NUMLOCK_FLAG 0x0200
#define KB_CAPSLOCK_FLAG 0x0400
#define KB_INALTSEQ_FLAG 0x0800
#define KB_ACCENT1_FLAG 0x1000
#define KB_ACCENT2_FLAG 0x2000
#define KB_ACCENT3_FLAG 0x4000
#define KB_ACCENT4_FLAG 0x8000
#define KEY_A 1
#define KEY_B 2
#define KEY_C 3
#define KEY_D 4
#define KEY_E 5
#define KEY_F 6
#define KEY_G 7
#define KEY_H 8
#define KEY_I 9
#define KEY_J 10
#define KEY_K 11
#define KEY_L 12
#define KEY_M 13
#define KEY_N 14
#define KEY_O 15
#define KEY_P 16
#define KEY_Q 17
#define KEY_R 18
#define KEY_S 19
#define KEY_T 20
#define KEY_U 21
#define KEY_V 22
#define KEY_W 23
#define KEY_X 24
#define KEY_Y 25
#define KEY_Z 26
#define KEY_0 27
#define KEY_1 28
#define KEY_2 29
#define KEY_3 30
#define KEY_4 31
#define KEY_5 32
#define KEY_6 33
#define KEY_7 34
#define KEY_8 35
#define KEY_9 36
#define KEY_0_PAD 37
#define KEY_1_PAD 38
#define KEY_2_PAD 39
#define KEY_3_PAD 40
#define KEY_4_PAD 41
#define KEY_5_PAD 42
#define KEY_6_PAD 43
#define KEY_7_PAD 44
#define KEY_8_PAD 45
#define KEY_9_PAD 46
#define KEY_F1 47
#define KEY_F2 48
#define KEY_F3 49
#define KEY_F4 50
#define KEY_F5 51
#define KEY_F6 52
#define KEY_F7 53
#define KEY_F8 54
#define KEY_F9 55
#define KEY_F10 56
#define KEY_F11 57
#define KEY_F12 58
#define KEY_ESC 59
#define KEY_TILDE 60
#define KEY_MINUS 61
#define KEY_EQUALS 62
#define KEY_BACKSPACE 63
#define KEY_TAB 64
#define KEY_OPENBRACE 65
#define KEY_CLOSEBRACE 66
#define KEY_ENTER 67
#define KEY_COLON 68
#define KEY_QUOTE 69
#define KEY_BACKSLASH 70
#define KEY_BACKSLASH2 71
#define KEY_COMMA 72
#define KEY_STOP 73
#define KEY_SLASH 74
#define KEY_SPACE 75
#define KEY_INSERT 76
#define KEY_DEL 77
#define KEY_HOME 78
#define KEY_END 79
#define KEY_PGUP 80
#define KEY_PGDN 81
#define KEY_LEFT 82
#define KEY_RIGHT 83
#define KEY_UP 84
#define KEY_DOWN 85
#define KEY_SLASH_PAD 86
#define KEY_ASTERISK 87
#define KEY_MINUS_PAD 88
#define KEY_PLUS_PAD 89
#define KEY_DEL_PAD 90
#define KEY_ENTER_PAD 91
#define KEY_PRTSCR 92
#define KEY_PAUSE 93
#define KEY_ABNT_C1 94
#define KEY_YEN 95
#define KEY_KANA 96
#define KEY_CONVERT 97
#define KEY_NOCONVERT 98
#define KEY_AT 99
#define KEY_CIRCUMFLEX 100
#define KEY_COLON2 101
#define KEY_KANJI 102
#define KEY_MODIFIERS 103
#define KEY_LSHIFT 103
#define KEY_RSHIFT 104
#define KEY_LCONTROL 105
#define KEY_RCONTROL 106
#define KEY_ALT 107
#define KEY_ALTGR 108
#define KEY_LWIN 109
#define KEY_RWIN 110
#define KEY_MENU 111
#define KEY_SCRLOCK 112
#define KEY_NUMLOCK 113
#define KEY_CAPSLOCK 114
#define KEY_MAX 115
int pc_install_keyb (void);
void pc_remove_keyb (void);
int pc_keypressed (void);
int pc_readkey (void);
int pc_keydown (int code);
/*
* timer
*/
int pc_install_int (PFUNC func, void *parm, unsigned int freq);
void pc_remove_timer (void);
/*
* mouse
*/
int pc_install_mouse (void);
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);
void pc_show_mouse (void);
void pc_scare_mouse (void);
void pc_unscare_mouse (void);
/*
* standard redirection
*/
void pc_open_stdout (void);
void pc_open_stderr (void);
void pc_close_stdout (void);
void pc_close_stderr (void);
#endif

180
src/glut/dos/PC_HW/pc_irq.S Normal file
View File

@@ -0,0 +1,180 @@
/*
* PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
.file "pc_irq.S"
.text
#define IRQ_STACK_SIZE 16384
#define IRQ_WRAPPER_LEN (__irq_wrapper_1-__irq_wrapper_0)
#define IRQ_OLD (__irq_old_0-__irq_wrapper_0)
#define IRQ_HOOK (__irq_hook_0-__irq_wrapper_0)
#define IRQ_STACK (__irq_stack_0-__irq_wrapper_0)
.balign 4
common:
movw $0x0400, %ax
int $0x31
movl %ss:8(%ebp), %ebx
cmpl $15, %ebx
jbe 0f
fail:
orl $-1, %eax
popl %edi
popl %ebx
leave
ret
0:
movl %ebx, %edi
imull $IRQ_WRAPPER_LEN, %edi
addl $__irq_wrapper_0, %edi
cmpb $7, %bl
jbe 1f
movb %dl, %dh
subb $8, %dh
1:
addb %dh, %bl
ret
.balign 4
.global _pc_install_irq
_pc_install_irq:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %edi
call common
cmpl $0, IRQ_HOOK(%edi)
jne fail
pushl $IRQ_WRAPPER_LEN
pushl %edi
call __go32_dpmi_lock_code
addl $8, %esp
testl %eax, %eax
jnz fail
pushl $IRQ_STACK_SIZE
call _pc_malloc
popl %edx
testl %eax, %eax
jz fail
addl %edx, %eax
movl %eax, IRQ_STACK(%edi)
movl %ss:12(%ebp), %eax
movl %eax, IRQ_HOOK(%edi)
movw $0x0204, %ax
int $0x31
movl %edx, IRQ_OLD(%edi)
movw %cx, IRQ_OLD+4(%edi)
movw $0x0205, %ax
movl %edi, %edx
movl %cs, %ecx
int $0x31
done:
xorl %eax, %eax
popl %edi
popl %ebx
leave
ret
.balign 4
.global _pc_remove_irq
_pc_remove_irq:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %edi
call common
cmpl $0, IRQ_HOOK(%edi)
je fail
movl $0, IRQ_HOOK(%edi)
movw $0x0205, %ax
movl IRQ_OLD(%edi), %edx
movl IRQ_OLD+4(%edi), %ecx
int $0x31
movl IRQ_STACK(%edi), %eax
subl $IRQ_STACK_SIZE, %eax
pushl %eax
call _free
popl %eax
jmp done
#define WRAPPER(x) ; \
.balign 4 ; \
__irq_wrapper_##x: ; \
pushal ; \
pushl %ds ; \
pushl %es ; \
pushl %fs ; \
pushl %gs ; \
movl %ss, %ebx ; \
movl %esp, %esi ; \
movl %cs:___djgpp_ds_alias, %ss ; \
movl %cs:__irq_stack_##x, %esp ; \
pushl %ss ; \
pushl %ss ; \
popl %es ; \
popl %ds ; \
movl ___djgpp_dos_sel, %fs ; \
pushl %fs ; \
popl %gs ; \
call *__irq_hook_##x ; \
movl %ebx, %ss ; \
movl %esi, %esp ; \
testl %eax, %eax ; \
popl %gs ; \
popl %fs ; \
popl %es ; \
popl %ds ; \
popal ; \
jz __irq_ignore_##x ; \
__irq_bypass_##x: ; \
ljmp *%cs:__irq_old_##x ; \
__irq_ignore_##x: ; \
iret ; \
.balign 4 ; \
__irq_old_##x: ; \
.long 0, 0 ; \
__irq_hook_##x: ; \
.long 0 ; \
__irq_stack_##x: ; \
.long 0
WRAPPER(0);
WRAPPER(1);
WRAPPER(2);
WRAPPER(3);
WRAPPER(4);
WRAPPER(5);
WRAPPER(6);
WRAPPER(7);
WRAPPER(8);
WRAPPER(9);
WRAPPER(10);
WRAPPER(11);
WRAPPER(12);
WRAPPER(13);
WRAPPER(14);
WRAPPER(15);

View File

@@ -0,0 +1,541 @@
/*
* PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#include <pc.h>
#include <sys/exceptn.h>
#include <sys/farptr.h>
#include "pc_hw.h"
#define KEYB_IRQ 1
#define KEY_BUFFER_SIZE 64
#define KB_MODIFIERS (KB_SHIFT_FLAG | KB_CTRL_FLAG | KB_ALT_FLAG | KB_LWIN_FLAG | KB_RWIN_FLAG | KB_MENU_FLAG)
#define KB_LED_FLAGS (KB_SCROLOCK_FLAG | KB_NUMLOCK_FLAG | KB_CAPSLOCK_FLAG)
static int keyboard_installed;
static volatile struct {
volatile int start, end;
volatile int key[KEY_BUFFER_SIZE];
} key_buffer;
static volatile int key_enhanced, key_pause_loop, key_shifts;
static int leds_ok = TRUE;
static int in_a_terrupt = FALSE;
static volatile char pc_key[KEY_MAX];
/* convert Allegro format scancodes into key_shifts flag bits */
static unsigned short modifier_table[KEY_MAX - KEY_MODIFIERS] =
{
KB_SHIFT_FLAG, KB_SHIFT_FLAG, KB_CTRL_FLAG,
KB_CTRL_FLAG, KB_ALT_FLAG, KB_ALT_FLAG,
KB_LWIN_FLAG, KB_RWIN_FLAG, KB_MENU_FLAG,
KB_SCROLOCK_FLAG, KB_NUMLOCK_FLAG, KB_CAPSLOCK_FLAG
};
/* lookup table for converting hardware scancodes into Allegro format */
static unsigned char hw_to_mycode[128] =
{
/* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2,
/* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6,
/* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0,
/* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB,
/* 0x10 */ KEY_Q, KEY_W, KEY_E, KEY_R,
/* 0x14 */ KEY_T, KEY_Y, KEY_U, KEY_I,
/* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE,
/* 0x1C */ KEY_ENTER, KEY_LCONTROL, KEY_A, KEY_S,
/* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H,
/* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON,
/* 0x28 */ KEY_QUOTE, KEY_TILDE, KEY_LSHIFT, KEY_BACKSLASH,
/* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V,
/* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA,
/* 0x34 */ KEY_STOP, KEY_SLASH, KEY_RSHIFT, KEY_ASTERISK,
/* 0x38 */ KEY_ALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1,
/* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5,
/* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9,
/* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_SCRLOCK, KEY_7_PAD,
/* 0x48 */ KEY_8_PAD, KEY_9_PAD, KEY_MINUS_PAD, KEY_4_PAD,
/* 0x4C */ KEY_5_PAD, KEY_6_PAD, KEY_PLUS_PAD, KEY_1_PAD,
/* 0x50 */ KEY_2_PAD, KEY_3_PAD, KEY_0_PAD, KEY_DEL_PAD,
/* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11,
/* 0x58 */ KEY_F12, 0, 0, KEY_LWIN,
/* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0,
/* 0x60 */ 0, 0, 0, 0,
/* 0x64 */ 0, 0, 0, 0,
/* 0x68 */ 0, 0, 0, 0,
/* 0x6C */ 0, 0, 0, 0,
/* 0x70 */ KEY_KANA, 0, 0, KEY_ABNT_C1,
/* 0x74 */ 0, 0, 0, 0,
/* 0x78 */ 0, KEY_CONVERT, 0, KEY_NOCONVERT,
/* 0x7C */ 0, KEY_YEN, 0, 0
};
/* lookup table for converting extended hardware codes into Allegro format */
static unsigned char hw_to_mycode_ex[128] =
{
/* 0x00 */ 0, KEY_ESC, KEY_1, KEY_2,
/* 0x04 */ KEY_3, KEY_4, KEY_5, KEY_6,
/* 0x08 */ KEY_7, KEY_8, KEY_9, KEY_0,
/* 0x0C */ KEY_MINUS, KEY_EQUALS, KEY_BACKSPACE, KEY_TAB,
/* 0x10 */ KEY_CIRCUMFLEX, KEY_AT, KEY_COLON2, KEY_R,
/* 0x14 */ KEY_KANJI, KEY_Y, KEY_U, KEY_I,
/* 0x18 */ KEY_O, KEY_P, KEY_OPENBRACE, KEY_CLOSEBRACE,
/* 0x1C */ KEY_ENTER_PAD, KEY_RCONTROL, KEY_A, KEY_S,
/* 0x20 */ KEY_D, KEY_F, KEY_G, KEY_H,
/* 0x24 */ KEY_J, KEY_K, KEY_L, KEY_COLON,
/* 0x28 */ KEY_QUOTE, KEY_TILDE, 0, KEY_BACKSLASH,
/* 0x2C */ KEY_Z, KEY_X, KEY_C, KEY_V,
/* 0x30 */ KEY_B, KEY_N, KEY_M, KEY_COMMA,
/* 0x34 */ KEY_STOP, KEY_SLASH_PAD, 0, KEY_PRTSCR,
/* 0x38 */ KEY_ALTGR, KEY_SPACE, KEY_CAPSLOCK, KEY_F1,
/* 0x3C */ KEY_F2, KEY_F3, KEY_F4, KEY_F5,
/* 0x40 */ KEY_F6, KEY_F7, KEY_F8, KEY_F9,
/* 0x44 */ KEY_F10, KEY_NUMLOCK, KEY_PAUSE, KEY_HOME,
/* 0x48 */ KEY_UP, KEY_PGUP, KEY_MINUS_PAD, KEY_LEFT,
/* 0x4C */ KEY_5_PAD, KEY_RIGHT, KEY_PLUS_PAD, KEY_END,
/* 0x50 */ KEY_DOWN, KEY_PGDN, KEY_INSERT, KEY_DEL,
/* 0x54 */ KEY_PRTSCR, 0, KEY_BACKSLASH2, KEY_F11,
/* 0x58 */ KEY_F12, 0, 0, KEY_LWIN,
/* 0x5C */ KEY_RWIN, KEY_MENU, 0, 0,
/* 0x60 */ 0, 0, 0, 0,
/* 0x64 */ 0, 0, 0, 0,
/* 0x68 */ 0, 0, 0, 0,
/* 0x6C */ 0, 0, 0, 0,
/* 0x70 */ 0, 0, 0, 0,
/* 0x74 */ 0, 0, 0, 0,
/* 0x78 */ 0, 0, 0, 0,
/* 0x7C */ 0, 0, 0, 0
};
/* default mapping table for the US keyboard layout */
static unsigned short standard_key_ascii_table[KEY_MAX] =
{
/* start */ 0,
/* alphabet */ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
/* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
/* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
/* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
/* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ',
/* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
/* numpad */ '/', '*', '-', '+', '.', 13,
/* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* capslock mapping table for the US keyboard layout */
static unsigned short standard_key_capslock_table[KEY_MAX] =
{
/* start */ 0,
/* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
/* numbers */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
/* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
/* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
/* misc chars */ 27, '`', '-', '=', 8, 9, '[', ']', 13, ';', '\'', '\\', '\\', ',', '.', '/', ' ',
/* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
/* numpad */ '/', '*', '-', '+', '.', 13,
/* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* shifted mapping table for the US keyboard layout */
static unsigned short standard_key_shift_table[KEY_MAX] =
{
/* start */ 0,
/* alphabet */ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
/* numbers */ ')', '!', '@', '#', '$', '%', '^', '&', '*', '(',
/* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
/* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
/* misc chars */ 27, '~', '_', '+', 8, 9, '{', '}', 13, ':', '"', '|', '|', '<', '>', '?', ' ',
/* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
/* numpad */ '/', '*', '-', '+', '.', 13,
/* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* ctrl+key mapping table for the US keyboard layout */
static unsigned short standard_key_control_table[KEY_MAX] =
{
/* start */ 0,
/* alphabet */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
/* numbers */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
/* numpad */ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
/* func keys */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
/* misc chars */ 27, 2, 2, 2, 127, 127, 2, 2, 10, 2, 2, 2, 2, 2, 2, 2, 2,
/* controls */ 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
/* numpad */ 2, 2, 2, 2, 2, 10,
/* modifiers */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* convert numeric pad scancodes into arrow codes */
static unsigned char numlock_table[10] =
{
KEY_INSERT, KEY_END, KEY_DOWN, KEY_PGDN, KEY_LEFT,
KEY_5_PAD, KEY_RIGHT, KEY_HOME, KEY_UP, KEY_PGUP
};
/* kb_wait_for_write_ready:
* Wait for the keyboard controller to set the ready-for-write bit.
*/
static __inline__ int kb_wait_for_write_ready (void)
{
int timeout = 4096;
while ((timeout>0) && (inportb(0x64)&2)) timeout--;
return (timeout>0);
}
/* kb_wait_for_read_ready:
* Wait for the keyboard controller to set the ready-for-read bit.
*/
static __inline__ int kb_wait_for_read_ready (void)
{
int timeout = 16384;
while ((timeout>0) && (!(inportb(0x64)&1))) timeout--;
return (timeout>0);
}
/* kb_send_data:
* Sends a byte to the keyboard controller. Returns 1 if all OK.
*/
static __inline__ int kb_send_data (unsigned char data)
{
int resends = 4;
int timeout, temp;
do {
if (!kb_wait_for_write_ready())
return 0;
outportb(0x60, data);
timeout = 4096;
while (--timeout>0) {
if (!kb_wait_for_read_ready())
return 0;
temp = inportb(0x60);
if (temp == 0xFA)
return 1;
if (temp == 0xFE)
break;
}
} while ((resends-- > 0) && (timeout > 0));
return 0;
}
static void update_leds (int leds)
{
if (leds_ok) {
if (!in_a_terrupt)
DISABLE();
if (!kb_send_data(0xED)) {
kb_send_data(0xF4);
leds_ok = FALSE;
} else if (!kb_send_data((leds>>8)&7)) {
kb_send_data(0xF4);
leds_ok = FALSE;
}
if (!in_a_terrupt)
ENABLE();
}
} ENDOFUNC(update_leds)
static void inject_key (int scancode)
{
unsigned short *table;
if ((scancode >= KEY_0_PAD) && (scancode <= KEY_9_PAD)) {
if (((key_shifts & KB_NUMLOCK_FLAG) != 0) == ((key_shifts & KB_SHIFT_FLAG) != 0)) {
scancode = numlock_table[scancode - KEY_0_PAD];
}
table = standard_key_ascii_table;
} else if (key_shifts & KB_CTRL_FLAG) {
table = standard_key_control_table;
} else if (key_shifts & KB_SHIFT_FLAG) {
if (key_shifts & KB_CAPSLOCK_FLAG) {
if (standard_key_ascii_table[scancode]==standard_key_capslock_table[scancode]) {
table = standard_key_shift_table;
} else {
table = standard_key_ascii_table;
}
} else {
table = standard_key_shift_table;
}
} else if (key_shifts & KB_CAPSLOCK_FLAG) {
table = standard_key_capslock_table;
} else {
table = standard_key_ascii_table;
}
key_buffer.key[key_buffer.end++] = (scancode<<16)|table[scancode];
if (key_buffer.end>=KEY_BUFFER_SIZE)
key_buffer.end = 0;
if (key_buffer.end==key_buffer.start) {
key_buffer.start++;
if (key_buffer.start>=KEY_BUFFER_SIZE)
key_buffer.start = 0;
}
} ENDOFUNC(inject_key)
static void handle_code (int scancode, int keycode)
{
in_a_terrupt++;
if (keycode==0) { /* pause */
inject_key(scancode);
pc_key[KEY_PAUSE] ^= TRUE;
} else if (scancode) {
int flag;
if (scancode>=KEY_MODIFIERS) {
flag = modifier_table[scancode - KEY_MODIFIERS];
} else {
flag = 0;
}
if ((char)keycode<0) { /* release */
pc_key[scancode] = FALSE;
if (flag&KB_MODIFIERS) {
key_shifts &= ~flag;
}
} else { /* keypress */
pc_key[scancode] = TRUE;
if (flag&KB_MODIFIERS) {
key_shifts |= flag;
}
if (flag&KB_LED_FLAGS) {
key_shifts ^= flag;
update_leds(key_shifts);
}
if (scancode<KEY_MODIFIERS) {
inject_key(scancode);
}
}
}
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;
temp = inportb(0x60);
if (temp<=0xe1) {
if (key_pause_loop) {
if (!--key_pause_loop) handle_code(KEY_PAUSE, 0);
} else
switch (temp) {
case 0xe0:
key_enhanced = TRUE;
break;
case 0xe1:
key_pause_loop = 5;
break;
default:
if (key_enhanced) {
key_enhanced = FALSE;
scancode = hw_to_mycode_ex[temp&0x7f];
} else {
scancode = hw_to_mycode[temp&0x7f];
}
handle_code(scancode, temp);
}
}
if (((temp==0x4F)||(temp==0x53))&&(key_shifts&KB_CTRL_FLAG)&&(key_shifts&KB_ALT_FLAG)) {
/* Hack alert:
only SIGINT (but not Ctrl-Break)
calls the destructors and will safely clean up
*/
__asm__("\n\
movb $0x79, %%al \n\
call ___djgpp_hw_exception \n\
":::"%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
}
satisfy();
return 0;
} ENDOFUNC(keyboard)
int pc_keypressed (void)
{
return (key_buffer.start!=key_buffer.end);
}
int pc_readkey (void)
{
if (keyboard_installed) {
int key;
do {
} while (key_buffer.start==key_buffer.end);
DISABLE();
key = key_buffer.key[key_buffer.start++];
if (key_buffer.start>=KEY_BUFFER_SIZE)
key_buffer.start = 0;
ENABLE();
return key;
} else {
return 0;
}
}
int pc_keydown (int code)
{
return pc_key[code];
}
void pc_remove_keyb (void)
{
if (keyboard_installed) {
int s1, s2, s3;
keyboard_installed = FALSE;
pc_clexit(pc_remove_keyb);
DISABLE();
_farsetsel(__djgpp_dos_sel);
_farnspokew(0x41c, _farnspeekw(0x41a));
s1 = _farnspeekb(0x417) & 0x80;
s2 = _farnspeekb(0x418) & 0xFC;
s3 = _farnspeekb(0x496) & 0xF3;
if (pc_key[KEY_RSHIFT]) { s1 |= 1; }
if (pc_key[KEY_LSHIFT]) { s1 |= 2; }
if (pc_key[KEY_LCONTROL]) { s2 |= 1; s1 |= 4; }
if (pc_key[KEY_ALT]) { s1 |= 8; s2 |= 2; }
if (pc_key[KEY_RCONTROL]) { s1 |= 4; s3 |= 4; }
if (pc_key[KEY_ALTGR]) { s1 |= 8; s3 |= 8; }
if (key_shifts&KB_SCROLOCK_FLAG) s1 |= 16;
if (key_shifts&KB_NUMLOCK_FLAG) s1 |= 32;
if (key_shifts&KB_CAPSLOCK_FLAG) s1 |= 64;
_farnspokeb(0x417, s1);
_farnspokeb(0x418, s2);
_farnspokeb(0x496, s3);
update_leds(key_shifts);
ENABLE();
pc_remove_irq(KEYB_IRQ);
}
}
int pc_install_keyb (void)
{
if (keyboard_installed||pc_install_irq(KEYB_IRQ, keyboard)) {
return -1;
} else {
int s1, s2, s3;
LOCKDATA(key_buffer);
LOCKDATA(key_enhanced);
LOCKDATA(key_pause_loop);
LOCKDATA(key_shifts);
LOCKDATA(leds_ok);
LOCKDATA(in_a_terrupt);
LOCKDATA(pc_key);
LOCKDATA(modifier_table);
LOCKDATA(hw_to_mycode);
LOCKDATA(hw_to_mycode_ex);
LOCKDATA(standard_key_ascii_table);
LOCKDATA(standard_key_capslock_table);
LOCKDATA(standard_key_shift_table);
LOCKDATA(standard_key_control_table);
LOCKDATA(numlock_table);
LOCKFUNC(update_leds);
LOCKFUNC(inject_key);
LOCKFUNC(handle_code);
LOCKFUNC(keyboard);
DISABLE();
_farsetsel(__djgpp_dos_sel);
_farnspokew(0x41c, _farnspeekw(0x41a));
key_shifts = 0;
s1 = _farnspeekb(0x417);
s2 = _farnspeekb(0x418);
s3 = _farnspeekb(0x496);
if (s1&1) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_RSHIFT] = TRUE; }
if (s1&2) { key_shifts |= KB_SHIFT_FLAG; pc_key[KEY_LSHIFT] = TRUE; }
if (s2&1) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_LCONTROL] = TRUE; }
if (s2&2) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALT] = TRUE; }
if (s3&4) { key_shifts |= KB_CTRL_FLAG; pc_key[KEY_RCONTROL] = TRUE; }
if (s3&8) { key_shifts |= KB_ALT_FLAG; pc_key[KEY_ALTGR] = TRUE; }
if (s1&16) key_shifts |= KB_SCROLOCK_FLAG;
if (s1&32) key_shifts |= KB_NUMLOCK_FLAG;
if (s1&64) key_shifts |= KB_CAPSLOCK_FLAG;
update_leds(key_shifts);
key_enhanced = key_pause_loop = 0;
key_buffer.start = key_buffer.end = 0;
ENABLE();
pc_atexit(pc_remove_keyb);
keyboard_installed = TRUE;
return 0;
}
}

View File

@@ -0,0 +1,258 @@
/*
* PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#include <dpmi.h>
#include "pc_hw.h"
#define MOUSE_STACK_SIZE 16384
#define CLEAR_MICKEYS() \
do { \
__asm__ __volatile__ ("movw $0xb, %%ax; int $0x33":::"%eax", "%ecx", "%edx"); \
ox = oy = 0; \
} while (0)
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 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 sx = 2;
static int sy = 2;
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;
ox = nx;
oy = ny;
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 (mouse_func) {
mouse_func(pc_mouse_x, pc_mouse_y, pc_mouse_b);
}
} ENDOFUNC(mouse)
void pc_remove_mouse (void)
{
if (mouse_callback) {
pc_clexit(pc_remove_mouse);
__asm__("\n\
movl %%edx, %%ecx \n\
shrl $16, %%ecx \n\
movw $0x0304, %%ax \n\
int $0x31 \n\
movw $0x000c, %%ax \n\
xorl %%ecx, %%ecx \n\
int $0x33 \n\
"::"d"(mouse_callback):"%eax", "%ecx");
mouse_callback = 0;
free((void *)((unsigned long)mouse_stack-MOUSE_STACK_SIZE));
}
}
int pc_install_mouse (void)
{
int buttons;
/* fail if already call-backed */
if (mouse_callback) {
return 0;
}
/* reset mouse and get status */
__asm__("\n\
xorl %%eax, %%eax \n\
int $0x33 \n\
andl %%ebx, %%eax \n\
movl %%eax, %0 \n\
":"=g" (buttons)::"%eax", "%ebx");
if (!buttons) {
return 0;
}
/* lock wrapper */
LOCKDATA(mouse_func);
LOCKDATA(mouse_stack);
LOCKDATA(mouse_callback);
LOCKDATA(mouse_regs);
LOCKDATA(pc_mouse_x);
LOCKDATA(pc_mouse_y);
LOCKDATA(pc_mouse_b);
LOCKDATA(minx);
LOCKDATA(maxx);
LOCKDATA(miny);
LOCKDATA(maxy);
LOCKDATA(sx);
LOCKDATA(sy);
LOCKDATA(emulat3);
LOCKDATA(ox);
LOCKDATA(oy);
LOCKFUNC(mouse);
LOCKFUNC(mouse_wrapper);
/* grab a locked stack */
if ((mouse_stack=pc_malloc(MOUSE_STACK_SIZE))==NULL) {
return 0;
}
/* try to hook a call-back */
__asm__("\n\
pushl %%ds \n\
pushl %%es \n\
movw $0x0303, %%ax \n\
pushl %%ds \n\
pushl %%cs \n\
popl %%ds \n\
popl %%es \n\
int $0x31 \n\
popl %%es \n\
popl %%ds \n\
jc 0f \n\
shll $16, %%ecx \n\
movw %%dx, %%cx \n\
movl %%ecx, %0 \n\
0: \n\
":"=g"(mouse_callback)
:"S" (mouse_wrapper), "D"(&mouse_regs)
:"%eax", "%ecx", "%edx");
if (!mouse_callback) {
free(mouse_stack);
return 0;
}
/* adjust stack */
mouse_stack = (void *)((unsigned long)mouse_stack + MOUSE_STACK_SIZE);
/* install the handler */
mouse_regs.x.ax = 0x000c;
mouse_regs.x.cx = 0x007f;
mouse_regs.x.dx = mouse_callback&0xffff;
mouse_regs.x.es = mouse_callback>>16;
__dpmi_int(0x33, &mouse_regs);
CLEAR_MICKEYS();
emulat3 = buttons<3;
pc_atexit(pc_remove_mouse);
return buttons;
}
MFUNC pc_install_mouse_handler (MFUNC handler)
{
MFUNC old;
if (!mouse_callback && !pc_install_mouse()) {
return NULL;
}
old = mouse_func;
mouse_func = handler;
return old;
}
void pc_mouse_area (int x1, int y1, int x2, int y2)
{
minx = x1;
maxx = x2;
miny = y1;
maxy = y2;
}
void pc_mouse_speed (int xspeed, int yspeed)
{
DISABLE();
sx = MAX(1, xspeed);
sy = MAX(1, yspeed);
ENABLE();
}
int pc_query_mouse (int *x, int *y)
{
*x = pc_mouse_x;
*y = pc_mouse_y;
return pc_mouse_b;
}
void pc_show_mouse (void)
{
/* not implemented */
}
void pc_scare_mouse (void)
{
/* not implemented */
}
void pc_unscare_mouse (void)
{
/* not implemented */
}
__asm__("\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\
\n\
.balign 4 \n\
.global _mouse_wrapper_end \n\
_mouse_wrapper_end:");

View File

@@ -0,0 +1,158 @@
/*
* PC/HW routine collection v1.0 for DOS/DJGPP
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#include <pc.h>
#include "pc_hw.h"
#define TIMER_IRQ 0
#define MAX_TIMERS 8
#define PIT_FREQ 0x1234DD
#define unvolatile(__v, __t) __extension__ ({union { volatile __t __cp; __t __p; } __q; __q.__cp = __v; __q.__p;})
static int timer_installed;
typedef struct {
volatile unsigned int counter, clock_ticks, freq;
volatile PFUNC func;
volatile void *parm;
} TIMER;
TIMER timer_main, timer_func[MAX_TIMERS];
static int timer ()
{
int i;
for (i=0;i<MAX_TIMERS;i++) {
TIMER *t = &timer_func[i];
if (t->func) {
t->clock_ticks += t->counter;
if (t->clock_ticks>=timer_main.counter) {
t->clock_ticks -= timer_main.counter;
t->func(unvolatile(t->parm, void *));
}
}
}
timer_main.clock_ticks += timer_main.counter;
if (timer_main.clock_ticks>=0x10000) {
timer_main.clock_ticks -= 0x10000;
return 1;
} else {
outportb(0x20, 0x20);
return 0;
}
} ENDOFUNC(timer)
void pc_remove_timer (void)
{
if (timer_installed) {
timer_installed = FALSE;
pc_clexit(pc_remove_timer);
DISABLE();
outportb(0x43, 0x34);
outportb(0x40, 0);
outportb(0x40, 0);
ENABLE();
pc_remove_irq(TIMER_IRQ);
}
}
static int install_timer (void)
{
if (timer_installed||pc_install_irq(TIMER_IRQ, timer)) {
return -1;
} else {
LOCKDATA(timer_func);
LOCKDATA(timer_main);
LOCKFUNC(timer);
timer_main.counter = 0x10000;
DISABLE();
outportb(0x43, 0x34);
outportb(0x40, 0);
outportb(0x40, 0);
timer_main.clock_ticks = 0;
ENABLE();
pc_atexit(pc_remove_timer);
timer_installed = TRUE;
return 0;
}
}
static TIMER *find_slot (PFUNC func)
{
int i;
for (i=0;i<MAX_TIMERS;i++) {
if (timer_func[i].func==func) {
return &timer_func[i];
}
}
for (i=0;i<MAX_TIMERS;i++) {
if (!timer_func[i].func) {
return &timer_func[i];
}
}
return NULL;
}
int pc_install_int (PFUNC func, void *parm, unsigned int freq)
{
int i;
TIMER *t;
if (!timer_installed) {
if (install_timer()) {
return -1;
}
}
if ((t=find_slot(func))!=NULL) {
unsigned int new_counter = PIT_FREQ / freq;
DISABLE();
t->func = func;
t->parm = parm;
t->freq = freq;
t->clock_ticks = 0;
if (new_counter < timer_main.counter) {
for (i=0;i<MAX_TIMERS;i++) {
if (timer_func[i].func) {
timer_func[i].counter = new_counter * timer_func[i].freq / freq;
}
}
outportb(0x43, 0x34);
outportb(0x40, (unsigned char)new_counter);
outportb(0x40, (unsigned char)(new_counter>>8));
timer_main.clock_ticks = 0;
timer_main.counter = new_counter;
timer_main.freq = freq;
} else {
t->counter = PIT_FREQ * freq / (timer_main.freq * timer_main.freq);
}
ENABLE();
return 0;
}
return -1;
}

152
src/glut/dos/callback.c Normal file
View File

@@ -0,0 +1,152 @@
/*
* 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"
void APIENTRY glutDisplayFunc (void (GLUTCALLBACK *func) (void))
{
display_func = func;
}
void APIENTRY glutReshapeFunc (void (GLUTCALLBACK *func) (int width, int height))
{
reshape_func = func;
}
void APIENTRY glutKeyboardFunc (void (GLUTCALLBACK *func) (unsigned char key, int x, int y))
{
keyboard_func = func;
}
void APIENTRY glutMouseFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y))
{
mouse_func = func;
}
void APIENTRY glutMotionFunc (void (GLUTCALLBACK *func) (int x, int y))
{
motion_func = func;
}
void APIENTRY glutPassiveMotionFunc (void (GLUTCALLBACK *func) (int x, int y))
{
passive_motion_func = func;
}
void APIENTRY glutEntryFunc (void (GLUTCALLBACK *func) (int state))
{
entry_func = func;
}
void APIENTRY glutVisibilityFunc (void (GLUTCALLBACK *func) (int state))
{
visibility_func = func;
}
void APIENTRY glutIdleFunc (void (GLUTCALLBACK *func) (void))
{
idle_func = func;
}
void APIENTRY glutTimerFunc (unsigned int millis, void (GLUTCALLBACK *func) (int value), int value)
{
}
void APIENTRY glutMenuStateFunc (void (GLUTCALLBACK *func) (int state))
{
menu_state_func = func;
}
void APIENTRY glutSpecialFunc (void (GLUTCALLBACK *func) (int key, int x, int y))
{
special_func = func;
}
void APIENTRY glutSpaceballMotionFunc (void (GLUTCALLBACK *func) (int x, int y, int z))
{
}
void APIENTRY glutSpaceballRotateFunc (void (GLUTCALLBACK *func) (int x, int y, int z))
{
}
void APIENTRY glutSpaceballButtonFunc (void (GLUTCALLBACK *func) (int button, int state))
{
}
void APIENTRY glutButtonBoxFunc (void (GLUTCALLBACK *func) (int button, int state))
{
}
void APIENTRY glutDialsFunc (void (GLUTCALLBACK *func) (int dial, int value))
{
}
void APIENTRY glutTabletMotionFunc (void (GLUTCALLBACK *func) (int x, int y))
{
}
void APIENTRY glutTabletButtonFunc (void (GLUTCALLBACK *func) (int button, int state, int x, int y))
{
}
void APIENTRY glutMenuStatusFunc (void (GLUTCALLBACK *func) (int status, int x, int y))
{
}
void APIENTRY glutOverlayDisplayFunc (void (GLUTCALLBACK *func) (void))
{
}
void APIENTRY glutWindowStatusFunc (void (GLUTCALLBACK *func) (int state))
{
}

46
src/glut/dos/color.c Normal file
View File

@@ -0,0 +1,46 @@
/*
* 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"
void APIENTRY glutSetColor (int ndx, GLfloat red, GLfloat green, GLfloat blue)
{
}
GLfloat APIENTRY glutGetColor (int ndx, int component)
{
return 0.0;
}
void APIENTRY glutCopyColormap (int win)
{
}

52
src/glut/dos/font.c Normal file
View File

@@ -0,0 +1,52 @@
/*
* 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"
void APIENTRY glutBitmapCharacter (void *font, int character)
{
}
int APIENTRY glutBitmapWidth (void *font, int character)
{
return 0;
}
void APIENTRY glutStrokeCharacter (void *font, int character)
{
}
int APIENTRY glutStrokeWidth (void *font, int character)
{
return 0;
}

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;

160
src/glut/dos/init.c Normal file
View File

@@ -0,0 +1,160 @@
/*
* 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
*/
#include "GL/glut.h"
#include "internal.h"
void APIENTRY glutInit (int *argcp, char **argv)
{
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_xpos = x;
g_ypos = y;
}
void APIENTRY glutInitWindowSize (int width, int height)
{
g_width = width;
g_height = height;
}
void APIENTRY glutMainLoop (void)
{
GLboolean idle;
static int old_mouse_x = 0;
static int old_mouse_y = 0;
static int old_mouse_b = 0;
glutPostRedisplay();
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 && display_func) {
idle = GL_FALSE;
g_redisplay = GL_FALSE;
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_b;
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;
motion_func(old_mouse_x, old_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 = new_mouse_b;
}
}
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

86
src/glut/dos/menu.c Normal file
View File

@@ -0,0 +1,86 @@
/*
* 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"
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 */

60
src/glut/dos/overlay.c Normal file
View File

@@ -0,0 +1,60 @@
/*
* 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"
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)
{
}

70
src/glut/dos/state.c Normal file
View File

@@ -0,0 +1,70 @@
/*
* 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"
#define FREQUENCY 100
static int timer_installed;
static volatile int ticks;
static void ticks_timer (void *p)
{
(void)p;
ticks++;
} ENDOFUNC(ticks_timer)
int APIENTRY glutGet (GLenum type)
{
switch (type) {
case GLUT_WINDOW_RGBA:
return 1;
case GLUT_ELAPSED_TIME:
if (!timer_installed) {
timer_installed = !timer_installed;
LOCKDATA(ticks);
LOCKFUNC(ticks_timer);
pc_install_int(ticks_timer, NULL, FREQUENCY);
}
return ticks*1000/FREQUENCY;
default:
return 0;
}
}
int APIENTRY glutDeviceGet (GLenum type)
{
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 */

217
src/glut/dos/window.c Normal file
View File

@@ -0,0 +1,217 @@
/*
* 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
*/
#include "GL/glut.h"
#include "GL/dmesa.h"
#include "internal.h"
static int window;
static DMesaVisual visual = NULL;
static DMesaContext context = NULL;
static DMesaBuffer buffer[MAX_WINDOWS];
static void clean (void)
{
int i;
for (i=0; i<MAX_WINDOWS; i++) {
glutDestroyWindow(i+1);
}
if (context) DMesaDestroyContext(context);
if (visual) DMesaDestroyVisual(visual);
pc_close_stdout();
pc_close_stderr();
}
int APIENTRY glutCreateWindow (const char *title)
{
int i;
if (!visual) {
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;
}
if ((visual=DMesaCreateVisual(screen_w, screen_h, DEFAULT_BPP,
g_display_mode & GLUT_DOUBLE,
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;
}
pc_open_stdout();
pc_open_stderr();
pc_atexit(clean);
}
for (i=0; i<MAX_WINDOWS; i++) {
if (!buffer[i]) {
DMesaBuffer b;
if ((b=DMesaCreateBuffer(visual, g_xpos, g_ypos, g_width, g_height))==NULL) {
return 0;
}
if (!DMesaMakeCurrent(context, b)) {
DMesaDestroyBuffer(b);
return 0;
}
if (g_mouse) {
pc_mouse_area(g_xpos, g_ypos, g_xpos + g_width - 1, g_ypos + g_height - 1);
}
buffer[window = i] = b;
return i+1;
}
}
return 0;
}
int APIENTRY glutCreateSubWindow (int win, int x, int y, int width, int height)
{
return GL_FALSE;
}
void APIENTRY glutDestroyWindow (int win)
{
if (buffer[win-1]) {
DMesaDestroyBuffer(buffer[win-1]);
buffer[win-1] = NULL;
}
}
void APIENTRY glutPostRedisplay (void)
{
g_redisplay = GL_TRUE;
}
void APIENTRY glutSwapBuffers (void)
{
if (g_mouse) pc_scare_mouse();
DMesaSwapBuffers(buffer[window]);
if (g_mouse) pc_unscare_mouse();
}
int APIENTRY glutGetWindow (void)
{
return window + 1;
}
void APIENTRY glutSetWindow (int win)
{
window = win - 1;
}
void APIENTRY glutSetWindowTitle (const char *title)
{
}
void APIENTRY glutSetIconTitle (const char *title)
{
}
void APIENTRY glutPositionWindow (int x, int y)
{
if (DMesaViewport(buffer[window], x, y, g_width, g_height)) {
g_xpos = x;
g_ypos = y;
}
}
void APIENTRY glutReshapeWindow (int width, int height)
{
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);
}
}
}
void APIENTRY glutPopWindow (void)
{
}
void APIENTRY glutPushWindow (void)
{
}
void APIENTRY glutIconifyWindow (void)
{
}
void APIENTRY glutShowWindow (void)
{
}
void APIENTRY glutHideWindow (void)
{
}

View File

@@ -25,8 +25,8 @@ OBJS = $(SRCS:.c=.obj)
MS_LIBS = ../lib/$(MESALIB) ../lib/$(GLULIB) winmm.lib $(guilibsdll)
SGI_LIBS = $(SGI_OPENGL) $(SGI_GLU) winmm.lib $(guilibsdll)
glut32.dll : $(OBJS) glut.def
$(link) $(LFLAGS) -out:glut32.dll -def:glut.def $(OBJS) $(MS_LIBS)
MesaGlut.dll : $(OBJS) glut.def
$(link) $(LFLAGS) -out:MesaGlut.dll -def:glut.def $(OBJS) $(MS_LIBS)
@echo "copying GLUT dynamic link library to lib directory..."
-copy $(GLUTDLL) ..\lib
@echo "copying GLUT import library to lib directory..."

View File

@@ -439,15 +439,15 @@ loadVisuals(int *nitems_return)
GLXFBConfigSGIX fbc;
int fbconfigID, drawType, renderType;
fbc = glXGetFBConfigFromVisualSGIX(__glutDisplay, vlist[i]);
fbc = __glut_glXGetFBConfigFromVisualSGIX(__glutDisplay, vlist[i]);
if (fbc) {
rc = glXGetFBConfigAttribSGIX(__glutDisplay, fbc,
rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, fbc,
GLX_FBCONFIG_ID_SGIX, &fbconfigID);
if ((rc == 0) && (fbconfigID != None)) {
rc = glXGetFBConfigAttribSGIX(__glutDisplay, fbc,
rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, fbc,
GLX_DRAWABLE_TYPE_SGIX, &drawType);
if ((rc == 0) && (drawType & GLX_WINDOW_BIT_SGIX)) {
rc = glXGetFBConfigAttribSGIX(__glutDisplay, fbc,
rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay, fbc,
GLX_RENDER_TYPE_SGIX, &renderType);
if ((rc == 0) && (renderType & GLX_RGBA_BIT_SGIX)) {
mode->fbc = fbc;
@@ -459,7 +459,7 @@ loadVisuals(int *nitems_return)
/* Start with "j = 1" to skip the GLX_RGBA attribute. */
for (j = 1; j < NUM_GLXCAPS; j++) {
rc = glXGetFBConfigAttribSGIX(__glutDisplay,
rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay,
fbc, glxcap[j], &mode->cap[j]);
if (rc != 0) {
mode->valid = 0;
@@ -509,7 +509,7 @@ loadVisuals(int *nitems_return)
#define GLX_VISUAL_CAVEAT_EXT 0x20
#endif
rc = glXGetFBConfigAttribSGIX(__glutDisplay,
rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay,
fbc, GLX_VISUAL_CAVEAT_EXT, &rating);
if (rc != 0) {
mode->cap[SLOW] = 0;
@@ -558,7 +558,7 @@ loadVisuals(int *nitems_return)
#define GLX_TRANSPARENT_TYPE_EXT 0x23
#endif
rc = glXGetFBConfigAttribSGIX(__glutDisplay,
rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay,
fbc, GLX_TRANSPARENT_TYPE_EXT, &transparent);
if (rc != 0) {
mode->cap[TRANSPARENT] = 0;
@@ -573,7 +573,7 @@ loadVisuals(int *nitems_return)
#endif
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample)
if (multisample) {
rc = glXGetFBConfigAttribSGIX(__glutDisplay,
rc = __glut_glXGetFBConfigAttribSGIX(__glutDisplay,
fbc, GLX_SAMPLES_SGIS, &mode->cap[SAMPLES]);
if (rc != 0) {
mode->cap[SAMPLES] = 0;

View File

@@ -50,4 +50,19 @@ glutExtensionSupported(const char *extension)
return 0;
}
/* XXX This isn't an official GLUT function, yet */
void * APIENTRY
glutGetProcAddress(const char *procName)
{
#if defined(_WIN32)
return (void *) wglGetProcAddress((LPCSTR) procName);
#elif defined(GLX_ARB_get_proc_address)
return (void *) glXGetProcAddressARB((const GLubyte *) procName);
#else
return NULL;
#endif
}
/* ENDCENTRY */

View File

@@ -46,3 +46,210 @@ __glutIsSupportedByGLX(char *extension)
return 0;
}
#endif
/*
* Wrapping of GLX extension functions.
* Technically, we should do a runtime test to see if we've got the
* glXGetProcAddressARB() function. I think GLX_ARB_get_proc_address
* is pretty widely supported now and any system that has
* GLX_ARB_get_proc_address defined in its header files should be OK
* at runtime.
*/
int
__glut_glXBindChannelToWindowSGIX(Display *dpy, int screen,
int channel, Window window)
{
#ifdef GLX_ARB_get_proc_address
typedef int (*glXBindChannelToWindowSGIX_t) (Display *, int, int, Window);
static glXBindChannelToWindowSGIX_t glXBindChannelToWindowSGIX_ptr = NULL;
if (!glXBindChannelToWindowSGIX_ptr) {
glXBindChannelToWindowSGIX_ptr = (glXBindChannelToWindowSGIX_t)
glXGetProcAddressARB((const GLubyte *) "glXBindChannelToWindowSGIX");
}
if (glXBindChannelToWindowSGIX_ptr)
return (*glXBindChannelToWindowSGIX_ptr)(dpy, screen, channel, window);
else
return 0;
#elif defined(GLX_SGIX_video_resize)
return glXBindChannelToWindowSGIX(dpy, screen, channel, window);
#else
return 0;
#endif
}
int
__glut_glXChannelRectSGIX(Display *dpy, int screen, int channel,
int x, int y, int w, int h)
{
#ifdef GLX_ARB_get_proc_address
typedef int (*glXChannelRectSGIX_t)(Display *, int, int, int, int, int, int);
static glXChannelRectSGIX_t glXChannelRectSGIX_ptr = NULL;
if (!glXChannelRectSGIX_ptr) {
glXChannelRectSGIX_ptr = (glXChannelRectSGIX_t)
glXGetProcAddressARB((const GLubyte *) "glXChannelRectSGIX");
}
if (glXChannelRectSGIX_ptr)
return (*glXChannelRectSGIX_ptr)(dpy, screen, channel, x, y, w, h);
else
return 0;
#elif defined(GLX_SGIX_video_resize)
return glXChannelRectSGIX(dpy, screen, channel, x, y, w, h);
#else
return 0;
#endif
}
int
__glut_glXQueryChannelRectSGIX(Display *dpy, int screen, int channel,
int *x, int *y, int *w, int *h)
{
#ifdef GLX_ARB_get_proc_address
typedef int (*glXQueryChannelRectSGIX_t)(Display *, int, int,
int *, int *, int *, int *);
static glXQueryChannelRectSGIX_t glXQueryChannelRectSGIX_ptr = NULL;
if (!glXQueryChannelRectSGIX_ptr) {
glXQueryChannelRectSGIX_ptr = (glXQueryChannelRectSGIX_t)
glXGetProcAddressARB((const GLubyte *) "glXQueryChannelRectSGIX");
}
if (glXQueryChannelRectSGIX_ptr)
return (*glXQueryChannelRectSGIX_ptr)(dpy, screen, channel, x, y, w, h);
else
return 0;
#elif defined(GLX_SGIX_video_resize)
return glXQueryChannelRectSGIX(dpy, screen, channel, x, y, w, h);
#else
return 0;
#endif
}
int
__glut_glXQueryChannelDeltasSGIX(Display *dpy, int screen, int channel,
int *dx, int *dy, int *dw, int *dh)
{
#ifdef GLX_ARB_get_proc_address
typedef int (*glXQueryChannelDeltasSGIX_t)(Display *, int, int,
int *, int *, int *, int *);
static glXQueryChannelDeltasSGIX_t glXQueryChannelDeltasSGIX_ptr = NULL;
if (!glXQueryChannelDeltasSGIX_ptr) {
glXQueryChannelDeltasSGIX_ptr = (glXQueryChannelDeltasSGIX_t)
glXGetProcAddressARB((const GLubyte *) "glXQueryChannelDeltasSGIX");
}
if (glXQueryChannelDeltasSGIX_ptr)
return (*glXQueryChannelDeltasSGIX_ptr)(dpy, screen, channel,
dx, dy, dw, dh);
else
return 0;
#elif defined(GLX_SGIX_video_resize)
return glXQueryChannelDeltasSGIX(dpy, screen, channel, dx, dy, dw, dh);
#else
return 0;
#endif
}
int
__glut_glXChannelRectSyncSGIX(Display *dpy, int screen,
int channel, GLenum synctype)
{
#ifdef GLX_ARB_get_proc_address
typedef int (*glXChannelRectSyncSGIX_t)(Display *, int, int, GLenum);
static glXChannelRectSyncSGIX_t glXChannelRectSyncSGIX_ptr = NULL;
if (!glXChannelRectSyncSGIX_ptr) {
glXChannelRectSyncSGIX_ptr = (glXChannelRectSyncSGIX_t)
glXGetProcAddressARB((const GLubyte *) "glXChannelRectSyncSGIX");
}
if (glXChannelRectSyncSGIX_ptr)
return (*glXChannelRectSyncSGIX_ptr)(dpy, screen, channel, synctype);
else
return 0;
#elif defined(GLX_SGIX_video_resize)
return glXChannelRectSyncSGIX(dpy, screen, channel, synctype);
#else
return 0;
#endif
}
GLXContext
__glut_glXCreateContextWithConfigSGIX(Display *dpy, GLXFBConfigSGIX config,
int render_type, GLXContext share_list,
Bool direct)
{
#ifdef GLX_ARB_get_proc_address
typedef GLXContext (*glXCreateContextWithConfigSGIX_t)(Display *,
GLXFBConfigSGIX, int, GLXContext, Bool);
static glXCreateContextWithConfigSGIX_t glXCreateContextWithConfig_ptr = NULL;
if (!glXCreateContextWithConfig_ptr) {
glXCreateContextWithConfig_ptr = (glXCreateContextWithConfigSGIX_t)
glXGetProcAddressARB((const GLubyte *) "glXCreateContextWithConfigSGIX");
}
if (glXCreateContextWithConfig_ptr)
return (*glXCreateContextWithConfig_ptr)(dpy, config, render_type,
share_list, direct);
else
return 0;
#elif defined(GLX_SGIX_fbconfig)
return glXCreateContextWithConfigSGIX(dpy, config, render_type,
share_list, direct);
#else
return 0;
#endif
}
int
__glut_glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config,
int attribute, int *value)
{
#ifdef GLX_ARB_get_proc_address
typedef int (*glXGetFBConfigAttribSGIX_t)(Display *,
GLXFBConfigSGIX, int, int *);
static glXGetFBConfigAttribSGIX_t glXGetFBConfigAttrib_ptr = NULL;
if (!glXGetFBConfigAttrib_ptr) {
glXGetFBConfigAttrib_ptr = (glXGetFBConfigAttribSGIX_t)
glXGetProcAddressARB((const GLubyte *) "glXGetFBConfigAttribSGIX");
}
if (glXGetFBConfigAttrib_ptr)
return (*glXGetFBConfigAttrib_ptr)(dpy, config, attribute, value);
else
return 0;
#elif defined(GLX_SGIX_fbconfig)
return glXGetFBConfigAttribSGIX(dpy, config, attribute, value);
#else
return 0;
#endif
}
GLXFBConfigSGIX
__glut_glXGetFBConfigFromVisualSGIX(Display *dpy, XVisualInfo *vis)
{
#ifdef GLX_ARB_get_proc_address
typedef GLXFBConfigSGIX (*glXGetFBConfigFromVisualSGIX_t)(Display *,
XVisualInfo *);
static glXGetFBConfigFromVisualSGIX_t glXGetFBConfigFromVisual_ptr = NULL;
if (!glXGetFBConfigFromVisual_ptr) {
glXGetFBConfigFromVisual_ptr = (glXGetFBConfigFromVisualSGIX_t)
glXGetProcAddressARB((const GLubyte *) "glXGetFBConfigFromVisualSGIX");
}
if (glXGetFBConfigFromVisual_ptr)
return (*glXGetFBConfigFromVisual_ptr)(dpy, vis);
else
return 0;
#elif defined(GLX_SGIX_fbconfig)
return glXGetFBConfigFromVisualSGIX(dpy, vis);
#else
return 0;
#endif
}

View File

@@ -395,7 +395,7 @@ glutEstablishOverlay(void)
}
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig)
if (fbc) {
window->ctx = glXCreateContextWithConfigSGIX(__glutDisplay, fbc,
window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc,
GLX_RGBA_TYPE_SGIX, None, __glutTryDirect);
} else
#endif

View File

@@ -57,7 +57,7 @@ glutVideoResizeGet(GLenum param)
if (canVideoResize < 0) {
canVideoResize = __glutIsSupportedByGLX("GLX_SGIX_video_resize");
if (canVideoResize) {
#if __sgi
#if defined(__sgi) && __sgi
/* This is a hack because IRIX 6.2, 6.3, and some 6.4
versions were released with GLX_SGIX_video_resize
being advertised by the X server though the video
@@ -94,7 +94,8 @@ glutVideoResizeGet(GLenum param)
#if defined(GLX_GLXEXT_PROTOTYPES)
#endif
glXQueryChannelDeltasSGIX(__glutDisplay, __glutScreen,
__glut_glXQueryChannelDeltasSGIX(__glutDisplay, __glutScreen,
videoResizeChannel, &dx, &dy, &dw, &dh);
/* glXQueryChannelDeltasSGIX is an inherent X server
@@ -138,7 +139,7 @@ glutVideoResizeGet(GLenum param)
if (videoResizeInUse) {
int x, y, width, height;
glXQueryChannelRectSGIX(__glutDisplay, __glutScreen,
__glut_glXQueryChannelRectSGIX(__glutDisplay, __glutScreen,
videoResizeChannel, &x, &y, &width, &height);
switch (param) {
case GLUT_VIDEO_RESIZE_X:
@@ -164,7 +165,7 @@ glutSetupVideoResizing(void)
{
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) {
glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen,
__glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen,
videoResizeChannel, __glutCurrentWindow->win);
videoResizeInUse = 1;
} else
@@ -178,7 +179,7 @@ glutStopVideoResizing(void)
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_video_resize)
if (glutVideoResizeGet(GLUT_VIDEO_RESIZE_POSSIBLE)) {
if (videoResizeInUse) {
glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen,
__glut_glXBindChannelToWindowSGIX(__glutDisplay, __glutScreen,
videoResizeChannel, None);
videoResizeInUse = 0;
}
@@ -196,10 +197,10 @@ glutVideoResize(int x, int y, int width, int height)
/* glXChannelRectSyncSGIX introduced in a patch to IRIX
6.2; the original unpatched IRIX 6.2 behavior is always
GLX_SYNC_SWAP_SGIX. */
glXChannelRectSyncSGIX(__glutDisplay, __glutScreen,
__glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen,
videoResizeChannel, GLX_SYNC_SWAP_SGIX);
#endif
glXChannelRectSGIX(__glutDisplay, __glutScreen,
__glut_glXChannelRectSGIX(__glutDisplay, __glutScreen,
videoResizeChannel, x, y, width, height);
}
#endif
@@ -218,10 +219,10 @@ glutVideoPan(int x, int y, int width, int height)
accomplish GLX_SYNC_FRAME_SGIX on IRIX unpatched 6.2;
this means you'd need a glutSwapBuffers to actually
realize the video resize. */
glXChannelRectSyncSGIX(__glutDisplay, __glutScreen,
__glut_glXChannelRectSyncSGIX(__glutDisplay, __glutScreen,
videoResizeChannel, GLX_SYNC_FRAME_SGIX);
#endif
glXChannelRectSGIX(__glutDisplay, __glutScreen,
__glut_glXChannelRectSGIX(__glutDisplay, __glutScreen,
videoResizeChannel, x, y, width, height);
}
#endif

View File

@@ -577,7 +577,7 @@ __glutCreateWindow(GLUTwindow * parent,
window->renderWin = window->win;
#if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig)
if (fbc) {
window->ctx = glXCreateContextWithConfigSGIX(__glutDisplay, fbc,
window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc,
GLX_RGBA_TYPE_SGIX, None, __glutTryDirect);
} else
#endif

View File

@@ -764,6 +764,29 @@ extern void __glutDestroyWindow(
#if !defined(_WIN32)
/* private routines from glut_glxext.c */
extern int __glutIsSupportedByGLX(char *);
extern int __glut_glXBindChannelToWindowSGIX(Display *dpy, int screen,
int channel, Window window);
extern int __glut_glXChannelRectSGIX(Display *dpy, int screen, int channel,
int x, int y, int w, int h);
extern int __glut_glXQueryChannelRectSGIX(Display *dpy, int screen,
int channel, int *x, int *y,
int *w, int *h);
extern int __glut_glXQueryChannelDeltasSGIX(Display *dpy, int screen,
int channel, int *dx, int *dy,
int *dw, int *dh);
extern int __glut_glXChannelRectSyncSGIX(Display *dpy, int screen, int channel,
GLenum synctype);
extern GLXContext __glut_glXCreateContextWithConfigSGIX(Display *dpy,
GLXFBConfigSGIX config,
int render_type,
GLXContext share_list,
Bool direct);
extern int __glut_glXGetFBConfigAttribSGIX(Display *dpy,
GLXFBConfigSGIX config,
int attribute,
int *value);
extern GLXFBConfigSGIX __glut_glXGetFBConfigFromVisualSGIX(Display *dpy,
XVisualInfo *vis);
#endif
/* private routines from glut_input.c */

View File

@@ -1,7 +1,7 @@
# $Id: Makefile.X11,v 1.58 2001/09/23 16:11:26 brianp Exp $
# $Id: Makefile.X11,v 1.58.2.4 2002/01/15 20:17:59 brianp Exp $
# Mesa 3-D graphics library
# Version: 4.0
# Version: 4.0.1
# Copyright (C) 1995-2001 Brian Paul
# Makefile for core library
@@ -200,69 +200,6 @@ OSMESA_OBJECTS = OSmesa/osmesa.o
$(CC) -c -I. $(CFLAGS) $< -o $@
# UGH! These rules shouldn't be needed but IRIX's make (and others?) needs them
X/glxapi.o: X/glxapi.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
X/fakeglx.o: X/fakeglx.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
X/xfonts.o: X/xfonts.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
X/xm_api.o: X/xm_api.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
X/xm_dd.o: X/xm_dd.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
X/xm_span.o: X/xm_span.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
X/xm_line.o: X/xm_line.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
X/xm_tri.o: X/xm_tri.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
SVGA/svgamesa.o: SVGA/svgamesa.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
SVGA/svgamesa8.o: SVGA/svgamesa8.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
SVGA/svgamesa15.o: SVGA/svgamesa15.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
SVGA/svgamesa16.o: SVGA/svgamesa16.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
SVGA/svgamesa24.o: SVGA/svgamesa24.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
SVGA/svgamesa32.o: SVGA/svgamesa32.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
OSmesa/osmesa.o: OSmesa/osmesa.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxapi.o: FX/fxapi.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxclip.o: FX/fxclip.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxdd.o: FX/fxdd.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxddspan.o: FX/fxddspan.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxddtex.o: FX/fxddtex.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxfastpath.o: FX/fxfastpath.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxpipeline.o: FX/fxpipeline.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxrender.o: FX/fxrender.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxsanity.o: FX/fxsanity.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxsetup.o: FX/fxsetup.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxtrifuncs.o: FX/fxtrifuncs.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxtexman.o: FX/fxtexman.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxvsetup.o: FX/fxvsetup.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/fxglidew.o: FX/fxglidew.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
FX/X86/fx_3dnow_fastpath.o: FX/X86/fx_3dnow_fastpath.S
X86/x86.o: X86/x86.c
@@ -279,26 +216,9 @@ X86/matypes.h: mtypes.h tnl/t_context.h X86/gen_matypes.c
./X86/gen_matypes > X86/matypes.h
rm -f X86/gen_matypes X86/*.o
$(ASM_SOURCES): X86/matypes.h
GGI/ggimesa.o: GGI/ggimesa.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
Trace/tr_2string.o: Trace/tr_2string.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
Trace/tr_attrib.o: Trace/tr_attrib.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
Trace/tr_context.o: Trace/tr_context.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
Trace/tr_control.o: Trace/tr_control.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
Trace/tr_error.o: Trace/tr_error.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
Trace/tr_print.o: Trace/tr_print.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
Trace/tr_wrapper.o: Trace/tr_wrapper.c
$(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
# We have X86/matypes.h depend on X86/matypes.h so that if ASM_SOURCES
# is empty we don't get an invalid Makefile.
$(ASM_SOURCES) X86/matypes.h: X86/matypes.h
##### TARGETS #####

View File

@@ -1,4 +1,4 @@
/* $Id: t_dd_dmatmp.h,v 1.10 2001/04/09 15:41:11 alanh Exp $ */
/* $Id: t_dd_dmatmp.h,v 1.10.2.3 2002/02/12 17:37:27 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -49,6 +49,7 @@
#define ELTS_VARS
#define ALLOC_ELTS( nr )
#define EMIT_ELT( offset, elt )
#define EMIT_TWO_ELTS( offset, elt0, elt1 )
#define INCR_ELTS( nr )
#define ELT_INIT(prim)
#define GET_CURRENT_VB_MAX_ELTS() 0
@@ -201,7 +202,7 @@ static void TAG(render_line_strip_verts)( GLcontext *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count - 1; j += nr - 1 ) {
for (j = start; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
EMIT_VERTS( ctx, j, nr );
currentsz = dmasz;
@@ -242,7 +243,7 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx,
if (currentsz < 8)
currentsz = dmasz;
for ( ; j < count - 1; j += nr - 1 ) {
for ( ; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
EMIT_VERTS( ctx, j, nr );
currentsz = dmasz;
@@ -306,11 +307,11 @@ static void TAG(render_tri_strip_verts)( GLcontext *ctx,
currentsz = GET_CURRENT_VB_MAX_VERTS();
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
if (flags & PRIM_PARITY) {
if ((flags & PRIM_PARITY) && count - start > 2) {
if (HAVE_TRI_STRIP_1 && 0) {
} else {
EMIT_VERTS( ctx, start, 1 );
@@ -323,7 +324,7 @@ static void TAG(render_tri_strip_verts)( GLcontext *ctx,
dmasz -= (dmasz & 1);
currentsz -= (currentsz & 1);
for (j = start ; j < count - 2; j += nr - 2 ) {
for (j = start ; j + 2 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
EMIT_VERTS( ctx, j, nr );
currentsz = dmasz;
@@ -351,11 +352,11 @@ static void TAG(render_tri_fan_verts)( GLcontext *ctx,
INIT(GL_TRIANGLE_FAN);
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
for (j = start + 1 ; j < count - 1; j += nr - 1 ) {
for (j = start + 1 ; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j + 1 );
EMIT_VERTS( ctx, start, 1 );
EMIT_VERTS( ctx, j, nr - 1 );
@@ -389,11 +390,11 @@ static void TAG(render_poly_verts)( GLcontext *ctx,
INIT(GL_POLYGON);
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
for (j = start + 1 ; j < count - 1 ; j += nr - 1 ) {
for (j = start + 1 ; j + 1 < count ; j += nr - 1 ) {
nr = MIN2( currentsz, count - j + 1 );
EMIT_VERTS( ctx, start, 1 );
EMIT_VERTS( ctx, j, nr - 1 );
@@ -429,19 +430,14 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
currentsz = GET_CURRENT_VB_MAX_VERTS();
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
if (flags & PRIM_PARITY) {
EMIT_VERTS( ctx, start, 1 );
currentsz--;
}
dmasz -= (dmasz & 2);
currentsz -= (currentsz & 2);
for (j = start ; j < count - 3; j += nr - 2 ) {
for (j = start ; j + 3 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
EMIT_VERTS( ctx, j, nr );
currentsz = dmasz;
@@ -449,7 +445,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
FINISH;
} else if (HAVE_TRI_STRIPS && ctx->_TriangleCaps & DD_FLATSHADE) {
} else if (HAVE_TRI_STRIPS && (ctx->_TriangleCaps & DD_FLATSHADE)) {
if (TAG(emit_elt_verts)( ctx, start, count )) {
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
@@ -475,7 +471,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
currentsz = currentsz/6*2;
dmasz = dmasz/6*2;
for (j = start; j < count - 3; j += nr - 2 ) {
for (j = start; j + 3 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
if (nr >= 4) {
GLint quads = (nr/2)-1;
@@ -485,7 +481,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 );
for ( i = 0 ; i < quads*2 ; i+=2 ) {
for ( i = j-start ; i < j-start+quads*2 ; i+=2 ) {
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
EMIT_TWO_ELTS( 2, (i+2), (i+1) );
EMIT_TWO_ELTS( 4, (i+3), (i+2) );
@@ -523,11 +519,11 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
count -= (count-start) & 1;
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
for (j = start; j < count - 3; j += nr - 2 ) {
for (j = start; j + 3 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
EMIT_VERTS( ctx, j, nr );
currentsz = dmasz;
@@ -606,7 +602,7 @@ static void TAG(render_quads_verts)( GLcontext *ctx,
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 );
for ( i = 0 ; i < quads*4 ; i+=4 ) {
for ( i = j-start ; i < j-start+quads*4 ; i+=4 ) {
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
EMIT_TWO_ELTS( 2, (i+3), (i+1) );
EMIT_TWO_ELTS( 4, (i+2), (i+3) );
@@ -744,7 +740,7 @@ static void TAG(render_line_strip_elts)( GLcontext *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count - 1; j += nr - 1 ) {
for (j = start; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr );
NEW_PRIMITIVE();
@@ -780,7 +776,7 @@ static void TAG(render_line_loop_elts)( GLcontext *ctx,
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
@@ -789,7 +785,7 @@ static void TAG(render_line_loop_elts)( GLcontext *ctx,
currentsz--;
dmasz--;
for ( ; j < count - 1; j += nr - 1 ) {
for ( ; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
/* NEW_PRIMITIVE(); */
TAG(emit_elts)( ctx, elts+j, nr );
@@ -862,11 +858,11 @@ static void TAG(render_tri_strip_elts)( GLcontext *ctx,
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
if (flags & PRIM_PARITY) {
if ((flags & PRIM_PARITY) && count - start > 2) {
TAG(emit_elts)( ctx, elts+start, 1 );
}
@@ -875,7 +871,7 @@ static void TAG(render_tri_strip_elts)( GLcontext *ctx,
dmasz -= (dmasz & 1);
currentsz -= (currentsz & 1);
for (j = start ; j < count - 2; j += nr - 2 ) {
for (j = start ; j + 2 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr );
NEW_PRIMITIVE();
@@ -904,11 +900,11 @@ static void TAG(render_tri_fan_elts)( GLcontext *ctx,
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
for (j = start + 1 ; j < count - 1; j += nr - 1 ) {
for (j = start + 1 ; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j + 1 );
TAG(emit_elts)( ctx, elts+start, 1 );
TAG(emit_elts)( ctx, elts+j, nr - 1 );
@@ -940,11 +936,11 @@ static void TAG(render_poly_elts)( GLcontext *ctx,
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8) {
FIRE_VERTICES();
NEW_BUFFER();
currentsz = dmasz;
}
for (j = start + 1 ; j < count - 1 ; j += nr - 1 ) {
for (j = start + 1 ; j + 1 < count ; j += nr - 1 ) {
nr = MIN2( currentsz, count - j + 1 );
TAG(emit_elts)( ctx, elts+start, 1 );
TAG(emit_elts)( ctx, elts+j, nr - 1 );
@@ -988,7 +984,7 @@ static void TAG(render_quad_strip_elts)( GLcontext *ctx,
currentsz = currentsz/6*2;
dmasz = dmasz/6*2;
for (j = start; j < count - 3; j += nr - 2 ) {
for (j = start; j + 3 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
if (nr >= 4)
@@ -1001,7 +997,7 @@ static void TAG(render_quad_strip_elts)( GLcontext *ctx,
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 );
for ( i = 0 ; i < quads ; i++, elts += 2 ) {
for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) {
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
EMIT_TWO_ELTS( 2, elts[2], elts[1] );
EMIT_TWO_ELTS( 4, elts[3], elts[2] );
@@ -1017,7 +1013,7 @@ static void TAG(render_quad_strip_elts)( GLcontext *ctx,
else {
ELT_INIT( GL_TRIANGLE_STRIP );
for (j = start; j < count - 3; j += nr - 2 ) {
for (j = start; j + 3 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts+j, nr );
NEW_PRIMITIVE();
@@ -1058,7 +1054,7 @@ static void TAG(render_quads_elts)( GLcontext *ctx,
if (currentsz < 8)
currentsz = dmasz;
for (j = start; j < count - 3; j += nr - 2 ) {
for (j = start; j + 3 < count; j += nr - 2 ) {
nr = MIN2( currentsz, count - j );
if (nr >= 4)
@@ -1069,7 +1065,7 @@ static void TAG(render_quads_elts)( GLcontext *ctx,
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads * 6 );
for ( i = 0 ; i < quads ; i++, elts += 4 ) {
for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) {
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
EMIT_TWO_ELTS( 2, elts[3], elts[1] );
EMIT_TWO_ELTS( 4, elts[2], elts[3] );

View File

@@ -1,4 +1,4 @@
/* $Id: t_dd_vb.c,v 1.15 2001/05/14 09:00:52 keithw Exp $ */
/* $Id: t_dd_vb.c,v 1.15.2.1 2001/12/13 10:57:41 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -277,7 +277,7 @@ IMPORT_QUALIFIER void TAG(import_float_spec_colors)( GLcontext *ctx )
#define INTERP_QUALIFIER static
#endif
#define GET_COLOR(ptr, idx) (((GLfloat (*)[4])((ptr)->Ptr))[idx])
#define GET_COLOR(ptr, idx) (((GLchan (*)[4])((ptr)->Ptr))[idx])
INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
@@ -289,16 +289,16 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) {
INTERP_4F( t,
GET_COLOR(VB->ColorPtr[1], dst),
GET_COLOR(VB->ColorPtr[1], out),
GET_COLOR(VB->ColorPtr[1], in) );
INTERP_4CHAN( t,
GET_COLOR(VB->ColorPtr[1], dst),
GET_COLOR(VB->ColorPtr[1], out),
GET_COLOR(VB->ColorPtr[1], in) );
if (VB->SecondaryColorPtr[1]) {
INTERP_3F( t,
GET_COLOR(VB->SecondaryColorPtr[1], dst),
GET_COLOR(VB->SecondaryColorPtr[1], out),
GET_COLOR(VB->SecondaryColorPtr[1], in) );
INTERP_3CHAN( t,
GET_COLOR(VB->SecondaryColorPtr[1], dst),
GET_COLOR(VB->SecondaryColorPtr[1], out),
GET_COLOR(VB->SecondaryColorPtr[1], in) );
}
}
@@ -316,12 +316,12 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx,
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
if (VB->ColorPtr[1]) {
COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst),
GET_COLOR(VB->ColorPtr[1], src) );
COPY_CHAN4( GET_COLOR(VB->ColorPtr[1], dst),
GET_COLOR(VB->ColorPtr[1], src) );
if (VB->SecondaryColorPtr[1]) {
COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst),
GET_COLOR(VB->SecondaryColorPtr[1], src) );
COPY_CHAN4( GET_COLOR(VB->SecondaryColorPtr[1], dst),
GET_COLOR(VB->SecondaryColorPtr[1], src) );
}
}

View File

@@ -1,4 +1,4 @@
/* $Id: t_dd_vbtmp.h,v 1.14 2001/05/03 16:49:28 keithw Exp $ */
/* $Id: t_dd_vbtmp.h,v 1.14.2.2 2002/02/12 17:37:27 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -136,6 +136,9 @@ static void TAG(emit)( GLcontext *ctx,
const GLubyte *mask = VB->ClipMask;
int i;
/* fprintf(stderr, "%s(big) importable %d %d..%d\n", */
/* __FUNCTION__, VB->importable_data, start, end); */
if (HAVE_HW_VIEWPORT && HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) {
(void) s;
coord = VB->ClipPtr->data;
@@ -226,6 +229,8 @@ static void TAG(emit)( GLcontext *ctx,
VIEWPORT_Z(v->v.z, coord[0][2]);
v->v.w = coord[0][3];
}
/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %.2f\n", */
/* i, v->v.x, v->v.y, v->v.z, v->v.w); */
coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride);
}
if (DO_RGBA) {
@@ -417,8 +422,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
col_stride = VB->ColorPtr[0]->StrideB;
ASSERT(VB->ColorPtr[0]->Type == GL_UNSIGNED_BYTE);
/* fprintf(stderr, "%s stride %d importable %d\n", */
/* __FUNCTION__, col_stride, VB->importable_data); */
/* fprintf(stderr, "%s(small) importable %x\n", */
/* __FUNCTION__, VB->importable_data); */
/* Pack what's left into a 4-dword vertex. Color is in a different
* place, and there is no 'w' coordinate.
@@ -449,6 +454,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
}
STRIDE_4UB( col, col_stride );
}
/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %x\n", */
/* i, v[0], v[1], v[2], *(int *)&v[3]); */
}
}
else {
@@ -470,6 +477,9 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
b[3] = col[i][3];
}
}
/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %x\n", */
/* i, v[0], v[1], v[2], *(int *)&v[3]); */
}
}
}
@@ -624,7 +634,7 @@ static void TAG(interp)( GLcontext *ctx,
if ((HAVE_HW_DIVIDE && CHECK_HW_DIVIDE) ||
DO_FOG || DO_SPEC || DO_TEX0 || DO_TEX1 ||
DO_TEX2 || DO_TEX3) {
DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES) {
dst->v.w = w;
@@ -729,7 +739,7 @@ static void TAG(init)( void )
if (DO_SPEC)
setup_tab[IND].copy_pv = copy_pv_rgba4_spec5;
else if (HAVE_HW_DIVIDE || DO_SPEC || DO_FOG || DO_TEX0 || DO_TEX1 ||
DO_TEX2 || DO_TEX3)
DO_TEX2 || DO_TEX3 || !HAVE_TINY_VERTICES)
setup_tab[IND].copy_pv = copy_pv_rgba4;
else
setup_tab[IND].copy_pv = copy_pv_rgba3;

View File

@@ -1,119 +0,0 @@
# DO NOT DELETE
accum.obj: accum.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
accum.obj: dlist.h macros.h
alpha.obj: alpha.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
alpha.obj: dlist.h macros.h
alphabuf.obj: alphabuf.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
alphabuf.obj: context.h macros.h
api1.obj: api.h bitmap.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
api1.obj: eval.h image.h macros.h matrix.h teximage.h
api2.obj: api.h bitmap.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
api2.obj: eval.h image.h macros.h matrix.h teximage.h
attrib.obj: attrib.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
attrib.obj: draw.h dlist.h macros.h
bitmap.obj: bitmap.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
bitmap.obj: feedback.h image.h macros.h pb.h
blend.obj: alphabuf.h types.h ..\include\GL\gl.h config.h fixed.h dd.h blend.h
blend.obj: context.h dlist.h macros.h pb.h span.h
bresenhm.obj: bresenhm.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
clip.obj: clip.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
clip.obj: dlist.h macros.h matrix.h vb.h xform.h
context.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h depth.h
context.obj: draw.h eval.h light.h lines.h dlist.h macros.h pb.h points.h
context.obj: pointers.h triangle.h teximage.h texobj.h texture.h vb.h vertex.h
copypix.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
copypix.obj: copypix.h depth.h feedback.h dlist.h macros.h pixel.h span.h
copypix.obj: stencil.h
depth.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h depth.h
depth.obj: dlist.h macros.h
dlist.obj: accum.h types.h ..\include\GL\gl.h config.h fixed.h dd.h alpha.h
dlist.obj: attrib.h bitmap.h blend.h clip.h context.h copypix.h depth.h draw.h
dlist.obj: drawpix.h enable.h eval.h feedback.h fog.h image.h light.h lines.h
dlist.obj: dlist.h logic.h macros.h masking.h matrix.h misc.h pixel.h points.h
dlist.obj: polygon.h scissor.h stencil.h texobj.h teximage.h texture.h vb.h
dlist.obj: vertex.h winpos.h
draw.obj: clip.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
draw.obj: draw.h feedback.h fog.h light.h lines.h dlist.h macros.h matrix.h
draw.obj: pb.h points.h texture.h vb.h xform.h
drawpix.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
drawpix.obj: drawpix.h feedback.h dlist.h macros.h pixel.h span.h stencil.h
enable.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h depth.h
enable.obj: draw.h enable.h light.h dlist.h macros.h stencil.h
eval.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h draw.h
eval.obj: eval.h dlist.h macros.h
feedback.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
feedback.obj: feedback.h dlist.h macros.h
fog.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h fog.h
fog.obj: dlist.h macros.h
get.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h get.h
get.obj: dlist.h macros.h
hash.obj: hash.h
interp.obj: interp.h types.h ..\include\GL\gl.h config.h fixed.h dd.h macros.h
image.obj: image.h types.h ..\include\GL\gl.h config.h fixed.h dd.h macros.h
image.obj: pixel.h
light.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h light.h
light.obj: dlist.h macros.h matrix.h vb.h xform.h
lines.obj: bresenhm.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
lines.obj: context.h feedback.h interp.h lines.h dlist.h macros.h pb.h vb.h
logic.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h dlist.h
logic.obj: logic.h macros.h pb.h
masking.obj: alphabuf.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
masking.obj: context.h macros.h masking.h pb.h
matrix.obj: accum.h types.h ..\include\GL\gl.h config.h fixed.h dd.h alphabuf.h
matrix.obj: context.h depth.h dlist.h macros.h matrix.h stencil.h
misc.obj: accum.h types.h ..\include\GL\gl.h config.h fixed.h dd.h alphabuf.h
misc.obj: context.h depth.h macros.h masking.h misc.h stencil.h
pb.obj: alpha.h types.h ..\include\GL\gl.h config.h fixed.h dd.h alphabuf.h
pb.obj: blend.h depth.h fog.h logic.h macros.h masking.h pb.h scissor.h
pb.obj: stencil.h texture.h
pixel.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h dlist.h
pixel.obj: macros.h pixel.h image.h span.h stencil.h
points.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
points.obj: feedback.h dlist.h macros.h pb.h span.h vb.h
pointers.obj: accum.h types.h ..\include\GL\gl.h config.h fixed.h dd.h alpha.h
pointers.obj: attrib.h bitmap.h blend.h clip.h context.h copypix.h depth.h
pointers.obj: draw.h drawpix.h enable.h eval.h feedback.h fog.h get.h light.h
pointers.obj: lines.h dlist.h logic.h macros.h masking.h matrix.h misc.h
pointers.obj: pixel.h points.h polygon.h readpix.h scissor.h stencil.h
pointers.obj: teximage.h texobj.h texture.h varray.h vb.h vertex.h winpos.h
polygon.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
polygon.obj: macros.h polygon.h
readpix.obj: alphabuf.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
readpix.obj: context.h depth.h feedback.h dlist.h macros.h image.h readpix.h
readpix.obj: span.h stencil.h
scissor.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
scissor.obj: macros.h dlist.h scissor.h
span.obj: alpha.h types.h ..\include\GL\gl.h config.h fixed.h dd.h alphabuf.h
span.obj: blend.h depth.h fog.h logic.h macros.h masking.h scissor.h span.h
span.obj: stencil.h texture.h
stencil.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h dlist.h
stencil.obj: macros.h pb.h stencil.h
teximage.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
teximage.obj: image.h macros.h pixel.h span.h teximage.h
texobj.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h macros.h
texobj.obj: teximage.h texobj.h
texture.obj: context.h types.h ..\include\GL\gl.h config.h fixed.h dd.h dlist.h
texture.obj: macros.h pb.h teximage.h texture.h
triangle.obj: depth.h types.h ..\include\GL\gl.h config.h fixed.h dd.h
triangle.obj: feedback.h macros.h span.h triangle.h vb.h tritemp.h
varray.obj: draw.h types.h ..\include\GL\gl.h config.h fixed.h dd.h context.h
varray.obj: enable.h dlist.h macros.h varray.h vb.h xform.h
vb.obj: types.h ..\include\GL\gl.h config.h fixed.h dd.h vb.h
vertex.obj: draw.h types.h ..\include\GL\gl.h config.h fixed.h dd.h light.h
vertex.obj: dlist.h macros.h vb.h vertex.h
winpos.obj: ..\include\GL\gl.h draw.h types.h config.h fixed.h dd.h dlist.h
winpos.obj: macros.h winpos.h
xform.obj: types.h ..\include\GL\gl.h config.h fixed.h dd.h xform.h
glx.obj: ..\include\GL\gl.h ..\include\GL\glx.h ..\include\GL\xmesa.h context.h
glx.obj: types.h config.h fixed.h dd.h macros.h xmesaP.h
osmesa.obj: ..\include\GL\osmesa.h ..\include\GL\gl.h context.h types.h
osmesa.obj: config.h fixed.h dd.h depth.h macros.h matrix.h vb.h tritemp.h
xfonts.obj: ..\include\GL\gl.h ..\include\GL\xmesa.h macros.h xmesaP.h types.h
xfonts.obj: config.h fixed.h dd.h context.h
xmesa1.obj: ..\include\GL\xmesa.h ..\include\GL\gl.h xmesaP.h types.h config.h
xmesa1.obj: fixed.h dd.h context.h macros.h matrix.h
xmesa2.obj: ..\include\GL\xmesa.h ..\include\GL\gl.h macros.h types.h config.h
xmesa2.obj: fixed.h dd.h xmesaP.h
xmesa3.obj: bresenhm.h types.h ..\include\GL\gl.h config.h fixed.h dd.h depth.h
xmesa3.obj: interp.h macros.h vb.h xmesaP.h ..\include\GL\xmesa.h tritemp.h

View File

@@ -0,0 +1,929 @@
/*
* 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 device driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#ifdef PC_HEADER
#include "all.h"
#else
#include "glheader.h"
#include "context.h"
#include "GL/dmesa.h"
#include "extensions.h"
#include "macros.h"
#include "matrix.h"
#include "mmath.h"
#include "texformat.h"
#include "texstore.h"
#include "array_cache/acache.h"
#include "swrast/s_context.h"
#include "swrast/s_depth.h"
#include "swrast/s_lines.h"
#include "swrast/s_triangle.h"
#include "swrast/s_trispan.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
#endif
#include "video.h"
/*
* In C++ terms, this class derives from the GLvisual class.
* Add system-specific fields to it.
*/
struct dmesa_visual {
GLvisual *gl_visual;
GLboolean db_flag; /* double buffered? */
GLboolean rgb_flag; /* RGB mode? */
GLuint depth; /* bits per pixel (1, 8, 24, etc) */
};
/*
* In C++ terms, this class derives from the GLframebuffer class.
* Add system-specific fields to it.
*/
struct dmesa_buffer {
GLframebuffer gl_buffer; /* The depth, stencil, accum, etc buffers */
void *the_window; /* your window handle, etc */
int bypp; /* bytes per pixel */
int xpos, ypos; /* position */
int width, height; /* size in pixels */
int bwidth, len; /* bytes in a line, then total */
};
/*
* In C++ terms, this class derives from the GLcontext class.
* Add system-specific fields to it.
*/
struct dmesa_context {
GLcontext *gl_ctx; /* the core library context */
DMesaVisual visual;
DMesaBuffer Buffer;
GLuint ClearColor;
/* etc... */
};
static void dmesa_update_state (GLcontext *ctx, GLuint new_state);
/**********************************************************************/
/***** Read/Write pixels *****/
/**********************************************************************/
#define FLIP(y) (c->Buffer->height - (y) - 1)
#define FLIP2(y) (h - (y) - 1)
static void write_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte rgba[][4], const GLubyte mask[])
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint i, offset;
offset = c->Buffer->width * FLIP(y) + x;
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++, offset++) {
if (mask[i]) {
vl_putpixel(b, offset, vl_mixrgba(rgba[i]));
}
}
} else {
/* draw all pixels */
for (i=0; i<n; i++, offset++) {
vl_putpixel(b, offset, vl_mixrgba(rgba[i]));
}
}
}
static void write_rgb_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
const GLubyte rgb[][3], const GLubyte mask[])
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint i, offset;
offset = c->Buffer->width * FLIP(y) + x;
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++, offset++) {
if (mask[i]) {
vl_putpixel(b, offset, vl_mixrgb(rgb[i]));
}
}
} else {
/* draw all pixels */
for (i=0; i<n; i++, offset++) {
vl_putpixel(b, offset, vl_mixrgb(rgb[i]));
}
}
}
static void write_mono_rgba_span (const GLcontext *ctx,
GLuint n, GLint x, GLint y,
const GLchan color[4], const GLubyte mask[])
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint i, offset, rgba = vl_mixrgba(color);
offset = c->Buffer->width * FLIP(y) + x;
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++, offset++) {
if (mask[i]) {
vl_putpixel(b, offset, rgba);
}
}
} else {
/* draw all pixels */
for (i=0; i<n; i++, offset++) {
vl_putpixel(b, offset, rgba);
}
}
}
static void read_rgba_span (const GLcontext *ctx, GLuint n, GLint x, GLint y,
GLubyte rgba[][4])
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint i, offset;
offset = c->Buffer->width * FLIP(y) + x;
/* read all pixels */
for (i=0; i<n; i++, offset++) {
vl_getrgba(b, offset, rgba[i]);
}
}
static void write_rgba_pixels (const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLubyte rgba[][4], const GLubyte mask[])
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint i, w = c->Buffer->width, h = c->Buffer->height;
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++) {
if (mask[i]) {
vl_putpixel(b, FLIP2(y[i])*w + x[i], vl_mixrgba(rgba[i]));
}
}
} else {
/* draw all pixels */
for (i=0; i<n; i++) {
vl_putpixel(b, FLIP2(y[i])*w + x[i], vl_mixrgba(rgba[i]));
}
}
}
static void write_mono_rgba_pixels (const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
const GLchan color[4], const GLubyte mask[])
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint i, w = c->Buffer->width, h = c->Buffer->height, rgba = vl_mixrgba(color);
if (mask) {
/* draw some pixels */
for (i=0; i<n; i++) {
if (mask[i]) {
vl_putpixel(b, FLIP2(y[i])*w + x[i], rgba);
}
}
} else {
/* draw all pixels */
for (i=0; i<n; i++) {
vl_putpixel(b, FLIP2(y[i])*w + x[i], rgba);
}
}
}
static void read_rgba_pixels (const GLcontext *ctx,
GLuint n, const GLint x[], const GLint y[],
GLubyte rgba[][4], const GLubyte mask[])
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint i, w = c->Buffer->width, h = c->Buffer->height;
if (mask) {
/* read some pixels */
for (i=0; i<n; i++) {
if (mask[i]) {
vl_getrgba(b, FLIP2(y[i])*w + x[i], rgba[i]);
}
}
} else {
/* read all pixels */
for (i=0; i<n; i++) {
vl_getrgba(b, FLIP2(y[i])*w + x[i], rgba[i]);
}
}
}
/**********************************************************************/
/***** Optimized triangle rendering *****/
/**********************************************************************/
/*
* flat, NON-depth-buffered, triangle.
*/
static void tri_rgb_flat (GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2)
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint w = c->Buffer->width, h = c->Buffer->height;
#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color);
#define RENDER_SPAN(span) \
GLuint i, offset = FLIP2(span.y)*w + span.x; \
for (i = 0; i < span.count; i++, offset++) { \
vl_putpixel(b, offset, rgb); \
}
#include "swrast/s_tritemp.h"
}
/*
* flat, depth-buffered, triangle.
*/
static void tri_rgb_flat_z (GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2)
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint w = c->Buffer->width, h = c->Buffer->height;
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define SETUP_CODE GLuint rgb = vl_mixrgb(v2->color);
#define RENDER_SPAN(span) \
GLuint i, offset = FLIP2(span.y)*w + span.x; \
for (i = 0; i < span.count; i++, offset++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
vl_putpixel(b, offset, rgb); \
zRow[i] = z; \
} \
span.z += span.zStep; \
}
#include "swrast/s_tritemp.h"
}
/*
* smooth, NON-depth-buffered, triangle.
*/
static void tri_rgb_smooth (GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2)
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint w = c->Buffer->width, h = c->Buffer->height;
#define INTERP_RGB 1
#define RENDER_SPAN(span) \
GLuint i, offset = FLIP2(span.y)*w + span.x; \
for (i = 0; i < span.count; i++, offset++) { \
unsigned char rgb[3]; \
rgb[0] = FixedToInt(span.red); \
rgb[1] = FixedToInt(span.green); \
rgb[2] = FixedToInt(span.blue); \
vl_putpixel(b, offset, vl_mixrgb(rgb)); \
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
}
#include "swrast/s_tritemp.h"
}
/*
* smooth, depth-buffered, triangle.
*/
static void tri_rgb_smooth_z (GLcontext *ctx,
const SWvertex *v0,
const SWvertex *v1,
const SWvertex *v2)
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
void *b = c->Buffer->the_window;
GLuint w = c->Buffer->width, h = c->Buffer->height;
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define INTERP_RGB 1
#define RENDER_SPAN(span) \
GLuint i, offset = FLIP2(span.y)*w + span.x; \
for (i = 0; i < span.count; i++, offset++) { \
const DEPTH_TYPE z = FixedToDepth(span.z); \
if (z < zRow[i]) { \
unsigned char rgb[3]; \
rgb[0] = FixedToInt(span.red); \
rgb[1] = FixedToInt(span.green); \
rgb[2] = FixedToInt(span.blue); \
vl_putpixel(b, offset, vl_mixrgb(rgb)); \
zRow[i] = z; \
} \
span.red += span.redStep; \
span.green += span.greenStep; \
span.blue += span.blueStep; \
span.z += span.zStep; \
}
#include "swrast/s_tritemp.h"
}
/*
* Analyze context state to see if we can provide a fast triangle function
* Otherwise, return NULL.
*/
static swrast_tri_func dmesa_choose_tri_function (GLcontext *ctx)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL;
if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL;
if (ctx->Texture._ReallyEnabled) return (swrast_tri_func) NULL;
if (ctx->Light.ShadeModel==GL_SMOOTH
&& swrast->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
&& ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Polygon.StippleFlag==GL_FALSE) {
return tri_rgb_smooth_z;
}
if (ctx->Light.ShadeModel==GL_FLAT
&& swrast->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
&& ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Polygon.StippleFlag==GL_FALSE) {
return tri_rgb_flat_z;
}
if (swrast->_RasterMask==0 /* no depth test */
&& ctx->Light.ShadeModel==GL_SMOOTH
&& ctx->Polygon.StippleFlag==GL_FALSE) {
return tri_rgb_smooth;
}
if (swrast->_RasterMask==0 /* no depth test */
&& ctx->Light.ShadeModel==GL_FLAT
&& ctx->Polygon.StippleFlag==GL_FALSE) {
return tri_rgb_flat;
}
return (swrast_tri_func)NULL;
}
/* Override for the swrast triangle-selection function. Try to use one
* of our internal line functions, otherwise fall back to the
* standard swrast functions.
*/
static void dmesa_choose_tri (GLcontext *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
if (!(swrast->Triangle=dmesa_choose_tri_function(ctx)))
_swrast_choose_triangle(ctx);
}
/**********************************************************************/
/***** Miscellaneous device driver funcs *****/
/**********************************************************************/
static void clear_color (GLcontext *ctx, const GLchan color[4])
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
c->ClearColor = vl_mixrgba(color);
}
static void clear (GLcontext *ctx, GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height)
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
const GLuint *colorMask = (GLuint *)&ctx->Color.ColorMask;
DMesaBuffer b = c->Buffer;
/*
* Clear the specified region of the buffers indicated by 'mask'
* using the clear color or index as specified by one of the two
* functions above.
* If all==GL_TRUE, clear whole buffer, else just clear region defined
* by x,y,width,height
*/
/* we can't handle color or index masking */
if (*colorMask==0xffffffff) {
if (mask & DD_BACK_LEFT_BIT) {
if (all) {
vl_clear(b->the_window, b->len, c->ClearColor);
} else {
vl_rect(b->the_window, x, y, width, height, c->ClearColor);
}
mask &= ~DD_BACK_LEFT_BIT;
}
}
if (mask) {
_swrast_Clear(ctx, mask, all, x, y, width, height);
}
}
/*
* Set the current reading buffer.
*/
static void set_read_buffer (GLcontext *ctx, GLframebuffer *buffer,
GLenum mode)
{
/*
DMesaContext c = (DMesaContext)ctx->DriverCtx;
dmesa_update_state(ctx);
*/
}
/*
* Set the destination/draw buffer.
*/
static GLboolean set_draw_buffer (GLcontext *ctx, GLenum mode)
{
if (mode==GL_BACK_LEFT) {
return GL_TRUE;
} else {
return GL_FALSE;
}
}
/*
* Return the width and height of the current buffer.
* If anything special has to been done when the buffer/window is
* resized, do it now.
*/
static void get_buffer_size (GLframebuffer *buffer, GLuint *width, GLuint *height)
{
DMesaBuffer b = (DMesaBuffer)buffer;
*width = b->width;
*height = b->height;
}
static const GLubyte* get_string (GLcontext *ctx, GLenum name)
{
switch (name) {
case GL_RENDERER:
return (const GLubyte *)"Mesa DOS\0DJGPP port (c) Borca Daniel 31-mar-2002";
default:
return NULL;
}
}
/**********************************************************************/
/***** Miscellaneous device driver funcs *****/
/***** Note that these functions are mandatory *****/
/**********************************************************************/
/* OPTIONAL FUNCTION: implements glFinish if possible */
static void finish (GLcontext *ctx)
{
/*
DMesaContext c = (DMesaContext)ctx->DriverCtx;
*/
}
/* OPTIONAL FUNCTION: implements glFlush if possible */
static void flush (GLcontext *ctx)
{
/*
DMesaContext c = (DMesaContext)ctx->DriverCtx;
*/
}
/**********************************************************************/
/**********************************************************************/
#define DMESA_NEW_TRIANGLE (_NEW_POLYGON | \
_NEW_TEXTURE | \
_NEW_LIGHT | \
_NEW_DEPTH | \
_NEW_RENDERMODE | \
_SWRAST_NEW_RASTERMASK)
/* Extend the software rasterizer with our line and triangle
* functions.
*/
static void dmesa_register_swrast_functions (GLcontext *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
swrast->choose_triangle = dmesa_choose_tri;
swrast->invalidate_triangle |= DMESA_NEW_TRIANGLE;
}
/* Setup pointers and other driver state that is constant for the life
* of a context.
*/
void dmesa_init_pointers (GLcontext *ctx)
{
TNLcontext *tnl;
ctx->Driver.UpdateState = dmesa_update_state;
ctx->Driver.GetString = get_string;
ctx->Driver.GetBufferSize = get_buffer_size;
ctx->Driver.Flush = flush;
ctx->Driver.Finish = finish;
/* Software rasterizer pixel paths:
*/
ctx->Driver.Accum = _swrast_Accum;
ctx->Driver.Bitmap = _swrast_Bitmap;
ctx->Driver.Clear = clear;
ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
ctx->Driver.CopyPixels = _swrast_CopyPixels;
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = _swrast_ReadPixels;
/* Software texture functions:
*/
ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format;
ctx->Driver.TexImage1D = _mesa_store_teximage1d;
ctx->Driver.TexImage2D = _mesa_store_teximage2d;
ctx->Driver.TexImage3D = _mesa_store_teximage3d;
ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d;
ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d;
ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d;
ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage;
ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d;
ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d;
ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d;
ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d;
ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d;
ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat;
ctx->Driver.CompressedTextureSize = _mesa_compressed_texture_size;
ctx->Driver.GetCompressedTexImage = _mesa_get_compressed_teximage;
/* Swrast hooks for imaging extensions:
*/
ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
/* Statechange callbacks:
*/
ctx->Driver.SetDrawBuffer = set_draw_buffer;
ctx->Driver.ClearColor = clear_color;
/* Initialize the TNL driver interface:
*/
tnl = TNL_CONTEXT(ctx);
tnl->Driver.RunPipeline = _tnl_run_pipeline;
/* Install swsetup for tnl->Driver.Render.*:
*/
_swsetup_Wakeup(ctx);
}
static void dmesa_update_state (GLcontext *ctx, GLuint new_state)
{
DMesaContext c = (DMesaContext)ctx->DriverCtx;
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
/* Initialize all the pointers in the DD struct. Do this whenever */
/* a new context is made current or we change buffers via set_buffer! */
_swrast_InvalidateState(ctx, new_state);
_swsetup_InvalidateState(ctx, new_state);
_ac_InvalidateState(ctx, new_state);
_tnl_InvalidateState(ctx, new_state);
swdd->SetReadBuffer = set_read_buffer;
/* RGB(A) span/pixel functions */
swdd->WriteRGBASpan = write_rgba_span;
swdd->WriteRGBSpan = write_rgb_span;
swdd->WriteMonoRGBASpan = write_mono_rgba_span;
swdd->WriteRGBAPixels = write_rgba_pixels;
swdd->WriteMonoRGBAPixels = write_mono_rgba_pixels;
swdd->ReadRGBASpan = read_rgba_span;
swdd->ReadRGBAPixels = read_rgba_pixels;
}
/**********************************************************************/
/***** DMesa Public API Functions *****/
/**********************************************************************/
/*
* The exact arguments to this function will depend on your window system
*/
DMesaVisual DMesaCreateVisual (GLint width, GLint height, GLint colDepth,
GLboolean dbFlag, GLint depthSize,
GLint stencilSize,
GLint accumSize)
{
DMesaVisual v;
GLint redBits, greenBits, blueBits, alphaBits;
if (!dbFlag) {
return NULL;
}
alphaBits = 0;
switch (colDepth) {
case 15:
redBits = 5;
greenBits = 5;
blueBits = 5;
break;
case 16:
redBits = 5;
greenBits = 6;
blueBits = 5;
break;
case 32:
alphaBits = 8;
case 24:
redBits = 8;
greenBits = 8;
blueBits = 8;
break;
default:
return NULL;
}
if (vl_video_init(width, height, colDepth)!=0) {
return NULL;
}
if ((v=(DMesaVisual)calloc(1, sizeof(struct dmesa_visual)))!=NULL) {
/* Create core visual */
v->gl_visual = _mesa_create_visual(colDepth>8, /* rgb */
dbFlag,
GL_FALSE, /* stereo */
redBits,
greenBits,
blueBits,
alphaBits,
0, /* indexBits */
depthSize,
stencilSize,
accumSize, /* accumRed */
accumSize, /* accumGreen */
accumSize, /* accumBlue */
alphaBits?accumSize:0, /* accumAlpha */
1); /* numSamples */
v->depth = colDepth;
v->db_flag = dbFlag;
}
return v;
}
void DMesaDestroyVisual (DMesaVisual v)
{
vl_video_exit(!0);
_mesa_destroy_visual(v->gl_visual);
free(v);
}
DMesaBuffer DMesaCreateBuffer (DMesaVisual visual,
GLint xpos, GLint ypos,
GLint width, GLint height)
{
DMesaBuffer b;
if ((b=(DMesaBuffer)calloc(1, sizeof(struct dmesa_buffer)))!=NULL) {
_mesa_initialize_framebuffer(&b->gl_buffer,
visual->gl_visual,
visual->gl_visual->depthBits > 0,
visual->gl_visual->stencilBits > 0,
visual->gl_visual->accumRedBits > 0,
visual->gl_visual->alphaBits > 0);
b->xpos = xpos;
b->ypos = ypos;
b->width = width;
b->height = height;
b->bypp = (visual->depth+7)/8;
}
return b;
}
void DMesaDestroyBuffer (DMesaBuffer b)
{
free(b->the_window);
_mesa_free_framebuffer_data(&b->gl_buffer);
free(b);
}
DMesaContext DMesaCreateContext (DMesaVisual visual,
DMesaContext share)
{
DMesaContext c;
GLboolean direct = GL_FALSE;
if ((c=(DMesaContext)calloc(1, sizeof(struct dmesa_context)))!=NULL) {
c->gl_ctx = _mesa_create_context(visual->gl_visual,
share ? share->gl_ctx : NULL,
(void *)c, direct);
_mesa_enable_sw_extensions(c->gl_ctx);
_mesa_enable_1_3_extensions(c->gl_ctx);
/* you probably have to do a bunch of other initializations here. */
c->visual = visual;
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext(c->gl_ctx);
_ac_CreateContext(c->gl_ctx);
_tnl_CreateContext(c->gl_ctx);
_swsetup_CreateContext(c->gl_ctx);
dmesa_init_pointers(c->gl_ctx);
dmesa_register_swrast_functions(c->gl_ctx);
}
return c;
}
void DMesaDestroyContext (DMesaContext c)
{
_mesa_destroy_context(c->gl_ctx);
free(c);
}
GLboolean DMesaViewport (DMesaBuffer b,
GLint xpos, GLint ypos,
GLint width, GLint height)
{
void *new_window;
if ((new_window=vl_sync_buffer(b->the_window, xpos, ypos, width, height))==NULL) {
return GL_FALSE;
} else {
b->the_window = new_window;
b->xpos = xpos;
b->ypos = ypos;
b->width = width;
b->height = height;
b->bwidth = width * b->bypp;
b->len = b->bwidth * height;
return GL_TRUE;
}
}
/*
* Make the specified context and buffer the current one.
*/
GLboolean DMesaMakeCurrent (DMesaContext c, DMesaBuffer b)
{
if (c&&b) {
if (!DMesaViewport(b, b->xpos, b->ypos, b->width, b->height)) {
return GL_FALSE;
}
c->Buffer = b;
dmesa_update_state(c->gl_ctx, 0);
_mesa_make_current(c->gl_ctx, &b->gl_buffer);
if (c->gl_ctx->Viewport.Width==0) {
/* initialize viewport to window size */
_mesa_Viewport(0, 0, b->width, b->height);
}
} else {
/* Detach */
_mesa_make_current(NULL, NULL);
}
return GL_TRUE;
}
void DMesaSwapBuffers (DMesaBuffer b)
{
/* copy/swap back buffer to front if applicable */
vl_flip(b->the_window, b->bwidth, b->height);
}

File diff suppressed because it is too large Load Diff

123
src/mesa/drivers/dos/dpmi.c Normal file
View File

@@ -0,0 +1,123 @@
/*
* 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 device driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#include <dpmi.h>
#include "dpmiint.h"
/* _create_linear_mapping:
* Maps a physical address range into linear memory.
*/
static int _create_linear_mapping (unsigned long *linear, unsigned long physaddr, int size)
{
__dpmi_meminfo meminfo;
if (physaddr >= 0x100000) {
/* map into linear memory */
meminfo.address = physaddr;
meminfo.size = size;
if (__dpmi_physical_address_mapping(&meminfo) != 0)
return -1;
*linear = meminfo.address;
} else {
/* exploit 1 -> 1 physical to linear mapping in low megabyte */
*linear = physaddr;
}
return 0;
}
/* _remove_linear_mapping:
* Frees the DPMI resources being used to map a linear address range.
*/
static void _remove_linear_mapping (unsigned long *linear)
{
__dpmi_meminfo meminfo;
if (*linear) {
if (*linear >= 0x100000) {
meminfo.address = *linear;
__dpmi_free_physical_address_mapping(&meminfo);
}
*linear = 0;
}
}
/* _create_selector:
* Allocates a selector to access a region of linear memory.
*/
int _create_selector (int *segment, unsigned long base, int size)
{
/* allocate an ldt descriptor */
if ((*segment=__dpmi_allocate_ldt_descriptors(1)) < 0) {
*segment = 0;
return -1;
}
/* create the linear mapping */
if (_create_linear_mapping(&base, base, size)) {
__dpmi_free_ldt_descriptor(*segment);
*segment = 0;
return -1;
}
/* set the descriptor base and limit */
__dpmi_set_segment_base_address(*segment, base);
__dpmi_set_segment_limit(*segment, MAX(size-1, 0xFFFF));
return 0;
}
/* _remove_selector:
* Frees a DPMI segment selector.
*/
void _remove_selector (int *segment)
{
if (*segment) {
unsigned long base;
__dpmi_get_segment_base_address(*segment, &base);
_remove_linear_mapping(&base);
__dpmi_free_ldt_descriptor(*segment);
*segment = 0;
}
}

View File

@@ -0,0 +1,48 @@
/*
* 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 device driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#ifndef DPMIINT_H_included
#define DPMIINT_H_included
#ifndef NULL
#define NULL 0
#endif
#ifndef MAX
#define MAX(x, y) (((x)<(y))?(y):(x))
#endif
int _create_selector (int *segment, unsigned long base, int size);
void _remove_selector (int *segment);
#endif

View File

@@ -0,0 +1,623 @@
/*
* 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 device driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#include <dpmi.h>
#include <stdlib.h>
#include <string.h>
#include <stubinfo.h>
#include <sys/exceptn.h>
#include <sys/segments.h>
#include <sys/farptr.h>
#include "video.h"
#include "dpmiint.h"
typedef unsigned char word8;
typedef unsigned short word16;
typedef unsigned long word32;
typedef struct vl_mode {
int mode;
int xres, yres;
int scanlen;
int bpp;
} vl_mode;
#define _16_ *(word16 *)&
#define _32_ *(word32 *)&
static int init;
static vl_mode modes[64];
/* card specific: valid forever */
static word16 vesa_ver;
static word32 hw_granularity, hw_linearfb;
static unsigned int gran_shift, gran_mask;
/* based upon mode specific data: valid entire session */
static int video_selector, banked_selector, linear_selector;
static int video_scanlen, video_bypp;
/* valid until next buffer */
static int current_offset, current_delta, current_width;
/* lookup table for scaling 5 bit colors up to 8 bits */
static int _rgb_scale_5[32] =
{
0, 8, 16, 24, 32, 41, 49, 57,
65, 74, 82, 90, 98, 106, 115, 123,
131, 139, 148, 156, 164, 172, 180, 189,
197, 205, 213, 222, 230, 238, 246, 255
};
/* lookup table for scaling 6 bit colors up to 8 bits */
static int _rgb_scale_6[64] =
{
0, 4, 8, 12, 16, 20, 24, 28,
32, 36, 40, 44, 48, 52, 56, 60,
64, 68, 72, 76, 80, 85, 89, 93,
97, 101, 105, 109, 113, 117, 121, 125,
129, 133, 137, 141, 145, 149, 153, 157,
161, 165, 170, 174, 178, 182, 186, 190,
194, 198, 202, 206, 210, 214, 218, 222,
226, 230, 234, 238, 242, 246, 250, 255
};
/*
* virtual clearing
*/
void (*vl_clear) (void *buffer, int len, int color);
#define v_clear15 v_clear16
extern void v_clear16 (void *buffer, int len, int color);
extern void v_clear32 (void *buffer, int len, int color);
__asm__("\n\
.text \n\
.balign 4 \n\
.global _v_clear16 \n\
_v_clear16: \n\
movl 12(%esp), %eax \n\
pushw %ax \n\
pushw %ax \n\
popl %eax \n\
jmp _v_clear_common \n\
.balign 4 \n\
.global _v_clear32 \n\
_v_clear32: \n\
movl 12(%esp), %eax \n\
.balign 4 \n\
_v_clear_common: \n\
movl 8(%esp), %ecx \n\
movl 4(%esp), %edx \n\
shrl $2, %ecx \n\
0: \n\
.balign 4 \n\
movl %eax, (%edx) \n\
addl $4, %edx \n\
decl %ecx \n\
jnz 0b \n\
ret");
extern void v_clear24 (void *buffer, int len, int color);
__asm__("\n\
.text \n\
.balign 4 \n\
.global _v_clear24 \n\
_v_clear24: \n\
movl 8(%esp), %edx \n\
movl $0xaaaaaaab, %eax \n\
mull %edx \n\
movl 12(%esp), %eax \n\
movl %edx, %ecx \n\
movl 4(%esp), %edx \n\
pushl %ebx \n\
shrl %ecx \n\
movb 18(%esp), %bl \n\
.balign 4 \n\
0: \n\
movw %ax, (%edx) \n\
movb %bl, 2(%edx) \n\
addl $3, %edx \n\
decl %ecx \n\
jnz 0b \n\
popl %ebx \n\
ret");
/*
* virtual rectangle clearing
*/
void vl_rect (void *buffer, int x, int y, int width, int height, int color)
{
int offset = y*current_width + x;
int delta = current_width - width;
for (y=0; y<height; y++) {
for (x=0; x<width; x++, offset++) {
vl_putpixel(buffer, offset, color);
}
offset += delta;
}
}
/*
* virtual dumping:
*/
void (*vl_flip) (void *buffer, int width, int height);
extern void b_dump_virtual (void *buffer, int width, int height);
__asm__("\n\
.text \n\
.balign 4 \n\
.global _b_dump_virtual \n\
_b_dump_virtual: \n\
pushl %ebx \n\
pushl %esi \n\
pushl %edi \n\
pushl %ebp \n\
movl _video_selector, %fs \n\
movl 4*4+4+0(%esp), %esi \n\
movl _hw_granularity, %ebp \n\
xorl %edx, %edx \n\
movl _current_offset, %eax \n\
divl %ebp \n\
movl %edx, %edi \n\
pushl %eax \n\
movl %eax, %edx \n\
xorl %ebx, %ebx \n\
movw $0x4f05, %ax \n\
int $0x10 \n\
movl _current_delta, %ebx \n\
movl 5*4+4+4(%esp), %ecx \n\
movl 5*4+4+8(%esp), %edx \n\
shrl $2, %ecx \n\
.balign 4 \n\
0: \n\
pushl %ecx \n\
.balign 4 \n\
1: \n\
cmpl %ebp, %edi \n\
jb 2f \n\
pushl %ebx \n\
pushl %edx \n\
incl 12(%esp) \n\
movw $0x4f05, %ax \n\
movl 12(%esp), %edx \n\
xorl %ebx, %ebx \n\
int $0x10 \n\
popl %edx \n\
popl %ebx \n\
subl %ebp, %edi \n\
2: \n\
movl (%esi), %eax \n\
addl $4, %esi \n\
movl %eax, %fs:(%edi) \n\
addl $4, %edi \n\
decl %ecx \n\
jnz 1b \n\
popl %ecx \n\
addl %ebx, %edi \n\
decl %edx \n\
jnz 0b \n\
popl %eax \n\
popl %ebp \n\
popl %edi \n\
popl %esi \n\
popl %ebx \n\
ret");
extern void l_dump_virtual (void *buffer, int width, int height);
__asm__("\n\
.text \n\
.balign 4 \n\
.global _l_dump_virtual \n\
_l_dump_virtual: \n\
pushl %ebx \n\
pushl %esi \n\
pushl %edi \n\
movl _video_selector, %fs \n\
movl 3*4+4+0(%esp), %esi \n\
movl _current_offset, %edi \n\
movl 3*4+4+4(%esp), %ecx \n\
movl 3*4+4+8(%esp), %edx \n\
movl _current_delta, %ebx \n\
shrl $2, %ecx \n\
.balign 4 \n\
0: \n\
pushl %ecx \n\
.balign 4 \n\
1: \n\
movl (%esi), %eax \n\
addl $4, %esi \n\
movl %eax, %fs:(%edi) \n\
addl $4, %edi \n\
decl %ecx \n\
jnz 1b \n\
popl %ecx \n\
addl %ebx, %edi \n\
decl %edx \n\
jnz 0b \n\
popl %edi \n\
popl %esi \n\
popl %ebx \n\
ret");
/*
* mix RGBA components
*/
int (*vl_mixrgba) (const unsigned char rgba[]);
#define vl_mixrgba15 vl_mixrgb15
#define vl_mixrgba16 vl_mixrgb16
#define vl_mixrgba24 vl_mixrgb24
static int vl_mixrgba32 (const unsigned char rgba[])
{
return (rgba[3]<<24)|(rgba[0]<<16)|(rgba[1]<<8)|(rgba[2]);
}
/*
* mix RGB components
*/
int (*vl_mixrgb) (const unsigned char rgb[]);
static int vl_mixrgb15 (const unsigned char rgb[])
{
return ((rgb[0]>>3)<<10)|((rgb[1]>>3)<<5)|(rgb[2]>>3);
}
static int vl_mixrgb16 (const unsigned char rgb[])
{
return ((rgb[0]>>3)<<11)|((rgb[1]>>2)<<5)|(rgb[2]>>3);
}
#define vl_mixrgb24 vl_mixrgb32
static int vl_mixrgb32 (const unsigned char rgb[])
{
return (rgb[0]<<16)|(rgb[1]<<8)|(rgb[2]);
}
/*
* vl_putpixel*
*/
void (*vl_putpixel) (void *buffer, int offset, int color);
#define v_putpixel15 v_putpixel16
extern void v_putpixel16 (void *buffer, int offset, int color);
__asm__("\n\
.text \n\
.balign 4 \n\
.global _v_putpixel16 \n\
_v_putpixel16: \n\
movl 8(%esp), %edx \n\
shll %edx \n\
movl 12(%esp), %eax \n\
addl 4(%esp), %edx \n\
movw %ax, (%edx) \n\
ret");
extern void v_putpixel24 (void *buffer, int offset, int color);
__asm__("\n\
.text \n\
.balign 4 \n\
.global _v_putpixel24 \n\
_v_putpixel24: \n\
movl 8(%esp), %edx \n\
leal (%edx, %edx, 2), %edx \n\
movl 12(%esp), %eax \n\
addl 4(%esp), %edx \n\
movw %ax, (%edx) \n\
shrl $16, %eax \n\
movb %al, 2(%edx) \n\
ret");
extern void v_putpixel32 (void *buffer, int offset, int color);
__asm__("\n\
.text \n\
.balign 4 \n\
.global _v_putpixel32 \n\
_v_putpixel32: \n\
movl 8(%esp), %edx \n\
shll $2, %edx \n\
movl 12(%esp), %eax \n\
addl 4(%esp), %edx \n\
movl %eax, (%edx) \n\
ret");
/*
* get pixel and decompose R, G, B, A
*/
void (*vl_getrgba) (void *buffer, int offset, unsigned char rgba[4]);
/*
* v_getrgba*
*/
static void v_getrgba15 (void *buffer, int offset, unsigned char rgba[4])
{
int c = ((word16 *)buffer)[offset];
rgba[0] = _rgb_scale_5[(c >> 10) & 0x1F];
rgba[1] = _rgb_scale_5[(c >> 5) & 0x1F];
rgba[2] = _rgb_scale_5[c & 0x1F];
rgba[3] = 255;
}
static void v_getrgba16 (void *buffer, int offset, unsigned char rgba[4])
{
int c = ((word16 *)buffer)[offset];
rgba[0] = _rgb_scale_5[(c >> 11) & 0x1F];
rgba[1] = _rgb_scale_6[(c >> 5) & 0x3F];
rgba[2] = _rgb_scale_5[c & 0x1F];
rgba[3] = 255;
}
static void v_getrgba24 (void *buffer, int offset, unsigned char rgba[4])
{
int c = *(word32 *)((long)buffer+offset*3);
rgba[0] = c >> 16;
rgba[1] = c >> 8;
rgba[2] = c;
rgba[3] = 255;
}
static void v_getrgba32 (void *buffer, int offset, unsigned char rgba[4])
{
int c = ((word32 *)buffer)[offset];
rgba[0] = c >> 16;
rgba[1] = c >> 8;
rgba[2] = c;
rgba[3] = c >> 24;
}
/*
* sync buffer with video hardware
*/
void *vl_sync_buffer (void *buffer, int x, int y, int width, int height)
{
void *newbuf;
if (width&3) {
return NULL;
} else {
if ((newbuf=realloc(buffer, width*height*video_bypp))!=NULL) {
current_offset = video_scanlen * y + video_bypp * x;
current_width = width;
current_delta = video_scanlen - video_bypp * width;
}
return newbuf;
}
}
/*
* attempts to detect VESA and video modes
*/
static word16 vl_vesa_init (void)
{
__dpmi_regs r;
unsigned short *p;
vl_mode *q;
char vesa_info[512], tmp[512];
int maxsize = 0;
_farpokel(_stubinfo->ds_selector, 0, 0x32454256);
r.x.ax = 0x4f00;
r.x.di = 0;
r.x.es = _stubinfo->ds_segment;
__dpmi_int(0x10, &r);
if (r.x.ax==0x004f) {
movedata(_stubinfo->ds_selector, 0, _my_ds(), (unsigned)vesa_info, 512);
if ((_32_ vesa_info[0])==0x41534556) {
p = (unsigned short *)(((_16_ vesa_info[0x10])<<4) + (_16_ vesa_info[0x0e]));
q = modes;
do {
if ((q->mode=_farpeekw(__djgpp_dos_sel, (unsigned long)(p++)))==0xffff) {
break;
}
r.x.ax = 0x4f01;
r.x.cx = q->mode;
r.x.di = 512;
r.x.es = _stubinfo->ds_segment;
__dpmi_int(0x10, &r);
movedata(_stubinfo->ds_selector, 512, _my_ds(), (unsigned)tmp, 256);
switch (tmp[0x19]) {
case 16:
q->bpp = tmp[0x1f] + tmp[0x21] + tmp[0x23];
break;
case 15:
case 24:
case 32:
q->bpp = tmp[0x19];
break;
default:
q->bpp = 0;
}
if ((r.x.ax==0x004f)&&((tmp[0]&0x11)==0x11)&&q->bpp) {
q->xres = _16_ tmp[0x12];
q->yres = _16_ tmp[0x14];
q->scanlen = _16_ tmp[0x10];
hw_granularity = (_16_ tmp[4])<<10;
if (tmp[0]&0x80) {
*(q+1) = *q++;
hw_linearfb = _32_ tmp[0x28];
q->mode |= 0x4000;
}
if (maxsize<(q->scanlen*q->yres)) {
maxsize = q->scanlen*q->yres;
}
q++;
}
} while (!0);
if (hw_linearfb) {
maxsize = ((maxsize+0xfffUL)&~0xfffUL);
if (_create_selector(&linear_selector, hw_linearfb, maxsize)) {
return 0;
}
}
if (_create_selector(&banked_selector, 0xa0000, hw_granularity)) {
_remove_selector(&linear_selector);
return 0;
}
return _16_ vesa_info[4];
}
}
return 0;
}
/*
* setup mode
*/
static int vl_setup_mode (vl_mode *p)
{
if (p->mode&0x4000) {
video_selector = linear_selector;
vl_flip = l_dump_virtual;
} else {
{ int n; for (gran_shift=0, n=hw_granularity; n; gran_shift++, n>>=1) ; }
gran_mask = (1<<(--gran_shift)) - 1;
if (hw_granularity!=(gran_mask+1)) {
return -1;
}
video_selector = banked_selector;
vl_flip = b_dump_virtual;
}
#define INITPTR(bpp) \
vl_putpixel = v_putpixel##bpp; \
vl_getrgba = v_getrgba##bpp; \
vl_clear = v_clear##bpp; \
vl_mixrgb = vl_mixrgb##bpp; \
vl_mixrgba = vl_mixrgba##bpp;
switch (p->bpp) {
case 15:
INITPTR(15);
break;
case 16:
INITPTR(16);
break;
case 24:
INITPTR(24);
break;
case 32:
INITPTR(32);
break;
default:
return -1;
}
#undef INITPTR
video_bypp = (p->bpp+7)/8;
video_scanlen = p->scanlen;
return 0;
}
/*
* shutdown the video engine
*/
void vl_video_exit (int textmode)
{
if (init) {
if (textmode) {
__asm__("movw $0x3, %%ax; int $0x10":::"%eax");
}
_remove_selector(&linear_selector);
_remove_selector(&banked_selector);
init = !init;
}
}
/*
* initialize video engine
*
* success: 0
* failure: -1
*/
int vl_video_init (int width, int height, int bpp)
{
vl_mode *p, *q;
unsigned int min;
/* check for prior initialization */
if (init) {
return 0;
}
/* initialize hardware */
if (!(vesa_ver=vl_vesa_init())) {
return -1;
}
init = !init;
/* search for a mode that fits our request */
for (min=-1, p=NULL, q=modes; q->mode!=0xffff; q++) {
if ((q->xres>=width)&&(q->yres>=height)&&(q->bpp==bpp)) {
if (min>=(unsigned)(q->xres*q->yres)) {
min = q->xres*q->yres;
p = q;
}
}
}
if (p) {
vl_setup_mode(p);
__asm__("movw $0x4f02, %%ax; int $0x10"::"b"(p->mode):"%eax");
return 0;
} else {
/* no suitable mode found, abort */
vl_video_exit(0);
return -1;
}
}

View File

@@ -0,0 +1,52 @@
/*
* 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 device driver v1.0 for Mesa 4.0
*
* Copyright (C) 2002 - Borca Daniel
* Email : dborca@yahoo.com
* Web : http://www.geocities.com/dborca
*/
#ifndef VIDEO_H_included
#define VIDEO_H_included
int vl_video_init (int width, int height, int bpp);
void vl_video_exit (int textmode);
void *vl_sync_buffer (void *buffer, int x, int y, int width, int height);
extern void (*vl_clear) (void *buffer, int len, int color);
void vl_rect (void *buffer, int x, int y, int width, int height, int color);
void (*vl_flip) (void *buffer, int width, int height);
extern int (*vl_mixrgba) (const unsigned char rgba[]);
extern int (*vl_mixrgb) (const unsigned char rgb[]);
extern void (*vl_putpixel) (void *buffer, int offset, int color);
extern void (*vl_getrgba) (void *buffer, int offset, unsigned char rgba[4]);
#endif

View File

@@ -295,7 +295,7 @@ void GGIread_rgba_pixels(const GLcontext *ctx,
int GGIsetup_driver(GGIMesaContext ggictx, struct ggi_mesa_info *info)
{
GLcontext *ctx = ggictx->gl_ctx;
#if 0
ctx->Driver.WriteRGBASpan = GGIwrite_rgba_span;
ctx->Driver.WriteRGBSpan = GGIwrite_rgb_span;
// ctx->Driver.WriteMonoRGBASpan = GGIwrite_mono_span;
@@ -312,7 +312,7 @@ int GGIsetup_driver(GGIMesaContext ggictx, struct ggi_mesa_info *info)
ctx->Driver.ReadRGBASpan = GGIread_rgba_span;
ctx->Driver.ReadCI32Pixels = GGIread_ci32_pixels;
ctx->Driver.ReadRGBAPixels = GGIread_rgba_pixels;
#endif
info->red_bits = R;
info->green_bits =G;
info->blue_bits = B;

View File

@@ -33,6 +33,7 @@
#include "swrast/s_context.h"
#include "swrast/s_depth.h"
#include "swrast/s_triangle.h"
#include "swrast/s_trispan.h"
/**********************************************************************/
/***** Write spans of pixels *****/
@@ -303,7 +304,7 @@ static swrast_tri_func ggimesa_stubs_get_triangle_func(GLcontext *ctx);
int GGIsetup_driver(GGIMesaContext ggictx, struct ggi_mesa_info *info)
{
GLcontext *ctx = ggictx->gl_ctx;
#if 0
ctx->Driver.WriteRGBASpan = GGIwrite_rgba_span;
ctx->Driver.WriteRGBSpan = GGIwrite_rgb_span;
ctx->Driver.WriteRGBAPixels = GGIwrite_rgba_pixels;
@@ -316,13 +317,15 @@ int GGIsetup_driver(GGIMesaContext ggictx, struct ggi_mesa_info *info)
ctx->Driver.ReadRGBASpan = GGIread_rgba_span;
ctx->Driver.ReadCI32Pixels = GGIread_ci32_pixels;
ctx->Driver.ReadRGBAPixels = GGIread_rgba_pixels;
#endif
return 0;
}
void GGIupdate_state(GLcontext *ctx)
{
#if 0
ctx->Driver.TriangleFunc = _swsetup_Triangle;
#endif
}

View File

@@ -224,6 +224,7 @@ static void gl_ggiSetupPointers(GLcontext *ctx)
ctx->Driver.ColorMask = gl_ggiColorMask;
ctx->Driver.Enable = gl_ggiEnable;
#if 0
ctx->Driver.SetDrawBuffer = gl_ggiSetDrawBuffer;
ctx->Driver.SetReadBuffer = gl_ggiSetReadBuffer;
@@ -239,7 +240,7 @@ static void gl_ggiSetupPointers(GLcontext *ctx)
ctx->Driver.LineFunc = _swsetup_Line;
ctx->Driver.TriangleFunc = _swsetup_Triangle;
ctx->Driver.QuadFunc = _swsetup_Quad;
#endif
}
static int gl_ggiInitInfo(GGIMesaContext ctx, struct ggi_mesa_info *info)

View File

@@ -1,4 +1,4 @@
/* $Id: fxdd.c,v 1.84 2001/09/23 16:50:01 brianp Exp $ */
/* $Id: fxdd.c,v 1.84.2.1 2002/03/16 00:50:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -103,19 +103,22 @@ fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder)
/* Return buffer size information */
static void
fxDDBufferSize(GLcontext * ctx, GLuint * width, GLuint * height)
fxDDBufferSize(GLframebuffer *buffer, GLuint * width, GLuint * height)
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
GET_CURRENT_CONTEXT(ctx);
if (ctx && ctx->DriverCtx) {
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxDDBufferSize(...) Start\n");
}
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxDDBufferSize(...) Start\n");
}
*width = fxMesa->width;
*height = fxMesa->height;
*width = fxMesa->width;
*height = fxMesa->height;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxDDBufferSize(...) End\n");
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxDDBufferSize(...) End\n");
}
}
}
@@ -1002,7 +1005,7 @@ fxSetupDDPointers(GLcontext * ctx)
ctx->Driver.CopyPixels = _swrast_CopyPixels;
ctx->Driver.DrawPixels = _swrast_DrawPixels;
ctx->Driver.ReadPixels = fxDDReadPixels;
ctx->Driver.ResizeBuffersMESA = _swrast_alloc_buffers;
ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
ctx->Driver.Finish = fxDDFinish;
ctx->Driver.Flush = NULL;
ctx->Driver.ChooseTextureFormat = fxDDChooseTextureFormat;

View File

@@ -1,4 +1,4 @@
/* $Id: fxddtex.c,v 1.45 2001/09/23 16:50:01 brianp Exp $ */
/* $Id: fxddtex.c,v 1.45.2.1 2001/11/06 16:00:58 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -327,7 +327,7 @@ fxDDTexDel(GLcontext * ctx, struct gl_texture_object *tObj)
tfxTexInfo *ti = fxTMGetTexInfo(tObj);
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxDDTexDel(%d,%p)\n", tObj->Name, ti);
fprintf(stderr, "fxmesa: fxDDTexDel(%d,%p)\n", tObj->Name, (void *) ti);
}
if (!ti)

View File

@@ -1,4 +1,4 @@
/* $Id: fxtris.c,v 1.17 2001/09/23 16:50:01 brianp Exp $ */
/* $Id: fxtris.c,v 1.17.2.1 2001/11/06 16:00:58 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -214,7 +214,7 @@ fx_fallback_point( fxMesaContext fxMesa,
static void fx_print_vertex( GLcontext *ctx, const GrVertex *v )
{
fprintf(stderr, "vertex at %p\n", v);
fprintf(stderr, "vertex at %p\n", (void *) v);
fprintf(stderr, "x %f y %f z %f oow %f\n",
v->x, v->y, v->ooz, v->oow);

View File

@@ -1,10 +1,10 @@
/* $Id: osmesa.c,v 1.71 2001/09/25 17:38:11 keithw Exp $ */
/* $Id: osmesa.c,v 1.71.2.4 2002/03/25 23:52:34 kschultz Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
* Version: 4.0.2
*
* Copyright (C) 1999-2001 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"),
@@ -427,21 +427,19 @@ static void compute_row_addresses( OSMesaContext ctx )
* with the lower-left image pixel stored in the first array position
* (ie. bottom-to-top).
*
* Since the only type initially supported is GL_UNSIGNED_BYTE, if the
* context is in RGBA mode, each pixel will be stored as a 4-byte RGBA
* value. If the context is in color indexed mode, each pixel will be
* stored as a 1-byte value.
*
* If the context's viewport hasn't been initialized yet, it will now be
* initialized to (0,0,width,height).
*
* Input: ctx - the rendering context
* buffer - the image buffer memory
* type - data type for pixel components, only GL_UNSIGNED_BYTE
* and GL_UNSIGNED_SHORT_5_6_5 supported now.
* type - data type for pixel components
* Normally, only GL_UNSIGNED_BYTE and GL_UNSIGNED_SHORT_5_6_5
* are supported. But if Mesa's been compiled with CHAN_BITS==16
* then type must be GL_UNSIGNED_SHORT. And if Mesa's been build
* with CHAN_BITS==32 then type must be GL_FLOAT.
* width, height - size of image buffer in pixels, at least 1
* Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx,
* invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1,
* invalid buffer address, invalid type, width<1, height<1,
* width>internal limit or height>internal limit.
*/
GLAPI GLboolean GLAPIENTRY
@@ -878,11 +876,21 @@ static void clear( GLcontext *ctx, GLbitfield mask, GLboolean all,
static void buffer_size( GLcontext *ctx, GLuint *width, GLuint *height )
static void buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
{
OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
*width = osmesa->width;
*height = osmesa->height;
#ifdef WIN32
/* Hack to get around problems with exporting glapi_Context from MesaGL
and importing into OSMesa. */
GLcontext *ctx = (GLcontext *) _glapi_get_context();
#else
GET_CURRENT_CONTEXT(ctx);
#endif
(void) buffer;
if (ctx) {
OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
*width = osmesa->width;
*height = osmesa->height;
}
}
@@ -1997,7 +2005,13 @@ static const GLubyte *get_string( GLcontext *ctx, GLenum name )
(void) ctx;
switch (name) {
case GL_RENDERER:
#if CHAN_BITS == 32
return (const GLubyte *) "Mesa OffScreen32";
#elif CHAN_BITS == 16
return (const GLubyte *) "Mesa OffScreen16";
#else
return (const GLubyte *) "Mesa OffScreen";
#endif
default:
return NULL;
}
@@ -2020,8 +2034,8 @@ static void osmesa_update_state( GLcontext *ctx, GLuint new_state )
ctx->Driver.GetString = get_string;
ctx->Driver.UpdateState = osmesa_update_state;
ctx->Driver.SetDrawBuffer = set_draw_buffer;
ctx->Driver.ResizeBuffersMESA = _swrast_alloc_buffers;
ctx->Driver.GetBufferSize = buffer_size;
ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
ctx->Driver.Accum = _swrast_Accum;
ctx->Driver.Bitmap = _swrast_Bitmap;

View File

@@ -1,5 +1,5 @@
DESCRIPTION 'Mesa OSMesa lib for Win32'
VERSION 3.5
VERSION 4.0
EXPORTS
OSMesaCreateContext

View File

@@ -1,4 +1,4 @@
/* $Id: svgamesa.c,v 1.16 2001/09/23 16:11:27 brianp Exp $ */
/* $Id: svgamesa.c,v 1.16.2.1 2002/03/16 00:50:12 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -210,7 +210,7 @@ static void copy_buffer( const GLubyte * buffer) {
}
}
static void get_buffer_size( GLcontext *ctx, GLuint *width, GLuint *height )
static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
{
*width = SVGAMesa->width = vga_getxdim();
*height = SVGAMesa->height = vga_getydim();
@@ -286,6 +286,7 @@ static void svgamesa_update_state( GLcontext *ctx, GLuint new_state )
ctx->Driver.GetBufferSize = get_buffer_size;
ctx->Driver.SetDrawBuffer = set_draw_buffer;
ctx->Driver.ResizeBuffers = _swrast_alloc_buffers;
/* Software rasterizer pixel paths:
*/

View File

@@ -1,499 +1,521 @@
/* File name : colors.h
* Version : 2.3
*
* Header file for display driver for Mesa 2.3 under
* Windows95 and WindowsNT
* This file defines macros and global variables needed
* for converting color format
*
* Copyright (C) 1996- Li Wei
* Address : Institute of Artificial Intelligence
* : & Robotics
* : Xi'an Jiaotong University
* Email : liwei@aiar.xjtu.edu.cn
* Web page : http://sun.aiar.xjtu.edu.cn
*
* This file and its associations are partially based on the
* Windows NT driver for Mesa, written by Mark Leaming
* (mark@rsinc.com).
*/
/* $Log: ddcolors.h 1997/6/14 by Li Wei(liwei@aiar.xjtu.edu.cn)
* Macros for pixel format defined
*/
/*
/* File name : colors.h
* Version : 2.3
*
* Header file for display driver for Mesa 2.3 under
* Windows95 and WindowsNT
* This file defines macros and global variables needed
* for converting color format
*
* Copyright (C) 1996- Li Wei
* Address : Institute of Artificial Intelligence
* : & Robotics
* : Xi'an Jiaotong University
* Email : liwei@aiar.xjtu.edu.cn
* Web page : http://sun.aiar.xjtu.edu.cn
*
* This file and its associations are partially based on the
* Windows NT driver for Mesa, written by Mark Leaming
* (mark@rsinc.com).
*/
/* $Log: ddcolors.h 1997/6/14 by Li Wei(liwei@aiar.xjtu.edu.cn)
* Macros for pixel format defined
*/
/*
* $Log: colors.h,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
* Revision 1.1.1.1.8.2 2002/01/15 16:47:37 kschultz
* Fixed pixel color component problem and clear code for 24-bit Windows
* devices. (Jeff Lewis)
*
* Revision 1.1.1.1.8.1 2002/01/15 16:12:15 kschultz
* Remove trailing CR's from most of the lines. No logical changes.
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.2 1999/01/03 03:08:57 brianp
* Ted Jump's changes
*
* Revision 1.1 1999/01/03 03:08:12 brianp
* Initial revision
*
* Revision 2.0.2 1997/4/30 15:58:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Add LUTs need for dithering
*/
/*
*
* Revision 2.0.2 1997/4/30 15:58:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Add LUTs need for dithering
*/
/*
* $Log: colors.h,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
* Revision 1.1.1.1.8.2 2002/01/15 16:47:37 kschultz
* Fixed pixel color component problem and clear code for 24-bit Windows
* devices. (Jeff Lewis)
*
* Revision 1.1.1.1.8.1 2002/01/15 16:12:15 kschultz
* Remove trailing CR's from most of the lines. No logical changes.
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.2 1999/01/03 03:08:57 brianp
* Ted Jump's changes
*
* Revision 1.1 1999/01/03 03:08:12 brianp
* Initial revision
*
* Revision 2.0.1 1997/4/29 15:52:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Add BGR8 Macro
*/
/*
*
* Revision 2.0.1 1997/4/29 15:52:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Add BGR8 Macro
*/
/*
* $Log: colors.h,v $
* Revision 1.1 1999/08/19 00:55:42 jtg
* Initial revision
* Revision 1.1.1.1.8.2 2002/01/15 16:47:37 kschultz
* Fixed pixel color component problem and clear code for 24-bit Windows
* devices. (Jeff Lewis)
*
* Revision 1.1.1.1.8.1 2002/01/15 16:12:15 kschultz
* Remove trailing CR's from most of the lines. No logical changes.
*
* Revision 1.1.1.1 1999/08/19 00:55:42 jtg
* Imported sources
*
* Revision 1.2 1999/01/03 03:08:57 brianp
* Ted Jump's changes
*
* Revision 1.1 1999/01/03 03:08:12 brianp
* Initial revision
*
* Revision 2.0 1996/11/15 10:55:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Initial revision
*/
/* Values for wmesa->pixelformat: */
#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */
#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */
#define PF_DITHER8 6 /* Dithered RGB using a lookup table */
#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */
#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */
#define PF_BADFORMAT 11
#define PF_INDEX8 12
char ColorMap16[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,
0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,
0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,
0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,
0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,
0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,
0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,
0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,
0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,
0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,
0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,
0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5)))
#ifdef DDRAW
#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11)))
#else
#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10)))
#endif
#define BGR24(r,g,b) (unsigned long)(((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16))) << 8)
#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16)))
/*
* If pixelformat==PF_8A8B8G8R:
*/
#define PACK_8A8B8G8R( R, G, B, A ) \
( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) )
/*
* If pixelformat==PF_8R8G8B:
*/
#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) )
/*
* If pixelformat==PF_5R6G5B:
*/
#ifdef DDRAW
#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(G&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[R])) << 11)))
#else
#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(ColorMap16[G]) << 5)) | (((WORD)(BYTE)(ColorMap16[R])) << 10)))
#endif
/*----------------------------------------------------------------------------
Division lookup tables. These tables compute 0-255 divided by 51 and
modulo 51. These tables could approximate gamma correction.
*/
char unsigned const aDividedBy51Rounded[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
};
char unsigned const aDividedBy51[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
};
char unsigned const aModulo51[256] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0,
};
/*----------------------------------------------------------------------------
Multiplication LUTs. These compute 0-5 times 6 and 36.
*/
char unsigned const aTimes6[6] =
{
0, 6, 12, 18, 24, 30
};
char unsigned const aTimes36[6] =
{
0, 36, 72, 108, 144, 180
};
/*----------------------------------------------------------------------------
Dither matrices for 8 bit to 2.6 bit halftones.
*/
char unsigned const aHalftone16x16[256] =
{
0, 44, 9, 41, 3, 46, 12, 43, 1, 44, 10, 41, 3, 46, 12, 43,
34, 16, 25, 19, 37, 18, 28, 21, 35, 16, 26, 19, 37, 18, 28, 21,
38, 6, 47, 3, 40, 9, 50, 6, 38, 7, 47, 4, 40, 9, 49, 6,
22, 28, 13, 31, 25, 31, 15, 34, 22, 29, 13, 32, 24, 31, 15, 34,
2, 46, 12, 43, 1, 45, 10, 42, 2, 45, 11, 42, 1, 45, 11, 42,
37, 18, 27, 21, 35, 17, 26, 20, 36, 17, 27, 20, 36, 17, 26, 20,
40, 8, 49, 5, 38, 7, 48, 4, 39, 8, 48, 5, 39, 7, 48, 4,
24, 30, 15, 33, 23, 29, 13, 32, 23, 30, 14, 33, 23, 29, 14, 32,
2, 46, 12, 43, 0, 44, 10, 41, 3, 47, 12, 44, 0, 44, 10, 41,
37, 18, 27, 21, 35, 16, 25, 19, 37, 19, 28, 22, 35, 16, 25, 19,
40, 9, 49, 5, 38, 7, 47, 4, 40, 9, 50, 6, 38, 6, 47, 3,
24, 30, 15, 34, 22, 29, 13, 32, 25, 31, 15, 34, 22, 28, 13, 31,
1, 45, 11, 42, 2, 46, 11, 42, 1, 45, 10, 41, 2, 46, 11, 43,
36, 17, 26, 20, 36, 17, 27, 21, 35, 16, 26, 20, 36, 18, 27, 21,
39, 8, 48, 4, 39, 8, 49, 5, 38, 7, 48, 4, 39, 8, 49, 5,
23, 29, 14, 33, 24, 30, 14, 33, 23, 29, 13, 32, 24, 30, 14, 33,
};
char unsigned const aHalftone8x8[64] =
{
0, 38, 9, 47, 2, 40, 11, 50,
25, 12, 35, 22, 27, 15, 37, 24,
6, 44, 3, 41, 8, 47, 5, 43,
31, 19, 28, 15, 34, 21, 31, 18,
1, 39, 11, 49, 0, 39, 10, 48,
27, 14, 36, 23, 26, 13, 35, 23,
7, 46, 4, 43, 7, 45, 3, 42,
33, 20, 30, 17, 32, 19, 29, 16,
};
char unsigned const aHalftone4x4_1[16] =
{
0, 25, 6, 31,
38, 12, 44, 19,
9, 35, 3, 28,
47, 22, 41, 15
};
char unsigned const aHalftone4x4_2[16] =
{
41, 3, 9, 28,
35, 15, 22, 47,
6, 25, 38, 0,
19, 44, 31, 12
};
/***************************************************************************
aWinGHalftoneTranslation
Translates a 2.6 bit-per-pixel halftoned representation into the
slightly rearranged WinG Halftone Palette.
*/
char unsigned const aWinGHalftoneTranslation[216] =
{
0,
29,
30,
31,
32,
249,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
250,
250,
57,
58,
59,
251,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
250,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
227,
112,
113,
114,
115,
116,
117,
118,
119,
151,
120,
121,
122,
123,
124,
228,
125,
126,
229,
133,
162,
135,
131,
132,
137,
166,
134,
140,
130,
136,
143,
138,
139,
174,
141,
142,
177,
129,
144,
145,
146,
147,
148,
149,
150,
157,
152,
153,
154,
155,
156,
192,
158,
159,
160,
161,
196,
163,
164,
165,
127,
199,
167,
168,
169,
170,
171,
172,
173,
207,
175,
176,
210,
178,
179,
180,
181,
182,
183,
184,
185,
186,
187,
188,
189,
190,
191,
224,
193,
194,
195,
252,
252,
197,
198,
128,
253,
252,
200,
201,
202,
203,
204,
205,
206,
230,
208,
209,
231,
211,
212,
213,
214,
215,
216,
217,
218,
219,
220,
221,
222,
254,
223,
232,
225,
226,
255,
};
*
* Revision 2.0 1996/11/15 10:55:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
* Initial revision
*/
/* Values for wmesa->pixelformat: */
#define PF_8A8B8G8R 3 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
#define PF_8R8G8B 4 /* 32-bit TrueColor: 8-R, 8-G, 8-B */
#define PF_5R6G5B 5 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */
#define PF_DITHER8 6 /* Dithered RGB using a lookup table */
#define PF_LOOKUP 7 /* Undithered RGB using a lookup table */
#define PF_GRAYSCALE 10 /* Grayscale or StaticGray */
#define PF_BADFORMAT 11
#define PF_INDEX8 12
char ColorMap16[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,
0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04,
0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05,
0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06,
0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,
0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09,
0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,0x0A,
0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,
0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,0x0D,
0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,0x0E,
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,
0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,
0x14,0x14,0x14,0x14,0x14,0x14,0x14,0x14,
0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,
0x17,0x17,0x17,0x17,0x17,0x17,0x17,0x17,
0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
0x19,0x19,0x19,0x19,0x19,0x19,0x19,0x19,
0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,0x1A,
0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,
0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,
0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,0x1D,
0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,0x1E,
0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F};
#define BGR8(r,g,b) (unsigned)(((BYTE)(b & 0xc0 | (g & 0xe0)>>2 | (r & 0xe0)>>5)))
#ifdef DDRAW
#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(g&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[r])) << 11)))
#else
#define BGR16(r,g,b) ((WORD)(((BYTE)(ColorMap16[b]) | ((BYTE)(ColorMap16[g]) << 5)) | (((WORD)(BYTE)(ColorMap16[r])) << 10)))
#endif
#define BGR24(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16)))
#define BGR32(r,g,b) (unsigned long)((DWORD)(((BYTE)(b)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(r))<<16)))
/*
* If pixelformat==PF_8A8B8G8R:
*/
#define PACK_8A8B8G8R( R, G, B, A ) \
( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) )
/*
* If pixelformat==PF_8R8G8B:
*/
#define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) )
/*
* If pixelformat==PF_5R6G5B:
*/
#ifdef DDRAW
#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(G&0xfc) << 3)) | (((WORD)(BYTE)(ColorMap16[R])) << 11)))
#else
#define PACK_5R6G5B( R, G, B) ((WORD)(((BYTE)(ColorMap16[B]) | ((BYTE)(ColorMap16[G]) << 5)) | (((WORD)(BYTE)(ColorMap16[R])) << 10)))
#endif
/*----------------------------------------------------------------------------
Division lookup tables. These tables compute 0-255 divided by 51 and
modulo 51. These tables could approximate gamma correction.
*/
char unsigned const aDividedBy51Rounded[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
};
char unsigned const aDividedBy51[256] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
};
char unsigned const aModulo51[256] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
49, 50, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0, 1, 2, 3,
4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0,
};
/*----------------------------------------------------------------------------
Multiplication LUTs. These compute 0-5 times 6 and 36.
*/
char unsigned const aTimes6[6] =
{
0, 6, 12, 18, 24, 30
};
char unsigned const aTimes36[6] =
{
0, 36, 72, 108, 144, 180
};
/*----------------------------------------------------------------------------
Dither matrices for 8 bit to 2.6 bit halftones.
*/
char unsigned const aHalftone16x16[256] =
{
0, 44, 9, 41, 3, 46, 12, 43, 1, 44, 10, 41, 3, 46, 12, 43,
34, 16, 25, 19, 37, 18, 28, 21, 35, 16, 26, 19, 37, 18, 28, 21,
38, 6, 47, 3, 40, 9, 50, 6, 38, 7, 47, 4, 40, 9, 49, 6,
22, 28, 13, 31, 25, 31, 15, 34, 22, 29, 13, 32, 24, 31, 15, 34,
2, 46, 12, 43, 1, 45, 10, 42, 2, 45, 11, 42, 1, 45, 11, 42,
37, 18, 27, 21, 35, 17, 26, 20, 36, 17, 27, 20, 36, 17, 26, 20,
40, 8, 49, 5, 38, 7, 48, 4, 39, 8, 48, 5, 39, 7, 48, 4,
24, 30, 15, 33, 23, 29, 13, 32, 23, 30, 14, 33, 23, 29, 14, 32,
2, 46, 12, 43, 0, 44, 10, 41, 3, 47, 12, 44, 0, 44, 10, 41,
37, 18, 27, 21, 35, 16, 25, 19, 37, 19, 28, 22, 35, 16, 25, 19,
40, 9, 49, 5, 38, 7, 47, 4, 40, 9, 50, 6, 38, 6, 47, 3,
24, 30, 15, 34, 22, 29, 13, 32, 25, 31, 15, 34, 22, 28, 13, 31,
1, 45, 11, 42, 2, 46, 11, 42, 1, 45, 10, 41, 2, 46, 11, 43,
36, 17, 26, 20, 36, 17, 27, 21, 35, 16, 26, 20, 36, 18, 27, 21,
39, 8, 48, 4, 39, 8, 49, 5, 38, 7, 48, 4, 39, 8, 49, 5,
23, 29, 14, 33, 24, 30, 14, 33, 23, 29, 13, 32, 24, 30, 14, 33,
};
char unsigned const aHalftone8x8[64] =
{
0, 38, 9, 47, 2, 40, 11, 50,
25, 12, 35, 22, 27, 15, 37, 24,
6, 44, 3, 41, 8, 47, 5, 43,
31, 19, 28, 15, 34, 21, 31, 18,
1, 39, 11, 49, 0, 39, 10, 48,
27, 14, 36, 23, 26, 13, 35, 23,
7, 46, 4, 43, 7, 45, 3, 42,
33, 20, 30, 17, 32, 19, 29, 16,
};
char unsigned const aHalftone4x4_1[16] =
{
0, 25, 6, 31,
38, 12, 44, 19,
9, 35, 3, 28,
47, 22, 41, 15
};
char unsigned const aHalftone4x4_2[16] =
{
41, 3, 9, 28,
35, 15, 22, 47,
6, 25, 38, 0,
19, 44, 31, 12
};
/***************************************************************************
aWinGHalftoneTranslation
Translates a 2.6 bit-per-pixel halftoned representation into the
slightly rearranged WinG Halftone Palette.
*/
char unsigned const aWinGHalftoneTranslation[216] =
{
0,
29,
30,
31,
32,
249,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
250,
250,
57,
58,
59,
251,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
250,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
227,
112,
113,
114,
115,
116,
117,
118,
119,
151,
120,
121,
122,
123,
124,
228,
125,
126,
229,
133,
162,
135,
131,
132,
137,
166,
134,
140,
130,
136,
143,
138,
139,
174,
141,
142,
177,
129,
144,
145,
146,
147,
148,
149,
150,
157,
152,
153,
154,
155,
156,
192,
158,
159,
160,
161,
196,
163,
164,
165,
127,
199,
167,
168,
169,
170,
171,
172,
173,
207,
175,
176,
210,
178,
179,
180,
181,
182,
183,
184,
185,
186,
187,
188,
189,
190,
191,
224,
193,
194,
195,
252,
252,
197,
198,
128,
253,
252,
200,
201,
202,
203,
204,
205,
206,
230,
208,
209,
231,
211,
212,
213,
214,
215,
216,
217,
218,
219,
220,
221,
222,
254,
223,
232,
225,
226,
255,
};

File diff suppressed because it is too large Load Diff

View File

@@ -57,10 +57,23 @@
#ifndef DDMESADEF_H
#define DDMESADEF_H
// uncomment this to use DirectDraw driver
//#define DDRAW 1
// uncomment this to use a pointer to a function for setting the pixels
// in the buffer
#define COMPILE_SETPIXEL 1
// uncomment this to enable the fast win32 rasterizers ( commented out for MesaGL 4.0 )
// #define FAST_RASTERIZERS 1
// uncomment this to enable setting function pointers once inside of
// WMesaCreateContext instead of on every call to wmesa_update_state()
#define SET_FPOINTERS_ONCE 1
#include <windows.h>
#include <GL\gl.h>
#include "context.h"
#ifdef DDRAW
#define DIRECTDRAW_VERSION 0x0100
#include <ddraw.h>
#endif
//#include "profile.h"
@@ -79,6 +92,9 @@ typedef struct _dibSection{
LPVOID base;
}WMDIBSECTION, *PWMDIBSECTION;
#ifdef COMPILE_SETPIXEL
typedef void (*SETPIXELTYPE)(struct wmesa_context *pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b);
#endif
typedef struct wmesa_context{
GLcontext *gl_ctx; /* The core GL/Mesa context */
@@ -132,15 +148,19 @@ typedef struct wmesa_context{
LPDIRECTDRAWSURFACE lpDDSOffScreen; // DirectDraw off screen surface
LPDIRECTDRAWPALETTE lpDDPal; // DirectDraw palette
BOOL bActive; // is application active?
DDSURFACEDESC ddsd;
int fullScreen;
int gMode ;
DDSURFACEDESC ddsd; // surface description
int fullScreen; // fullscreen ?
int gMode ; // fullscreen mode
LONG oldWndProc; // old Window proc. we need to hook WM_MOVE message to update the drawing rectangle
#endif
RECT rectOffScreen;
RECT rectSurface;
HWND hwnd;
DWORD pitch;
PBYTE addrOffScreen;
#ifdef COMPILE_SETPIXEL
SETPIXELTYPE wmSetPixel;
#endif // COMPILE_SETPIXEL
//#ifdef PROFILE
// MESAPROF profile;
//#endif

View File

@@ -1,10 +1,9 @@
/* $Id: fakeglx.c,v 1.59 2001/10/22 22:45:18 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 4.1
* Version: 4.0.2
*
* Copyright (C) 1999-2001 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"),
@@ -66,7 +65,7 @@
#define SERVER_MINOR_VERSION 4
/* This is appended onto the glXGetClient/ServerString version strings. */
#define MESA_GLX_VERSION "Mesa 4.1"
#define MESA_GLX_VERSION "Mesa 4.0.2"
/* Who implemented this GLX? */
#define VENDOR "Brian Paul"
@@ -1233,9 +1232,9 @@ Fake_glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
if (XMesaMakeCurrent2(xmctx, drawBuffer, readBuffer)) {
((__GLXcontext *) ctx)->currentDpy = dpy;
((__GLXcontext *) ctx)->currentDrawable = draw;
#ifndef GLX_BUILT_IN_XMESA
((__GLXcontext *) ctx)->currentReadable = read;
#ifdef GLX_BUILT_IN_XMESA
printf("Set fake context ctx %p\n", ctx);
#else
__glXSetCurrentContext(ctx);
#endif
return True;

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