diff options
author | dawes <dawes> | 2000-11-30 17:31:29 +0000 |
---|---|---|
committer | dawes <dawes> | 2000-11-30 17:31:29 +0000 |
commit | d129f7fd02961869422c111dd8c3cf824bc54243 (patch) | |
tree | a8616855bbbfea89de0a0584e6d0daade1711bd2 | |
parent | c6fd424b4371a3348ec8a34475cfacad1c8fddb9 (diff) |
Initial revision
283 files changed, 60004 insertions, 0 deletions
diff --git a/xc/extras/Mesa/BeOS/Makefile b/xc/extras/Mesa/BeOS/Makefile new file mode 100644 index 000000000..e46b74446 --- /dev/null +++ b/xc/extras/Mesa/BeOS/Makefile @@ -0,0 +1,42 @@ +# $Id: Makefile,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# Makefile for BeOS demos + +# Written by Brian Paul +# This file is in the public domain. + + + +CC = g++ + +# Use Mesa: +CFLAGS = -I../include -c -g +LFLAGS = -L../lib -Xlinker -rpath ../lib -lbe -lGL + +# Use BeOS OpenGL: +#CFLAGS = -I/boot/develop/headers/be/opengl -c -g +#LFLAGS = -L../lib -Xlinker -rpath ../lib -lbe -lGL + + +PROGRAMS = demo sample + +default: $(PROGRAMS) + + +clean: + rm -f demo sample + rm -f *.o + + +demo: demo.o + $(CC) demo.o $(LFLAGS) -o $@ + +demo.o: demo.cpp + $(CC) $(CFLAGS) demo.cpp + + +sample: sample.o + $(CC) sample.o $(LFLAGS) -o $@ + +sample.o: sample.cpp + $(CC) $(CFLAGS) sample.cpp diff --git a/xc/extras/Mesa/BeOS/demo.cpp b/xc/extras/Mesa/BeOS/demo.cpp new file mode 100644 index 000000000..308adb396 --- /dev/null +++ b/xc/extras/Mesa/BeOS/demo.cpp @@ -0,0 +1,153 @@ +// $Id: demo.cpp,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +// Simple BeOS GLView demo +// Written by Brian Paul +// This file is in the public domain. + + + +#include <stdio.h> +#include <Application.h> +#include <Window.h> +#include <GLView.h> + + +class MyWindow : public BWindow +{ +public: + MyWindow(BRect frame); + virtual bool QuitRequested(); +}; + + +MyWindow::MyWindow(BRect frame) + : BWindow(frame, "demo", B_TITLED_WINDOW, B_NOT_ZOOMABLE) +{ + // no-op +} + +bool MyWindow::QuitRequested() +{ + be_app->PostMessage(B_QUIT_REQUESTED); + return true; +} + + +class MyGL : public BGLView +{ +public: + MyGL(BRect rect, char *name, ulong options); + +// virtual void AttachedToWindow(); + virtual void Draw(BRect updateRect); + virtual void Pulse(); + virtual void FrameResized(float w, float h); +private: + float mAngle; +}; + + +MyGL::MyGL(BRect rect, char *name, ulong options) + : BGLView(rect, name, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP_BOTTOM, 0, options) +{ + mAngle = 0.0; +} + + +#if 0 +void MyGL::AttachedToWindow() +{ + BGLView::AttachedToWindow(); + LockGL(); + glClearColor(.7, .7, 0, 0); + UnlockGL(); +} +#endif + + +void MyGL::FrameResized(float w, float h) +{ + BGLView::FrameResized(w, h); + + printf("FrameResized\n"); + LockGL(); + BGLView::FrameResized(w,h); + glViewport(0, 0, (int) (w + 1), (int) (h + 1)); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-1, 1, -1, 1, 10, 30); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0, 0, -18); + UnlockGL(); +} + + + +void MyGL::Draw(BRect r) +{ + printf("MyGL::Draw\n"); + BGLView::Draw(r); + LockGL(); + glClear(GL_COLOR_BUFFER_BIT); + glPushMatrix(); + glRotatef(mAngle, 0, 0, 1); + glColor3f(0, 0, 1); + glBegin(GL_POLYGON); + glVertex2f(-1, -1); + glVertex2f( 1, -1); + glVertex2f( 1, 1); + glVertex2f(-1, 1); + glEnd(); + SwapBuffers(); + UnlockGL(); +} + + +void MyGL::Pulse() +{ + printf("pulse\n"); + BGLView::Pulse(); + mAngle += 1.0; + + LockGL(); + glClear(GL_COLOR_BUFFER_BIT); + glPushMatrix(); + glRotatef(mAngle, 0, 0, 1); + glColor3f(0, 0, 1); + glBegin(GL_POLYGON); + glVertex2f(-1, -1); + glVertex2f( 1, -1); + glVertex2f( 1, 1); + glVertex2f(-1, 1); + glEnd(); + SwapBuffers(); + UnlockGL(); +} + + + +int main(int argc, char *argv[]) +{ + BApplication *app = new BApplication("application/demo"); + + // make top-level window + int x = 500, y = 500; + int w = 400, h = 400; + MyWindow *win = new MyWindow(BRect(x, y, x + w, y + h)); + // win->Lock(); + // win->Unlock(); + win->Show(); + + // Make OpenGL view and put it in the window + MyGL *gl = new MyGL(BRect(5, 5, w-10, h-10), "GL", BGL_RGB | BGL_DOUBLE); + // MyGL *gl = new MyGL(BRect(5, 5, w-10, h-10), "GL", BGL_RGB ); + win->AddChild(gl); + + printf("calling app->Run\n"); + app->Run(); + + delete app; + + return 0; +} diff --git a/xc/extras/Mesa/BeOS/sample.cpp b/xc/extras/Mesa/BeOS/sample.cpp new file mode 100644 index 000000000..2310b3388 --- /dev/null +++ b/xc/extras/Mesa/BeOS/sample.cpp @@ -0,0 +1,212 @@ +// sample BGLView app from the Be Book + + +#include <stdio.h> +#include <Application.h> +#include <Window.h> +#include <GLView.h> + + +class SampleGLView : public BGLView +{ +public: + SampleGLView(BRect frame, uint32 type); + virtual void AttachedToWindow(void); + virtual void FrameResized(float newWidth, float newHeight); + virtual void ErrorCallback(GLenum which); + + void Render(void); + +private: + void gInit(void); + void gDraw(void); + void gReshape(int width, int height); + + float width; + float height; +}; + + + +class SampleGLWindow : public BWindow +{ +public: + SampleGLWindow(BRect frame, uint32 type); + virtual bool QuitRequested() { return true; } + +private: + SampleGLView *theView; +}; + + +class SampleGLApp : public BApplication +{ +public: + SampleGLApp(); +private: + SampleGLWindow *theWindow; +}; + + +SampleGLApp::SampleGLApp() + : BApplication("application/x-vnd.sample") +{ + BRect windowRect; + uint32 type = BGL_RGB|BGL_DOUBLE; + + windowRect.Set(50, 50, 350, 350); + + theWindow = new SampleGLWindow(windowRect, type); +} + + + +SampleGLWindow::SampleGLWindow(BRect frame, uint32 type) + : BWindow(frame, "OpenGL Test", B_TITLED_WINDOW, 0) +{ + theView = new SampleGLView(Bounds(), type); + AddChild(theView); + Show(); + theView->Render(); +} + + + +SampleGLView::SampleGLView(BRect frame, uint32 type) + : BGLView(frame, "SampleGLView", B_FOLLOW_ALL_SIDES, 0, type) +{ + width = frame.right-frame.left; + height = frame.bottom-frame.top; +} + + +void SampleGLView::AttachedToWindow(void) +{ + LockGL(); + BGLView::AttachedToWindow(); + gInit(); + gReshape(width, height); + UnlockGL(); +} + + +void SampleGLView::FrameResized(float newWidth, float newHeight) +{ + LockGL(); + BGLView::FrameResized(width, height); + width = newWidth; + height = newHeight; + + gReshape(width,height); + + UnlockGL(); + Render(); +} + + +void SampleGLView::ErrorCallback(GLenum whichError) +{ +// fprintf(stderr, "Unexpected error occured (%d):\\n", whichError); +// fprintf(stderr, " %s\\n", gluErrorString(whichError)); +} + + + +// globals +GLenum use_stipple_mode; // GL_TRUE to use dashed lines +GLenum use_smooth_mode; // GL_TRUE to use anti-aliased lines +GLint linesize; // Line width +GLint pointsize; // Point diameter + +float pntA[3] = { + -160.0, 0.0, 0.0 +}; +float pntB[3] = { + -130.0, 0.0, 0.0 +}; + + + +void SampleGLView::gInit(void) +{ + glClearColor(0.0, 0.0, 0.0, 0.0); + glLineStipple(1, 0xF0E0); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + use_stipple_mode = GL_FALSE; + use_smooth_mode = GL_TRUE; + linesize = 2; + pointsize = 4; +} + + + +void SampleGLView::gDraw(void) +{ + GLint i; + + glClear(GL_COLOR_BUFFER_BIT); + glLineWidth(linesize); + + if (use_stipple_mode) { + glEnable(GL_LINE_STIPPLE); + } else { + glDisable(GL_LINE_STIPPLE); + } + + if (use_smooth_mode) { + glEnable(GL_LINE_SMOOTH); + glEnable(GL_BLEND); + } else { + glDisable(GL_LINE_SMOOTH); + glDisable(GL_BLEND); + } + + glPushMatrix(); + + for (i = 0; i < 360; i += 5) { + glRotatef(5.0, 0,0,1); // Rotate right 5 degrees + glColor3f(1.0, 1.0, 0.0); // Set color for line + glBegin(GL_LINE_STRIP); // And create the line + glVertex3fv(pntA); + glVertex3fv(pntB); + glEnd(); + + glPointSize(pointsize); // Set size for point + glColor3f(0.0, 1.0, 0.0); // Set color for point + glBegin(GL_POINTS); + glVertex3fv(pntA); // Draw point at one end + glVertex3fv(pntB); // Draw point at other end + glEnd(); + } + + glPopMatrix(); // Done with matrix +} + + +void SampleGLView::gReshape(int width, int height) +{ + glViewport(0, 0, width, height); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-175, 175, -175, 175, -1, 1); + glMatrixMode(GL_MODELVIEW); +} + + +void SampleGLView::Render(void) +{ + LockGL(); + gDraw(); + SwapBuffers(); + UnlockGL(); +} + + + +int main(int argc, char *argv[]) +{ + SampleGLApp *app = new SampleGLApp; + app->Run(); + delete app; + return 0; +} diff --git a/xc/extras/Mesa/MESADOS.BAT b/xc/extras/Mesa/MESADOS.BAT new file mode 100644 index 000000000..328a7298f --- /dev/null +++ b/xc/extras/Mesa/MESADOS.BAT @@ -0,0 +1,28 @@ +@echo off +rem Remove next for no mapfile +echo >mesados.lnk option map=mapfile +rem Remove next line for no debug info +echo >>mesados.lnk debug all +rem Comment out next two lines if you aren`t using univbe VESA support +echo >>mesados.lnk library \scitech\lib\dos32\wc\svga.lib +echo >>mesados.lnk library \scitech\lib\dos32\wc\svga.lib +rem MGL support, isn`t finished yet. sorry!. +rem echo >>mesados.lnk library \scitech\lib\dos32\wc\mgllt.lib +echo >>mesados.lnk library \scitech\lib\dos32\wc\dos4gw\pmode.lib +rem these are the main mesa libs +echo >>mesados.lnk library ..\src-glu\dosglub.lib +echo >>mesados.lnk library ..\src-tk\tkdos.lib +echo >>mesados.lnk library ..\src\dosmesa.lib +echo >>mesados.lnk library ..\src-aux\dosaux.lib +rem set wcl386=/DDOSVGA /I\mesa\include /d3 /5r /mf /wx /x /fp5 /k80000 +set wcl386=/DDOSVGA /I\mesa\include /5r /fp5 /wx /x /d1 /otexan /mf /k80000 +wcl386 %1 %2 %3 %4 %5 %6 %7 @mesados +goto exit +wstrip %1.exe +del %1.obj +%1 +pause +del %1.exe +:exit +rem del mesados.lnk +set wcl386= diff --git a/xc/extras/Mesa/MESAFX.BAT b/xc/extras/Mesa/MESAFX.BAT new file mode 100644 index 000000000..90932eddc --- /dev/null +++ b/xc/extras/Mesa/MESAFX.BAT @@ -0,0 +1,11 @@ +call vcvars32 x86 + +mkdir lib +cd src +nmake /f Makefile.fx +cd ..\src-glu +nmake /f Makefile.fx +cd ..\src-glut +nmake /f Makefile.fx +cd ..\3Dfx\demos +nmake /f Makefile.fx diff --git a/xc/extras/Mesa/Make-config b/xc/extras/Mesa/Make-config new file mode 100644 index 000000000..a3ca687c3 --- /dev/null +++ b/xc/extras/Mesa/Make-config @@ -0,0 +1,1387 @@ +# $Id: Make-config,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +MESA_MAJOR=3 +MESA_MINOR=4 +MESA_TINY=0 +VERSION=$(MESA_MAJOR).$(MESA_MINOR) + +# Mesa 3-D graphics library +# +# Copyright (C) 1999-2000 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# 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. + + +# The following variables are passed to each Makefile: +# +# GL_LIB the name of the Mesa "GL" library file (usually libGL.so) +# GLU_LIB the name of the Mesa "GLU" library file (usually libGLU.so) +# GLUT_LIB the name of the GLUT library file (usually libglut.so) +# GLW_LIB the name of the GLw widget library file (usually libGLw.so) +# CC the C compiler (usually cc or gcc) +# CFLAGS flags to C compiler (usually -O) +# MAKELIB the script or command to make a library file +# GL_LIB_DEPS list of libraries which the GL library depends on +# GLU_LIB_DEPS list of libraries which the GLU library depends on +# GLUT_LIB_DEPS list of libraries which the GLUT library depends on +# APP_LIB_DEPS list of libraries which demo programs depend upon +# ASM_SOURCES optional list of assembly language files to assemble +# +# +# Optionally, you can add definitions for the INCDIR and LIBDIR variables +# which specify where to find the Mesa include files and where to put the +# Mesa libraries. The defaults are ../include and ../lib. This use of +# overriding makefile macros on the command line should work with most +# variants of make. +# +# If your system supports the X Shared Memory extension add -DUSE_XSHM to the +# CFLAGS line and add -lXext to the GL_LIB_DEPS line. +# +# Some compilers complain about const parameters. Adding -DNO_CONST to the +# CFLAGS line should silence suth warnings. +# +# +# To add a new system configuration just follow the examples below and update +# the top-level Makefile.X11 file. + + + +aix: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -O -DAIXV3" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +aix-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -O -DAIXV3" \ + "MAKELIB = ../bin/mklib.aix" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +# Make-config additions for the Amiga 3000 UX +# Carlyn Voss Iuzzolino 5/8/95: +# Modified gcc part as follows: +# Needed to take out -pedantic because that makes gcc complain about +# ANSI-CC not allowing #ident in Amiga's /usr/include/*.h files. +# Took out -O2 (unrecognized option for gcc on the Amiga). +# Needs /usr/lib/libsocket.a file. +amix: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS =" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lsocket -lnsl -lm" + +beos-r4: + $(MAKE) -f Makefile.BeOS-R4 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = g++" \ + "CFLAGS = -O -DNO_CONST" \ + "MAKELIB = ../bin/mklib.beos-r4" \ + "APP_LIB_DEPS = " + +bsdos: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -I/usr/X11/include -O2" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11/lib -lX11 -lipc -lm" + +bsdos4: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -I/usr/X11/include -O2 -fPIC" \ + "MAKELIB = ../bin/mklib.bsdos4" \ + "APP_LIB_DEPS = -L/usr/X11/lib -lX11 -lipc -lm" + +cygnus: + $(MAKE) -f Makefile.cygnus $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "DLLTOOL = dlltool" \ + "WING_DIR= /wing" \ + "LD = ld" \ + "CFLAGS = -I. -DWIN32 -D__WIN32__ -D_WINDOWS \ + -O2 -funroll-loops \ + -fexpensive-optimizations -fomit-frame-pointer -ffast-math \ + -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "WLIBS = ../lib/wing32.a -lkernel32 -luser32 -lgdi32" + +cygnus-linux: + $(MAKE) -f Makefile.cygnus $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gnuwin32gcc" \ + "DLLTOOL = gnuwin32dlltool --as gnuwin32as" \ + "LD = gnuwin32ld" \ + "WING_DIR= /dos/wing" \ + "CFLAGS = -I. -DWIN32 -D__WIN32__ -D_WINDOWS \ + -O2 -funroll-loops \ + -fexpensive-optimizations -fomit-frame-pointer -ffast-math \ + -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ + "MAKELIB = ../bin/mklib.cygnus-linux" \ + "WLIBS = ../lib/wing32.a -lkernel32 -luser32 -lgdi32" + +dgux: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lm" + +freebsd: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O2 -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100" \ + "MAKELIB = ../bin/mklib.freebsd" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" + +freebsd-386: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -ffast-math -fPIC -pedantic -I/usr/X11R6/include -DUSE_XSHM -DHZ=100 -DUSE_X86_ASM -DFREEBSD" \ + "MAKELIB = ../bin/mklib.freebsd" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S" + +gcc: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -pedantic -O2" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lm" + +hpux9: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = +O3 -Aa -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm" + +hpux9-gcc: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm" + +hpux9-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.sl" \ + "GLU_LIB = libGLU.sl" \ + "GLUT_LIB = libglut.sl" \ + "GLW_LIB = libGLw.sl" \ + "CC = cc" \ + "CFLAGS = +z +O3 +Olibcalls +ESlit -Aa +Onolimit -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.hpux" \ + "APP_LIB_DEPS = -L/usr/lib/X11R5 -s -Wl,+s,-B,nonfatal,-B,immediate -lXext -lXmu -lXi -lX11 -lm" + +hpux9-gcc-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.sl" \ + "GLU_LIB = libGLU.sl" \ + "GLUT_LIB = libglut.sl" \ + "GLW_LIB = libGLw.sl" \ + "CC = gcc" \ + "CFLAGS = -fPIC -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R5 -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.hpux" \ + "APP_LIB_DEPS = -L/usr/lib/X11R5 -lXext -lXmu -lXi -lX11 -lm" + +hpux10: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = +O3 +DAportable -Aa -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" + +hpux10-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL" \ + "GLU_LIB = libGLU" \ + "GLUT_LIB = libglut" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = +z -Ae +O2 +Onolimit +Oaggressive -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.hpux" \ + "APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" + +hpux10-gcc: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" + +hpux10-gcc-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.sl" \ + "GLU_LIB = libGLU.sl" \ + "GLUT_LIB = libglut.sl" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -fPIC -ansi -O3 -D_HPUX_SOURCE -I/usr/include/X11R6 -I/usr/contrib/X11R6/include -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.hpux" \ + "APP_LIB_DEPS = -L/usr/lib/X11R6 -L/usr/contrib/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" + + +# For IRIX 4: don't use -fullwarn because it causes too much garbage +irix4: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -O2 -ansi -prototypes -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -lXext -lXmu -lXi -lX11 -lm" + +# On IRIX 5.3 -sopt causes a problem in drawpixels.c so we don't use it +irix5: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -O2 -ansi -fullwarn -DUSE_XSHM -DNO_CONST" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +# On IRIX 5.2+gcc +irix5-gcc: + make $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O2 -pedantic -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +# IRIX 5 using Dynamic Shared Objects (DSO) +irix5-dso: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = cc" \ + "CFLAGS = -O2 -ansi -fullwarn -DUSE_XSHM -DNO_CONST" \ + "MAKELIB = ../bin/mklib.irix5" \ + "APP_LIB_DEPS = -rpath ../lib -lX11 -lXmu -lXi -lm" + +irix6-o32: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -32 -mips2 -O2 -ansi -DUSE_XSHM -DNO_CONST" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +irix6-o32-dso: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = cc" \ + "CFLAGS = -32 -mips2 -O2 -ansi -DUSE_XSHM -DNO_CONST" \ + "MAKELIB = ../bin/mklib.irix6-32" \ + "APP_LIB_DEPS = -rpath ../lib -lX11 -lXext -lXmu -lXi -lm" + +# For IRIX 6: -woff: +# 1209 - controlling expression is constant +irix6-n32: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "LIBDIR = ../lib32" \ + "CC = cc" \ + "CFLAGS = -n32 -mips3 -O3 -ansi -woff 1209,1521" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +irix6-n32-dso: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.a" \ + "LIBDIR = ../lib32" \ + "CC = cc" \ + "CFLAGS = -n32 -mips3 -O3 -ansi -DUSE_XSHM -woff 1185,1521" \ + "MAKELIB = ../bin/mklib.irix6-n32" \ + "APP_LIB_DEPS = -rpath ../lib32 -lX11 -lXmu -lXi -lfpe -lm" + +irix6-gcc-n32-sl: + make $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "LIBDIR = ../lib32" \ + "CC = gcc" \ + "CFLAGS = -mabi=n32 -mips3 -O3 -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.irix6-n32" \ + "APP_LIB_DEPS = -rpath ../lib32 -lX11 -lXmu -lXi -lm" + +# For IRIX 6-64: -woff: +# 1068 - integer conversion resulted in a change of sign +# 1069 - integer conversion resulted in truncation +# 1174 - variable was declared but never referenced +# 1185 - enumerated type mixed with another type +# 1209 - controlling expression is constant +# 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 \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "LIBDIR = ../lib64" \ + "CC = cc" \ + "CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +irix6-64-dso: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "LIBDIR = ../lib64" \ + "CC = cc" \ + "CFLAGS = -64 -O3 -ansi -woff 1068,1069,1174,1185,1209,1474,1552 -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.irix6-64" \ + "APP_LIB_DEPS = -rpath ../lib64 -lX11 -lXmu -lXi -lm" + +linux: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include" \ + "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 = -lm" + +linux-static: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -funroll-loops -ansi -pedantic -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DPTHREADS -I/usr/X11R6/include" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm -lpthread" + +linux-x86: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ + "CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -DPTHREADS -I/usr/X11R6/include" \ + "MAKELIB = ../bin/mklib.linux" \ + "GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -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" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S \ + X86/mmx_blend.S \ + X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ + X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ + X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ + X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ + X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ + X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ + X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ + X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ + X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ + X86/katmai_norm_raw.S X86/katmai_vertex.S" + +linux-x86-static: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ + "CFLAGS = -Wall -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -DPTHREADS -I/usr/X11R6/include" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -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" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S \ + X86/mmx_blend.S \ + X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ + X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ + X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ + X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ + X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ + X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ + X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ + X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ + X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ + X86/katmai_norm_raw.S X86/katmai_vertex.S" + +# Contributed by Uwe_Maurer@t-online.de +linux-ggi: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DGGI -DCDECL=" \ + "MAKELIB = ../bin/mklib.ggi" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lggi -lm" + +# Contributed by Emmanuel marty core@ggi-project.org +linux-386-ggi: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O3 -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DUSE_X86_ASM -DGGI -DCDECL=" \ + "MAKELIB = ../bin/mklib.ggi" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lggi -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S" + +linux-glide: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ + "MAKELIB = ../bin/mklib.linux" \ + "GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -L/usr/local/glide/lib -lglide2x" \ + "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" + +linux-386-glide: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ + "MAKELIB = ../bin/mklib.linux" \ + "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 -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S" + +linux-386-opt-glide: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DUSE_X86_ASM -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include" \ + "MAKELIB = ../bin/mklib.linux" \ + "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 -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S" + +linux-386-opt-V2-glide: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O3 -m486 -fomit-frame-pointer -pipe -ansi -pedantic -ffast-math -fexpensive-optimizations -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DFX -DFX_V2 -DUSE_X86_ASM -DPTHREAD -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include"\ + "MAKELIB = ../bin/mklib.linux" \ + "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 -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S" + +linux-x86-glide: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ + "CFLAGS = -O3 -ansi -pedantic -fPIC -ffast-math -funroll-loops -fomit-frame-pointer -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -DUSE_XSHM -DFX -DPTHREADS -I/usr/X11R6/include -I/usr/include/glide -I/usr/local/glide/include -I/usr/src/mesa-glx/src/FX/X86" \ + "MAKELIB = ../bin/mklib.linux" \ + "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 -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S \ + X86/mmx_blend.S \ + X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ + X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ + X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ + X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ + X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ + FX/X86/fx_3dnow_fastpath.S \ + X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ + X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ + X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ + X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ + X86/katmai_norm_raw.S X86/katmai_vertex.S" + +linux-alpha: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -fPIC -D_XOPEN_SOURCE -DSHM" \ + "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 = -lm" + +linux-alpha-static: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -mcpu=ev5 -ansi -mieee -pedantic -L/usr/X11R6/lib -D_XOPEN_SOURCE -DSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lm" + +linux-ppc: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fPIC -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM" \ + "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 = -lm" + +linux-ppc-static: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -mcpu=603 -ansi -pedantic -fsigned-char -ffast-math -funroll-loops -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lm" + +linux-sparc-static: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -pedantic -funroll-loops -O3 -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXt -lXmu -lXi -lm" + +# Replace -mv8 with -mcypress, -msupersparc or -msparclite as appropriate. +linux-sparc5: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -mv8 -O2 -ffast-math -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM" \ + "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 = -lm" + +# 32-bit Sparc ELF userland, on UltraSparc +linux-sparc-ultra: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -mv8 -O2 -mtune=ultrasparc -ansi -pedantic -fPIC -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM" \ + "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 = -lm" + +# May want to add these CFLAGS for better performance under LynxOS and GCC: +# -fPIC -O2 -ansi -pedantic -mieee-fp -DUSE_XSHM -funroll-loops +# -fexpensive-optimizations -fomit-frame-pointer -ffast-math +# and -malign-loops=2 -malign-jumps=2 -malign-functions=2 for Pentium +lynxos: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O2 -ansi -pedantic -funroll-loops -ffast-math -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11/lib -lXext -lXi -lXmu -lX11 -lbsd -lm" + +machten-2.2: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -DTENON -D__MACHTEN__ -fstrength-reduce -m68881 -O2" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -L/usr/lib/X11 -lX11 -lm" + +machten-4.0: + $(MAKE) targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -DTENON -D__MACHTEN__ -fstrength-reduce -O2" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -L/usr/X11R5/lib -lX11 -lm" + +mklinux: + $(MAKE) targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -pedantic -O2" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lmoto -L/usr/X11/lib -lXmu -lX11 -lm" + +netbsd: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -O2 -fPIC -DUSE_XSHM -I/usr/X11R6/include -DHZ=100" \ + "MAKELIB = ../bin/mklib.netbsd" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11 -lm" + +next: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "DRIVER_SOURCES = OSmesa/osmesa.c" \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "CC = ${MYCC}" \ + "CFLAGS = -traditional-cpp -DOPENSTEP -O4" \ + "MAKELIB = ../bin/mklib.ar-ruv" + +openbsd: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = cc" \ + "CFLAGS = -O2 -fPIC -I/usr/X11R6/include -DUSE_XSHM -DHZ=100" \ + "MAKELIB = ../bin/mklib.openbsd" \ + "APP_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXi -lm" + +openstep: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "DRIVER_SOURCES = OSmesa/osmesa.c" \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "CC = ${MYCC}" \ + "CFLAGS = -traditional-cpp -DOPENSTEP -O4" \ + "MAKELIB = ../bin/mklib.openstep" + +openstep-win32: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "DRIVER_SOURCES = OSmesa/osmesa.c" \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "CC = gcc" \ + "CFLAGS = -DOPENSTEP -O4" \ + "MAKELIB = ../bin/mklib.openstep" + +os2-x11: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = MesaGL.a" \ + "GLU_LIB = MesaGLU.a" \ + "GLUT_LIB = glut.a" \ + "GLW_LIB = GLw.a" \ + "CC = gcc" \ + "CFLAGS = -Zmt -O3 -m486 -funroll-loops -Wall -Wno-unused -ansi -pedantic -ffast-math -DUSE_X86_ASM -D_SVID_SOURCE -D_BSD_SOURCE -I$(X11ROOT)/XFree86/include" \ + "MAKELIB = ..\\bin\\mklib-emx.cmd " \ + "APP_LIB_DEPS = -Zmt -Zcrtdll -Zexe -L$(X11ROOT)/XFree86/lib -lXt -lX11 -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S" + +osf1: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -O0 -std1 -ieee_with_no_inexact -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +osf1-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = cc" \ + "CFLAGS = -O0 -std1 -ieee_with_no_inexact -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.osf1" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +pgi-cygnus: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = pgcc" \ + "CFLAGS = -fast -cyglibs -Munix -I. -DWIN32 -D__WIN32__ -D_WINDOWS " \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lm" + +pgi-mingw32: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = pgcc" \ + "CFLAGS = -fast -msvcrt -Munix -I. -DWIN32 -D__WIN32__ -D_WINDOWS " \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lm" + +# QNX V4 & Watcom Compiler +qnx: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -O" \ + "MAKELIB = ../bin/mklib.qnx" \ + "APP_LIB_DEPS = -L/usr/X11/lib -lX11 -lm" + +sco: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -pedantic -O2 -mieee-fp" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11/lib -lX11 -lm" + +sco5: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -pedantic -O2 -mieee-fp" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lXm -lXt -lX11 -lXmu -lXext -lsocket -lx -lm" + +solaris-x86: + $(MAKE) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -Xa -xO3 -xpentium -KPIC -I/usr/openwin/include -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.solaris" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +solaris-x86-gcc: + $(MAKE) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -m486 -fPIC -I/usr/openwin/include -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.solaris" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos4: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = acc" \ + "CFLAGS = -O -DUSE_XSHM -DSUNOS4" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +sunos4-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = acc" \ + "CFLAGS = -Kpic -O -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4" \ + "MAKELIB = ld -assert pure-text -o" \ + "APP_LIB_DEPS = -L/usr/lib/X11R5 -lX11 -lXext -lXmu -lXi -lm" + +sunos4-gcc: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -DUSE_XSHM -DSUNOS4 -I/usr/openwin/include" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos4-gcc-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so.$(VERSION)" \ + "GLU_LIB = libGLU.so.$(VERSION)" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -fPIC -O3 -I/usr/openwin/include -I/usr/include/X11R5 -I/usr/include/X11R5 -DUSE_XSHM -DSUNOS4 -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.sunos4" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos4-gcc-x11r6-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so.$(VERSION)" \ + "GLU_LIB = libGLU.so.$(VERSION)" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -fPIC -O3 -I/usr/X11R6.3/include -DUSE_XSHM -DSUNOS4 -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.sunos4" \ + "APP_LIB_DEPS = -L/usr/X11R6.3/lib/X11 -lX11 -lXext -lXmu -lXi -lm" + +sunos5: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos5-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = cc" \ + "CFLAGS = -KPIC -Xa -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.sunos5" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos5-ultra: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -Xa -fast -xO5 -xtarget=ultra -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos5-ultra-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = cc" \ + "CFLAGS = -KPIC -Xa -fast -xO5 -xtarget=ultra -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.sunos5" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos5-gcc: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos5-gcc-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -fPIC -O3 -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.sunos5" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +sunos5-x11r6-gcc-sl: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -fPIC -O3 -DUSE_XSHM -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.sunos5" \ + "APP_LIB_DEPS = -lSM -lICE -lX11 -lXext -lXmu -lXi -lnsl -lsocket -lm" + +# Contributed by John Stone +sunos5-pthread: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "CC = cc" \ + "CFLAGS = -mt -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG -DPTHREADS" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lpthread -lm" + +# Contributed by John Stone +sunos5-thread: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "CC = cc" \ + "CFLAGS = -mt -Xa -fast -xO4 -native -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DSOLARIS_2_4_BUG -DSOLARIS_THREADS" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -L/usr/dt/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lthread -lm" + +# Contributed by John Stone +sunos5-gcc-thread: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG -D_REENTRANT -DSOLARIS_THREADS" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lthread -lm" + +# Contributed by John Stone +sunos5-gcc-pthread: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "CC = gcc" \ + "CFLAGS = -O3 -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG -D_REENTRANT -DPTHREADS" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lpthread -lm" + +# from Ron Metoyer (metoyer@iexist.flw.lucent.com) +sunSolaris-CC: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = CC" \ + "CFLAGS = -O -I/usr/openwin/include -DUSE_XSHM -DSOLARIS_2_4_BUG" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/openwin/lib -R/usr/openwin/lib -lX11 -lXext -lXmu -lXi -lm" + +#This config doesn't work, Ultrix C compiler isn't ANSI compliant +ultrix: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -O -Dconst=/**/" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lXmu -lX11 -lXi -lm" + +ultrix-gcc: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -pedantic -O2" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lXmu -lX11 -lXi -lm" + +# tested on Cray C90 running UNICOS 8.0.4 +unicos: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS =" \ + "MAKELIB = ../bin/mklib/ar-rcv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lm" + +unixware: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -O -I/usr/X/include -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lsocket -lnsl -lm" + +unixware-shared: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL" \ + "GLU_LIB = libGLU" \ + "GLUT_LIB = libglut" \ + "GLW_LIB = libGLw" \ + "CC = cc" \ + "CFLAGS = -O -I/usr/X/include -KPIC,inline -DUSE_XSHM" \ + "MAKELIB = ../bin/mklib.solaris" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lsocket -lnsl -lm" + +uwin: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "CC = gcc" \ + "CFLAGS = -pedantic -O2 -I/usr/X11/include " \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11/lib -lX11 -lm" + +vistra: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -pedantic -O2" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -lX11 -lsocket -lnsl -lgen -lm" + + +# for debugging on IRIX 5.x systems +# -woff 1209 = "controlling expression is constant" +# -woff 1210 = "controlling expression is constant" +# -woff 1506 = "implict conversion from unsigned long to smaller type" +# -woff 1521 = "nonstandard preprocessing directive is used" +# -woff 3496 = "bitwise operator precedence" +irix-debug: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "LIBDIR = ../lib32" \ + "CC = cc" \ + "CFLAGS = -g -n32 -ansi -fullwarn -DUSE_XSHM -DDEBUG -woff 1209,1210,1506,1521,3496" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -rpath ../lib32 -lX11 -lXext -lXmu -lXi -lfpe -lXext -lXmu -lXi -lm" + +DEBUG: + pmake $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = cc" \ + "CFLAGS = -g -ansi -prototypes -fullwarn -DUSE_XSHM -DDEBUG" \ + "MAKELIB = ../bin/mklib.ar-rcv" \ + "APP_LIB_DEPS = -lX11 -lXext -lXmu -lXi -lfpe -lm" + +# for debugging on Linux systems +linux-debug: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -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" \ + "MAKELIB = ../bin/mklib.linux" \ + "GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lvga -L/usr/local/glide/lib -lglide2x" \ + "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" + +linux-static-debug: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -DUSE_XSHM -DDEBUG -DMESA_DEBUG -DSVGA -DFX -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/include/glide -I/usr/local/glide/include" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -ltexus -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lvga -lm" \ + +linux-x86-debug: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc -malign-loops=2 -malign-jumps=2 -malign-functions=2" \ + "CFLAGS = -O2 -g -ansi -pedantic -Wall -Wmissing-prototypes -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_XSHM -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -DPTHREADS -I/usr/X11R6/include -DDEBUG -DMESA_DEBUG" \ + "MAKELIB = ../bin/mklib.linux" \ + "GL_LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -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" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S \ + X86/mmx_blend.S \ + X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ + X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ + X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ + X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ + X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ + X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ + X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ + X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ + X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ + X86/katmai_norm_raw.S X86/katmai_vertex.S" + +linux-glide-debug: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.so" \ + "GLU_LIB = libGLU.so" \ + "GLUT_LIB = libglut.so" \ + "GLW_LIB = libGLw.so" \ + "CC = gcc" \ + "CFLAGS = -g -ansi -pedantic -Wall -Wmissing-prototypes -fPIC -ffast-math -D_SVID_SOURCE -D_BSD_SOURCE -I/usr/X11R6/include -DUSE_XSHM -DPTHREADS -DFX -DDEBUG -I/usr/local/glide/include -I/usr/include/glide" \ + "MAKELIB = ../bin/mklib.linux" \ + "APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -L/usr/X11R6/lib -lX11 -lXext -lXmu -lXt -lXi -lvga -lm -lpthread" + +# for profiling on Linux systems +linux-prof: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -Wall -O2 -pg -ansi -pedantic -ffast-math -DUSE_XSHM -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/X11/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S \ + X86/mmx_blend.S \ + X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ + X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ + X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ + X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ + X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ + FX/X86/fx_3dnow_fastpath.S \ + X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ + X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ + X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ + X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ + X86/katmai_norm_raw.S X86/katmai_vertex.S" + +linux-glide-prof: + $(MAKE) $(MFLAGS) -f Makefile.X11 targets \ + "GL_LIB = libGL.a" \ + "GLU_LIB = libGLU.a" \ + "GLUT_LIB = libglut.a" \ + "GLW_LIB = libGLw.a" \ + "CC = gcc" \ + "CFLAGS = -O2 -pg -ansi -pedantic -Wall -DUSE_XSHM -D_SVID_SOURCE -D_BSD_SOURCE -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM -I/usr/include/glide -I/usr/local/glide/include" \ + "MAKELIB = ../bin/mklib.ar-ruv" \ + "APP_LIB_DEPS = -L/usr/local/glide/lib -lglide2x -L/usr/X11/lib -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm" \ + "ASM_SOURCES = X86/common_x86_asm.S X86/glapi_x86.S \ + X86/x86_xform_raw2.S X86/x86_xform_raw3.S \ + X86/x86_xform_raw4.S X86/x86_xform_masked2.S \ + X86/x86_xform_masked3.S X86/x86_xform_masked4.S \ + X86/x86_cliptest.S X86/x86_vertex.S \ + X86/mmx_blend.S \ + X86/3dnow_xform_raw1.S X86/3dnow_xform_raw2.S \ + X86/3dnow_xform_raw3.S X86/3dnow_xform_raw4.S \ + X86/3dnow_xform_masked1.S X86/3dnow_xform_masked2.S \ + X86/3dnow_xform_masked3.S X86/3dnow_xform_masked4.S \ + X86/3dnow_norm_raw.S X86/3dnow_vertex.S \ + FX/X86/fx_3dnow_fastpath.S \ + X86/katmai_xform_raw1.S X86/katmai_xform_masked1.S \ + X86/katmai_xform_raw2.S X86/katmai_xform_masked2.S \ + X86/katmai_xform_raw3.S X86/katmai_xform_masked3.S \ + X86/katmai_xform_raw4.S X86/katmai_xform_masked4.S \ + X86/katmai_norm_raw.S X86/katmai_vertex.S" diff --git a/xc/extras/Mesa/Makefile b/xc/extras/Mesa/Makefile new file mode 100644 index 000000000..9b2e5592f --- /dev/null +++ b/xc/extras/Mesa/Makefile @@ -0,0 +1,660 @@ +# $Id: Makefile,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# Mesa 3-D graphics library +# Version: 3.4 +# +# Copyright (C) 1999-2000 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# 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. + + +# Top-level makefile for Mesa +# To add a new configuration for your system add it to the list below +# then update the Make-config file. + +SHELL = /bin/sh + + + +default: + @echo "Type one of the following:" + @echo " make aix for IBM RS/6000 with AIX" + @echo " make aix-sl for IBM RS/6000, make shared libs" + @echo " make amiwin for Amiga with SAS/C and AmiWin" + @echo " make amix for Amiga 3000 UX SVR4 v2.1 systems" + @echo " make beos-r4 for BeOS R4" + @echo " make bsdos for BSD/OS from BSDI using GCC" + @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 dgux for Data General" + @echo " make freebsd for FreeBSD systems with GCC" + @echo " make freebsd-386 for FreeBSD systems with GCC, w/ Intel assembly" + @echo " make gcc for a generic system with GCC" + @echo " make hpux9 for HP systems with HPUX 9.x" + @echo " make hpux9-sl for HP systems with HPUX 9.x, make shared libs" + @echo " make hpux9-gcc for HP systems with HPUX 9.x using GCC" + @echo " make hpux9-gcc-sl for HP systems with HPUX 9.x, GCC, make shared libs" + @echo " make hpux10 for HP systems with HPUX 10.x" + @echo " make hpux10-sl for HP systems with HPUX 10.x, shared libs" + @echo " make hpux10-gcc for HP systems with HPUX 10.x w/ GCC" + @echo " make hpux10-gcc-sl for HP systems with HPUX 10.x w/ GCC, shared libs" + @echo " make irix4 for SGI systems with IRIX 4.x" + @echo " make irix5 for SGI systems with IRIX 5.x" + @echo " make irix5-gcc for SGI systems with IRIX 5.x using GCC" + @echo " make irix5-dso for SGI systems with IRIX 5.x, make DSOs" + @echo " make irix6-o32 for SGI systems with IRIX 6.x, make o32-bit libs" + @echo " make irix6-o32-dso for SGI systems with IRIX 6.x, make o32-bit DSOs" + @echo " make irix6-n32 for SGI systems with IRIX 6.x, make n32-bit libs" + @echo " make irix6-n32-dso for SGI systems with IRIX 6.x, make n32-bit DSOs" + @echo " make irix6-gcc-n32-sl for SGI systems with IRIX 6.x, GCC, make n32 DSOs" + @echo " make irix6-64 for SGI systems with IRIX 6.x, make 64-bit libs" + @echo " make irix6-64-dso for SGI systems with IRIX 6.x, make 64-bit DSOs" + + @echo " make linux for Linux systems, make shared .so libs" + @echo " make linux-static for Linux systems, make static .a libs" + @echo " make linux-x86 for Linux on Intel, make shared .so libs" + @echo " make linux-x86-static for Linux on Intel, make static .a libs" + @echo " make linux-ggi for Linux systems with libggi" + @echo " make linux-386-ggi for Linux systems with libggi w/ Intel assembly" + @echo " make linux-glide for Linux w/ 3Dfx Glide driver" + @echo " make linux-386-glide for Linux w/ 3Dfx Glide driver, Intel assembly" + @echo " make linux-386-opt-glide for Linux with 3Dfx Voodoo1 for GLQuake" + @echo " make linux-386-opt-V2-glide for Linux with 3Dfx Voodoo2 for GLQuake" + @echo " make linux-x86-glide for Linux w/ all x86 asm for Glide" + @echo " make linux-alpha for Linux on Alpha systems" + @echo " make linux-alpha-static for Linux on Alpha systems, static libs" + @echo " make linux-ppc for Linux on PowerPC systems" + @echo " make linux-ppc-static for Linux on PowerPC systems, static libs" + @echo " make linux-sparc for Linux on Sparc systems" + @echo " make linux-sparc5-elf for Sparc5 systems, make ELF shared libs" + @echo " make linux-sparc-ultra for UltraSparc systems, make ELF shared libs" + @echo " make lynxos for LynxOS systems with GCC" + @echo " make macintosh for Macintosh" + @echo " make machten-2.2 for Macs w/ MachTen 2.2 (68k w/ FPU)" + @echo " make machten-4.0 for Macs w/ MachTen 4.0.1 or newer with GNU make" + @echo " make mklinux for Linux on Power Macintosh" + @echo " make netbsd for NetBSD 1.0 systems with GCC" + @echo " make next for NeXT systems with NEXTSTEP 3.3" + @echo " make openbsd for OpenBSD systems" + @echo " make openstep for OpenStep/MacOSX Server systems" + @echo " make os2-x11 for OS/2 with XFree86" + @echo " make osf1 for DEC Alpha systems with OSF/1" + @echo " make osf1-sl for DEC Alpha systems with OSF/1, make shared libs" + @echo " make pgi-cygnus for Cygnus with Portland Group, Inc. compiler" + @echo " make pgi-mingw32 for mingW32 with Portland Group, Inc. compiler" + @echo " make qnx for QNX V4 systems with Watcom compiler" + @echo " make sco for SCO Unix systems with ODT" + @echo " make sco5 for SCO 5.0.5 OpenServer Unix" + @echo " make solaris-x86 for PCs with Solaris" + @echo " make solaris-x86-gcc for PCs with Solaris using GCC" + @echo " make sunos4 for Suns with SunOS 4.x" + @echo " make sunos4-sl for Suns with SunOS 4.x, make shared libs" + @echo " make sunos4-gcc for Suns with SunOS 4.x and GCC" + @echo " make sunos4-gcc-sl for Suns with SunOS 4.x, GCC, make shared libs" + @echo " make sunos5 for Suns with SunOS 5.x" + @echo " make sunos5-sl for Suns with SunOS 5.x, make shared libs" + @echo " make sunos5-ultra for Sun UltraSPARCs with SunOS 5.x" + @echo " make sunos5-ultra-sl for Sun UltraSPARCs with SunOS 5.x, make shared libs" + @echo " make sunos5-thread for Suns with SunOS 5.x, using Solaris threads" + @echo " make sunos5-pthread for Suns with SunOS 5.[56] using POSIX threads" + @echo " make sunos5-gcc-thread for Suns with SunOS 5.x and GCC, using Solaris threads" + @echo " make sunos5-gcc-pthread for Suns with SunOS 5.[56] and GCC, using POSIX threads" + @echo " make sunos5-gcc for Suns with SunOS 5.x and GCC" + @echo " make sunos5-gcc-sl for Suns with SunOS 5.x, GCC, make shared libs" + @echo " make sunos5-x11r6-gcc-sl for Suns with X11R6, GCC, make shared libs" + @echo " make sunos5-gcc-thread for Suns with SunOS 5.x and GCC, using Solaris threads" + @echo " make sunos5-gcc-pthread for Suns with SunOS 5.[56] and GCC, using POSIX threads" + @echo " make sunSolaris-CC for Solaris using C++ compiler" + @echo " make ultrix-gcc for DEC systems with Ultrix and GCC" + @echo " make unicos for Cray C90 (and other?) systems" + @echo " make unixware for PCs running UnixWare" + @echo " make unixware-shared for PCs running UnixWare, shared libs" + @echo " make uwin for Windows NT with AT&T/Wipro UWIN" + @echo " make vistra for Stardent Vistra systems" + @echo " make clean remove .o files" + @echo " make realclean remove .o, library and executable files" + + + +aix aix-sl amix bsdos bsdos4 dgux freebsd freebsd-386 gcc \ +hpux9 hpux9-sl hpux9-gcc hpux9-gcc-sl \ +hpux10 hpux10-sl hpux10-gcc hpux10-gcc-sl \ +irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \ +linux linux-static linux-debug linux-static-debug linux-prof \ +linux-x86 linux-x86-static linux-x86-debug \ +linux-glide linux-386-glide linux-386-opt-glide \ +linux-386-opt-V2-glide linux-x86-glide linux-glide-debug linux-glide-prof \ +linux-alpha-static linux-alpha \ +linux-ppc-static linux-ppc \ +linux-sparc \ +linux-sparc5-elf \ +linux-sparc-ultra \ +lynxos machten-2.2 machten-4.0 \ +mklinux netbsd osf1 osf1-sl openbsd qnx sco sco5 \ +solaris-x86 solaris-x86-gcc sunSolaris-CC \ +sunos4 sunos4-sl sunos4-gcc sunos4-gcc-sl sunos4-gcc-x11r6-sl \ +sunos5 sunos5-sl sunos5-ultra sunos5-ultra-sl sunos5-gcc sunos5-gcc-sl \ +sunos5-thread sunos5-pthread sunos5-gcc-thread sunos5-gcc-pthread \ +sunos5-x11r6-gcc-sl ultrix-gcc unicos unixware uwin vistra: + -mkdir lib + 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 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 + if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + +irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug: + -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 + if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + + +irix6-64 irix6-64-dso: + -mkdir lib64 + touch src/depend + touch src-glu/depend + 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 + if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + + +amiwin: + bin/mklib.amiwin + + +beos-r4: + -mkdir lib + -rm src/depend + touch src/depend + -rm src-glu/depend + touch src-glu/depend + if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + if [ -d src-glu ] ; then cd src-glu ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + if [ -d BeOS ] ; then cd BeOS ; $(MAKE) ; fi + if [ -d src-glut.beos ] ; then cd src-glut.beos ; $(MAKE) ; fi + if [ -d src-glut.beos ] ; then cp src-glut.beos/obj*/libglut.so lib ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + +pgi-cygnus pgi-mingw32 \ +cygnus cygnus-linux: + -mkdir lib + touch src/depend + touch src-glu/depend + 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 + if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + +macintosh: + @echo "See the README file for Macintosh intallation information" + +next: + -mkdir lib + cd src ; $(MAKE) -f Makefile.X11 "MYCC=${CC}" $@ + cd src-glu ; $(MAKE) -f Makefile.X11 "MYCC=${CC}" $@ + +openstep: + -mkdir lib + cd src ; $(MAKE) -f Makefile.X11 "MYCC=${CC}" $@ + cd src-glu ; $(MAKE) -f Makefile.X11 "MYCC=${CC}" $@ + +os2-x11: + if not EXIST .\lib md lib + touch src/depend + touch src-glu/depend + if exist src-glut touch src-glut/depend + cd src & make -f Makefile.X11 $@ + cd src-glu & make -f Makefile.X11 $@ + if exist src-glut cd src-glut & make -f Makefile.X11 $@ + if exist demos cd demos & make -f Makefile.X11 $@ + if exist xdemos cd xdemos & make -f Makefile.X11 $@ + if exist samples cd samples & make -f Makefile.X11 $@ + if exist book cd book & make -f Makefile.X11 $@ + +linux-ggi linux-386-ggi: + -mkdir lib + touch src/depend + touch src-glu/depend + if [ -d src-glut ] ; then touch src-glut/depend ; fi + if [ -d widgets-sgi ] ; then touch widgets-sgi/depend ; fi + if [ -d ggi ] ; then touch ggi/depend ; fi + if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d src/GGI/default ] ; then cd src/GGI/default ; $(MAKE) ; fi + if [ -d src/GGI/display ] ; then cd src/GGI/display ; $(MAKE) ; fi + if [ -d src-glut ] ; then cd src-glu ; $(MAKE) -f Makefile.X11 $@ ; fi +# if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d ggi ] ; then cd ggi ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d ggi ] ; then cd ggi/demos; $(MAKE) ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + +# if you change GGI_DEST please change it in ggimesa.conf, too. +DESTDIR=/usr/local +GGI_DEST=lib/ggi/mesa + +linux-ggi-install linux-386-ggi-install: + install -d $(DESTDIR)/$(GGI_DEST)/default $(DESTDIR)/$(GGI_DEST)/display $(DESTDIR)/etc/ggi + install -m 0755 src/GGI/default/*.so $(DESTDIR)/$(GGI_DEST)/default + install -m 0755 src/GGI/display/*.so $(DESTDIR)/$(GGI_DEST)/display + install -m 0644 src/GGI/ggimesa.conf $(DESTDIR)/etc/ggi +# if [ -z "`grep ggimesa $(DESTDIR)/etc/ggi/libggi.conf`" ]; then \ +# echo ".include $(DESTDIR)/etc/ggi/ggimesa.conf" >> $(DESTDIR)/etc/ggi/libggi.conf ; \ +# fi + +# Remove .o files, emacs backup files, etc. +clean: + -rm -f ggi/*~ *.o + -rm -f src/GGI/default/*~ *.so + -rm -f src/GGI/display/*~ *.so + -rm -f include/*~ + -rm -f include/GL/*~ + -rm -f src/*.o src/*~ src/*.a src/*/*.o src/*/*~ + -rm -f src-glu/*.o src-glu/*~ src-glu/*.a + -rm -f src-glut/*.o + -rm -f demos/*.o + -rm -f book/*.o book/*~ + -rm -f xdemos/*.o xdemos/*~ + -rm -f samples/*.o samples/*~ + -rm -f ggi/*.o ggi/demos/*.o ggi/*.a + -rm -f widgets-sgi/*.o + -rm -f widgets-mesa/*/*.o + +# Remove everything that can be remade +realclean: clean + -rm -f lib/* + 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-3.4 +LIB_NAME = MesaLib-3.4 +DEMO_NAME = MesaDemos-3.4 +GLU_NAME = MesaGLU-3.4 +GLUT_NAME = GLUT-3.7 + + +LIB_FILES = \ + $(DIRECTORY)/Makefile* \ + $(DIRECTORY)/Make-config \ + $(DIRECTORY)/acconfig.h \ + $(DIRECTORY)/acinclude.m4 \ + $(DIRECTORY)/aclocal.m4 \ + $(DIRECTORY)/conf.h.in \ + $(DIRECTORY)/config.guess \ + $(DIRECTORY)/config.sub \ + $(DIRECTORY)/configure \ + $(DIRECTORY)/configure.in \ + $(DIRECTORY)/install-sh \ + $(DIRECTORY)/ltconfig \ + $(DIRECTORY)/ltmain.sh \ + $(DIRECTORY)/missing \ + $(DIRECTORY)/mkinstalldirs \ + $(DIRECTORY)/stamp-h.in \ + $(DIRECTORY)/docs/CONFIG \ + $(DIRECTORY)/docs/CONFORM \ + $(DIRECTORY)/docs/COPYING \ + $(DIRECTORY)/docs/COPYRIGHT \ + $(DIRECTORY)/docs/DEVINFO \ + $(DIRECTORY)/docs/IAFA-PACKAGE \ + $(DIRECTORY)/docs/INSTALL \ + $(DIRECTORY)/docs/INSTALL.GNU \ + $(DIRECTORY)/docs/README \ + $(DIRECTORY)/docs/README.* \ + $(DIRECTORY)/docs/RELNOTES* \ + $(DIRECTORY)/docs/VERSIONS \ + $(DIRECTORY)/docs/*.spec \ + $(DIRECTORY)/bin/README \ + $(DIRECTORY)/bin/mklib* \ + $(DIRECTORY)/*.BAT \ + $(DIRECTORY)/*.bat \ + $(DIRECTORY)/descrip.mms \ + $(DIRECTORY)/mms-config \ + $(DIRECTORY)/xlib.opt \ + $(DIRECTORY)/STARTUP.MK \ + $(DIRECTORY)/mesawin32.mak \ + $(DIRECTORY)/Names.win \ + $(DIRECTORY)/win32-openstep.sh \ + $(DIRECTORY)/common.dja \ + $(DIRECTORY)/include/GL/Makefile.in \ + $(DIRECTORY)/include/GL/Makefile.am \ + $(DIRECTORY)/include/GL/dosmesa.h \ + $(DIRECTORY)/include/GL/amesa.h \ + $(DIRECTORY)/include/GL/fxmesa.h \ + $(DIRECTORY)/include/GL/ggimesa.h \ + $(DIRECTORY)/include/GL/gl.h \ + $(DIRECTORY)/include/GL/glext.h \ + $(DIRECTORY)/include/GL/gl_mangle.h \ + $(DIRECTORY)/include/GL/glu.h \ + $(DIRECTORY)/include/GL/glu_mangle.h \ + $(DIRECTORY)/include/GL/glx.h \ + $(DIRECTORY)/include/GL/glx_mangle.h \ + $(DIRECTORY)/include/GL/mesa_wgl.h \ + $(DIRECTORY)/include/GL/mglmesa.h \ + $(DIRECTORY)/include/GL/osmesa.h \ + $(DIRECTORY)/include/GL/svgamesa.h \ + $(DIRECTORY)/include/GL/wmesa.h \ + $(DIRECTORY)/include/GL/xmesa.h \ + $(DIRECTORY)/include/GL/xmesa_x.h \ + $(DIRECTORY)/include/GL/xmesa_xf86.h \ + $(DIRECTORY)/include/GLView.h \ + $(DIRECTORY)/include/Makefile.in \ + $(DIRECTORY)/include/Makefile.am \ + $(DIRECTORY)/src/Makefile* \ + $(DIRECTORY)/src/descrip.mms \ + $(DIRECTORY)/src/mms_depend \ + $(DIRECTORY)/src/mesa.conf \ + $(DIRECTORY)/src/*.def \ + $(DIRECTORY)/src/depend \ + $(DIRECTORY)/src/*.[chS] \ + $(DIRECTORY)/src/Allegro/*.[ch] \ + $(DIRECTORY)/src/BeOS/*.cpp \ + $(DIRECTORY)/src/D3D/*.cpp \ + $(DIRECTORY)/src/D3D/*.CPP \ + $(DIRECTORY)/src/D3D/*.h \ + $(DIRECTORY)/src/D3D/*.H \ + $(DIRECTORY)/src/D3D/*.c \ + $(DIRECTORY)/src/D3D/*.C \ + $(DIRECTORY)/src/D3D/MAKEFILE \ + $(DIRECTORY)/src/D3D/*bat \ + $(DIRECTORY)/src/D3D/*DEF \ + $(DIRECTORY)/src/DOS/DEPEND.DOS \ + $(DIRECTORY)/src/DOS/*.c \ + $(DIRECTORY)/src/FX/Makefile.am \ + $(DIRECTORY)/src/FX/Makefile.in \ + $(DIRECTORY)/src/FX/*.[ch] \ + $(DIRECTORY)/src/FX/*.def \ + $(DIRECTORY)/src/FX/X86/Makefile.am \ + $(DIRECTORY)/src/FX/X86/Makefile.in \ + $(DIRECTORY)/src/FX/X86/*.[Shc] \ + $(DIRECTORY)/src/GGI/Makefile.am \ + $(DIRECTORY)/src/GGI/Makefile.in \ + $(DIRECTORY)/src/GGI/*.[ch] \ + $(DIRECTORY)/src/GGI/ggimesa.conf.in \ + $(DIRECTORY)/src/GGI/default/*.c \ + $(DIRECTORY)/src/GGI/default/Makefile.am \ + $(DIRECTORY)/src/GGI/default/Makefile.in \ + $(DIRECTORY)/src/GGI/default/genkgi.conf.in \ + $(DIRECTORY)/src/GGI/display/*.c \ + $(DIRECTORY)/src/GGI/display/Makefile.am \ + $(DIRECTORY)/src/GGI/display/Makefile.in \ + $(DIRECTORY)/src/GGI/display/fbdev.conf.in \ + $(DIRECTORY)/src/GGI/include/Makefile.am \ + $(DIRECTORY)/src/GGI/include/Makefile.in \ + $(DIRECTORY)/src/GGI/include/ggi/Makefile.am \ + $(DIRECTORY)/src/GGI/include/ggi/Makefile.in \ + $(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.am \ + $(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.in \ + $(DIRECTORY)/src/GGI/include/ggi/mesa/*.h \ + $(DIRECTORY)/src/KNOWN_BUGS \ + $(DIRECTORY)/src/OSmesa/Makefile.am \ + $(DIRECTORY)/src/OSmesa/Makefile.in \ + $(DIRECTORY)/src/OSmesa/*.[ch] \ + $(DIRECTORY)/src/S3/*.[ch] \ + $(DIRECTORY)/src/S3/*.def \ + $(DIRECTORY)/src/S3/*.mak \ + $(DIRECTORY)/src/S3/*.rc \ + $(DIRECTORY)/src/SVGA/Makefile.am \ + $(DIRECTORY)/src/SVGA/Makefile.in \ + $(DIRECTORY)/src/SVGA/*.[ch] \ + $(DIRECTORY)/src/Windows/*.[ch] \ + $(DIRECTORY)/src/Windows/*.def \ + $(DIRECTORY)/src/X/Makefile.am \ + $(DIRECTORY)/src/X/Makefile.in \ + $(DIRECTORY)/src/X/*.[ch] \ + $(DIRECTORY)/src/X86/*.[ch] \ + $(DIRECTORY)/src/X86/Makefile.am \ + $(DIRECTORY)/src/X86/Makefile.in \ + $(DIRECTORY)/src/X86/*.S \ + $(DIRECTORY)/src-glu/README[12] \ + $(DIRECTORY)/src-glu/Makefile* \ + $(DIRECTORY)/src-glu/descrip.mms \ + $(DIRECTORY)/src-glu/mms_depend \ + $(DIRECTORY)/src-glu/*.def \ + $(DIRECTORY)/src-glu/depend \ + $(DIRECTORY)/src-glu/*.[ch] \ + $(DIRECTORY)/widgets-mesa/ChangeLog \ + $(DIRECTORY)/widgets-mesa/INSTALL \ + $(DIRECTORY)/widgets-mesa/Makefile.in \ + $(DIRECTORY)/widgets-mesa/README \ + $(DIRECTORY)/widgets-mesa/TODO \ + $(DIRECTORY)/widgets-mesa/configure \ + $(DIRECTORY)/widgets-mesa/demos/ChangeLog \ + $(DIRECTORY)/widgets-mesa/demos/Cube \ + $(DIRECTORY)/widgets-mesa/demos/Ed \ + $(DIRECTORY)/widgets-mesa/demos/Makefile.in \ + $(DIRECTORY)/widgets-mesa/demos/Mcube \ + $(DIRECTORY)/widgets-mesa/demos/Tea \ + $(DIRECTORY)/widgets-mesa/demos/*.[ch] \ + $(DIRECTORY)/widgets-mesa/demos/events \ + $(DIRECTORY)/widgets-mesa/include/GL/ChangeLog \ + $(DIRECTORY)/widgets-mesa/include/GL/*.h \ + $(DIRECTORY)/widgets-mesa/include/GL/Makefile.in \ + $(DIRECTORY)/widgets-mesa/man/ChangeLog \ + $(DIRECTORY)/widgets-mesa/man/GL* \ + $(DIRECTORY)/widgets-mesa/man/Makefile.in \ + $(DIRECTORY)/widgets-mesa/man/Mesa* \ + $(DIRECTORY)/widgets-mesa/src/ChangeLog \ + $(DIRECTORY)/widgets-mesa/src/*.c \ + $(DIRECTORY)/widgets-mesa/src/Makefile.in \ + $(DIRECTORY)/widgets-sgi/*.[ch] \ + $(DIRECTORY)/widgets-sgi/Makefile* \ + $(DIRECTORY)/widgets-sgi/README \ + $(DIRECTORY)/util/README \ + $(DIRECTORY)/util/Makefile.am \ + $(DIRECTORY)/util/Makefile.in \ + $(DIRECTORY)/util/*.[ch] \ + $(DIRECTORY)/util/sampleMakefile \ + $(DIRECTORY)/vms/analyze_map.com \ + $(DIRECTORY)/vms/xlib.opt \ + $(DIRECTORY)/vms/xlib_share.opt \ + $(DIRECTORY)/BeOS/Makefile \ + $(DIRECTORY)/BeOS/*.cpp \ + $(DIRECTORY)/WIN32/NMAKE.MAK \ + $(DIRECTORY)/WIN32/NMAKE.MIF \ + $(DIRECTORY)/WIN32/RES/*rc \ + $(DIRECTORY)/WIN32/RES/*def \ + $(DIRECTORY)/WIN32/RULES/lib.* \ + $(DIRECTORY)/WIN32/RULES/progs.* \ + $(DIRECTORY)/macos/README \ + $(DIRECTORY)/macos/gli_api/*.h \ + $(DIRECTORY)/macos/cglpane/CGLPane.* \ + $(DIRECTORY)/macos/include-mac/*.h \ + $(DIRECTORY)/macos/libraries/*.stub \ + $(DIRECTORY)/macos/libraries/*Stub \ + $(DIRECTORY)/macos/projects/*.mcp \ + $(DIRECTORY)/macos/projects/*.exp \ + $(DIRECTORY)/macos/projects/*.h \ + $(DIRECTORY)/macos/resources/*.c \ + $(DIRECTORY)/macos/resources/*.r \ + $(DIRECTORY)/macos/resources/*.rsrc \ + $(DIRECTORY)/macos/src-agl/*.exp \ + $(DIRECTORY)/macos/src-agl/*.[ch] \ + $(DIRECTORY)/macos/src-gli/*.[ch] \ + $(DIRECTORY)/OpenStep + +DEMO_FILES = \ + $(DIRECTORY)/include/GL/glut.h \ + $(DIRECTORY)/include/GL/glutf90.h \ + $(DIRECTORY)/include/GL/glut_h.dja \ + $(DIRECTORY)/src-glut/Makefile* \ + $(DIRECTORY)/src-glut/depend \ + $(DIRECTORY)/src-glut/*def \ + $(DIRECTORY)/src-glut/descrip.mms \ + $(DIRECTORY)/src-glut/mms_depend \ + $(DIRECTORY)/src-glut/*.[ch] \ + $(DIRECTORY)/src-glut.dja/* \ + $(DIRECTORY)/src-glut.beos/Makefile \ + $(DIRECTORY)/src-glut.beos/*.cpp \ + $(DIRECTORY)/src-glut.beos/*.h \ + $(DIRECTORY)/images/* \ + $(DIRECTORY)/demos/Makefile* \ + $(DIRECTORY)/demos/descrip.mms \ + $(DIRECTORY)/demos/*.[ch] \ + $(DIRECTORY)/demos/*.cxx \ + $(DIRECTORY)/demos/*.dat \ + $(DIRECTORY)/demos/README \ + $(DIRECTORY)/xdemos/Makefile* \ + $(DIRECTORY)/xdemos/descrip.mms \ + $(DIRECTORY)/xdemos/*.[cf] \ + $(DIRECTORY)/book/Makefile* \ + $(DIRECTORY)/book/README \ + $(DIRECTORY)/book/*.[ch] \ + $(DIRECTORY)/samples/Makefile* \ + $(DIRECTORY)/samples/README \ + $(DIRECTORY)/samples/*.c \ + $(DIRECTORY)/mtdemos \ + $(DIRECTORY)/ggi + +GLU_FILES = \ + $(DIRECTORY)/Makefile* \ + $(DIRECTORY)/Make-config \ + $(DIRECTORY)/bin/mklib* \ + $(DIRECTORY)/include/GL/gl.h \ + $(DIRECTORY)/include/GL/gl_mangle.h \ + $(DIRECTORY)/include/GL/glext.h \ + $(DIRECTORY)/include/GL/glu.h \ + $(DIRECTORY)/include/GL/glu_mangle.h \ + $(DIRECTORY)/src-glu/README[12] \ + $(DIRECTORY)/src-glu/Makefile* \ + $(DIRECTORY)/src-glu/descrip.mms \ + $(DIRECTORY)/src-glu/mms_depend \ + $(DIRECTORY)/src-glu/*.def \ + $(DIRECTORY)/src-glu/depend \ + $(DIRECTORY)/src-glu/*.[ch] + +GLUT_FILES = \ + $(DIRECTORY)/Makefile* \ + $(DIRECTORY)/Make-config \ + $(DIRECTORY)/bin/mklib* \ + $(DIRECTORY)/include/GL/gl.h \ + $(DIRECTORY)/include/GL/gl_mangle.h \ + $(DIRECTORY)/include/GL/glext.h \ + $(DIRECTORY)/include/GL/glu.h \ + $(DIRECTORY)/include/GL/glu_mangle.h \ + $(DIRECTORY)/include/GL/glut.h \ + $(DIRECTORY)/include/GL/glutf90.h \ + $(DIRECTORY)/include/GL/glut_h.dja \ + $(DIRECTORY)/src-glut/Makefile* \ + $(DIRECTORY)/src-glut/depend \ + $(DIRECTORY)/src-glut/*def \ + $(DIRECTORY)/src-glut/descrip.mms \ + $(DIRECTORY)/src-glut/mms_depend \ + $(DIRECTORY)/src-glut/*.[ch] \ + $(DIRECTORY)/src-glut.dja/* \ + $(DIRECTORY)/src-glut.beos/Makefile \ + $(DIRECTORY)/src-glut.beos/*.cpp \ + $(DIRECTORY)/src-glut.beos/*.h + + +lib_tar: + cp Makefile.X11 Makefile ; \ + cd .. ; \ + tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \ + gzip $(LIB_NAME).tar ; \ + mv $(LIB_NAME).tar.gz $(DIRECTORY) + +demo_tar: + cd .. ; \ + tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) ; \ + gzip $(DEMO_NAME).tar ; \ + mv $(DEMO_NAME).tar.gz $(DIRECTORY) + +glu_tar: + cp Makefile.X11 Makefile ; \ + cd .. ; \ + tar -cvf $(GLU_NAME).tar $(GLU_FILES) ; \ + gzip $(GLU_NAME).tar ; \ + mv $(GLU_NAME).tar.gz $(DIRECTORY) + +glut_tar: + cp Makefile.X11 Makefile ; \ + cd .. ; \ + tar -cvf $(GLUT_NAME).tar $(GLUT_FILES) ; \ + gzip $(GLUT_NAME).tar ; \ + mv $(GLUT_NAME).tar.gz $(DIRECTORY) + + +lib_zip: + -rm $(LIB_NAME).zip ; \ + cp Makefile.X11 Makefile ; \ + cd .. ; \ + zip -r $(LIB_NAME).zip $(LIB_FILES) ; \ + mv $(LIB_NAME).zip $(DIRECTORY) + +demo_zip: + -rm $(DEMO_NAME).zip ; \ + cd .. ; \ + zip -r $(DEMO_NAME).zip $(DEMO_FILES) ; \ + mv $(DEMO_NAME).zip $(DIRECTORY) + + + +SRC_FILES = \ + RELNOTES \ + src/Makefile* \ + src/depend \ + src/*.[chS] \ + src/*/*.[ch] \ + include/GL/*.h + +srctar: + tar -cvf src.tar $(SRC_FILES) ; \ + gzip src.tar + +srctar.zip: + -rm src.zip + zip -r src.zip $(SRC_FILES) ; \ diff --git a/xc/extras/Mesa/Makefile.X11 b/xc/extras/Mesa/Makefile.X11 new file mode 100644 index 000000000..82eb4cbf0 --- /dev/null +++ b/xc/extras/Mesa/Makefile.X11 @@ -0,0 +1,660 @@ +# $Id: Makefile.X11,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# Mesa 3-D graphics library +# Version: 3.4 +# +# Copyright (C) 1999-2000 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# 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. + + +# Top-level makefile for Mesa +# To add a new configuration for your system add it to the list below +# then update the Make-config file. + +SHELL = /bin/sh + + + +default: + @echo "Type one of the following:" + @echo " make aix for IBM RS/6000 with AIX" + @echo " make aix-sl for IBM RS/6000, make shared libs" + @echo " make amiwin for Amiga with SAS/C and AmiWin" + @echo " make amix for Amiga 3000 UX SVR4 v2.1 systems" + @echo " make beos-r4 for BeOS R4" + @echo " make bsdos for BSD/OS from BSDI using GCC" + @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 dgux for Data General" + @echo " make freebsd for FreeBSD systems with GCC" + @echo " make freebsd-386 for FreeBSD systems with GCC, w/ Intel assembly" + @echo " make gcc for a generic system with GCC" + @echo " make hpux9 for HP systems with HPUX 9.x" + @echo " make hpux9-sl for HP systems with HPUX 9.x, make shared libs" + @echo " make hpux9-gcc for HP systems with HPUX 9.x using GCC" + @echo " make hpux9-gcc-sl for HP systems with HPUX 9.x, GCC, make shared libs" + @echo " make hpux10 for HP systems with HPUX 10.x" + @echo " make hpux10-sl for HP systems with HPUX 10.x, shared libs" + @echo " make hpux10-gcc for HP systems with HPUX 10.x w/ GCC" + @echo " make hpux10-gcc-sl for HP systems with HPUX 10.x w/ GCC, shared libs" + @echo " make irix4 for SGI systems with IRIX 4.x" + @echo " make irix5 for SGI systems with IRIX 5.x" + @echo " make irix5-gcc for SGI systems with IRIX 5.x using GCC" + @echo " make irix5-dso for SGI systems with IRIX 5.x, make DSOs" + @echo " make irix6-o32 for SGI systems with IRIX 6.x, make o32-bit libs" + @echo " make irix6-o32-dso for SGI systems with IRIX 6.x, make o32-bit DSOs" + @echo " make irix6-n32 for SGI systems with IRIX 6.x, make n32-bit libs" + @echo " make irix6-n32-dso for SGI systems with IRIX 6.x, make n32-bit DSOs" + @echo " make irix6-gcc-n32-sl for SGI systems with IRIX 6.x, GCC, make n32 DSOs" + @echo " make irix6-64 for SGI systems with IRIX 6.x, make 64-bit libs" + @echo " make irix6-64-dso for SGI systems with IRIX 6.x, make 64-bit DSOs" + + @echo " make linux for Linux systems, make shared .so libs" + @echo " make linux-static for Linux systems, make static .a libs" + @echo " make linux-x86 for Linux on Intel, make shared .so libs" + @echo " make linux-x86-static for Linux on Intel, make static .a libs" + @echo " make linux-ggi for Linux systems with libggi" + @echo " make linux-386-ggi for Linux systems with libggi w/ Intel assembly" + @echo " make linux-glide for Linux w/ 3Dfx Glide driver" + @echo " make linux-386-glide for Linux w/ 3Dfx Glide driver, Intel assembly" + @echo " make linux-386-opt-glide for Linux with 3Dfx Voodoo1 for GLQuake" + @echo " make linux-386-opt-V2-glide for Linux with 3Dfx Voodoo2 for GLQuake" + @echo " make linux-x86-glide for Linux w/ all x86 asm for Glide" + @echo " make linux-alpha for Linux on Alpha systems" + @echo " make linux-alpha-static for Linux on Alpha systems, static libs" + @echo " make linux-ppc for Linux on PowerPC systems" + @echo " make linux-ppc-static for Linux on PowerPC systems, static libs" + @echo " make linux-sparc for Linux on Sparc systems" + @echo " make linux-sparc5-elf for Sparc5 systems, make ELF shared libs" + @echo " make linux-sparc-ultra for UltraSparc systems, make ELF shared libs" + @echo " make lynxos for LynxOS systems with GCC" + @echo " make macintosh for Macintosh" + @echo " make machten-2.2 for Macs w/ MachTen 2.2 (68k w/ FPU)" + @echo " make machten-4.0 for Macs w/ MachTen 4.0.1 or newer with GNU make" + @echo " make mklinux for Linux on Power Macintosh" + @echo " make netbsd for NetBSD 1.0 systems with GCC" + @echo " make next for NeXT systems with NEXTSTEP 3.3" + @echo " make openbsd for OpenBSD systems" + @echo " make openstep for OpenStep/MacOSX Server systems" + @echo " make os2-x11 for OS/2 with XFree86" + @echo " make osf1 for DEC Alpha systems with OSF/1" + @echo " make osf1-sl for DEC Alpha systems with OSF/1, make shared libs" + @echo " make pgi-cygnus for Cygnus with Portland Group, Inc. compiler" + @echo " make pgi-mingw32 for mingW32 with Portland Group, Inc. compiler" + @echo " make qnx for QNX V4 systems with Watcom compiler" + @echo " make sco for SCO Unix systems with ODT" + @echo " make sco5 for SCO 5.0.5 OpenServer Unix" + @echo " make solaris-x86 for PCs with Solaris" + @echo " make solaris-x86-gcc for PCs with Solaris using GCC" + @echo " make sunos4 for Suns with SunOS 4.x" + @echo " make sunos4-sl for Suns with SunOS 4.x, make shared libs" + @echo " make sunos4-gcc for Suns with SunOS 4.x and GCC" + @echo " make sunos4-gcc-sl for Suns with SunOS 4.x, GCC, make shared libs" + @echo " make sunos5 for Suns with SunOS 5.x" + @echo " make sunos5-sl for Suns with SunOS 5.x, make shared libs" + @echo " make sunos5-ultra for Sun UltraSPARCs with SunOS 5.x" + @echo " make sunos5-ultra-sl for Sun UltraSPARCs with SunOS 5.x, make shared libs" + @echo " make sunos5-thread for Suns with SunOS 5.x, using Solaris threads" + @echo " make sunos5-pthread for Suns with SunOS 5.[56] using POSIX threads" + @echo " make sunos5-gcc-thread for Suns with SunOS 5.x and GCC, using Solaris threads" + @echo " make sunos5-gcc-pthread for Suns with SunOS 5.[56] and GCC, using POSIX threads" + @echo " make sunos5-gcc for Suns with SunOS 5.x and GCC" + @echo " make sunos5-gcc-sl for Suns with SunOS 5.x, GCC, make shared libs" + @echo " make sunos5-x11r6-gcc-sl for Suns with X11R6, GCC, make shared libs" + @echo " make sunos5-gcc-thread for Suns with SunOS 5.x and GCC, using Solaris threads" + @echo " make sunos5-gcc-pthread for Suns with SunOS 5.[56] and GCC, using POSIX threads" + @echo " make sunSolaris-CC for Solaris using C++ compiler" + @echo " make ultrix-gcc for DEC systems with Ultrix and GCC" + @echo " make unicos for Cray C90 (and other?) systems" + @echo " make unixware for PCs running UnixWare" + @echo " make unixware-shared for PCs running UnixWare, shared libs" + @echo " make uwin for Windows NT with AT&T/Wipro UWIN" + @echo " make vistra for Stardent Vistra systems" + @echo " make clean remove .o files" + @echo " make realclean remove .o, library and executable files" + + + +aix aix-sl amix bsdos bsdos4 dgux freebsd freebsd-386 gcc \ +hpux9 hpux9-sl hpux9-gcc hpux9-gcc-sl \ +hpux10 hpux10-sl hpux10-gcc hpux10-gcc-sl \ +irix4 irix5 irix5-gcc irix5-dso irix6-o32 irix6-o32-dso \ +linux linux-static linux-debug linux-static-debug linux-prof \ +linux-x86 linux-x86-static linux-x86-debug \ +linux-glide linux-386-glide linux-386-opt-glide \ +linux-386-opt-V2-glide linux-x86-glide linux-glide-debug linux-glide-prof \ +linux-alpha-static linux-alpha \ +linux-ppc-static linux-ppc \ +linux-sparc \ +linux-sparc5-elf \ +linux-sparc-ultra \ +lynxos machten-2.2 machten-4.0 \ +mklinux netbsd osf1 osf1-sl openbsd qnx sco sco5 \ +solaris-x86 solaris-x86-gcc sunSolaris-CC \ +sunos4 sunos4-sl sunos4-gcc sunos4-gcc-sl sunos4-gcc-x11r6-sl \ +sunos5 sunos5-sl sunos5-ultra sunos5-ultra-sl sunos5-gcc sunos5-gcc-sl \ +sunos5-thread sunos5-pthread sunos5-gcc-thread sunos5-gcc-pthread \ +sunos5-x11r6-gcc-sl ultrix-gcc unicos unixware uwin vistra: + -mkdir lib + 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 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 + if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + +irix6-n32 irix6-n32-dso irix6-gcc-n32-sl irix-debug: + -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 + if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + + +irix6-64 irix6-64-dso: + -mkdir lib64 + touch src/depend + touch src-glu/depend + 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 + if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + + +amiwin: + bin/mklib.amiwin + + +beos-r4: + -mkdir lib + -rm src/depend + touch src/depend + -rm src-glu/depend + touch src-glu/depend + if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + if [ -d src-glu ] ; then cd src-glu ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + if [ -d BeOS ] ; then cd BeOS ; $(MAKE) ; fi + if [ -d src-glut.beos ] ; then cd src-glut.beos ; $(MAKE) ; fi + if [ -d src-glut.beos ] ; then cp src-glut.beos/obj*/libglut.so lib ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.BeOS-R4 $@ ; fi + +pgi-cygnus pgi-mingw32 \ +cygnus cygnus-linux: + -mkdir lib + touch src/depend + touch src-glu/depend + 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 + if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + +macintosh: + @echo "See the README file for Macintosh intallation information" + +next: + -mkdir lib + cd src ; $(MAKE) -f Makefile.X11 "MYCC=${CC}" $@ + cd src-glu ; $(MAKE) -f Makefile.X11 "MYCC=${CC}" $@ + +openstep: + -mkdir lib + cd src ; $(MAKE) -f Makefile.X11 "MYCC=${CC}" $@ + cd src-glu ; $(MAKE) -f Makefile.X11 "MYCC=${CC}" $@ + +os2-x11: + if not EXIST .\lib md lib + touch src/depend + touch src-glu/depend + if exist src-glut touch src-glut/depend + cd src & make -f Makefile.X11 $@ + cd src-glu & make -f Makefile.X11 $@ + if exist src-glut cd src-glut & make -f Makefile.X11 $@ + if exist demos cd demos & make -f Makefile.X11 $@ + if exist xdemos cd xdemos & make -f Makefile.X11 $@ + if exist samples cd samples & make -f Makefile.X11 $@ + if exist book cd book & make -f Makefile.X11 $@ + +linux-ggi linux-386-ggi: + -mkdir lib + touch src/depend + touch src-glu/depend + if [ -d src-glut ] ; then touch src-glut/depend ; fi + if [ -d widgets-sgi ] ; then touch widgets-sgi/depend ; fi + if [ -d ggi ] ; then touch ggi/depend ; fi + if [ -d src ] ; then cd src ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d src/GGI/default ] ; then cd src/GGI/default ; $(MAKE) ; fi + if [ -d src/GGI/display ] ; then cd src/GGI/display ; $(MAKE) ; fi + if [ -d src-glut ] ; then cd src-glu ; $(MAKE) -f Makefile.X11 $@ ; fi +# if [ -d src-glut ] ; then cd src-glut ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d ggi ] ; then cd ggi ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d ggi ] ; then cd ggi/demos; $(MAKE) ; fi + if [ -d demos ] ; then cd demos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d xdemos ] ; then cd xdemos ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d samples ] ; then cd samples ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d book ] ; then cd book ; $(MAKE) -f Makefile.X11 $@ ; fi + if [ -d widgets-sgi ] ; then cd widgets-sgi; $(MAKE) -f Makefile.X11 $@ ; fi + +# if you change GGI_DEST please change it in ggimesa.conf, too. +DESTDIR=/usr/local +GGI_DEST=lib/ggi/mesa + +linux-ggi-install linux-386-ggi-install: + install -d $(DESTDIR)/$(GGI_DEST)/default $(DESTDIR)/$(GGI_DEST)/display $(DESTDIR)/etc/ggi + install -m 0755 src/GGI/default/*.so $(DESTDIR)/$(GGI_DEST)/default + install -m 0755 src/GGI/display/*.so $(DESTDIR)/$(GGI_DEST)/display + install -m 0644 src/GGI/ggimesa.conf $(DESTDIR)/etc/ggi +# if [ -z "`grep ggimesa $(DESTDIR)/etc/ggi/libggi.conf`" ]; then \ +# echo ".include $(DESTDIR)/etc/ggi/ggimesa.conf" >> $(DESTDIR)/etc/ggi/libggi.conf ; \ +# fi + +# Remove .o files, emacs backup files, etc. +clean: + -rm -f ggi/*~ *.o + -rm -f src/GGI/default/*~ *.so + -rm -f src/GGI/display/*~ *.so + -rm -f include/*~ + -rm -f include/GL/*~ + -rm -f src/*.o src/*~ src/*.a src/*/*.o src/*/*~ + -rm -f src-glu/*.o src-glu/*~ src-glu/*.a + -rm -f src-glut/*.o + -rm -f demos/*.o + -rm -f book/*.o book/*~ + -rm -f xdemos/*.o xdemos/*~ + -rm -f samples/*.o samples/*~ + -rm -f ggi/*.o ggi/demos/*.o ggi/*.a + -rm -f widgets-sgi/*.o + -rm -f widgets-mesa/*/*.o + +# Remove everything that can be remade +realclean: clean + -rm -f lib/* + 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-3.4 +LIB_NAME = MesaLib-3.4 +DEMO_NAME = MesaDemos-3.4 +GLU_NAME = MesaGLU-3.4 +GLUT_NAME = GLUT-3.7 + + +LIB_FILES = \ + $(DIRECTORY)/Makefile* \ + $(DIRECTORY)/Make-config \ + $(DIRECTORY)/acconfig.h \ + $(DIRECTORY)/acinclude.m4 \ + $(DIRECTORY)/aclocal.m4 \ + $(DIRECTORY)/conf.h.in \ + $(DIRECTORY)/config.guess \ + $(DIRECTORY)/config.sub \ + $(DIRECTORY)/configure \ + $(DIRECTORY)/configure.in \ + $(DIRECTORY)/install-sh \ + $(DIRECTORY)/ltconfig \ + $(DIRECTORY)/ltmain.sh \ + $(DIRECTORY)/missing \ + $(DIRECTORY)/mkinstalldirs \ + $(DIRECTORY)/stamp-h.in \ + $(DIRECTORY)/docs/CONFIG \ + $(DIRECTORY)/docs/CONFORM \ + $(DIRECTORY)/docs/COPYING \ + $(DIRECTORY)/docs/COPYRIGHT \ + $(DIRECTORY)/docs/DEVINFO \ + $(DIRECTORY)/docs/IAFA-PACKAGE \ + $(DIRECTORY)/docs/INSTALL \ + $(DIRECTORY)/docs/INSTALL.GNU \ + $(DIRECTORY)/docs/README \ + $(DIRECTORY)/docs/README.* \ + $(DIRECTORY)/docs/RELNOTES* \ + $(DIRECTORY)/docs/VERSIONS \ + $(DIRECTORY)/docs/*.spec \ + $(DIRECTORY)/bin/README \ + $(DIRECTORY)/bin/mklib* \ + $(DIRECTORY)/*.BAT \ + $(DIRECTORY)/*.bat \ + $(DIRECTORY)/descrip.mms \ + $(DIRECTORY)/mms-config \ + $(DIRECTORY)/xlib.opt \ + $(DIRECTORY)/STARTUP.MK \ + $(DIRECTORY)/mesawin32.mak \ + $(DIRECTORY)/Names.win \ + $(DIRECTORY)/win32-openstep.sh \ + $(DIRECTORY)/common.dja \ + $(DIRECTORY)/include/GL/Makefile.in \ + $(DIRECTORY)/include/GL/Makefile.am \ + $(DIRECTORY)/include/GL/dosmesa.h \ + $(DIRECTORY)/include/GL/amesa.h \ + $(DIRECTORY)/include/GL/fxmesa.h \ + $(DIRECTORY)/include/GL/ggimesa.h \ + $(DIRECTORY)/include/GL/gl.h \ + $(DIRECTORY)/include/GL/glext.h \ + $(DIRECTORY)/include/GL/gl_mangle.h \ + $(DIRECTORY)/include/GL/glu.h \ + $(DIRECTORY)/include/GL/glu_mangle.h \ + $(DIRECTORY)/include/GL/glx.h \ + $(DIRECTORY)/include/GL/glx_mangle.h \ + $(DIRECTORY)/include/GL/mesa_wgl.h \ + $(DIRECTORY)/include/GL/mglmesa.h \ + $(DIRECTORY)/include/GL/osmesa.h \ + $(DIRECTORY)/include/GL/svgamesa.h \ + $(DIRECTORY)/include/GL/wmesa.h \ + $(DIRECTORY)/include/GL/xmesa.h \ + $(DIRECTORY)/include/GL/xmesa_x.h \ + $(DIRECTORY)/include/GL/xmesa_xf86.h \ + $(DIRECTORY)/include/GLView.h \ + $(DIRECTORY)/include/Makefile.in \ + $(DIRECTORY)/include/Makefile.am \ + $(DIRECTORY)/src/Makefile* \ + $(DIRECTORY)/src/descrip.mms \ + $(DIRECTORY)/src/mms_depend \ + $(DIRECTORY)/src/mesa.conf \ + $(DIRECTORY)/src/*.def \ + $(DIRECTORY)/src/depend \ + $(DIRECTORY)/src/*.[chS] \ + $(DIRECTORY)/src/Allegro/*.[ch] \ + $(DIRECTORY)/src/BeOS/*.cpp \ + $(DIRECTORY)/src/D3D/*.cpp \ + $(DIRECTORY)/src/D3D/*.CPP \ + $(DIRECTORY)/src/D3D/*.h \ + $(DIRECTORY)/src/D3D/*.H \ + $(DIRECTORY)/src/D3D/*.c \ + $(DIRECTORY)/src/D3D/*.C \ + $(DIRECTORY)/src/D3D/MAKEFILE \ + $(DIRECTORY)/src/D3D/*bat \ + $(DIRECTORY)/src/D3D/*DEF \ + $(DIRECTORY)/src/DOS/DEPEND.DOS \ + $(DIRECTORY)/src/DOS/*.c \ + $(DIRECTORY)/src/FX/Makefile.am \ + $(DIRECTORY)/src/FX/Makefile.in \ + $(DIRECTORY)/src/FX/*.[ch] \ + $(DIRECTORY)/src/FX/*.def \ + $(DIRECTORY)/src/FX/X86/Makefile.am \ + $(DIRECTORY)/src/FX/X86/Makefile.in \ + $(DIRECTORY)/src/FX/X86/*.[Shc] \ + $(DIRECTORY)/src/GGI/Makefile.am \ + $(DIRECTORY)/src/GGI/Makefile.in \ + $(DIRECTORY)/src/GGI/*.[ch] \ + $(DIRECTORY)/src/GGI/ggimesa.conf.in \ + $(DIRECTORY)/src/GGI/default/*.c \ + $(DIRECTORY)/src/GGI/default/Makefile.am \ + $(DIRECTORY)/src/GGI/default/Makefile.in \ + $(DIRECTORY)/src/GGI/default/genkgi.conf.in \ + $(DIRECTORY)/src/GGI/display/*.c \ + $(DIRECTORY)/src/GGI/display/Makefile.am \ + $(DIRECTORY)/src/GGI/display/Makefile.in \ + $(DIRECTORY)/src/GGI/display/fbdev.conf.in \ + $(DIRECTORY)/src/GGI/include/Makefile.am \ + $(DIRECTORY)/src/GGI/include/Makefile.in \ + $(DIRECTORY)/src/GGI/include/ggi/Makefile.am \ + $(DIRECTORY)/src/GGI/include/ggi/Makefile.in \ + $(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.am \ + $(DIRECTORY)/src/GGI/include/ggi/mesa/Makefile.in \ + $(DIRECTORY)/src/GGI/include/ggi/mesa/*.h \ + $(DIRECTORY)/src/KNOWN_BUGS \ + $(DIRECTORY)/src/OSmesa/Makefile.am \ + $(DIRECTORY)/src/OSmesa/Makefile.in \ + $(DIRECTORY)/src/OSmesa/*.[ch] \ + $(DIRECTORY)/src/S3/*.[ch] \ + $(DIRECTORY)/src/S3/*.def \ + $(DIRECTORY)/src/S3/*.mak \ + $(DIRECTORY)/src/S3/*.rc \ + $(DIRECTORY)/src/SVGA/Makefile.am \ + $(DIRECTORY)/src/SVGA/Makefile.in \ + $(DIRECTORY)/src/SVGA/*.[ch] \ + $(DIRECTORY)/src/Windows/*.[ch] \ + $(DIRECTORY)/src/Windows/*.def \ + $(DIRECTORY)/src/X/Makefile.am \ + $(DIRECTORY)/src/X/Makefile.in \ + $(DIRECTORY)/src/X/*.[ch] \ + $(DIRECTORY)/src/X86/*.[ch] \ + $(DIRECTORY)/src/X86/Makefile.am \ + $(DIRECTORY)/src/X86/Makefile.in \ + $(DIRECTORY)/src/X86/*.S \ + $(DIRECTORY)/src-glu/README[12] \ + $(DIRECTORY)/src-glu/Makefile* \ + $(DIRECTORY)/src-glu/descrip.mms \ + $(DIRECTORY)/src-glu/mms_depend \ + $(DIRECTORY)/src-glu/*.def \ + $(DIRECTORY)/src-glu/depend \ + $(DIRECTORY)/src-glu/*.[ch] \ + $(DIRECTORY)/widgets-mesa/ChangeLog \ + $(DIRECTORY)/widgets-mesa/INSTALL \ + $(DIRECTORY)/widgets-mesa/Makefile.in \ + $(DIRECTORY)/widgets-mesa/README \ + $(DIRECTORY)/widgets-mesa/TODO \ + $(DIRECTORY)/widgets-mesa/configure \ + $(DIRECTORY)/widgets-mesa/demos/ChangeLog \ + $(DIRECTORY)/widgets-mesa/demos/Cube \ + $(DIRECTORY)/widgets-mesa/demos/Ed \ + $(DIRECTORY)/widgets-mesa/demos/Makefile.in \ + $(DIRECTORY)/widgets-mesa/demos/Mcube \ + $(DIRECTORY)/widgets-mesa/demos/Tea \ + $(DIRECTORY)/widgets-mesa/demos/*.[ch] \ + $(DIRECTORY)/widgets-mesa/demos/events \ + $(DIRECTORY)/widgets-mesa/include/GL/ChangeLog \ + $(DIRECTORY)/widgets-mesa/include/GL/*.h \ + $(DIRECTORY)/widgets-mesa/include/GL/Makefile.in \ + $(DIRECTORY)/widgets-mesa/man/ChangeLog \ + $(DIRECTORY)/widgets-mesa/man/GL* \ + $(DIRECTORY)/widgets-mesa/man/Makefile.in \ + $(DIRECTORY)/widgets-mesa/man/Mesa* \ + $(DIRECTORY)/widgets-mesa/src/ChangeLog \ + $(DIRECTORY)/widgets-mesa/src/*.c \ + $(DIRECTORY)/widgets-mesa/src/Makefile.in \ + $(DIRECTORY)/widgets-sgi/*.[ch] \ + $(DIRECTORY)/widgets-sgi/Makefile* \ + $(DIRECTORY)/widgets-sgi/README \ + $(DIRECTORY)/util/README \ + $(DIRECTORY)/util/Makefile.am \ + $(DIRECTORY)/util/Makefile.in \ + $(DIRECTORY)/util/*.[ch] \ + $(DIRECTORY)/util/sampleMakefile \ + $(DIRECTORY)/vms/analyze_map.com \ + $(DIRECTORY)/vms/xlib.opt \ + $(DIRECTORY)/vms/xlib_share.opt \ + $(DIRECTORY)/BeOS/Makefile \ + $(DIRECTORY)/BeOS/*.cpp \ + $(DIRECTORY)/WIN32/NMAKE.MAK \ + $(DIRECTORY)/WIN32/NMAKE.MIF \ + $(DIRECTORY)/WIN32/RES/*rc \ + $(DIRECTORY)/WIN32/RES/*def \ + $(DIRECTORY)/WIN32/RULES/lib.* \ + $(DIRECTORY)/WIN32/RULES/progs.* \ + $(DIRECTORY)/macos/README \ + $(DIRECTORY)/macos/gli_api/*.h \ + $(DIRECTORY)/macos/cglpane/CGLPane.* \ + $(DIRECTORY)/macos/include-mac/*.h \ + $(DIRECTORY)/macos/libraries/*.stub \ + $(DIRECTORY)/macos/libraries/*Stub \ + $(DIRECTORY)/macos/projects/*.mcp \ + $(DIRECTORY)/macos/projects/*.exp \ + $(DIRECTORY)/macos/projects/*.h \ + $(DIRECTORY)/macos/resources/*.c \ + $(DIRECTORY)/macos/resources/*.r \ + $(DIRECTORY)/macos/resources/*.rsrc \ + $(DIRECTORY)/macos/src-agl/*.exp \ + $(DIRECTORY)/macos/src-agl/*.[ch] \ + $(DIRECTORY)/macos/src-gli/*.[ch] \ + $(DIRECTORY)/OpenStep + +DEMO_FILES = \ + $(DIRECTORY)/include/GL/glut.h \ + $(DIRECTORY)/include/GL/glutf90.h \ + $(DIRECTORY)/include/GL/glut_h.dja \ + $(DIRECTORY)/src-glut/Makefile* \ + $(DIRECTORY)/src-glut/depend \ + $(DIRECTORY)/src-glut/*def \ + $(DIRECTORY)/src-glut/descrip.mms \ + $(DIRECTORY)/src-glut/mms_depend \ + $(DIRECTORY)/src-glut/*.[ch] \ + $(DIRECTORY)/src-glut.dja/* \ + $(DIRECTORY)/src-glut.beos/Makefile \ + $(DIRECTORY)/src-glut.beos/*.cpp \ + $(DIRECTORY)/src-glut.beos/*.h \ + $(DIRECTORY)/images/* \ + $(DIRECTORY)/demos/Makefile* \ + $(DIRECTORY)/demos/descrip.mms \ + $(DIRECTORY)/demos/*.[ch] \ + $(DIRECTORY)/demos/*.cxx \ + $(DIRECTORY)/demos/*.dat \ + $(DIRECTORY)/demos/README \ + $(DIRECTORY)/xdemos/Makefile* \ + $(DIRECTORY)/xdemos/descrip.mms \ + $(DIRECTORY)/xdemos/*.[cf] \ + $(DIRECTORY)/book/Makefile* \ + $(DIRECTORY)/book/README \ + $(DIRECTORY)/book/*.[ch] \ + $(DIRECTORY)/samples/Makefile* \ + $(DIRECTORY)/samples/README \ + $(DIRECTORY)/samples/*.c \ + $(DIRECTORY)/mtdemos \ + $(DIRECTORY)/ggi + +GLU_FILES = \ + $(DIRECTORY)/Makefile* \ + $(DIRECTORY)/Make-config \ + $(DIRECTORY)/bin/mklib* \ + $(DIRECTORY)/include/GL/gl.h \ + $(DIRECTORY)/include/GL/gl_mangle.h \ + $(DIRECTORY)/include/GL/glext.h \ + $(DIRECTORY)/include/GL/glu.h \ + $(DIRECTORY)/include/GL/glu_mangle.h \ + $(DIRECTORY)/src-glu/README[12] \ + $(DIRECTORY)/src-glu/Makefile* \ + $(DIRECTORY)/src-glu/descrip.mms \ + $(DIRECTORY)/src-glu/mms_depend \ + $(DIRECTORY)/src-glu/*.def \ + $(DIRECTORY)/src-glu/depend \ + $(DIRECTORY)/src-glu/*.[ch] + +GLUT_FILES = \ + $(DIRECTORY)/Makefile* \ + $(DIRECTORY)/Make-config \ + $(DIRECTORY)/bin/mklib* \ + $(DIRECTORY)/include/GL/gl.h \ + $(DIRECTORY)/include/GL/gl_mangle.h \ + $(DIRECTORY)/include/GL/glext.h \ + $(DIRECTORY)/include/GL/glu.h \ + $(DIRECTORY)/include/GL/glu_mangle.h \ + $(DIRECTORY)/include/GL/glut.h \ + $(DIRECTORY)/include/GL/glutf90.h \ + $(DIRECTORY)/include/GL/glut_h.dja \ + $(DIRECTORY)/src-glut/Makefile* \ + $(DIRECTORY)/src-glut/depend \ + $(DIRECTORY)/src-glut/*def \ + $(DIRECTORY)/src-glut/descrip.mms \ + $(DIRECTORY)/src-glut/mms_depend \ + $(DIRECTORY)/src-glut/*.[ch] \ + $(DIRECTORY)/src-glut.dja/* \ + $(DIRECTORY)/src-glut.beos/Makefile \ + $(DIRECTORY)/src-glut.beos/*.cpp \ + $(DIRECTORY)/src-glut.beos/*.h + + +lib_tar: + cp Makefile.X11 Makefile ; \ + cd .. ; \ + tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \ + gzip $(LIB_NAME).tar ; \ + mv $(LIB_NAME).tar.gz $(DIRECTORY) + +demo_tar: + cd .. ; \ + tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) ; \ + gzip $(DEMO_NAME).tar ; \ + mv $(DEMO_NAME).tar.gz $(DIRECTORY) + +glu_tar: + cp Makefile.X11 Makefile ; \ + cd .. ; \ + tar -cvf $(GLU_NAME).tar $(GLU_FILES) ; \ + gzip $(GLU_NAME).tar ; \ + mv $(GLU_NAME).tar.gz $(DIRECTORY) + +glut_tar: + cp Makefile.X11 Makefile ; \ + cd .. ; \ + tar -cvf $(GLUT_NAME).tar $(GLUT_FILES) ; \ + gzip $(GLUT_NAME).tar ; \ + mv $(GLUT_NAME).tar.gz $(DIRECTORY) + + +lib_zip: + -rm $(LIB_NAME).zip ; \ + cp Makefile.X11 Makefile ; \ + cd .. ; \ + zip -r $(LIB_NAME).zip $(LIB_FILES) ; \ + mv $(LIB_NAME).zip $(DIRECTORY) + +demo_zip: + -rm $(DEMO_NAME).zip ; \ + cd .. ; \ + zip -r $(DEMO_NAME).zip $(DEMO_FILES) ; \ + mv $(DEMO_NAME).zip $(DIRECTORY) + + + +SRC_FILES = \ + RELNOTES \ + src/Makefile* \ + src/depend \ + src/*.[chS] \ + src/*/*.[ch] \ + include/GL/*.h + +srctar: + tar -cvf src.tar $(SRC_FILES) ; \ + gzip src.tar + +srctar.zip: + -rm src.zip + zip -r src.zip $(SRC_FILES) ; \ diff --git a/xc/extras/Mesa/Makefile.am b/xc/extras/Mesa/Makefile.am new file mode 100644 index 000000000..2a4ecfdff --- /dev/null +++ b/xc/extras/Mesa/Makefile.am @@ -0,0 +1,34 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = 1.4 foreign + +if HAVE_DEMOS +DEMO_DIRS = book demos samples xdemos + +exec: + @for subdir in $(DEMO_DIRS); do \ + echo "Making exec in $$subdir"; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) exec); \ + done; +else +exec: +endif + +if NEED_GLUT +SUB_GLUT = src-glut +endif + +SUBDIRS = include src src-glu $(SUB_GLUT) $(DEMO_DIRS) util + +EXTRA_DIST = docs/INSTALL docs/INSTALL.GNU docs/CONFIG docs/IAFA-PACKAGE \ + docs/RELNOTES docs/VERSIONS docs/CONFORM docs/COPYING \ + docs/COPYRIGHT docs/README docs/README.3DFX docs/README.BEOS \ + docs/README.GGI docs/README.MINGW32 docs/README.MITS \ + docs/README.QUAKE docs/README.THREADS docs/README.X11 \ + images/girl.rgb images/reflect.rgb images/tile.rgb + +strip: + @for subdir in src src-glu $(SUB_GLUT); do \ + echo "Making strip in $$subdir"; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) strip); \ + done; diff --git a/xc/extras/Mesa/Makefile.in b/xc/extras/Mesa/Makefile.in new file mode 100644 index 000000000..3281df441 --- /dev/null +++ b/xc/extras/Mesa/Makefile.in @@ -0,0 +1,406 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +AUTOMAKE_OPTIONS = 1.4 foreign + +@HAVE_DEMOS_TRUE@DEMO_DIRS = book demos samples xdemos + +@NEED_GLUT_TRUE@SUB_GLUT = src-glut + +SUBDIRS = include src src-glu $(SUB_GLUT) $(DEMO_DIRS) util + +EXTRA_DIST = docs/INSTALL docs/INSTALL.GNU docs/CONFIG docs/IAFA-PACKAGE docs/RELNOTES docs/VERSIONS docs/CONFORM docs/COPYING docs/COPYRIGHT docs/README docs/README.3DFX docs/README.BEOS docs/README.GGI docs/README.MINGW32 docs/README.MITS docs/README.QUAKE docs/README.THREADS docs/README.X11 images/girl.rgb images/reflect.rgb images/tile.rgb + +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = conf.h +CONFIG_CLEAN_FILES = +DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \ +acconfig.h acinclude.m4 aclocal.m4 conf.h.in config.guess config.sub \ +configure configure.in install-sh ltconfig ltmain.sh missing \ +mkinstalldirs + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +DIST_SUBDIRS = include src src-glu src-glut book demos samples xdemos \ +util +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): configure.in acinclude.m4 + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +conf.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi +stamp-h: $(srcdir)/conf.h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=conf.h \ + $(SHELL) ./config.status + @echo timestamp > stamp-h 2> /dev/null +$(srcdir)/conf.h.in: $(srcdir)/stamp-h.in + @if test ! -f $@; then \ + rm -f $(srcdir)/stamp-h.in; \ + $(MAKE) $(srcdir)/stamp-h.in; \ + else :; fi +$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h + cd $(top_srcdir) && $(AUTOHEADER) + @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null + +mostlyclean-hdr: + +clean-hdr: + +distclean-hdr: + -rm -f conf.h + +maintainer-clean-hdr: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) conf.h.in $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)conf.h.in$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags conf.h.in $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile + $(mkinstalldirs) $(distdir)/docs $(distdir)/images + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(DIST_SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +all-recursive-am: conf.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile conf.h +all-redirect: all-recursive-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-hdr clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-hdr distclean-tags distclean-generic clean-am + -rm -f libtool + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ +install-data-recursive uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +@HAVE_DEMOS_TRUE@exec: +@HAVE_DEMOS_TRUE@ @for subdir in $(DEMO_DIRS); do \ +@HAVE_DEMOS_TRUE@ echo "Making exec in $$subdir"; \ +@HAVE_DEMOS_TRUE@ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) exec); \ +@HAVE_DEMOS_TRUE@ done; +@HAVE_DEMOS_FALSE@exec: + +strip: + @for subdir in src src-glu $(SUB_GLUT); do \ + echo "Making strip in $$subdir"; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) strip); \ + done; + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/Makefile.win b/xc/extras/Mesa/Makefile.win new file mode 100644 index 000000000..2d3bcb874 --- /dev/null +++ b/xc/extras/Mesa/Makefile.win @@ -0,0 +1,7 @@ +target: + echo Please use the command-line build files in + echo ./win32 for building Mesa on Win32. + echo. + echo Better yet, use the IDE files if you have + echo DevStudio 5. + echo -Ted diff --git a/xc/extras/Mesa/Mingw32.bat b/xc/extras/Mesa/Mingw32.bat new file mode 100644 index 000000000..10e2410b1 --- /dev/null +++ b/xc/extras/Mesa/Mingw32.bat @@ -0,0 +1,75 @@ +echo off
+rem
+rem .bat file for building Mesa3d/Mingw32
+rem
+rem Paul Garceau, August 26, 1998
+rem Updated January, 13, 2000 -- Paul Garceau
+rem
+rem GCC-2.95.2/Mingw32 build of Mesa 3-D Graphics Library (v3.3)
+
+rem Build Requirements:
+rem
+rem .bat file uses Make 3.77
+rem "touch" must be somewhere on your system path variable %PATH%
+rem
+rem "touch" doesn't seem to work using OS environment variables so
+rem we need to directly access any "touch" directory/folder references
+
+
+rem Set up Mesa Root directory/folder -- modify as needed
+rem
+set mesaroot=d:\mesa-3.3
+
+rem move to Mesa3d root directory
+cd %mesaroot%
+
+rem set up Mesa3d build path
+PATH=%mesaroot%;%PATH%
+
+rem Set up Mesa Source directory/folder
+set mesasrc=%mesaroot%\src
+
+rem Set up Mesa lib directory/folder
+md lib
+
+rem Set up Mesa lib directory/folder
+set mesalib=%mesaroot%\lib
+
+touch src/depend
+touch src-glu/depend
+
+rem touch src-glut/depend
+
+rem Generate wing32.dll for the sake of Mesa build
+cd %mesasrc%\windows
+
+rem
+rem Create a .a lib file
+rem
+dlltool --input-def wing32.def --output-lib wing32.a --dllname wing32.dll
+rem
+rem Create a .dll file (wing32.dll); GCC-2.95.2/Mingw32 compiler used
+rem
+gcc -mdll -o wing32.dll wing32.a -WI,temp.exp
+move wing32.dll %mesalib%
+
+rem Return to mesa-3.3 'root' directory
+cd %mesaroot%
+
+rem Begin build of mesa-3.3 libs for GCC-2.95.2/Mingw32
+
+rem Build libGL.a
+rem
+make -w --directory=%mesasrc% -fmakefile.m32
+
+rem move the completed library
+move %mesasrc%\libGL.a %mesalib%\libGL.a
+
+rem Build libGLU.a
+rem
+make -w --directory=%mesaroot%\src-glu -f makefile.m32
+
+rem move the completed library to the lib directory
+move %mesaroot%\src-glu\libGLU.a %mesalib%\libGLU.a
+
+rem Library build complete
diff --git a/xc/extras/Mesa/Names.win b/xc/extras/Mesa/Names.win new file mode 100644 index 000000000..5909d5950 --- /dev/null +++ b/xc/extras/Mesa/Names.win @@ -0,0 +1,3 @@ +MESAGL=MesaGL
+MESAGLU=MesaGLU
+MESAGLUT=MesaGLUT
diff --git a/xc/extras/Mesa/OpenStep/MesaView/Makefile b/xc/extras/Mesa/OpenStep/MesaView/Makefile new file mode 100644 index 000000000..37a6b677f --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/Makefile @@ -0,0 +1,55 @@ +# +# Generated by the NeXT Project Builder. +# +# NOTE: Do NOT change this file -- Project Builder maintains it. +# +# Put all of your customizations in files called Makefile.preamble +# and Makefile.postamble (both optional), and Makefile will include them. +# + +NAME = MesaView + +PROJECTVERSION = 2.6 +PROJECT_TYPE = Application +LANGUAGE = English + +ICONSECTIONS = -sectcreate __ICON app /NextLibrary/Frameworks/AppKit.framework/Resources/NSDefaultApplicationIcon.tiff + +LOCAL_RESOURCES = MesaView.nib + +CLASSES = MesaView.m + +HFILES = MesaView.h mesadraw.h vect3d.h + +MFILES = MesaView_main.m + +CFILES = mesadraw.c vect3d.c + +OTHERSRCS = Makefile.preamble Makefile Makefile.postamble m.template\ + h.template + + +MAKEFILEDIR = $(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles +CODE_GEN_STYLE = DYNAMIC +MAKEFILE = app.make +NEXTSTEP_INSTALLDIR = $(HOME)/Apps +WINDOWS_INSTALLDIR = /MyApps +LIBS = -lMesaGL -lMesaGLU +DEBUG_LIBS = $(LIBS) +PROF_LIBS = $(LIBS) + + +HEADER_PATHS = -I../../include/ +LIBRARY_PATHS = -L../../lib/ +FRAMEWORKS = -framework AppKit -framework Foundation + + +include $(MAKEFILEDIR)/platform.make + +-include Makefile.preamble + +include $(MAKEFILEDIR)/$(MAKEFILE) + +-include Makefile.postamble + +-include Makefile.dependencies diff --git a/xc/extras/Mesa/OpenStep/MesaView/Makefile.postamble b/xc/extras/Mesa/OpenStep/MesaView/Makefile.postamble new file mode 100644 index 000000000..5ee86feaa --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/Makefile.postamble @@ -0,0 +1,118 @@ +############################################################################### +# NeXT Makefile.postamble +# Copyright 1996, NeXT Software, Inc. +# +# This Makefile is used for configuring the standard app makefiles associated +# with ProjectBuilder. +# +# Use this template to set attributes for a project, sub-project, bundle, or +# palette. Each node in the project's tree of sub-projects and bundles +# should have it's own Makefile.preamble and Makefile.postamble. Additional +# rules (e.g., after_install) that are defined by the developer should be +# defined in this file. +# +############################################################################### +# +# Here are the variables exported by the common "app" makefiles that can be +# used in any customizations you make to the template below: +# +# PRODUCT_ROOT - Name of the directory to which resources are copied. +# OFILE_DIR - Directory into which .o object files are generated. +# (Note that this name is calculated based on the target +# architectures specified in Project Builder). +# DERIVED_SRC_DIR - Directory used for all other derived files +# ALL_CFLAGS - All the flags passed to the cc(1) driver for compilations +# +# NAME - name of application, bundle, subproject, palette, etc. +# LANGUAGE - langage in which the project is written (default "English") +# LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project +# GLOBAL_RESOURCES - non-localized resources of project +# PROJECTVERSION - version of ProjectBuilder project (NS3.X = 1.1, NS4.0 = 2.0) +# ICONSECTIONS - Specifies icon sections when linking executable +# +# CLASSES - Class implementation files in project. +# HFILES - Header files in project. +# MFILES - Other Objective-C source files in project. +# CFILES - Other C source files in project. +# PSWFILES - .psw files in the project +# PSWMFILES - .pswm files in the project +# SUBPROJECTS - Subprojects of this project +# BUNDLES - Bundle subprojects of this project +# OTHERSRCS - Other miscellaneous sources of this project +# OTHERLINKED - Source files not matching a standard source extention +# +# LIBS - Libraries to link with when making app target +# DEBUG_LIBS - Libraries to link with when making debug target +# PROF_LIBS - Libraries to link with when making profile target +# OTHERLINKEDOFILES - Other relocatable files to (always) link in. +# +# APP_MAKEFILE_DIR - Directory in which to find generic set of Makefiles +# MAKEFILEDIR - Directory in which to find $(MAKEFILE) +# MAKEFILE - Top level mechanism Makefile (e.g., app.make, bundle.make) +# INSTALLDIR - Directory app will be installed into by 'install' target +# +############################################################################### + + +# Change defaults assumed by the standard makefiles here. Edit the +# following default values as appropriate. (Note that if no Makefile.postamble +# exists, these values will have defaults set in common.make). + +# Versioning of frameworks, libraries, bundles, and palettes: +#CURRENTLY_ACTIVE_VERSION = YES + # Set to "NO" to produce a compatibility binary +#DEPLOY_WITH_VERSION_NAME = A + # This should be incremented as your API changes. +#COMPATIBILITY_PROJECT_VERSION = 1 + # This should be incremented as your API grows. +#CURRENT_PROJECT_VERSION = 1 + # Defaults to using the "vers_string" hack. + +# Some compiler flags can be easily overridden here, but onlytake effect at +# the top-level: +#OPTIMIZATION_CFLAG = -O +#DEBUG_SYMBOLS_CFLAG = -g -gcodeview +#WARNING_CFLAGS = -Wmost +#DEBUG_BUILD_CFLAGS = -DDEBUG +#PROFILE_BUILD_CFLAGS = -pg -DPROFILE + +# Flags passed to yacc +#YFLAGS = -d + +# Library and Framework projects only: +# 1. If you want something other than the default .dylib name, override it here +#DYLIB_INSTALL_NAME = lib$(NAME).dylib + +# 2. If you want to change the -install_name flag from the absolute path to the development area, change it here. One good choice is the installation directory. Another one might be none at all. +#DYLIB_INSTALL_DIR = $(INSTALLDIR) + +# Ownership and permissions of files installed by 'install' target +#INSTALL_AS_USER = root + # User/group ownership +#INSTALL_AS_GROUP = wheel + # (probably want to set both of these) +#INSTALL_PERMISSIONS = + # If set, 'install' chmod's executable to this + +# Options to strip for various project types. Note: -S strips debugging symbols +# (executables can be stripped down further with -x or, if they load no bundles, with no +# options at all). +#APP_STRIP_OPTS = -S +#TOOL_STRIP_OPTS = -S +#LIBRARY_STRIP_OPTS = -S + # for .a archives +#DYNAMIC_STRIP_OPTS = -S + # for bundles and shared libraries + +######################################################################### +# Put rules to extend the behavior of the standard Makefiles here. "Official" +# user-defined rules are: +# * before_install +# * after_install +# * after_installhdrs +# You should avoid redefining things like "install" or "app", as they are +# owned by the top-level Makefile API and no context has been set up for where +# derived files should go. +# +# Note: on MS Windows, executables, have an extension, so rules and dependencies +# for generated tools should use $(EXECUTABLE_EXT) on the end. diff --git a/xc/extras/Mesa/OpenStep/MesaView/Makefile.preamble b/xc/extras/Mesa/OpenStep/MesaView/Makefile.preamble new file mode 100644 index 000000000..ec1fb6808 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/Makefile.preamble @@ -0,0 +1,125 @@ +############################################################################### +# NeXT Makefile.preamble +# Copyright 1996, NeXT Software, Inc. +# +# This Makefile is used for configuring the standard app makefiles associated +# with ProjectBuilder. +# +# Use this template to set attributes for a project. Each node in a project +# tree of sub-projects, tools, etc. should have its own Makefile.preamble and +# Makefile.postamble. +# +############################################################################### +## Configure the flags passed to $(CC) here. These flags will also be +## inherited by all nested sub-projects and bundles. Put your -I, -D, -U, and +## -L flags in ProjectBuilder's Build Options inspector if at all possible. +## To change the default flags that get passed to ${CC} +## (e.g. change -O to -O2), see Makefile.postamble. + +# Flags passed to compiler (in addition to -g, -O, etc) +OTHER_CFLAGS = +# Flags passed to ld (in addition to -ObjC, etc.) +OTHER_LDFLAGS = +# Flags passed to libtool when building libraries +OTHER_LIBTOOL_FLAGS = +# For ordering named sections on NEXTSTEP (see ld(1)) +SECTORDER_FLAGS = + +# If you do not want any headers exported before compilations begin, +# uncomment the following line. This can be a big time saver. +#SKIP_EXPORTING_HEADERS = YES + +# Stuff related to exporting headers from this project that isn't already +# handled by PB. +OTHER_PUBLIC_HEADERS = +OTHER_PROJECT_HEADERS = +OTHER_PRIVATE_HEADERS = + +# Set these two macros if you want a precomp to be built as part of +# installation. The cc -precomp will be run in the public header directory +# on the specified public header files with the specified additional flags. +PUBLIC_PRECOMPILED_HEADERS = +PUBLIC_PRECOMPILED_HEADERS_CFLAGS = + +# Set this for library projects if you want to publish header files. If your +# app or tool project exports headers Don't +# include $(DSTROOT); this is added for you automatically. +PUBLIC_HEADER_DIR = +PRIVATE_HEADER_DIR = + +# If, in a subproject, you want to append to the parent's PUBLIC_HEADER_DIR# +# (say, to add a subdirectory like "/sys"), you can use: +PUBLIC_HEADER_DIR_SUFFIX = +PRIVATE_HEADER_DIR_SUFFIX = + +# Additional (non-localized) resources for this project, which can be generated +OTHER_RESOURCES = + +# Uncomment this to produce a static archive-style (.a) library +#LIBRARY_STYLE = STATIC + +# Set this to YES if you don't want a final libtool call for a library/framework. +BUILD_OFILES_LIST_ONLY = + +# Additional relocatables to be linked into this project +OTHER_OFILES = +# Additional libraries to link against +OTHER_LIBS = +# To include a version string, project source must exist in a directory named +# $(NAME).%d[.%d][.%d] and the following line must be uncommented. +# OTHER_GENERATED_OFILES = $(VERS_OFILE) + +## Configure how things get built here. Additional dependencies, source files, +## derived files, and build order should be specified here. + +# Other dependencies of this project +OTHER_PRODUCT_DEPENDS = +# Built *before* building subprojects/bundles +OTHER_INITIAL_TARGETS = +# Other source files maintained by .pre/postamble +OTHER_SOURCEFILES = +# Additional files to be removed by `make clean' +OTHER_GARBAGE = + +# Targets to build before installation +OTHER_INSTALL_DEPENDS = + +# More obscure flags you might want to set for pswrap, yacc, lex, etc. +PSWFLAGS = +YFLAGS = +LFLAGS = + +## Delete this line if you want fast and loose cleans that will not remove +## things like precomps and user-defined OTHER_GARBAGE in subprojects. +CLEAN_ALL_SUBPROJECTS = YES + +## Add more obscure source files here to cause them to be automatically +## processed by the appropriate tool. Note that these files should also be +## added to "Supporting Files" in ProjectBuilder. The desired .o files that +## result from these files should also be added to OTHER_OFILES above so they +## will be linked in. + +# .msg files that should have msgwrap run on them +MSGFILES = +# .defs files that should have mig run on them +DEFSFILES = +# .mig files (no .defs files) that should have mig run on them +MIGFILES = +# .x files that should have rpcgen run on them +RPCFILES = + +## Add additional Help directories here (add them to the project as "Other +## Resources" in Project Builder) so that they will be compressed into .store +## files and copied into the app wrapper. If the help directories themselves +## need to also be in the app wrapper, then a cp command will need to be added +## in an after_install target. +OTHER_HELP_DIRS = + +# After you have saved your project using the 4.0 PB, you will automatically +# start using the makefiles in /NextDeveloper/Makefiles/project. If you should +# need to revert back to the old 3.3 Makefile behavior, override MAKEFILEDIR to +# be /NextDeveloper/Makefiles/app. + +# Don't add more rules here unless you want the first one to be the default +# target for make! Put all your targets in Makefile.postamble. + diff --git a/xc/extras/Mesa/OpenStep/MesaView/MesaView.h b/xc/extras/Mesa/OpenStep/MesaView/MesaView.h new file mode 100644 index 000000000..01e7abc64 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/MesaView.h @@ -0,0 +1,28 @@ +#import <AppKit/AppKit.h> +#import <GL/osmesa.h> +#import "mesadraw.h" + +@interface MesaView : NSView +{ + float zoomDist; + float spinAngle; + float elevAngle; + id zoomSlider; + id spinSlider; + id elevSlider; + unsigned char *buffer; + OSMesaContext ctx; + BOOL draggingBase; + BOOL whiteBackground; + int averagingNormals; + int colourDrape; + NSTimer *timer_object; +} +- changeZoom:sender; +- changeElev:sender; +- changeSpin:sender; +- changeNormal:sender; +- changeDrape:sender; +- changeBackground:sender; +- remakeSurface:sender; +@end diff --git a/xc/extras/Mesa/OpenStep/MesaView/MesaView.iconheader b/xc/extras/Mesa/OpenStep/MesaView/MesaView.iconheader new file mode 100644 index 000000000..9b5d8f1eb --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/MesaView.iconheader @@ -0,0 +1,2 @@ +F MesaView.app MesaView app +F MesaView MesaView app diff --git a/xc/extras/Mesa/OpenStep/MesaView/MesaView.m b/xc/extras/Mesa/OpenStep/MesaView/MesaView.m new file mode 100644 index 000000000..ea0ae08bc --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/MesaView.m @@ -0,0 +1,197 @@ +#import <MesaView.h> + +@interface MesaView(Private) +-(void)_renderImage; +-(void)_createViewport; +-(void)_startDrag; +-(void)_stopDrag:(NSTimer*)the_timer; +@end + +@implementation MesaView + +- initWithFrame:(NSRect)frameRect +{ + [super initWithFrame: frameRect]; + ctx = NULL; + buffer = NULL; + zoomDist=130; + spinAngle=0; + elevAngle=30; + draggingBase=NO; + averagingNormals=0; + colourDrape=0; + whiteBackground=NO; + timer_object=nil; + make_matrix(); + [self _createViewport]; + return self; +} + +- (void)awakeFromNib +{ + [zoomSlider setFloatValue:zoomDist]; + [spinSlider setFloatValue:spinAngle]; + [elevSlider setFloatValue:elevAngle]; +} + + +- (void)dealloc +{ + OSMesaDestroyContext(ctx); + free(buffer); + [timer_object invalidate]; + [timer_object release]; + [super dealloc]; +} + + +- (BOOL)isOpaque +{ + return YES; +} + +- (void)_createViewport +{ + if(buffer) + free(buffer); + buffer=malloc([self bounds].size.width*[self bounds].size.height*4); + + if(ctx) + OSMesaDestroyContext(ctx); + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, + [self bounds].size.width, [self bounds].size.height ); + OSMesaPixelStore( OSMESA_Y_UP, 0 ); + + + my_init([self bounds].size.width,[self bounds].size.height); +} + +- (void)resizeWithOldSuperviewSize:(NSSize)old +{ + [super resizeWithOldSuperviewSize:old]; + [self _createViewport]; + [self setNeedsDisplay:YES]; +} + +- (void)drawRect:(NSRect)rect +{ + set_viewpoint(zoomDist, elevAngle, spinAngle); + if(draggingBase) + { + if(whiteBackground) + { + PSsetgray(1); + NSRectFill(rect); + PSsetgray(0); + } + else + { + PSsetgray(0); + NSRectFill(rect); + PSsetgray(1); + } + outline_scene(); + + } + else + { + [self _renderImage]; + } +} + +- (void)_renderImage +{ + NSBitmapImageRep *bitmap; + + draw_scene(averagingNormals,colourDrape,whiteBackground); + + bitmap = [[ NSBitmapImageRep alloc] initWithBitmapDataPlanes:&buffer + pixelsWide:[self bounds].size.width + pixelsHigh:[self bounds].size.height + bitsPerSample:8 samplesPerPixel:4 + hasAlpha:YES isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bytesPerRow:0 bitsPerPixel:0]; + [bitmap autorelease]; + [bitmap draw]; +} + +- (void)_startDrag +{ + draggingBase=YES; + timer_object = [NSTimer + scheduledTimerWithTimeInterval:(NSTimeInterval)0.0 + target:self selector:@selector(_stopDrag:) + userInfo:nil repeats:NO]; + [timer_object retain]; +} + +- (void)_stopDrag:(NSTimer*)the_timer +{ + [timer_object invalidate]; + [timer_object release]; + timer_object=nil; + draggingBase=NO; + [self setNeedsDisplay:YES]; +} + +- changeZoom:sender +{ + if(!draggingBase) + [self _startDrag]; + zoomDist = [zoomSlider floatValue]; + [self display]; + return self; +} + +- changeSpin:sender +{ + if(!draggingBase) + [self _startDrag]; + spinAngle = [spinSlider floatValue]; + [self display]; + return self; +} + +- changeElev:sender +{ + if(!draggingBase) + [self _startDrag]; + elevAngle = [elevSlider floatValue]; + [self display]; + return self; +} + +- changeNormal:sender +{ + averagingNormals=[sender state]; + [self setNeedsDisplay:YES]; + return self; +} + +- changeDrape:sender +{ + colourDrape=[sender state]; + [self setNeedsDisplay:YES]; + return self; +} + + +- remakeSurface:sender +{ + make_matrix(); + [self setNeedsDisplay:YES]; + return self; +} + +- changeBackground:sender +{ + whiteBackground=[sender state]; + [self setNeedsDisplay:YES]; + return self; +} + + + +@end diff --git a/xc/extras/Mesa/OpenStep/MesaView/MesaView_main.m b/xc/extras/Mesa/OpenStep/MesaView/MesaView_main.m new file mode 100644 index 000000000..1ef1c5b2a --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/MesaView_main.m @@ -0,0 +1,5 @@ +#import <AppKit/AppKit.h> + +int main(int argc, const char *argv[]) { + return NSApplicationMain(argc, argv); +} diff --git a/xc/extras/Mesa/OpenStep/MesaView/PB.project b/xc/extras/Mesa/OpenStep/MesaView/PB.project new file mode 100644 index 000000000..cdf3807b4 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/PB.project @@ -0,0 +1,31 @@ +{ + APPCLASS = NSApplication; + FILESTABLE = { + BUNDLES = (); + CLASSES = (MesaView.m); + FRAMEWORKS = (AppKit.framework, Foundation.framework); + HEADERSEARCH = (../../include/); + H_FILES = (MesaView.h, mesadraw.h, vect3d.h); + INTERFACES = (MesaView.nib); + LIBRARYSEARCH = (../../lib/); + LIBS = (); + OTHER_LIBS = (MesaGL, MesaGLU); + OTHER_LINKED = (mesadraw.c, MesaView_main.m, vect3d.c); + OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble, m.template, h.template); + SUBPROJECTS = (); + TOOLS = (); + }; + LANGUAGE = English; + LOCALIZABLE_FILES = {MesaView.nib = MesaView.nib; }; + MAKEFILEDIR = "$(NEXT_ROOT)/NextDeveloper/Makefiles/pb_makefiles"; + NEXTSTEP_BUILDTOOL = /bin/gnumake; + NEXTSTEP_INSTALLDIR = "$(HOME)/Apps"; + NEXTSTEP_MAINNIB = MesaView; + PDO_UNIX_MAINNIB = MesaView; + PROJECTNAME = MesaView; + PROJECTTYPE = Application; + PROJECTVERSION = 2.6; + WINDOWS_BUILDTOOL = make; + WINDOWS_INSTALLDIR = /MyApps; + WINDOWS_MAINNIB = MesaView; +} diff --git a/xc/extras/Mesa/OpenStep/MesaView/README b/xc/extras/Mesa/OpenStep/MesaView/README new file mode 100644 index 000000000..b8475d542 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/README @@ -0,0 +1,12 @@ +This is an application which I wrote to play around with Mesa and +the rendering of surfaces. It is not particularly well written but does +demonstarte how to incorporate Mesa into an actual OpenStep application. +The Application generates a random surface of heights and colours +which can be viewed from any angle by rotating the viewpoint. During rotation +the Mesa projection functions are used to find the corners of the surface +which is then drawn in wireframe using PostScript operators for speed. Normals +to the surface my be generated for each face, or averaged for each vertex. The +colouring of the surface may also be switched between colours for the +individual points and a texture mapping of the colour matrix. + +-Pete French. (pete@ohm.york.ac.uk) 28/5/98 diff --git a/xc/extras/Mesa/OpenStep/MesaView/h.template b/xc/extras/Mesa/OpenStep/MesaView/h.template new file mode 100644 index 000000000..7b523c7eb --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/h.template @@ -0,0 +1,11 @@ +$$ +/* $FILENAME$ created by $USERNAME$ on $DATE$ */ + +#import <AppKit/AppKit.h> + +@interface $FILENAMESANSEXTENSION$ : NSObject +{ + +} + +@end diff --git a/xc/extras/Mesa/OpenStep/MesaView/mesadraw.c b/xc/extras/Mesa/OpenStep/MesaView/mesadraw.c new file mode 100644 index 000000000..5f85e6322 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/mesadraw.c @@ -0,0 +1,356 @@ +#include <stdio.h> +#include <stdlib.h> +#include <memory.h> +#include "mesadraw.h" +#include "vect3d.h" + +#define DIM 32 +#define MAX_HEIGHT (300/DIM) +#define RADS(x) ((x)/57.29577951) + +static GLdouble mesh[DIM][DIM][3]; +static GLubyte cols[DIM][DIM][3]; + +/* + * Create a random matrix of heights and colours + */ + +void make_matrix(void) +{ + int i,j; + + for(i=0;i<DIM;i++) + for(j=0;j<DIM;j++) + { + mesh[i][j][0]=((100.0*i)/(DIM-1.0))-50.0; + mesh[i][j][2]=((100.0*j)/(DIM-1.0))-50.0; + mesh[i][j][1]=(rand()%MAX_HEIGHT); + cols[i][j][0]=(mesh[i][j][1]*255)/MAX_HEIGHT; + cols[i][j][1]=255-cols[i][j][0]; + cols[i][j][2]=0; + } +} + +/* + * Initialise the OpenGL stuff + */ + +void my_init (float w, float h) +{ + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_position[] = { 5.0, 3.0, 9.0, 0.0 }; + + glMatrixMode (GL_PROJECTION); + glLoadIdentity (); + glMatrixMode (GL_MODELVIEW); + glLoadIdentity (); + + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glShadeModel(GL_SMOOTH); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHTING); + glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE); + glEnable(GL_COLOR_MATERIAL); + glEnable(GL_DEPTH_TEST); + + glViewport(0,0,w,h); + glMatrixMode (GL_PROJECTION); + gluPerspective (60.0, w/h, 1.0, 400.0); +} + +/* + * Set the viewpoint + */ + +void set_viewpoint(float zoomDist, float elevAngle, float spinAngle) +{ + float flat_radius, x, y, z, xl, zl; + flat_radius=zoomDist*cos(RADS(elevAngle)); + x=0.0-(flat_radius*sin(RADS(spinAngle))); + xl=50.0*sin(RADS(spinAngle)); + z=flat_radius*cos(RADS(spinAngle)); + zl= -50.0*cos(RADS(spinAngle)); + y=zoomDist*sin(RADS(elevAngle)); + + glMatrixMode (GL_MODELVIEW); + glLoadIdentity (); +/* + * we make a somewhat spurious "up" vector because we know we are + * looking at the origin and that it's mapped into the plane of + * the screen anyway so the percise direction is irrelevent. + */ + gluLookAt (x, y, z, + 0, 0, 0, + xl, 50, zl); +} + +/* + * Get a normal to a corner of a quad. + */ + +void get_quad_normal(int x, int z, int cx, int cz, GLdouble n[3]) +{ + GLdouble *c1, *c2, *c3, *c4; + c1 = &mesh[x][z][0]; + c2 = &mesh[x+1][z][0]; + c3 = &mesh[x+1][z+1][0]; + c4 = &mesh[x][z+1][0]; + if((cx==0) && (cz==0)) + return perpnorm(c4,c1,c2,n); + if((cx==0) && (cz==0)) + return perpnorm(c4,c1,c2,n); + if((cx==1) && (cz==0)) + return perpnorm(c1,c2,c3,n); + if((cx==1) && (cz==1)) + return perpnorm(c2,c3,c4,n); + if((cx==0) && (cz==1)) + return perpnorm(c3,c4,c1,n); +} + +/* + * Get a normal to a plane as the average of + * the normals at the four corners of the quad. + */ + +void get_plane_normal(int x, int z, GLdouble n[3]) +{ + GLdouble total[3]={0,0,0}; + get_quad_normal(x,z,0,0,n); + add3(total,n,total); + get_quad_normal(x,z,0,1,n); + add3(total,n,total); + get_quad_normal(x,z,1,0,n); + add3(total,n,total); + get_quad_normal(x,z,1,1,n); + add3(total,n,total); + normalize(total); + n[0]=total[0]; + n[1]=total[1]; + n[2]=total[2]; +} + +/* + * Get a normal to a point as the average + * of the surrounding quads. + */ + +void get_vertex_normal(int x, int z, GLdouble n[3]) +{ + GLdouble total[3]={0,0,0}; + if((x>0) && (z>0)) + { + get_quad_normal(x-1,z-1,1,1,n); + add3(total,n,total); + } + if((x>0) && (z<(DIM-1))) + { + get_quad_normal(x-1,z,1,0,n); + add3(total,n,total); + } + if((x<(DIM-1)) && (z>0)) + { + get_quad_normal(x,z-1,0,1,n); + add3(total,n,total); + } + if((x<(DIM-1)) && (z<(DIM-1))) + { + get_quad_normal(x,z,0,0,n); + add3(total,n,total); + } + normalize(total); + n[0]=total[0]; + n[1]=total[1]; + n[2]=total[2]; +} + +/* + * Draw the scene + */ + +void draw_scene(int av, int drape, int white) +{ + int xstrip, zrow; + + if(drape) { + glTexImage2D(GL_TEXTURE_2D, 0, 3, + DIM, DIM, 0, GL_RGB, + GL_UNSIGNED_BYTE, &cols[0][0][0]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glEnable(GL_TEXTURE_2D); + } + else + glDisable(GL_TEXTURE_2D); + + /* + * Clear the image buffer. + */ + if(white) + glClearColor(1,1,1,1); + else + glClearColor(0,0,0,1); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + + if(drape) + glColor3ub(255,255,255); /* basic white surface to be modulated */ + for(xstrip=0;xstrip<DIM-1;xstrip++) + { + glBegin(GL_QUADS); + for(zrow=0;zrow<DIM-1;zrow++) + { + GLdouble *c1, *c2, *c3, *c4; + GLdouble n1[3], n2[3], n3[3], n4[3]; + GLdouble t1[2], t2[2], t3[2], t4[2]; + int passes,toggle; + + /* corner co-ords */ + c1 = &mesh[xstrip][zrow][0]; + c2 = &mesh[xstrip+1][zrow][0]; + c3 = &mesh[xstrip+1][zrow+1][0]; + c4 = &mesh[xstrip][zrow+1][0]; + + /* + * texture co-ords - these look a bit odd, but we don't want to + * drape the entire texture over the surface - the vertices are + * assumed to be the centres of the squares on the texture and thus + * vertex 0,0 is halfway into the first square of the texture. Thus + * the texture is DIM wide, but the surface is DIM-1 wide compared + * to it - hence the +0.5's to offset the surface into the texture. + */ + t1[1]=(xstrip+0.5)/DIM; t1[0]=(zrow+0.5)/DIM; + t2[1]=(xstrip+1.5)/DIM; t2[0]=(zrow+0.5)/DIM; + t3[1]=(xstrip+1.5)/DIM; t3[0]=(zrow+1.5)/DIM; + t4[1]=(xstrip+0.5)/DIM; t4[0]=(zrow+1.5)/DIM; + + /* normal vectors */ + if(av) + { + get_vertex_normal(xstrip,zrow,n1); + get_vertex_normal(xstrip+1,zrow,n2); + get_vertex_normal(xstrip+1,zrow+1,n3); + get_vertex_normal(xstrip,zrow+1,n4); + } + else + { + get_plane_normal(xstrip,zrow,n1); + memcpy(n2,n1,3*sizeof(GLdouble)); + memcpy(n3,n1,3*sizeof(GLdouble)); + memcpy(n4,n1,3*sizeof(GLdouble)); + } + + /* + * we do this to draw the quads in the opposite direction for + * each strip as this reduces the effects of the triangluarisation + * of the quad by the rendering algorithm. + */ + for(passes=0;passes<4;passes++) + { + if((xstrip&1) == (zrow&1)) + toggle=3-passes; + else + toggle=passes; + switch (toggle) + { + case 0: + glNormal3dv(n1); + if(drape) + glTexCoord2dv(t1); + else + glColor3ubv(&cols[xstrip][zrow][0]); + glVertex3dv(c1); + break; + + case 1: + glNormal3dv(n2); + if(drape) + glTexCoord2dv(t2); + else + glColor3ubv(&cols[xstrip+1][zrow][0]); + glVertex3dv(c2); + break; + + case 2: + glNormal3dv(n3); + if(drape) + glTexCoord2dv(t3); + else + glColor3ubv(&cols[xstrip+1][zrow+1][0]); + glVertex3dv(c3); + break; + + case 3: + glNormal3dv(n4); + if(drape) + glTexCoord2dv(t4); + else + glColor3ubv(&cols[xstrip][zrow+1][0]); + glVertex3dv(c4); + break; + } + } + } + glEnd(); + } + + glFlush(); +} + +/* + * We use the display postscript operators to send + * an outline of the base area directly into the window + * by projecting points and drawing lines. We also draw + * a small arrow representing "north" to hep orientation. + */ + +void outline_scene(void) +{ + GLdouble model[16], proj[16]; + GLint viewport[4]; + GLdouble winx, winy, winz; + + glGetDoublev(GL_MODELVIEW_MATRIX, model); + glGetDoublev(GL_PROJECTION_MATRIX, proj); + glGetIntegerv(GL_VIEWPORT, viewport); + + /* Having got these we can draw the base */ + PSnewpath(); + gluProject(-50.0, 0, -50.0, model, proj, viewport, &winx, &winy, &winz); + PSmoveto(winx,winy); + gluProject(50.0, 0, -50.0, model, proj, viewport, &winx, &winy, &winz); + PSlineto(winx,winy); + gluProject(50.0, 0, 50.0, model, proj, viewport, &winx, &winy, &winz); + PSlineto(winx,winy); + gluProject(-50.0, 0, 50.0, model, proj, viewport, &winx, &winy, &winz); + PSlineto(winx,winy); + PSclosepath(); + PSstroke(); + + /* draw the "north" arrow */ + PSnewpath(); + gluProject(-10.0, 0, 0.0, model, proj, viewport, &winx, &winy, &winz); + PSmoveto(winx,winy); + gluProject(10.0, 0, 0.0, model, proj, viewport, &winx, &winy, &winz); + PSlineto(winx,winy); + gluProject(0.0, 0, 10.0, model, proj, viewport, &winx, &winy, &winz); + PSmoveto(winx,winy); + gluProject(0.0, 0, -15.0, model, proj, viewport, &winx, &winy, &winz); + PSlineto(winx,winy); + gluProject(-5.0, 0, -10.0, model, proj, viewport, &winx, &winy, &winz); + PSmoveto(winx,winy); + gluProject(0.0, 0, -15.0, model, proj, viewport, &winx, &winy, &winz); + PSlineto(winx,winy); + gluProject(5.0, 0, -10.0, model, proj, viewport, &winx, &winy, &winz); + PSlineto(winx,winy); + PSstroke(); +} diff --git a/xc/extras/Mesa/OpenStep/MesaView/mesadraw.h b/xc/extras/Mesa/OpenStep/MesaView/mesadraw.h new file mode 100644 index 000000000..06906631e --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/mesadraw.h @@ -0,0 +1,12 @@ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <AppKit/psops.h> + +extern void set_viewpoint(float, float, float); +extern void draw_scene(int,int,int); +extern void make_matrix(void); +extern void outline_scene(void); +extern void my_init(float width, float height); diff --git a/xc/extras/Mesa/OpenStep/MesaView/vect3d.c b/xc/extras/Mesa/OpenStep/MesaView/vect3d.c new file mode 100644 index 000000000..29f97ce98 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/vect3d.c @@ -0,0 +1,168 @@ +/* vect3d.c */ + +/* Routines to manipulate 3 dimensional vectors. All these routines + * should work even if the input and output vectors are the same. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <GL/gl.h> +#include "vect3d.h" + +#if defined(__cplusplus) || defined(c_plusplus) +#define class c_class +#endif + +void (*errfunc)(char *) = 0; + +void seterrorfunc(void (*func)(char *)) +{ + errfunc = func; +} + +void error(char *s) +{ + if (errfunc) + (*errfunc)(s); + else { + fprintf(stderr, s); + fprintf(stderr, "\n"); + exit(1); + } +} + +void diff3(GLdouble p[3], GLdouble q[3], GLdouble diff[3]) +{ + diff[0] = p[0] - q[0]; + diff[1] = p[1] - q[1]; + diff[2] = p[2] - q[2]; +} + +void add3(GLdouble p[3], GLdouble q[3], GLdouble sum[3]) +{ + sum[0] = p[0] + q[0]; + sum[1] = p[1] + q[1]; + sum[2] = p[2] + q[2]; +} + +void scalarmult(GLdouble s, GLdouble v[3], GLdouble vout[3]) +{ + vout[0] = v[0]*s; + vout[1] = v[1]*s; + vout[2] = v[2]*s; +} + +GLdouble dot3(GLdouble p[3], GLdouble q[3]) +{ + return p[0]*q[0] + p[1]*q[1] + p[2]*q[2]; +} + +GLdouble length3(GLdouble v[3]) +{ + return sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); +} + +GLdouble dist3(GLdouble p[3], GLdouble q[3]) +{ + GLdouble d[3]; + + diff3(p, q, d); + return length3(d); +} + +void copy3(GLdouble old[3], GLdouble new_c[3]) +{ + new_c[0] = old[0], new_c[1] = old[1], new_c[2] = old[2]; +} + +void crossprod(GLdouble v1[3], GLdouble v2[3], GLdouble prod[3]) +{ + GLdouble 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]; +} + +void normalize(GLdouble v[3]) +{ + GLdouble d; + + d = sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]); + if (d == 0.0) { + error("normalize: zero length vector"); + v[0] = d = 1.0; + } + d = 1/d; + v[0] *= d; v[1] *= d; v[2] *= d; +} + +void print3(GLdouble v[3]) +{ + GLdouble len; + + len = length3(v); + printf("(%g %g %g); len: %g\n", v[0], v[1], v[2], len); +} + +void printmat3(GLdouble m[3][3]) +{ + int i, j; + + for (i=0; i<3; i++) { + for (j=0; j<3; j++) + printf("%7.4f ", m[i][j]); + printf("\n"); + } +} + +void identifymat3(GLdouble m[3][3]) +{ + int i, j; + + for (i=0; i<3; i++) + for (j=0; j<3; j++) + m[i][j] = (i == j) ? 1.0 : 0.0; +} + +void copymat3(GLdouble *to, GLdouble *from) +{ + int i; + + for (i=0; i<9; i++) { + *to++ = *from++; + } +} + +void xformvec3(GLdouble v[3], GLdouble m[3][3], GLdouble vm[3]) +{ + GLdouble result[3]; /* in case v == vm */ + int i; + + for (i=0; i<3; i++) { + result[i] = v[0]*m[0][i] + v[1]*m[1][i] + v[2]*m[2][i]; + } + for (i=0; i<3; i++) { + vm[i] = result[i]; + } +} + +long samepoint(GLdouble p1[3], GLdouble p2[3]) +{ + if (p1[0] == p2[0] && p1[1] == p2[1] && p1[2] == p2[2]) + return 1; + return 0; +} + +void perpnorm(GLdouble p1[3], GLdouble p2[3], GLdouble p3[3], GLdouble n[3]) +{ + GLdouble d1[3], d2[3]; + + diff3(p2, p1, d1); + diff3(p2, p3, d2); + crossprod(d1, d2, n); + normalize(n); +} + diff --git a/xc/extras/Mesa/OpenStep/MesaView/vect3d.h b/xc/extras/Mesa/OpenStep/MesaView/vect3d.h new file mode 100644 index 000000000..5c4fc4bc9 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/MesaView/vect3d.h @@ -0,0 +1,22 @@ +/* + * vect3d.h - the definitions for vect3d.c functions. + */ + +extern void error(char *); +extern void diff3(GLdouble [3], GLdouble [3], GLdouble [3]); +extern void add3(GLdouble [3], GLdouble [3], GLdouble [3]); +extern void scalarmult(GLdouble, GLdouble [3], GLdouble [3]); +extern GLdouble dot3(GLdouble [3], GLdouble [3]); +extern GLdouble length3(GLdouble [3]); +extern GLdouble dist3(GLdouble [3], GLdouble [3]); +extern void copy3(GLdouble [3], GLdouble [3]); +extern void crossprod(GLdouble [3], GLdouble [3], GLdouble [3]); +extern void normalize(GLdouble [3]); +extern void print3(GLdouble [3]); +extern void printmat3(GLdouble [3][3]); +extern void identifymat3(GLdouble [3][3]); +extern void copymat3(GLdouble *, GLdouble *); +extern void xformvec3(GLdouble [3], GLdouble [3][3], GLdouble [3]); +extern long samepoint(GLdouble p1[3], GLdouble p2[3]); +extern void perpnorm(GLdouble p1[3], GLdouble p2[3], + GLdouble p3[3], GLdouble n[3]); diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/cone.c b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/cone.c new file mode 100644 index 000000000..9e464e504 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/cone.c @@ -0,0 +1,117 @@ +/* + * (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. + */ +/* + * cone.c + * This program demonstrates the use of the GL lighting model. + * A sphere is drawn using a grey material characteristic. + * A single light source illuminates the object. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Initialize material property, light source, and lighting model. + */ +void myinit(void) +{ + GLfloat mat_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + GLfloat mat_diffuse[] = { 0.8, 0.8, 0.8, 1.0 }; +/* mat_specular and mat_shininess are NOT default values */ + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_shininess[] = { 50.0 }; + + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; +/* light_position is NOT default value */ + GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; + + GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glTranslatef (0.0, -1.0, 0.0); + glRotatef (250.0, 1.0, 0.0, 0.0); + auxSolidCone(1.0, 2.0); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-1.5, 1.5, -1.5*(GLfloat)h/(GLfloat)w, + 1.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0); + else + glOrtho (-1.5*(GLfloat)w/(GLfloat)h, + 1.5*(GLfloat)w/(GLfloat)h, -1.5, 1.5, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/cone_ball.c b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/cone_ball.c new file mode 100644 index 000000000..4f10e3be9 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/cone_ball.c @@ -0,0 +1,80 @@ +#include <stdio.h> +#include <stdlib.h> +#include "GL/osmesa.h" + +int gl_width=480; +int gl_height=480; + +void init(void) +{ + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_DEPTH_TEST); +} + +/* + * reshape simply creates an orthographic projection + * within the viewport. + */ +void reshape(int w, int h) +{ + glViewport(0,0,w,h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-2.5, 2.5, -2.5, 2.5, -5.0, 5.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +void display(void) +{ + GLfloat red_mat[] = { 1.0, 0.0, 0.0, 0.5 }; + GLfloat green_mat[] = { 0.0, 1.0, 0.0, 0.5 }; + GLfloat blue_mat[] = { 0.0, 0.0, 1.0, 0.5}; + + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + + glPushMatrix(); + glRotatef(20.0, 1.0, 0.0, 0.0); + + glPushMatrix(); + glTranslatef(-0.75, 0.5, 0.0); + glRotatef(90.0, 1.0, 0.0, 0.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red_mat ); + auxSolidTorus(0.275, 0.85); + glPopMatrix(); + + glPushMatrix(); + glTranslatef(-0.75, -0.5, 0.0); + glRotatef(270.0, 1.0, 0.0, 0.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, green_mat ); + auxSolidCone(1.0, 2.0); + glPopMatrix(); + + glPushMatrix(); + glTranslatef(0.75, 0.0, -1.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat ); + auxSolidSphere(1.0); + glPopMatrix(); + + glPopMatrix(); +} + +void render_image(void) +{ + init(); + reshape(gl_width,gl_height); + display(); +} + diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/material.c b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/material.c new file mode 100644 index 000000000..e1324fa6c --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/material.c @@ -0,0 +1,285 @@ +/* + * (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. + */ +/* + * material.c + * This program demonstrates the use of the GL lighting model. + * Several objects are drawn using different material characteristics. + * A single light source illuminates the objects. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Initialize z-buffer, projection matrix, light source, + * and lighting model. Do not specify a material property here. + */ +void myinit(void) +{ + GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat position[] = { 0.0, 3.0, 2.0, 0.0 }; + GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 }; + GLfloat local_view[] = { 0.0 }; + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_POSITION, position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + + glClearColor(0.0, 0.1, 0.1, 0.0); +} + +/* Draw twelve spheres in 3 rows with 4 columns. + * The spheres in the first row have materials with no ambient reflection. + * The second row has materials with significant ambient reflection. + * The third row has materials with colored ambient reflection. + * + * The first column has materials with blue, diffuse reflection only. + * The second column has blue diffuse reflection, as well as specular + * reflection with a low shininess exponent. + * The third column has blue diffuse reflection, as well as specular + * reflection with a high shininess exponent (a more concentrated highlight). + * The fourth column has materials which also include an emissive component. + * + * glTranslatef() is used to move spheres to their appropriate locations. + */ + +void display(void) +{ + GLfloat no_mat[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat mat_ambient[] = { 0.7, 0.7, 0.7, 1.0 }; + GLfloat mat_ambient_color[] = { 0.8, 0.8, 0.2, 1.0 }; + GLfloat mat_diffuse[] = { 0.1, 0.5, 0.8, 1.0 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat no_shininess[] = { 0.0 }; + GLfloat low_shininess[] = { 5.0 }; + GLfloat high_shininess[] = { 100.0 }; + GLfloat mat_emission[] = {0.3, 0.2, 0.2, 0.0}; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + +/* draw sphere in first row, first column + * diffuse reflection only; no ambient or specular + */ + glPushMatrix(); + glTranslatef (-3.75, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, second column + * diffuse and specular reflection; low shininess; no ambient + */ + glPushMatrix(); + glTranslatef (-1.25, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, third column + * diffuse and specular reflection; high shininess; no ambient + */ + glPushMatrix(); + glTranslatef (1.25, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, fourth column + * diffuse reflection; emission; no ambient or specular reflection + */ + glPushMatrix(); + glTranslatef (3.75, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, first column + * ambient and diffuse reflection; no specular + */ + glPushMatrix(); + glTranslatef (-3.75, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, second column + * ambient, diffuse and specular reflection; low shininess + */ + glPushMatrix(); + glTranslatef (-1.25, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, third column + * ambient, diffuse and specular reflection; high shininess + */ + glPushMatrix(); + glTranslatef (1.25, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, fourth column + * ambient and diffuse reflection; emission; no specular + */ + glPushMatrix(); + glTranslatef (3.75, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, first column + * colored ambient and diffuse reflection; no specular + */ + glPushMatrix(); + glTranslatef (-3.75, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, second column + * colored ambient, diffuse and specular reflection; low shininess + */ + glPushMatrix(); + glTranslatef (-1.25, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, third column + * colored ambient, diffuse and specular reflection; high shininess + */ + glPushMatrix(); + glTranslatef (1.25, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, fourth column + * colored ambient and diffuse reflection; emission; no specular + */ + glPushMatrix(); + glTranslatef (3.75, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= (h * 2)) + glOrtho (-6.0, 6.0, -3.0*((GLfloat)h*2)/(GLfloat)w, + 3.0*((GLfloat)h*2)/(GLfloat)w, -10.0, 10.0); + else + glOrtho (-6.0*(GLfloat)w/((GLfloat)h*2), + 6.0*(GLfloat)w/((GLfloat)h*2), -3.0, 3.0, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=600; +int gl_height=450; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/sphere.c b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/sphere.c new file mode 100644 index 000000000..b545a2777 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/sphere.c @@ -0,0 +1,81 @@ +/* + * (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. + */ +/* + * sphere.c + * This program draws a wire frame sphere. It uses + * glTranslatef() as a viewing transformation. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +void display (void) +{ + glClear(GL_COLOR_BUFFER_BIT); + glColor3f (1.0, 1.0, 1.0); + glPushMatrix(); +/* glTranslatef() as viewing transformation */ + glTranslatef (0.0, 0.0, -5.0); + auxWireSphere(1.0); + glPopMatrix(); + glFlush(); +} + +void myinit (void) +{ + glShadeModel (GL_FLAT); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, (GLfloat) w/(GLfloat) h, 1.0, 20.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=400; +int gl_height=400; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/tea.c b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/tea.c new file mode 100644 index 000000000..cb2a4164d --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/tea.c @@ -0,0 +1,135 @@ +/* + * (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. + */ +/* + * tea.c + * This program demonstrates two-sided lighting and compares + * it with one-sided lighting. Three teapots are drawn, with + * a clipping plane to expose the interior of the objects. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Initialize light source. + */ +void myinit(void) +{ + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; +/* light_position is NOT default value */ + GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glFrontFace (GL_CW); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); +} + +void display(void) +{ + GLdouble eqn[4] = {1.0, 0.0, -1.0, 1.0}; + GLfloat two_side_on[] = { GL_TRUE }; + GLfloat two_side_off[] = { GL_FALSE }; + GLfloat mat_diffuse[] = { 0.8, 0.8, 0.8, 1.0 }; + GLfloat back_diffuse[] = { 0.8, 0.2, 0.8, 1.0 }; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix (); + glClipPlane (GL_CLIP_PLANE0, eqn); /* slice objects */ + glEnable (GL_CLIP_PLANE0); + + glPushMatrix (); + glTranslatef (0.0, 2.0, 0.0); + auxSolidTeapot(1.0); /* one-sided lighting */ + glPopMatrix (); + + /* two-sided lighting, but same material */ + glLightModeli (GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); + glPushMatrix (); + glTranslatef (0.0, 0.0, 0.0); + auxSolidTeapot(1.0); + glPopMatrix (); + + /* two-sided lighting, two different materials */ + glMaterialfv (GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv (GL_BACK, GL_DIFFUSE, back_diffuse); + glPushMatrix (); + glTranslatef (0.0, -2.0, 0.0); + auxSolidTeapot(1.0); + glPopMatrix (); + + glLightModeli (GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); + glDisable (GL_CLIP_PLANE0); + glPopMatrix (); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-4.0, 4.0, -4.0*(GLfloat)h/(GLfloat)w, + 4.0*(GLfloat)h/(GLfloat)w, -10.0, 10.0); + else + glOrtho (-4.0*(GLfloat)w/(GLfloat)h, + 4.0*(GLfloat)w/(GLfloat)h, -4.0, 4.0, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/teapots.c b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/teapots.c new file mode 100644 index 000000000..959531761 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/teapots.c @@ -0,0 +1,180 @@ +/* + * (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. + */ +/* + * teapots.c + * This program demonstrates lots of material properties. + * A single light source illuminates the objects. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Initialize depth buffer, projection matrix, light source, + * and lighting model. Do not specify a material property here. + */ +void myinit(void) +{ + GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat position[] = { 0.0, 3.0, 3.0, 0.0 }; + + GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + GLfloat local_view[] = { 0.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_POSITION, position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view); + + glFrontFace (GL_CW); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); +} + +/* Move object into position. Use 3rd through 12th parameters + * to specify the material property. Draw a teapot. + */ +void renderTeapot (GLfloat x, GLfloat y, + GLfloat ambr, GLfloat ambg, GLfloat ambb, + GLfloat difr, GLfloat difg, GLfloat difb, + GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine) +{ + float mat[4]; + + glPushMatrix(); + glTranslatef (x, y, 0.0); + mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0; + glMaterialfv (GL_FRONT, GL_AMBIENT, mat); + mat[0] = difr; mat[1] = difg; mat[2] = difb; + glMaterialfv (GL_FRONT, GL_DIFFUSE, mat); + mat[0] = specr; mat[1] = specg; mat[2] = specb; + glMaterialfv (GL_FRONT, GL_SPECULAR, mat); + glMaterialf (GL_FRONT, GL_SHININESS, shine*128.0); + auxSolidTeapot(1.0); + glPopMatrix(); +} + +/* First column: emerald, jade, obsidian, pearl, ruby, turquoise + * 2nd column: brass, bronze, chrome, copper, gold, silver + * 3rd column: black, cyan, green, red, white, yellow plastic + * 4th column: black, cyan, green, red, white, yellow rubber + */ +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + renderTeapot (2.0, 17.0, 0.0215, 0.1745, 0.0215, + 0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6); + renderTeapot (2.0, 14.0, 0.135, 0.2225, 0.1575, + 0.54, 0.89, 0.63, 0.316228, 0.316228, 0.316228, 0.1); + renderTeapot (2.0, 11.0, 0.05375, 0.05, 0.06625, + 0.18275, 0.17, 0.22525, 0.332741, 0.328634, 0.346435, 0.3); + renderTeapot (2.0, 8.0, 0.25, 0.20725, 0.20725, + 1, 0.829, 0.829, 0.296648, 0.296648, 0.296648, 0.088); + renderTeapot (2.0, 5.0, 0.1745, 0.01175, 0.01175, + 0.61424, 0.04136, 0.04136, 0.727811, 0.626959, 0.626959, 0.6); + renderTeapot (2.0, 2.0, 0.1, 0.18725, 0.1745, + 0.396, 0.74151, 0.69102, 0.297254, 0.30829, 0.306678, 0.1); + renderTeapot (6.0, 17.0, 0.329412, 0.223529, 0.027451, + 0.780392, 0.568627, 0.113725, 0.992157, 0.941176, 0.807843, + 0.21794872); + renderTeapot (6.0, 14.0, 0.2125, 0.1275, 0.054, + 0.714, 0.4284, 0.18144, 0.393548, 0.271906, 0.166721, 0.2); + renderTeapot (6.0, 11.0, 0.25, 0.25, 0.25, + 0.4, 0.4, 0.4, 0.774597, 0.774597, 0.774597, 0.6); + renderTeapot (6.0, 8.0, 0.19125, 0.0735, 0.0225, + 0.7038, 0.27048, 0.0828, 0.256777, 0.137622, 0.086014, 0.1); + renderTeapot (6.0, 5.0, 0.24725, 0.1995, 0.0745, + 0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4); + renderTeapot (6.0, 2.0, 0.19225, 0.19225, 0.19225, + 0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4); + renderTeapot (10.0, 17.0, 0.0, 0.0, 0.0, 0.01, 0.01, 0.01, + 0.50, 0.50, 0.50, .25); + renderTeapot (10.0, 14.0, 0.0, 0.1, 0.06, 0.0, 0.50980392, 0.50980392, + 0.50196078, 0.50196078, 0.50196078, .25); + renderTeapot (10.0, 11.0, 0.0, 0.0, 0.0, + 0.1, 0.35, 0.1, 0.45, 0.55, 0.45, .25); + renderTeapot (10.0, 8.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, + 0.7, 0.6, 0.6, .25); + renderTeapot (10.0, 5.0, 0.0, 0.0, 0.0, 0.55, 0.55, 0.55, + 0.70, 0.70, 0.70, .25); + renderTeapot (10.0, 2.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, + 0.60, 0.60, 0.50, .25); + renderTeapot (14.0, 17.0, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, + 0.4, 0.4, 0.4, .078125); + renderTeapot (14.0, 14.0, 0.0, 0.05, 0.05, 0.4, 0.5, 0.5, + 0.04, 0.7, 0.7, .078125); + renderTeapot (14.0, 11.0, 0.0, 0.05, 0.0, 0.4, 0.5, 0.4, + 0.04, 0.7, 0.04, .078125); + renderTeapot (14.0, 8.0, 0.05, 0.0, 0.0, 0.5, 0.4, 0.4, + 0.7, 0.04, 0.04, .078125); + renderTeapot (14.0, 5.0, 0.05, 0.05, 0.05, 0.5, 0.5, 0.5, + 0.7, 0.7, 0.7, .078125); + renderTeapot (14.0, 2.0, 0.05, 0.05, 0.0, 0.5, 0.5, 0.4, + 0.7, 0.7, 0.04, .078125); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (0.0, 16.0, 0.0, 16.0*(GLfloat)h/(GLfloat)w, + -10.0, 10.0); + else + glOrtho (0.0, 16.0*(GLfloat)w/(GLfloat)h, 0.0, 16.0, + -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=500; +int gl_height=600; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/texgen.c b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/texgen.c new file mode 100644 index 000000000..93b5aaa54 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/GLaux/texgen.c @@ -0,0 +1,129 @@ +/* + * (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. + */ +/* texgen.c + * This program draws a texture mapped teapot with + * automatically generated texture coordinates. The + * texture is rendered as stripes on the teapot. + */ + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +#define stripeImageWidth 32 +GLubyte stripeImage[3*stripeImageWidth]; + +void makeStripeImage(void) +{ + int j; + + for (j = 0; j < stripeImageWidth; j++) { + stripeImage[3*j] = (j<=4) ? 255 : 0; + stripeImage[3*j+1] = (j>4) ? 255 : 0; + stripeImage[3*j+2] = 0; + } +} + +/* glTexGen stuff: */ + +GLfloat sgenparams[] = {1.0, 1.0, 1.0, 0.0}; + +void myinit(void) +{ + glClearColor (0.0, 0.0, 0.0, 0.0); + + makeStripeImage(); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexImage1D(GL_TEXTURE_1D, 0, 3, stripeImageWidth, 0, + GL_RGB, GL_UNSIGNED_BYTE, stripeImage); + + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGenfv(GL_S, GL_OBJECT_PLANE, sgenparams); + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + glEnable(GL_TEXTURE_GEN_S); + glEnable(GL_TEXTURE_1D); + glEnable(GL_CULL_FACE); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glFrontFace(GL_CW); + glCullFace(GL_BACK); + glMaterialf (GL_FRONT, GL_SHININESS, 64.0); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glPushMatrix (); + glRotatef(45.0, 0.0, 0.0, 1.0); + auxSolidTeapot(2.0); + glPopMatrix (); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-3.5, 3.5, -3.5*(GLfloat)h/(GLfloat)w, + 3.5*(GLfloat)h/(GLfloat)w, -3.5, 3.5); + else + glOrtho (-3.5*(GLfloat)w/(GLfloat)h, + 3.5*(GLfloat)w/(GLfloat)h, -3.5, 3.5, -3.5, 3.5); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +int gl_width=200; +int gl_height=200; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/Makefile b/xc/extras/Mesa/OpenStep/Old_Demos/Makefile new file mode 100644 index 000000000..2594e533a --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/Makefile @@ -0,0 +1,15 @@ +INCDIR = ../../include +GL_LIBS = generic.o -L../../lib -lMesaGLU -lMesaGL +PROGS = chess nurbs surface\ + checker checker2 texturesurf font model disk + +all: generic.o $(PROGS) + +generic.o: + $(CC) -c -I$(INCDIR) $(CFLAGS) $*.m -o $@ + +.c: $(LIB_DEP) generic.o + $(CC) -I$(INCDIR) $(CFLAGS) $*.c $(GL_LIBS) -framework AppKit -o $@ + +clean: + rm -f $(PROGS) *.o diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/Makefile.NeXT b/xc/extras/Mesa/OpenStep/Old_Demos/Makefile.NeXT new file mode 100644 index 000000000..41e1945bc --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/Makefile.NeXT @@ -0,0 +1,19 @@ +INCDIR = ../../include +GL_LIBS = generic_next.o -L../../lib -lMesaGLU -lMesaGL +PROGS = chess nurbs surface\ + checker checker2 texturesurf font model disk + +all: + ranlib ../../lib/*.a + make -f Makefile.NeXT CC="$(CC)" progs + +progs: generic_next.o $(PROGS) + +generic_next.o: + $(CC) -c -I$(INCDIR) $(CFLAGS) ../Old_NeXT/generic.m -o $@ + +.c: $(LIB_DEP) generic_next.o + $(CC) -I$(INCDIR) $(CFLAGS) $*.c $(GL_LIBS) -lNeXT_s -o $@ + +clean: + rm -f $(PROGS) *.o diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/README b/xc/extras/Mesa/OpenStep/Old_Demos/README new file mode 100644 index 000000000..e433db2bd --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/README @@ -0,0 +1,25 @@ +This directory contains some of the old demos which were supplied +with Mesa-2.6. Almost all of these old demos were taken from the +code in the "book" directory on the old Mesa distribution. The +book itself, and hence the examples, have been updated to use +the GLUT library as opposed to the AUX library, thus the examples +here do not reflect those found in the current book directory. Programs +which used the AUX library to render shapes such as consed, spheres and +teapots do not run under Mesa 3.0 and can be found in the Aux directory. + +The file "generic.m" contains code for generating a simple application +programaticaly with a single window in which the bitmap generated by +Mesa is displayed. It is heavily based on the original code written +by Pascal Thibaudeau (pascal@galileo.slip.u-bordeaux.fr) for his NeXTStep +Mesa port. The code takes the window size from two global variables +called gl_width and gl_height which are declared in the individual +examples. A function "render_image" is also provided by each example which +replaces the "main" or the original code. This function simply calls +"init, "reshape" and "display" to generate the bitmap when it is called +from generic.m to render the image. A piece of code such as "nurbs.c" +shows how this code works as opposed to the original code from the books +directory. + +These examples do not work under Windows. + +-Pete French. (pete@ohm.york.ac.uk) 28/5/98 diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/README.NeXT b/xc/extras/Mesa/OpenStep/Old_Demos/README.NeXT new file mode 100644 index 000000000..4742ac4fa --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/README.NeXT @@ -0,0 +1,7 @@ +Although these old demo examples are intended for use with OpenStep +they can also be made to work with NeXTStep by using the "Makefile.NeXT" +makefile in this directory. This ranlibs the libraries and builds the +examples using the generic file taken from Pascal Thibaudeau's original +NeXT support in the "Old_NeXT" directory. + +-Pete French. (pete@ohm.york.ac.uk) 28/5/98 diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/checker.c b/xc/extras/Mesa/OpenStep/Old_Demos/checker.c new file mode 100644 index 000000000..f255ce14f --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/checker.c @@ -0,0 +1,121 @@ +/* + * (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. + */ +/* checker.c + * This program texture maps a checkerboard image onto + * two rectangles. This program clamps the texture, if + * the texture coordinates fall outside 0.0 and 1.0. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> + +/* Create checkerboard texture */ +#define checkImageWidth 64 +#define checkImageHeight 64 +GLubyte checkImage[checkImageWidth][checkImageHeight][3]; + +void makeCheckImage(void) +{ + int i, j, r, c; + + for (i = 0; i < checkImageWidth; i++) { + for (j = 0; j < checkImageHeight; j++) { + c = ((((i&0x8)==0)^((j&0x8))==0))*255; + checkImage[i][j][0] = (GLubyte) c; + checkImage[i][j][1] = (GLubyte) c; + checkImage[i][j][2] = (GLubyte) c; + } + } +} + +void myinit(void) +{ + glClearColor (0.0, 0.0, 0.0, 0.0); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + makeCheckImage(); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0, 3, checkImageWidth, + checkImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, + &checkImage[0][0][0]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_FLAT); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); + glTexCoord2f(0.0, 1.0); glVertex3f(-2.0, 1.0, 0.0); + glTexCoord2f(1.0, 1.0); glVertex3f(0.0, 1.0, 0.0); + glTexCoord2f(1.0, 0.0); glVertex3f(0.0, -1.0, 0.0); + + glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 0.0); + glTexCoord2f(0.0, 1.0); glVertex3f(1.0, 1.0, 0.0); + glTexCoord2f(1.0, 1.0); glVertex3f(2.41421, 1.0, -1.41421); + glTexCoord2f(1.0, 0.0); glVertex3f(2.41421, -1.0, -1.41421); + glEnd(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -3.6); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/checker2.c b/xc/extras/Mesa/OpenStep/Old_Demos/checker2.c new file mode 100644 index 000000000..4f272ab05 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/checker2.c @@ -0,0 +1,121 @@ +/* + * (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. + */ +/* checker2.c + * This program texture maps a checkerboard image onto + * two rectangles. This program repeats the texture, if + * the texture coordinates fall outside 0.0 and 1.0. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> + +/* Create checkerboard texture */ +#define checkImageWidth 64 +#define checkImageHeight 64 +GLubyte checkImage[checkImageWidth][checkImageHeight][3]; + +void makeCheckImage(void) +{ + int i, j, r, c; + + for (i = 0; i < checkImageWidth; i++) { + for (j = 0; j < checkImageHeight; j++) { + c = ((((i&0x8)==0)^((j&0x8))==0))*255; + checkImage[i][j][0] = (GLubyte) c; + checkImage[i][j][1] = (GLubyte) c; + checkImage[i][j][2] = (GLubyte) c; + } + } +} + +void myinit(void) +{ + glClearColor (0.0, 0.0, 0.0, 0.0); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + makeCheckImage(); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0, 3, checkImageWidth, + checkImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, + &checkImage[0][0][0]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_FLAT); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(-2.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(0.0, 1.0, 0.0); + glTexCoord2f(3.0, 0.0); glVertex3f(0.0, -1.0, 0.0); + + glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(1.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(2.41421, 1.0, -1.41421); + glTexCoord2f(3.0, 0.0); glVertex3f(2.41421, -1.0, -1.41421); + glEnd(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -3.6); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/chess.c b/xc/extras/Mesa/OpenStep/Old_Demos/chess.c new file mode 100644 index 000000000..ff702339a --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/chess.c @@ -0,0 +1,119 @@ +/* + * (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. + */ +/* chess.c + * This program texture maps a checkerboard image onto + * two rectangles. The texture coordinates for the + * rectangles are 0.0 to 3.0. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include <math.h> + +#define checkImageWidth 64 +#define checkImageHeight 64 +GLubyte checkImage[checkImageWidth][checkImageHeight][3]; + +void makecheckimage(void) +{ + int i, j, r, c; + + for (i = 0; i < checkImageWidth; i++) { + for (j = 0; j < checkImageHeight; j++) { + c = ((((i&0x8)==0)^((j&0x8))==0))*255; + checkImage[i][j][0] = (GLubyte) c; + checkImage[i][j][1] = (GLubyte) c; + checkImage[i][j][2] = (GLubyte) c; + } + } +} + +void myinit(void) +{ + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + makecheckimage(); + glTexImage2D(GL_TEXTURE_2D, 0, 3, + checkImageWidth, checkImageHeight, 0, + GL_RGB, GL_UNSIGNED_BYTE, &checkImage[0][0][0]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_FLAT); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(-2.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(0.0, 1.0, 0.0); + glTexCoord2f(3.0, 0.0); glVertex3f(0.0, -1.0, 0.0); + + glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(1.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(2.41421, 1.0, -1.41421); + glTexCoord2f(3.0, 0.0); glVertex3f(2.41421, -1.0, -1.41421); + glEnd(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -3.6); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/disk.c b/xc/extras/Mesa/OpenStep/Old_Demos/disk.c new file mode 100644 index 000000000..74a71e789 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/disk.c @@ -0,0 +1,113 @@ +/* + * (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. + */ +/* + * disk.c + * This program demonstrates the use of the quadrics + * Utility Library routines to draw circles and arcs. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> + +GLUquadricObj * quadObj; + +/* Clear the screen. For each triangle, set the current + * color and modify the modelview matrix. + */ +void display(void) +{ + glClearColor (0.0, 0.0, 0.0, 1.0); + glClear (GL_COLOR_BUFFER_BIT); + + glPushMatrix(); + gluQuadricDrawStyle (quadObj, GLU_FILL); + glColor3f (1.0, 1.0, 1.0); + glTranslatef (10.0, 10.0, 0.0); + gluDisk (quadObj, 0.0, 5.0, 10, 2); + glPopMatrix(); + + glPushMatrix(); + glColor3f (1.0, 1.0, 0.0); + glTranslatef (20.0, 20.0, 0.0); + gluPartialDisk (quadObj, 0.0, 5.0, 10, 3, 30.0, 120.0); + glPopMatrix(); + + glPushMatrix(); + gluQuadricDrawStyle (quadObj, GLU_SILHOUETTE); + glColor3f (0.0, 1.0, 1.0); + glTranslatef (30.0, 30.0, 0.0); + gluPartialDisk (quadObj, 0.0, 5.0, 10, 3, 135.0, 270.0); + glPopMatrix(); + + glPushMatrix(); + gluQuadricDrawStyle (quadObj, GLU_LINE); + glColor3f (1.0, 0.0, 1.0); + glTranslatef (40.0, 40.0, 0.0); + gluDisk (quadObj, 2.0, 5.0, 10, 10); + glPopMatrix(); + glFlush(); +} + +void myinit (void) { + quadObj = gluNewQuadric (); + glShadeModel(GL_FLAT); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (0.0, 50.0, + 0.0, 50.0*(GLfloat)h/(GLfloat)w, -1.0, 1.0); + else + glOrtho (0.0, 50.0*(GLfloat)w/(GLfloat)h, + 0.0, 50.0, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity (); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/font.c b/xc/extras/Mesa/OpenStep/Old_Demos/font.c new file mode 100644 index 000000000..eca644c73 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/font.c @@ -0,0 +1,219 @@ +/* + * (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. + */ +/* + * font.c + * + * Draws some text in a bitmapped font. Uses glBitmap() + * and other pixel routines. Also demonstrates use of + * display lists. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include <string.h> + +GLubyte rasters[][13] = { +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36}, +{0x00, 0x00, 0x00, 0x66, 0x66, 0xff, 0x66, 0x66, 0xff, 0x66, 0x66, 0x00, 0x00}, +{0x00, 0x00, 0x18, 0x7e, 0xff, 0x1b, 0x1f, 0x7e, 0xf8, 0xd8, 0xff, 0x7e, 0x18}, +{0x00, 0x00, 0x0e, 0x1b, 0xdb, 0x6e, 0x30, 0x18, 0x0c, 0x76, 0xdb, 0xd8, 0x70}, +{0x00, 0x00, 0x7f, 0xc6, 0xcf, 0xd8, 0x70, 0x70, 0xd8, 0xcc, 0xcc, 0x6c, 0x38}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1c, 0x0c, 0x0e}, +{0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c}, +{0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30}, +{0x00, 0x00, 0x00, 0x00, 0x99, 0x5a, 0x3c, 0xff, 0x3c, 0x5a, 0x99, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x00, 0x00}, +{0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 0x03}, +{0x00, 0x00, 0x3c, 0x66, 0xc3, 0xe3, 0xf3, 0xdb, 0xcf, 0xc7, 0xc3, 0x66, 0x3c}, +{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x38, 0x18}, +{0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0xe7, 0x7e}, +{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0x07, 0x03, 0x03, 0xe7, 0x7e}, +{0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xcc, 0x6c, 0x3c, 0x1c, 0x0c}, +{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xff}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, +{0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x03, 0x03, 0xff}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e}, +{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x03, 0x7f, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e}, +{0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06}, +{0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60}, +{0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x0c, 0x06, 0x03, 0xc3, 0xc3, 0x7e}, +{0x00, 0x00, 0x3f, 0x60, 0xcf, 0xdb, 0xd3, 0xdd, 0xc3, 0x7e, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18}, +{0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, +{0x00, 0x00, 0x7e, 0xe7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, +{0x00, 0x00, 0xfc, 0xce, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xce, 0xfc}, +{0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff}, +{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xff}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, +{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, +{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e}, +{0x00, 0x00, 0x7c, 0xee, 0xc6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06}, +{0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3}, +{0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0}, +{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3}, +{0x00, 0x00, 0xc7, 0xc7, 0xcf, 0xcf, 0xdf, 0xdb, 0xfb, 0xf3, 0xf3, 0xe3, 0xe3}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0x7e}, +{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, +{0x00, 0x00, 0x3f, 0x6e, 0xdf, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c}, +{0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, +{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0xe0, 0xc0, 0xc0, 0xe7, 0x7e}, +{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, +{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, +{0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, +{0x00, 0x00, 0xc3, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3}, +{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3}, +{0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff}, +{0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c}, +{0x00, 0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60}, +{0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18}, +{0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x30, 0x70}, +{0x00, 0x00, 0x7f, 0xc3, 0xc3, 0x7f, 0x03, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0}, +{0x00, 0x00, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x03, 0x03, 0x03, 0x03, 0x03}, +{0x00, 0x00, 0x7f, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x33, 0x1e}, +{0x7e, 0xc3, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0}, +{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00}, +{0x38, 0x6c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x0c, 0x00}, +{0x00, 0x00, 0xc6, 0xcc, 0xf8, 0xf0, 0xd8, 0xcc, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0}, +{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78}, +{0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xfe, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfc, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, +{0xc0, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0x00, 0x00, 0x00, 0x00}, +{0x03, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, 0xfe, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xfe, 0x03, 0x03, 0x7e, 0xc0, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x1c, 0x36, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x00}, +{0x00, 0x00, 0x7e, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc3, 0xe7, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00}, +{0xc0, 0x60, 0x60, 0x30, 0x18, 0x3c, 0x66, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xff, 0x60, 0x30, 0x18, 0x0c, 0x06, 0xff, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x0f, 0x18, 0x18, 0x18, 0x38, 0xf0, 0x38, 0x18, 0x18, 0x18, 0x0f}, +{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, +{0x00, 0x00, 0xf0, 0x18, 0x18, 0x18, 0x1c, 0x0f, 0x1c, 0x18, 0x18, 0x18, 0xf0}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x8f, 0xf1, 0x60, 0x00, 0x00, 0x00} +}; + +GLuint fontOffset; + +void makeRasterFont(void) +{ + GLuint i; + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + fontOffset = glGenLists (128); + for (i = 32; i < 127; i++) { + glNewList(i+fontOffset, GL_COMPILE); + glBitmap(8, 13, 0.0, 2.0, 10.0, 0.0, rasters[i-32]); + glEndList(); + } +} + +void myinit(void) +{ + glShadeModel (GL_FLAT); + makeRasterFont(); +} + +void printString(char *s) +{ + glPushAttrib (GL_LIST_BIT); + glListBase(fontOffset); + glCallLists(strlen(s), GL_UNSIGNED_BYTE, (GLubyte *) s); + glPopAttrib (); +} + +/* Everything above this line could be in a library that defines a font. + * To make it work, you've got to call makeRasterFont() before you start + * making calls to printString(). + */ +void display(void) +{ + GLfloat white[3] = { 1.0, 1.0, 1.0 }; + int i, j; + char teststring[33]; + + glClear(GL_COLOR_BUFFER_BIT); + glColor3fv(white); + for (i = 32; i < 127; i += 32) { + glRasterPos2i(20, 200 - 18*i/32); + for (j = 0; j < 32; j++) + teststring[j] = (char) (i+j); + teststring[32] = 0; + printString(teststring); + } + glRasterPos2i(20, 100); + printString("The quick brown fox jumps"); + glRasterPos2i(20, 82); + printString("over a lazy dog."); + glFlush (); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho (0.0, w, 0.0, h, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/generic.m b/xc/extras/Mesa/OpenStep/Old_Demos/generic.m new file mode 100644 index 000000000..32d4f3754 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/generic.m @@ -0,0 +1,110 @@ +/* generic.m*/ + +/* Demo of OPENSTEP Mesa rendering */ + +/* + * See Mesa/include/GL/osmesa.h for documentation of the OSMesa functions. + * + * If you want to render BIG images you'll probably have to increase + * MAX_WIDTH and MAX_HEIGHT in src/config.h. + * + * This program is in the public domain. + * + * Brian Paul + * + * NEXTSTEP output provided by Pascal Thibaudeau + * pthibaud@frbdx11.cribx1.u-bordeaux.fr + * OpenStep conversion by Pete French + * pete@ohm.york.ac.uk + */ + +#import <AppKit/AppKit.h> +#import <stdio.h> +#import <stdlib.h> +#import "GL/osmesa.h" + +extern int gl_width,gl_height; +extern void render_image(void); + +int main( int argc, char *argv[] ) +{ + OSMesaContext ctx; + unsigned char *buffer; + NSWindow *myWindow; + NSView *myView; + NSMenu *myMenu; + NSBitmapImageRep *bitmap; + + unsigned long start, end; + char name[50]; + NSRect GR; + NSPoint position; + + [[NSAutoreleasePool alloc] init]; + NSApp=[NSApplication sharedApplication]; + + /* Create an RGBA-mode context */ + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + + /* Allocate the image buffer */ + buffer = malloc( gl_width * gl_height * 4 ); + + /* Bind the buffer to the context and make it current */ + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, gl_width, gl_height ); + OSMesaPixelStore( OSMESA_Y_UP, 0 ); + + bitmap = [[ NSBitmapImageRep alloc] initWithBitmapDataPlanes:&buffer + pixelsWide:gl_width + pixelsHigh:gl_height + bitsPerSample:8 samplesPerPixel:4 + hasAlpha:YES isPlanar:NO + colorSpaceName:NSDeviceRGBColorSpace + bytesPerRow:0 bitsPerPixel:0]; + GR = NSMakeRect(100, 100, gl_width, gl_height); + + myWindow = [[ NSWindow alloc] initWithContentRect:GR + styleMask:NSTitledWindowMask| + NSMiniaturizableWindowMask + backing:NSBackingStoreBuffered defer:NO]; + + sprintf(name, "Mesa demo: `%s'", argv[0]); + + myView = [[ NSView alloc] initWithFrame:GR]; + + myMenu = [[ NSMenu alloc] initWithTitle:@"OpenStep Mesa"]; + [myMenu addItemWithTitle:@"Quit" + action:@selector(terminate:) + keyEquivalent:@"q"]; + [myMenu sizeToFit]; + + [myWindow setTitle:[NSString stringWithCString:name]]; + [myWindow display]; + [myWindow setContentView:myView]; + [myWindow makeKeyAndOrderFront:nil]; + + [NSApp setMainMenu:myMenu]; + + [myView lockFocus]; + + /* here is the Mesa call */ + start=time(0); + render_image(); + end=time(0); + printf("Rendering took %ld seconds\n",end-start); + fflush(stdout); + + /* draw the bitmap */ + [bitmap draw]; + [bitmap release]; + [myWindow flushWindow]; + [myView unlockFocus]; + free( buffer ); + + /* destroy the context */ + OSMesaDestroyContext( ctx ); + + [NSApp run]; + [NSApp release]; + + return 0; +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/model.c b/xc/extras/Mesa/OpenStep/Old_Demos/model.c new file mode 100644 index 000000000..435abc88c --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/model.c @@ -0,0 +1,115 @@ +/* + * (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. + */ +/* + * model.c + * This program demonstrates the use of OpenGL modeling + * transformations. Four triangles are drawn, each with + * a different transformation. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> + +void draw_triangle(void) +{ + glBegin(GL_LINE_LOOP); + glVertex2f(0.0, 25.0); + glVertex2f(25.0, -25.0); + glVertex2f(-25.0, -25.0); + glEnd(); +} + +/* Clear the screen. For each triangle, set the current + * color and modify the modelview matrix. + */ +void display(void) +{ + glClearColor (0.0, 0.0, 0.0, 1.0); + glClear (GL_COLOR_BUFFER_BIT); + + glLoadIdentity (); + glColor3f (1.0, 1.0, 1.0); + draw_triangle (); + + glEnable (GL_LINE_STIPPLE); + glLineStipple (1, 0xF0F0); + glLoadIdentity (); + glTranslatef (-20.0, 0.0, 0.0); + draw_triangle (); + + glLineStipple (1, 0xF00F); + glLoadIdentity (); + glScalef (1.5, 0.5, 1.0); + draw_triangle (); + + glLineStipple (1, 0x8888); + glLoadIdentity (); + glRotatef (90.0, 0.0, 0.0, 1.0); + draw_triangle (); + glDisable (GL_LINE_STIPPLE); + + glFlush(); +} + +void myinit (void) +{ + glShadeModel (GL_FLAT); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-50.0, 50.0, -50.0*(GLfloat)h/(GLfloat)w, + 50.0*(GLfloat)h/(GLfloat)w, -1.0, 1.0); + else + glOrtho (-50.0*(GLfloat)w/(GLfloat)h, + 50.0*(GLfloat)w/(GLfloat)h, -50.0, 50.0, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/nurbs.c b/xc/extras/Mesa/OpenStep/Old_Demos/nurbs.c new file mode 100644 index 000000000..57ca29806 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/nurbs.c @@ -0,0 +1,191 @@ +/* + * (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. + */ +/* + * nurbs.c + * This program shows a NURBS (Non-uniform rational B-splines) + * surface, shaped like a heart. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> + +#define S_NUMPOINTS 13 +#define S_ORDER 3 +#define S_NUMKNOTS (S_NUMPOINTS + S_ORDER) +#define T_NUMPOINTS 3 +#define T_ORDER 3 +#define T_NUMKNOTS (T_NUMPOINTS + T_ORDER) +#define SQRT2 1.41421356237309504880 + +/* initialized local data */ + +GLfloat sknots[S_NUMKNOTS] = + {-1.0, -1.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, + 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 9.0, 9.0}; +GLfloat tknots[T_NUMKNOTS] = {1.0, 1.0, 1.0, 2.0, 2.0, 2.0}; + +GLfloat ctlpoints[S_NUMPOINTS][T_NUMPOINTS][4] = { +{ {4.,2.,2.,1.},{4.,1.6,2.5,1.},{4.,2.,3.0,1.} }, +{ {5.,4.,2.,1.},{5.,4.,2.5,1.},{5.,4.,3.0,1.} }, +{ {6.,5.,2.,1.},{6.,5.,2.5,1.},{6.,5.,3.0,1.} }, +{ {SQRT2*6.,SQRT2*6.,SQRT2*2.,SQRT2}, + {SQRT2*6.,SQRT2*6.,SQRT2*2.5,SQRT2}, + {SQRT2*6.,SQRT2*6.,SQRT2*3.0,SQRT2} }, +{ {5.2,6.7,2.,1.},{5.2,6.7,2.5,1.},{5.2,6.7,3.0,1.} }, +{ {SQRT2*4.,SQRT2*6.,SQRT2*2.,SQRT2}, + {SQRT2*4.,SQRT2*6.,SQRT2*2.5,SQRT2}, + {SQRT2*4.,SQRT2*6.,SQRT2*3.0,SQRT2} }, +{ {4.,5.2,2.,1.},{4.,4.6,2.5,1.},{4.,5.2,3.0,1.} }, +{ {SQRT2*4.,SQRT2*6.,SQRT2*2.,SQRT2}, + {SQRT2*4.,SQRT2*6.,SQRT2*2.5,SQRT2}, + {SQRT2*4.,SQRT2*6.,SQRT2*3.0,SQRT2} }, +{ {2.8,6.7,2.,1.},{2.8,6.7,2.5,1.},{2.8,6.7,3.0,1.} }, +{ {SQRT2*2.,SQRT2*6.,SQRT2*2.,SQRT2}, + {SQRT2*2.,SQRT2*6.,SQRT2*2.5,SQRT2}, + {SQRT2*2.,SQRT2*6.,SQRT2*3.0,SQRT2} }, +{ {2.,5.,2.,1.},{2.,5.,2.5,1.},{2.,5.,3.0,1.} }, +{ {3.,4.,2.,1.},{3.,4.,2.5,1.},{3.,4.,3.0,1.} }, +{ {4.,2.,2.,1.},{4.,1.6,2.5,1.},{4.,2.,3.0,1.} } +}; + +GLUnurbsObj *theNurb; + +/* Initialize material property, light source, lighting model, + * and depth buffer. + */ +void myinit(void) +{ + GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_diffuse[] = { 1.0, 0.2, 1.0, 1.0 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_shininess[] = { 50.0 }; + + GLfloat light0_position[] = { 1.0, 0.1, 1.0, 0.0 }; + GLfloat light1_position[] = { -1.0, 0.1, 1.0, 0.0 }; + + GLfloat lmodel_ambient[] = { 0.3, 0.3, 0.3, 1.0 }; + + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); + glLightfv(GL_LIGHT0, GL_POSITION, light0_position); + glLightfv(GL_LIGHT1, GL_POSITION, light1_position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHT1); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + glEnable(GL_AUTO_NORMAL); + + theNurb = gluNewNurbsRenderer(); + + gluNurbsProperty(theNurb, GLU_SAMPLING_TOLERANCE, 25.0); + gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + glTranslatef (4., 4.5, 2.5); + glRotatef (220.0, 1., 0., 0.); + glRotatef (115.0, 0., 1., 0.); + glTranslatef (-4., -4.5, -2.5); + + gluBeginSurface(theNurb); + gluNurbsSurface(theNurb, + S_NUMKNOTS, sknots, + T_NUMKNOTS, tknots, + 4 * T_NUMPOINTS, + 4, + &ctlpoints[0][0][0], + S_ORDER, T_ORDER, + GL_MAP2_VERTEX_4); + gluEndSurface(theNurb); + + glPopMatrix(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-2.0, 2.0, -2.0, 2.0, 0.8, 10.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + gluLookAt(7.0,4.5,4.0, 4.5,4.5,2.0, 6.0,-3.0,2.0); +} + +#ifdef OLD_CODE +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, and handle input events. + */ +int main(int argc, char** argv) +{ + auxInitDisplayMode (AUX_SINGLE | AUX_RGB | AUX_DEPTH); + auxInitPosition (0, 0, 500, 500); + auxInitWindow (argv[0]); + myinit(); + auxReshapeFunc (myReshape); + auxMainLoop(display); +} +#endif + +/* + * This is how we port nurbs.c to OpenStep. Forget the aux calls, + * simply call init(), then reshape() with the window size and finally + * display(). The two size integers are global to generic.m so that it + * knows how big to make the OpenStep window. + */ + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/surface.c b/xc/extras/Mesa/OpenStep/Old_Demos/surface.c new file mode 100644 index 000000000..d0ad50202 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/surface.c @@ -0,0 +1,142 @@ +/* + * (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. + */ +/* + * surface.c + * This program draws a NURBS surface in the shape of a + * symmetrical hill. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> + +GLfloat ctlpoints[4][4][3]; + +GLUnurbsObj *theNurb; + +/* + * Initializes the control points of the surface to a small hill. + * The control points range from -3 to +3 in x, y, and z + */ +void init_surface(void) +{ + int u, v; + for (u = 0; u < 4; u++) { + for (v = 0; v < 4; v++) { + ctlpoints[u][v][0] = 2.0*((GLfloat)u - 1.5); + ctlpoints[u][v][1] = 2.0*((GLfloat)v - 1.5); + + if ( (u == 1 || u == 2) && (v == 1 || v == 2)) + ctlpoints[u][v][2] = 3.0; + else + ctlpoints[u][v][2] = -3.0; + } + } +} + +/* Initialize material property and depth buffer. + */ +void myinit(void) +{ + GLfloat mat_diffuse[] = { 0.7, 0.7, 0.7, 1.0 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_shininess[] = { 100.0 }; + + glClearColor (0.0, 0.0, 0.0, 1.0); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + + init_surface(); + + theNurb = gluNewNurbsRenderer(); + gluNurbsProperty(theNurb, GLU_SAMPLING_TOLERANCE, 25.0); + gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL); +} + +void display(void) +{ + GLfloat knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0}; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + glRotatef(330.0, 1.,0.,0.); + glScalef (0.5, 0.5, 0.5); + + gluBeginSurface(theNurb); + gluNurbsSurface(theNurb, + 8, knots, + 8, knots, + 4 * 3, + 3, + &ctlpoints[0][0][0], + 4, 4, + GL_MAP2_VERTEX_3); + gluEndSurface(theNurb); + + glPopMatrix(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective (45.0, (GLdouble)w/(GLdouble)h, 3.0, 8.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef (0.0, 0.0, -5.0); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_Demos/texturesurf.c b/xc/extras/Mesa/OpenStep/Old_Demos/texturesurf.c new file mode 100644 index 000000000..59baa4243 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_Demos/texturesurf.c @@ -0,0 +1,137 @@ +/* + * (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. + */ +/* texturesurf.c + * This program uses evaluators to generate a curved + * surface and automatically generated texture coordinates. + */ + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include <math.h> + +GLfloat ctrlpoints[4][4][3] = { + {{ -1.5, -1.5, 4.0}, { -0.5, -1.5, 2.0}, + {0.5, -1.5, -1.0}, {1.5, -1.5, 2.0}}, + {{ -1.5, -0.5, 1.0}, { -0.5, -0.5, 3.0}, + {0.5, -0.5, 0.0}, {1.5, -0.5, -1.0}}, + {{ -1.5, 0.5, 4.0}, { -0.5, 0.5, 0.0}, + {0.5, 0.5, 3.0}, {1.5, 0.5, 4.0}}, + {{ -1.5, 1.5, -2.0}, { -0.5, 1.5, -2.0}, + {0.5, 1.5, 0.0}, {1.5, 1.5, -1.0}} +}; + +GLfloat texpts[2][2][2] = {{{0.0, 0.0}, {0.0, 1.0}}, + {{1.0, 0.0}, {1.0, 1.0}}}; + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glColor3f(1.0, 1.0, 1.0); + glEvalMesh2(GL_FILL, 0, 20, 0, 20); + glFlush(); +} + +#define imageWidth 64 +#define imageHeight 64 +GLubyte image[3*imageWidth*imageHeight]; + +void makeImage(void) +{ + int i, j; + float ti, tj; + + for (i = 0; i < imageWidth; i++) { + ti = 2.0*3.14159265*i/imageWidth; + for (j = 0; j < imageHeight; j++) { + tj = 2.0*3.14159265*j/imageHeight; + + image[3*(imageHeight*i+j)] = (GLubyte) 127*(1.0+sin(ti)); + image[3*(imageHeight*i+j)+1] = (GLubyte) 127*(1.0+cos(2*tj)); + image[3*(imageHeight*i+j)+2] = (GLubyte) 127*(1.0+cos(ti+tj)); + } + } +} + +void myinit(void) +{ + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, + 0, 1, 12, 4, &ctrlpoints[0][0][0]); + glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, + 0, 1, 4, 2, &texpts[0][0][0]); + glEnable(GL_MAP2_TEXTURE_COORD_2); + glEnable(GL_MAP2_VERTEX_3); + glMapGrid2f(20, 0.0, 1.0, 20, 0.0, 1.0); + makeImage(); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, 3, imageWidth, imageHeight, 0, + GL_RGB, GL_UNSIGNED_BYTE, image); + glEnable(GL_TEXTURE_2D); + glEnable(GL_DEPTH_TEST); + glEnable(GL_NORMALIZE); + glShadeModel (GL_FLAT); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho(-4.0, 4.0, -4.0*(GLfloat)h/(GLfloat)w, + 4.0*(GLfloat)h/(GLfloat)w, -4.0, 4.0); + else + glOrtho(-4.0*(GLfloat)w/(GLfloat)h, + 4.0*(GLfloat)w/(GLfloat)h, -4.0, 4.0, -4.0, 4.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glRotatef(85.0, 1.0, 1.0, 1.0); +} + +int gl_width=300; +int gl_height=300; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/README b/xc/extras/Mesa/OpenStep/Old_NeXT/README new file mode 100644 index 000000000..bd18ad030 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/README @@ -0,0 +1,136 @@ + ======================================= + = NeXT (TM) Mesa-OpenGL (TM) = + ======================================= + by + Pascal Thibaudeau + pthibaud@cribx1.u-bordeaux.fr + pascal@galileo.slip.u-bordeaux.fr (NeXTMail OK) + + +@(#) README 1.4 96/11/29 19:49:23 + +# Revision 1.4 1996/11/29 19:49:23 pascal thibaudeau +# Mesa-2.0.1 fixed +# +# Revision 1.3 1996/10/16 10:59:02 pascal thibaudeau +# Mesa-2.0 fixed +# +# Revision 1.2 1996/05/16 00:17:02 pascal thibaudeau +# Mesa-1.2.8 fixed +# +# Revision 1.1 1996/03/02 15:03:07 pascal thibaudeau +# Initial revision +# + +1. Introduction +--------------- + +This is the README file for the NeXT version of the Mesa library. +The file consists of information specific to the NeXT version of Mesa. +For more general information please read the README file in the main Mesa +directory. + +2. Whats new? +------------- + +See the general Mesa README for all the new items in Mesa-2.0. This +section will only discuss those items which are specific to the NeXT. + + 0.4 Release + ========= + - New demos from the book directory + - old nextdemoX removed + + 0.3 Release + ========= + - Mesa-2.0 is fixed + + 0.2 Release + ========= + - Some tk functions are now supported. + - minor bugs are corrected. + + 0.1 Release + ========= + - Off-Screen rendering buffer is read by NXBitmapImageRep function. + - 32bpp is directly supported. + - WIDTH and HEIGHT are staticly defined. + - The window style is NX_TITLEDSTYLE. + - NeXT demos are straightforward ports of some book/ files. + + +3. The Distribution +------------------- + +NeXT Mesa is distributed in one form. This should make it easier to only +download what you need. The package is as follows: + + Mesa-2.0.tar.gz + +This release contains the complete source to Mesa for the NeXT + +4. Documentation +---------------- + +There is a Mesa WWW page: http://www.ssec.wisc.edu/~brianp/Mesa.html + +There is a general WWW page related to OpenGL under NeXTSTEP: +http://wwwcip.informatik.uni-erlangen.de/user/tsengel/ + +5. Compiling Mesa +---------------- + +In order to compile NeXT Mesa you need the following items: + + NEXTSTEP Developper Kit Release 3.3 + NeXT Mesa-2.0 (source) + +The project files included with the NeXT Mesa source should work +fine. The only things you may need to update are the access paths. +Simply typing "make next" should compile Mesa and a number of NeXT demo +programs found in the NeXT/ directory. This was tested on a i386,m68k running +NEXTSTEP 3.3. + +6. Test suite +------------- + +The NeXT version of Mesa does not pass many of the tests in the +demos or samples suites. This is primarily due to dependencies in the +suites on the size of particular X fonts, and other X related features. We +will be working on developping a more general NeXT suite for Mesa under +the NeXT, but for now, you will not be able to pass many of the tests. +It is, however, much better than the alpha release! + + +6. NeXT Mesa Mailing List +----------------------------- +if uou want to subscribe to the Mesa mailing list., please send the following +message to the address listproc@iqm.unicamp.br + +subs mesa <your name> + +For example: + +subs mesa Pascal Thibaudeau + +You will receive a welcome message from the list server when you have been +added to the list. It tells you how to post messages to the list, how +to unsubscribe, etc. Thanks to Pedro Vazquez for setting up the list. + +7. Acknowledgement +------------------------- +I would also like to thank the following contributors : + +Thomas Engel <tomi@shinto.nbg.sub.org>: GNU3DKit Project +Gregor Hoffleit <flight@mathi.uni-heidelberg.DE>: GNU3DKit Project +Pete French <pete@ohm.york.ac.uk>: + +If you have comments or Bug reports don't hesitate to send them to: +Pascal Thibaudeau +pthibaud@cribx1.u-bordeaux.fr +pascal@galileo.slip.u-bordeaux.fr (NeXTMail OK) + + + + + diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/README.FIRST b/xc/extras/Mesa/OpenStep/Old_NeXT/README.FIRST new file mode 100644 index 000000000..633e0e485 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/README.FIRST @@ -0,0 +1,7 @@ +This directory contains Pascal Thibaudeau's original code for NeXT support +under Mesa 2.0. This is now obsolete and NeXT support is incorporated +into OpenStep support. The generic.m file from this directory has been +used to make some of these demos continue to work. See the README +file in OpenStep/Old_Demos for details. + +-Pete French. (pete@ohm.york.ac.uk) 28/5/98 diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/README.rtf b/xc/extras/Mesa/OpenStep/Old_NeXT/README.rtf new file mode 100644 index 000000000..6657f4460 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/README.rtf @@ -0,0 +1,206 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\fmodern Courier;\f2\fnil Times-Roman;} +\paperw9860 +\paperh12540 +\margl120 +\margr120 +{\colortbl;\red1\green12\blue44;\red3\green0\blue123;\red41\green4\blue44;\red0\green7\blue44;} +\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f0\b0\i0\ulnone\fs24\fc0\cf0 \ + +\b\qc NeXT +\b0\fs16\up8 TM +\b\fs24 +\up0 Mesa-OpenGL +\b0\fs16\up8 TM +\fs24\up0 \ +by\ + +\b\gray46\fc1\cf1 Pascal Thibaudeau +\b0\gray0\fc0\cf0 \ +pthibaud@cribx1.u-bordeaux.fr \ +pascal@galileo.slip.u-bordeaux.fr ( +\f1 NeXTMail OK +\f0 )\ + +\ql @(#) README 1.4 96/11/29 19:49:23\ +\ +\ +# Revision 1.4 1996/11/29 19:49:23 pascal thibaudeau \ +# Mesa-2.0.1 fixed\ +#\ +# Revision 1.3 1996/10/16 10:59:02 pascal thibaudeau \ +# Mesa-2.0 fixed\ +#\ +# Revision 1.2 1996/05/16 00:17:02 pascal thibaudeau \ +# Mesa-1.2.8 fixed\ +#\ +# Revision 1.1 1996/03/02 15:03:07 pascal thibaudeau \ +# Mesa-1.2.7 fixed\ +# Initial revision\ +#\ +\ + +\b 1. Introduction +\b0 \ +\ +This is the README file for the NeXT version of the +\i Mesa +\i0 library. \ +The file consists of information specific to the NeXT version of +\i Mesa +\i0 .\ +For more general information please read the README file in the main +\i Mesa +\i0 \ +directory.\ +\ + +\b 2. Whats new? +\b0 \ +\ +See the general +\i Mesa +\i0 README for all new items in Mesa-2.0. This\ +section will only discuss those items which are specific to the NeXT.\ +\ + +\gray56\fc2\cf2 0.4 Release +\gray0\fc0\cf0 \ + =========\ + - New demos from the book directory.\ + - old nextdemoX removed.\ +\ + +\gray56\fc2\cf2 0.3 Release +\gray0\fc0\cf0 \ + =========\ + - Mesa-2.0 is fixed.\ +\ + +\gray56\fc2\cf2 0.2 Release +\gray0\fc0\cf0 \ + =========\ + - Some tk functions are now supported.\ + - minor bugs are corrected.\ +\ + +\gray56\fc2\cf2 0.1 Release +\gray0\fc0\cf0 \ + =========\ + - Off-Screen rendering buffer is read by +\f1 NXBitmapImageRep +\f0 function.\ + - 32bpp is directly supported.\ + - WIDTH and HEIGHT are staticly defined.\ + - The window style is +\f1 NX_TITLEDSTYLE +\f0 .\ + - NeXT demos are straightforward ports of some book/ files.\ + \ + \ + +\b 3. The Distribution +\b0 \ +\ +NeXT +\i Mesa +\i0 is distributed in one form. This should make it easier to \ +download only what you need. The package is as follows:\ +\ + +\f1 Mesa-2.0.tar.gz +\f0 \ +\ +This release contains the complete source to +\i Mesa +\i0 for the NeXT\ +\ + +\b 4. Documentation +\b0 \ +\ +The +\i Mesa +\i0 WWW page is : +\gray75\fc3\cf3 http://www.ssec.wisc.edu/~brianp/Mesa.html +\gray0\fc0\cf0 \ +\ +There is also a general WWW page related to OpenGL under NeXTSTEP:\ + +\gray75\fc3\cf3 http://wwwcip.informatik.uni-erlangen.de/user/tsengel/ +\gray0\fc0\cf0 \ +\ + +\b 5. Compiling Mesa +\b0 \ +\ +In order to compile NeXT +\i Mesa +\i0 you need the following items:\ +\ + NEXTSTEP Developper Kit Release 3.3\ + NeXT Mesa-2.0 (source)\ +\ +The project files included with the NeXT +\i Mesa +\i0 source should work \ +fine. The only things you may need to update are the access paths.\ +Simply typing "make next" should compile Mesa and a number of NeXT demo\ +programs found in the NeXT/ directory. This was tested on a i386,m68k running \ +NEXTSTEP 3.3. \ +\ + +\b 6. Test suite +\b0 \ +\ +The NeXT version of +\i Mesa +\i0 does not pass many of the tests in the\ +demos or samples suites. This is primarily due to dependencies in the \ +suites on the size of particular X fonts, and other X related features. We\ +will be working on developping a more general NeXT suite for +\i Mesa +\i0 under the\ +NeXT, but for now, you will not be able to pass many of the tests. \ +It is, however, much better than the alpha release!\ +\ +\ + +\b 7. NeXT Mesa Mailing List\ +\ + +\b0 If you want to subscribe to the +\i Mesa +\i0 Mailing List, please send the following message to the address listproc@iqm.unicamp.br\ +\ + +\f1 subs mesa <your name> +\f0 \ +\ +For example:\ +\ + +\f1 subs mesa Pascal Thibaudeau\ + +\f0 \ +You will receive a welcome message from the list server when you have been\ +added to the list. It tells you how to post messages to the list, how\ +to unsubscribe, etc. Thanks to Pedro Vazquez for setting up the list.\ +\ + +\b 8. Acknowledgements\ + +\b0 \ +I would also like to thank the following contributors :\ +\ +Thomas Engel <tomi@shinto.nbg.sub.org>: GNU3DKit Project\ +Gregor Hoffleit <flight@mathi.uni-heidelberg.DE>: GNU3DKit Project\ +Pete French <pete@ohm.york.ac.uk>:\ +\ +\ +If you have comments or Bug reports don't hesitate to send them to:\ + +\gray35\fc4\cf4 Pascal Thibaudeau\ +pthibaud@cribx1.u-bordeaux.fr\ +pascal@galileo.slip.u-bordeaux.fr (NeXTMail OK)\ + +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/alpha3D.c b/xc/extras/Mesa/OpenStep/Old_NeXT/alpha3D.c new file mode 100644 index 000000000..96d2db824 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/alpha3D.c @@ -0,0 +1,137 @@ +/* + * (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. + */ +/* + * alpha3D.c + * This program demonstrates how to intermix opaque and + * alpha blended polygons in the same scene, by using glDepthMask. + * Pressing the left mouse button toggles the eye position. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +void myinit(void) +{ + GLfloat mat_ambient[] = { 0.0, 0.0, 0.0, 0.15 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 0.15 }; + GLfloat mat_shininess[] = { 15.0 }; + + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); + + glEnable (GL_LIGHTING); + glEnable (GL_LIGHT0); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); +} + +GLboolean eyePosition = GL_FALSE; + +void toggleEye (AUX_EVENTREC *event) +{ + if (eyePosition) + eyePosition = GL_FALSE; + else + eyePosition = GL_TRUE; +} + +void display(void) +{ + GLfloat position[] = { 0.0, 0.0, 1.0, 1.0 }; + GLfloat mat_torus[] = { 0.75, 0.75, 0.0, 1.0 }; + GLfloat mat_cylinder[] = { 0.0, 0.75, 0.75, 0.15 }; + + glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glLightfv (GL_LIGHT0, GL_POSITION, position); + glPushMatrix (); + if (eyePosition) + gluLookAt (0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); + else + gluLookAt (0.0, 0.0, -9.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); + glPushMatrix (); + glTranslatef (0.0, 0.0, 1.0); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_torus); + auxSolidTorus (0.275, 0.85); + glPopMatrix (); + + glEnable (GL_BLEND); + glDepthMask (GL_FALSE); + glBlendFunc (GL_SRC_ALPHA, GL_ONE); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_cylinder); + glTranslatef (0.0, 0.0, -1.0); + auxSolidCylinder (1.0, 2.0); + glDepthMask (GL_TRUE); + glDisable (GL_BLEND); + glPopMatrix (); + + glFlush (); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(30.0, (GLfloat) w/(GLfloat) h, 1.0, 20.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, and handle input events. + */ + + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} + + + + + + + diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/checker.c b/xc/extras/Mesa/OpenStep/Old_NeXT/checker.c new file mode 100644 index 000000000..9f777d8ec --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/checker.c @@ -0,0 +1,122 @@ +/* + * (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. + */ +/* checker.c + * This program texture maps a checkerboard image onto + * two rectangles. This program clamps the texture, if + * the texture coordinates fall outside 0.0 and 1.0. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Create checkerboard texture */ +#define checkImageWidth 64 +#define checkImageHeight 64 +GLubyte checkImage[checkImageWidth][checkImageHeight][3]; + +void makeCheckImage(void) +{ + int i, j, r, c; + + for (i = 0; i < checkImageWidth; i++) { + for (j = 0; j < checkImageHeight; j++) { + c = ((((i&0x8)==0)^((j&0x8))==0))*255; + checkImage[i][j][0] = (GLubyte) c; + checkImage[i][j][1] = (GLubyte) c; + checkImage[i][j][2] = (GLubyte) c; + } + } +} + +void myinit(void) +{ + glClearColor (0.0, 0.0, 0.0, 0.0); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + makeCheckImage(); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0, 3, checkImageWidth, + checkImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, + &checkImage[0][0][0]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_FLAT); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); + glTexCoord2f(0.0, 1.0); glVertex3f(-2.0, 1.0, 0.0); + glTexCoord2f(1.0, 1.0); glVertex3f(0.0, 1.0, 0.0); + glTexCoord2f(1.0, 0.0); glVertex3f(0.0, -1.0, 0.0); + + glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 0.0); + glTexCoord2f(0.0, 1.0); glVertex3f(1.0, 1.0, 0.0); + glTexCoord2f(1.0, 1.0); glVertex3f(2.41421, 1.0, -1.41421); + glTexCoord2f(1.0, 0.0); glVertex3f(2.41421, -1.0, -1.41421); + glEnd(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -3.6); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/checker2.c b/xc/extras/Mesa/OpenStep/Old_NeXT/checker2.c new file mode 100644 index 000000000..76c855484 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/checker2.c @@ -0,0 +1,122 @@ +/* + * (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. + */ +/* checker2.c + * This program texture maps a checkerboard image onto + * two rectangles. This program repeats the texture, if + * the texture coordinates fall outside 0.0 and 1.0. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Create checkerboard texture */ +#define checkImageWidth 64 +#define checkImageHeight 64 +GLubyte checkImage[checkImageWidth][checkImageHeight][3]; + +void makeCheckImage(void) +{ + int i, j, r, c; + + for (i = 0; i < checkImageWidth; i++) { + for (j = 0; j < checkImageHeight; j++) { + c = ((((i&0x8)==0)^((j&0x8))==0))*255; + checkImage[i][j][0] = (GLubyte) c; + checkImage[i][j][1] = (GLubyte) c; + checkImage[i][j][2] = (GLubyte) c; + } + } +} + +void myinit(void) +{ + glClearColor (0.0, 0.0, 0.0, 0.0); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + makeCheckImage(); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexImage2D(GL_TEXTURE_2D, 0, 3, checkImageWidth, + checkImageHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, + &checkImage[0][0][0]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_FLAT); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(-2.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(0.0, 1.0, 0.0); + glTexCoord2f(3.0, 0.0); glVertex3f(0.0, -1.0, 0.0); + + glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(1.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(2.41421, 1.0, -1.41421); + glTexCoord2f(3.0, 0.0); glVertex3f(2.41421, -1.0, -1.41421); + glEnd(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -3.6); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/chess.c b/xc/extras/Mesa/OpenStep/Old_NeXT/chess.c new file mode 100644 index 000000000..1184dd26f --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/chess.c @@ -0,0 +1,120 @@ +/* + * (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. + */ +/* chess.c + * This program texture maps a checkerboard image onto + * two rectangles. The texture coordinates for the + * rectangles are 0.0 to 3.0. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include <math.h> +#include "glaux.h" + +#define checkImageWidth 64 +#define checkImageHeight 64 +GLubyte checkImage[checkImageWidth][checkImageHeight][3]; + +void makecheckimage(void) +{ + int i, j, r, c; + + for (i = 0; i < checkImageWidth; i++) { + for (j = 0; j < checkImageHeight; j++) { + c = ((((i&0x8)==0)^((j&0x8))==0))*255; + checkImage[i][j][0] = (GLubyte) c; + checkImage[i][j][1] = (GLubyte) c; + checkImage[i][j][2] = (GLubyte) c; + } + } +} + +void myinit(void) +{ + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + makecheckimage(); + glTexImage2D(GL_TEXTURE_2D, 0, 3, + checkImageWidth, checkImageHeight, 0, + GL_RGB, GL_UNSIGNED_BYTE, &checkImage[0][0][0]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_FLAT); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(-2.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(0.0, 1.0, 0.0); + glTexCoord2f(3.0, 0.0); glVertex3f(0.0, -1.0, 0.0); + + glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(1.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(2.41421, 1.0, -1.41421); + glTexCoord2f(3.0, 0.0); glVertex3f(2.41421, -1.0, -1.41421); + glEnd(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -3.6); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/cone.c b/xc/extras/Mesa/OpenStep/Old_NeXT/cone.c new file mode 100644 index 000000000..9e464e504 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/cone.c @@ -0,0 +1,117 @@ +/* + * (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. + */ +/* + * cone.c + * This program demonstrates the use of the GL lighting model. + * A sphere is drawn using a grey material characteristic. + * A single light source illuminates the object. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Initialize material property, light source, and lighting model. + */ +void myinit(void) +{ + GLfloat mat_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + GLfloat mat_diffuse[] = { 0.8, 0.8, 0.8, 1.0 }; +/* mat_specular and mat_shininess are NOT default values */ + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_shininess[] = { 50.0 }; + + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; +/* light_position is NOT default value */ + GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; + + GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glTranslatef (0.0, -1.0, 0.0); + glRotatef (250.0, 1.0, 0.0, 0.0); + auxSolidCone(1.0, 2.0); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-1.5, 1.5, -1.5*(GLfloat)h/(GLfloat)w, + 1.5*(GLfloat)h/(GLfloat)w, -10.0, 10.0); + else + glOrtho (-1.5*(GLfloat)w/(GLfloat)h, + 1.5*(GLfloat)w/(GLfloat)h, -1.5, 1.5, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/cone_ball.c b/xc/extras/Mesa/OpenStep/Old_NeXT/cone_ball.c new file mode 100644 index 000000000..4f10e3be9 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/cone_ball.c @@ -0,0 +1,80 @@ +#include <stdio.h> +#include <stdlib.h> +#include "GL/osmesa.h" + +int gl_width=480; +int gl_height=480; + +void init(void) +{ + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_DEPTH_TEST); +} + +/* + * reshape simply creates an orthographic projection + * within the viewport. + */ +void reshape(int w, int h) +{ + glViewport(0,0,w,h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-2.5, 2.5, -2.5, 2.5, -5.0, 5.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +void display(void) +{ + GLfloat red_mat[] = { 1.0, 0.0, 0.0, 0.5 }; + GLfloat green_mat[] = { 0.0, 1.0, 0.0, 0.5 }; + GLfloat blue_mat[] = { 0.0, 0.0, 1.0, 0.5}; + + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + + glPushMatrix(); + glRotatef(20.0, 1.0, 0.0, 0.0); + + glPushMatrix(); + glTranslatef(-0.75, 0.5, 0.0); + glRotatef(90.0, 1.0, 0.0, 0.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red_mat ); + auxSolidTorus(0.275, 0.85); + glPopMatrix(); + + glPushMatrix(); + glTranslatef(-0.75, -0.5, 0.0); + glRotatef(270.0, 1.0, 0.0, 0.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, green_mat ); + auxSolidCone(1.0, 2.0); + glPopMatrix(); + + glPushMatrix(); + glTranslatef(0.75, 0.0, -1.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat ); + auxSolidSphere(1.0); + glPopMatrix(); + + glPopMatrix(); +} + +void render_image(void) +{ + init(); + reshape(gl_width,gl_height); + display(); +} + diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/disk.c b/xc/extras/Mesa/OpenStep/Old_NeXT/disk.c new file mode 100644 index 000000000..7ccde828f --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/disk.c @@ -0,0 +1,114 @@ +/* + * (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. + */ +/* + * disk.c + * This program demonstrates the use of the quadrics + * Utility Library routines to draw circles and arcs. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +GLUquadricObj * quadObj; + +/* Clear the screen. For each triangle, set the current + * color and modify the modelview matrix. + */ +void display(void) +{ + glClearColor (0.0, 0.0, 0.0, 1.0); + glClear (GL_COLOR_BUFFER_BIT); + + glPushMatrix(); + gluQuadricDrawStyle (quadObj, GLU_FILL); + glColor3f (1.0, 1.0, 1.0); + glTranslatef (10.0, 10.0, 0.0); + gluDisk (quadObj, 0.0, 5.0, 10, 2); + glPopMatrix(); + + glPushMatrix(); + glColor3f (1.0, 1.0, 0.0); + glTranslatef (20.0, 20.0, 0.0); + gluPartialDisk (quadObj, 0.0, 5.0, 10, 3, 30.0, 120.0); + glPopMatrix(); + + glPushMatrix(); + gluQuadricDrawStyle (quadObj, GLU_SILHOUETTE); + glColor3f (0.0, 1.0, 1.0); + glTranslatef (30.0, 30.0, 0.0); + gluPartialDisk (quadObj, 0.0, 5.0, 10, 3, 135.0, 270.0); + glPopMatrix(); + + glPushMatrix(); + gluQuadricDrawStyle (quadObj, GLU_LINE); + glColor3f (1.0, 0.0, 1.0); + glTranslatef (40.0, 40.0, 0.0); + gluDisk (quadObj, 2.0, 5.0, 10, 10); + glPopMatrix(); + glFlush(); +} + +void myinit (void) { + quadObj = gluNewQuadric (); + glShadeModel(GL_FLAT); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (0.0, 50.0, + 0.0, 50.0*(GLfloat)h/(GLfloat)w, -1.0, 1.0); + else + glOrtho (0.0, 50.0*(GLfloat)w/(GLfloat)h, + 0.0, 50.0, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity (); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/dof.c b/xc/extras/Mesa/OpenStep/Old_NeXT/dof.c new file mode 100644 index 000000000..25d2d19b6 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/dof.c @@ -0,0 +1,234 @@ +/* + * (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. + */ +/* + * dof.c + * This program demonstrates use of the accumulation buffer to + * create an out-of-focus depth-of-field effect. The teapots + * are drawn several times into the accumulation buffer. The + * viewing volume is jittered, except at the focal point, where + * the viewing volume is at the same position, each time. In + * this case, the gold teapot remains in focus. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include <math.h> +#include "glaux.h" +#include "jitter.h" + +#define PI_ 3.14159265358979323846 + +/* accFrustum() + * The first 6 arguments are identical to the glFrustum() call. + * + * pixdx and pixdy are anti-alias jitter in pixels. + * Set both equal to 0.0 for no anti-alias jitter. + * eyedx and eyedy are depth-of field jitter in pixels. + * Set both equal to 0.0 for no depth of field effects. + * + * focus is distance from eye to plane in focus. + * focus must be greater than, but not equal to 0.0. + * + * Note that accFrustum() calls glTranslatef(). You will + * probably want to insure that your ModelView matrix has been + * initialized to identity before calling accFrustum(). + */ +void accFrustum(GLdouble left, GLdouble right, GLdouble bottom, + GLdouble top, GLdouble near, GLdouble far, GLdouble pixdx, + GLdouble pixdy, GLdouble eyedx, GLdouble eyedy, GLdouble focus) +{ + GLdouble xwsize, ywsize; + GLdouble dx, dy; + GLint viewport[4]; + + glGetIntegerv (GL_VIEWPORT, viewport); + + xwsize = right - left; + ywsize = top - bottom; + + dx = -(pixdx*xwsize/(GLdouble) viewport[2] + eyedx*near/focus); + dy = -(pixdy*ywsize/(GLdouble) viewport[3] + eyedy*near/focus); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum (left + dx, right + dx, bottom + dy, top + dy, near, far); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef (-eyedx, -eyedy, 0.0); +} + +/* accPerspective() + * + * The first 4 arguments are identical to the gluPerspective() call. + * pixdx and pixdy are anti-alias jitter in pixels. + * Set both equal to 0.0 for no anti-alias jitter. + * eyedx and eyedy are depth-of field jitter in pixels. + * Set both equal to 0.0 for no depth of field effects. + * + * focus is distance from eye to plane in focus. + * focus must be greater than, but not equal to 0.0. + * + * Note that accPerspective() calls accFrustum(). + */ +void accPerspective(GLdouble fovy, GLdouble aspect, + GLdouble near, GLdouble far, GLdouble pixdx, GLdouble pixdy, + GLdouble eyedx, GLdouble eyedy, GLdouble focus) +{ + GLdouble fov2,left,right,bottom,top; + + fov2 = ((fovy*PI_) / 180.0) / 2.0; + + top = near / (cos(fov2) / sin(fov2)); + bottom = -top; + + right = top * aspect; + left = -right; + + accFrustum (left, right, bottom, top, near, far, + pixdx, pixdy, eyedx, eyedy, focus); +} + +void myinit(void) +{ + GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat position[] = { 0.0, 3.0, 3.0, 0.0 }; + + GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + GLfloat local_view[] = { 0.0 }; + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_POSITION, position); + + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view); + + glFrontFace (GL_CW); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + + glMatrixMode (GL_MODELVIEW); + glLoadIdentity (); + + glClearColor(0.0, 0.0, 0.0, 0.0); + glClearAccum(0.0, 0.0, 0.0, 0.0); +} + +void renderTeapot (GLfloat x, GLfloat y, GLfloat z, + GLfloat ambr, GLfloat ambg, GLfloat ambb, + GLfloat difr, GLfloat difg, GLfloat difb, + GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine) +{ + float mat[4]; + + glPushMatrix(); + glTranslatef (x, y, z); + mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0; + glMaterialfv (GL_FRONT, GL_AMBIENT, mat); + mat[0] = difr; mat[1] = difg; mat[2] = difb; + glMaterialfv (GL_FRONT, GL_DIFFUSE, mat); + mat[0] = specr; mat[1] = specg; mat[2] = specb; + glMaterialfv (GL_FRONT, GL_SPECULAR, mat); + glMaterialf (GL_FRONT, GL_SHININESS, shine*128.0); + auxSolidTeapot(0.5); + glPopMatrix(); +} + +/* display() draws 5 teapots into the accumulation buffer + * several times; each time with a jittered perspective. + * The focal point is at z = 5.0, so the gold teapot will + * stay in focus. The amount of jitter is adjusted by the + * magnitude of the accPerspective() jitter; in this example, 0.33. + * In this example, the teapots are drawn 8 times. See jitter.h + */ +void display(void) +{ + int jitter; + GLint viewport[4]; + + glGetIntegerv (GL_VIEWPORT, viewport); + glClear(GL_ACCUM_BUFFER_BIT); + + for (jitter = 0; jitter < 8; jitter++) { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + accPerspective (45.0, + (GLdouble) viewport[2]/(GLdouble) viewport[3], + 1.0, 15.0, 0.0, 0.0, + 0.33*j8[jitter].x, 0.33*j8[jitter].y, 5.0); +/* ruby, gold, silver, emerald, and cyan teapots */ + renderTeapot (-1.1, -0.5, -4.5, 0.1745, 0.01175, 0.01175, + 0.61424, 0.04136, 0.04136, 0.727811, 0.626959, 0.626959, 0.6); + renderTeapot (-0.5, -0.5, -5.0, 0.24725, 0.1995, 0.0745, + 0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4); + renderTeapot (0.2, -0.5, -5.5, 0.19225, 0.19225, 0.19225, + 0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4); + renderTeapot (1.0, -0.5, -6.0, 0.0215, 0.1745, 0.0215, + 0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6); + renderTeapot (1.8, -0.5, -6.5, 0.0, 0.1, 0.06, 0.0, 0.50980392, + 0.50980392, 0.50196078, 0.50196078, 0.50196078, .25); + glAccum (GL_ACCUM, 0.125); + } + + glAccum (GL_RETURN, 1.0); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); +} + +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, depth buffer, and handle input events. + */ +int gl_width=250; +int gl_height=250; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/font.c b/xc/extras/Mesa/OpenStep/Old_NeXT/font.c new file mode 100644 index 000000000..cbc1d6b7a --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/font.c @@ -0,0 +1,220 @@ +/* + * (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. + */ +/* + * font.c + * + * Draws some text in a bitmapped font. Uses glBitmap() + * and other pixel routines. Also demonstrates use of + * display lists. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include <string.h> +#include "glaux.h" + +GLubyte rasters[][13] = { +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36}, +{0x00, 0x00, 0x00, 0x66, 0x66, 0xff, 0x66, 0x66, 0xff, 0x66, 0x66, 0x00, 0x00}, +{0x00, 0x00, 0x18, 0x7e, 0xff, 0x1b, 0x1f, 0x7e, 0xf8, 0xd8, 0xff, 0x7e, 0x18}, +{0x00, 0x00, 0x0e, 0x1b, 0xdb, 0x6e, 0x30, 0x18, 0x0c, 0x76, 0xdb, 0xd8, 0x70}, +{0x00, 0x00, 0x7f, 0xc6, 0xcf, 0xd8, 0x70, 0x70, 0xd8, 0xcc, 0xcc, 0x6c, 0x38}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1c, 0x0c, 0x0e}, +{0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c}, +{0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30}, +{0x00, 0x00, 0x00, 0x00, 0x99, 0x5a, 0x3c, 0xff, 0x3c, 0x5a, 0x99, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x00, 0x00}, +{0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 0x03}, +{0x00, 0x00, 0x3c, 0x66, 0xc3, 0xe3, 0xf3, 0xdb, 0xcf, 0xc7, 0xc3, 0x66, 0x3c}, +{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x38, 0x18}, +{0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0xe7, 0x7e}, +{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0x07, 0x03, 0x03, 0xe7, 0x7e}, +{0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xcc, 0x6c, 0x3c, 0x1c, 0x0c}, +{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xff}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, +{0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x03, 0x03, 0xff}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e}, +{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x03, 0x7f, 0xe7, 0xc3, 0xc3, 0xe7, 0x7e}, +{0x00, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x30, 0x18, 0x1c, 0x1c, 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06}, +{0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x60}, +{0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x18, 0x0c, 0x06, 0x03, 0xc3, 0xc3, 0x7e}, +{0x00, 0x00, 0x3f, 0x60, 0xcf, 0xdb, 0xd3, 0xdd, 0xc3, 0x7e, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18}, +{0x00, 0x00, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, +{0x00, 0x00, 0x7e, 0xe7, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, +{0x00, 0x00, 0xfc, 0xce, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc7, 0xce, 0xfc}, +{0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xc0, 0xff}, +{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc0, 0xc0, 0xc0, 0xff}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xcf, 0xc0, 0xc0, 0xc0, 0xc0, 0xe7, 0x7e}, +{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, +{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e}, +{0x00, 0x00, 0x7c, 0xee, 0xc6, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06}, +{0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xe0, 0xf0, 0xd8, 0xcc, 0xc6, 0xc3}, +{0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0}, +{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb, 0xff, 0xff, 0xe7, 0xc3}, +{0x00, 0x00, 0xc7, 0xc7, 0xcf, 0xcf, 0xdf, 0xdb, 0xfb, 0xf3, 0xf3, 0xe3, 0xe3}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0x7e}, +{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, +{0x00, 0x00, 0x3f, 0x6e, 0xdf, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c}, +{0x00, 0x00, 0xc3, 0xc6, 0xcc, 0xd8, 0xf0, 0xfe, 0xc7, 0xc3, 0xc3, 0xc7, 0xfe}, +{0x00, 0x00, 0x7e, 0xe7, 0x03, 0x03, 0x07, 0x7e, 0xe0, 0xc0, 0xc0, 0xe7, 0x7e}, +{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff}, +{0x00, 0x00, 0x7e, 0xe7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, +{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, +{0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xdb, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3}, +{0x00, 0x00, 0xc3, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3}, +{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3}, +{0x00, 0x00, 0xff, 0xc0, 0xc0, 0x60, 0x30, 0x7e, 0x0c, 0x06, 0x03, 0x03, 0xff}, +{0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c}, +{0x00, 0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60}, +{0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18}, +{0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x30, 0x70}, +{0x00, 0x00, 0x7f, 0xc3, 0xc3, 0x7f, 0x03, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0}, +{0x00, 0x00, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x03, 0x03, 0x03, 0x03, 0x03}, +{0x00, 0x00, 0x7f, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x33, 0x1e}, +{0x7e, 0xc3, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0x7e, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0}, +{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x18, 0x00}, +{0x38, 0x6c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x0c, 0x00}, +{0x00, 0x00, 0xc6, 0xcc, 0xf8, 0xf0, 0xd8, 0xcc, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0}, +{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78}, +{0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xfe, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfc, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, +{0xc0, 0xc0, 0xc0, 0xfe, 0xc3, 0xc3, 0xc3, 0xc3, 0xfe, 0x00, 0x00, 0x00, 0x00}, +{0x03, 0x03, 0x03, 0x7f, 0xc3, 0xc3, 0xc3, 0xc3, 0x7f, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xe0, 0xfe, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xfe, 0x03, 0x03, 0x7e, 0xc0, 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x1c, 0x36, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x00}, +{0x00, 0x00, 0x7e, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x66, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc3, 0xe7, 0xff, 0xdb, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00}, +{0xc0, 0x60, 0x60, 0x30, 0x18, 0x3c, 0x66, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0xff, 0x60, 0x30, 0x18, 0x0c, 0x06, 0xff, 0x00, 0x00, 0x00, 0x00}, +{0x00, 0x00, 0x0f, 0x18, 0x18, 0x18, 0x38, 0xf0, 0x38, 0x18, 0x18, 0x18, 0x0f}, +{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, +{0x00, 0x00, 0xf0, 0x18, 0x18, 0x18, 0x1c, 0x0f, 0x1c, 0x18, 0x18, 0x18, 0xf0}, +{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x8f, 0xf1, 0x60, 0x00, 0x00, 0x00} +}; + +GLuint fontOffset; + +void makeRasterFont(void) +{ + GLuint i; + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + fontOffset = glGenLists (128); + for (i = 32; i < 127; i++) { + glNewList(i+fontOffset, GL_COMPILE); + glBitmap(8, 13, 0.0, 2.0, 10.0, 0.0, rasters[i-32]); + glEndList(); + } +} + +void myinit(void) +{ + glShadeModel (GL_FLAT); + makeRasterFont(); +} + +void printString(char *s) +{ + glPushAttrib (GL_LIST_BIT); + glListBase(fontOffset); + glCallLists(strlen(s), GL_UNSIGNED_BYTE, (GLubyte *) s); + glPopAttrib (); +} + +/* Everything above this line could be in a library that defines a font. + * To make it work, you've got to call makeRasterFont() before you start + * making calls to printString(). + */ +void display(void) +{ + GLfloat white[3] = { 1.0, 1.0, 1.0 }; + int i, j; + char teststring[33]; + + glClear(GL_COLOR_BUFFER_BIT); + glColor3fv(white); + for (i = 32; i < 127; i += 32) { + glRasterPos2i(20, 200 - 18*i/32); + for (j = 0; j < 32; j++) + teststring[j] = (char) (i+j); + teststring[32] = 0; + printString(teststring); + } + glRasterPos2i(20, 100); + printString("The quick brown fox jumps"); + glRasterPos2i(20, 82); + printString("over a lazy dog."); + glFlush (); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho (0.0, w, 0.0, h, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/generic.m b/xc/extras/Mesa/OpenStep/Old_NeXT/generic.m new file mode 100644 index 000000000..31bad2e7a --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/generic.m @@ -0,0 +1,121 @@ +/* generic.m*/ + +/* Demo of NEXTSTEP Mesa rendering */ + +/* + * See Mesa/include/GL/osmesa.h for documentation of the OSMesa functions. + * + * If you want to render BIG images you'll probably have to increase + * MAX_WIDTH and MAX_HEIGHT in src/config.h. + * + * This program is in the public domain. + * + * Brian Paul + * + * NEXTSTEP output provided by Pascal Thibaudeau + * pthibaud@cribx1.u-bordeaux.fr + * OpenStep conversion by Pete French + * pete@ohm.york.ac.uk + */ + +#import <appkit/Application.h> +#import <appkit/Window.h> +#import <appkit/Menu.h> +#import <appkit/View.h> +#import <appkit/color.h> +#import <appkit/NXBitmapImageRep.h> +#import <stdio.h> +#import <stdlib.h> +#import "GL/osmesa.h" + +extern int gl_width,gl_height; +extern void render_image(void); + +int main( int argc, char *argv[] ) +{ + OSMesaContext ctx; + unsigned char *buffer; + id myWindow; + id myView; + id myMenu; + char name[50]; + unsigned long start, end; + NXBitmapImageRep *bitmap; + NXRect GR; + + NXApp=[Application new]; + + /* Create an RGBA-mode context */ + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + + /* Allocate the image buffer */ + buffer = malloc( gl_width * gl_height * 4 ); + + /* Bind the buffer to the context and make it current */ + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, gl_width, gl_height ); + OSMesaPixelStore( OSMESA_Y_UP, 0 ); + + /* Fill the bitmap with the buffer */ + bitmap = [[ NXBitmapImageRep alloc] + initData: buffer + pixelsWide:gl_width + pixelsHigh:gl_height + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpace: 2 + bytesPerRow:gl_width*4 + bitsPerPixel: 32]; + + NXSetRect(&GR,100, 100, gl_width, gl_height); + + myWindow = [[ Window alloc] + initContent: &GR + style:NX_TITLEDSTYLE + backing: NX_BUFFERED + buttonMask: NX_MINIATURIZEBUTTONMASK + defer: NO]; + + sprintf(name, "Mesa demo: `%s'", argv[0]); + + myView = [[ View alloc] initFrame:&GR]; + + myMenu = [[ Menu alloc] initTitle: "NeXTStep Mesa"]; + [myMenu addItem: "Quit" + action:@selector(terminate:) + keyEquivalent: 'q']; + [myMenu sizeToFit]; + + [myWindow setTitle: name]; + [myWindow display]; + [myWindow setContentView:myView]; + [myWindow makeKeyAndOrderFront:nil]; + + [NXApp setMainMenu:myMenu]; + + [myView lockFocus]; + + /* here is the Mesa call */ + start=time(0); + render_image(); + end=time(0); + printf("Rendering took %ld seconds\n",end-start); + fflush(stdout); + + /* draw the bitmap */ + [bitmap draw]; + /* free the bitmap */ + [bitmap free]; + [myWindow flushWindow]; + [myView unlockFocus]; + free( buffer ); + + /* destroy the context */ + OSMesaDestroyContext( ctx ); + + [NXApp run]; + [NXApp free]; + + return 0; +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/jitter.h b/xc/extras/Mesa/OpenStep/Old_NeXT/jitter.h new file mode 100644 index 000000000..1ec08c87f --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/jitter.h @@ -0,0 +1,222 @@ +/* + * (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. + */ +/* +jitter.h + +This file contains jitter point arrays for 2,3,4,8,15,24 and 66 jitters. + +The arrays are named j2, j3, etc. Each element in the array has the form, +for example, j8[0].x and j8[0].y + +Values are floating point in the range -.5 < x < .5, -.5 < y < .5, and +have a gaussian distribution around the origin. + +Use these to do model jittering for scene anti-aliasing and view volume +jittering for depth of field effects. Use in conjunction with the +accwindow() routine. +*/ + +typedef struct +{ + GLfloat x, y; +} jitter_point; + +#define MAX_SAMPLES 66 + + +/* 2 jitter points */ +jitter_point j2[] = +{ + { 0.246490, 0.249999}, + {-0.246490, -0.249999} +}; + + +/* 3 jitter points */ +jitter_point j3[] = +{ + {-0.373411, -0.250550}, + { 0.256263, 0.368119}, + { 0.117148, -0.117570} +}; + + +/* 4 jitter points */ +jitter_point j4[] = +{ + {-0.208147, 0.353730}, + { 0.203849, -0.353780}, + {-0.292626, -0.149945}, + { 0.296924, 0.149994} +}; + + +/* 8 jitter points */ +jitter_point j8[] = +{ + {-0.334818, 0.435331}, + { 0.286438, -0.393495}, + { 0.459462, 0.141540}, + {-0.414498, -0.192829}, + {-0.183790, 0.082102}, + {-0.079263, -0.317383}, + { 0.102254, 0.299133}, + { 0.164216, -0.054399} +}; + + +/* 15 jitter points */ +jitter_point j15[] = +{ + { 0.285561, 0.188437}, + { 0.360176, -0.065688}, + {-0.111751, 0.275019}, + {-0.055918, -0.215197}, + {-0.080231, -0.470965}, + { 0.138721, 0.409168}, + { 0.384120, 0.458500}, + {-0.454968, 0.134088}, + { 0.179271, -0.331196}, + {-0.307049, -0.364927}, + { 0.105354, -0.010099}, + {-0.154180, 0.021794}, + {-0.370135, -0.116425}, + { 0.451636, -0.300013}, + {-0.370610, 0.387504} +}; + + +/* 24 jitter points */ +jitter_point j24[] = +{ + { 0.030245, 0.136384}, + { 0.018865, -0.348867}, + {-0.350114, -0.472309}, + { 0.222181, 0.149524}, + {-0.393670, -0.266873}, + { 0.404568, 0.230436}, + { 0.098381, 0.465337}, + { 0.462671, 0.442116}, + { 0.400373, -0.212720}, + {-0.409988, 0.263345}, + {-0.115878, -0.001981}, + { 0.348425, -0.009237}, + {-0.464016, 0.066467}, + {-0.138674, -0.468006}, + { 0.144932, -0.022780}, + {-0.250195, 0.150161}, + {-0.181400, -0.264219}, + { 0.196097, -0.234139}, + {-0.311082, -0.078815}, + { 0.268379, 0.366778}, + {-0.040601, 0.327109}, + {-0.234392, 0.354659}, + {-0.003102, -0.154402}, + { 0.297997, -0.417965} +}; + + +/* 66 jitter points */ +jitter_point j66[] = +{ + { 0.266377, -0.218171}, + {-0.170919, -0.429368}, + { 0.047356, -0.387135}, + {-0.430063, 0.363413}, + {-0.221638, -0.313768}, + { 0.124758, -0.197109}, + {-0.400021, 0.482195}, + { 0.247882, 0.152010}, + {-0.286709, -0.470214}, + {-0.426790, 0.004977}, + {-0.361249, -0.104549}, + {-0.040643, 0.123453}, + {-0.189296, 0.438963}, + {-0.453521, -0.299889}, + { 0.408216, -0.457699}, + { 0.328973, -0.101914}, + {-0.055540, -0.477952}, + { 0.194421, 0.453510}, + { 0.404051, 0.224974}, + { 0.310136, 0.419700}, + {-0.021743, 0.403898}, + {-0.466210, 0.248839}, + { 0.341369, 0.081490}, + { 0.124156, -0.016859}, + {-0.461321, -0.176661}, + { 0.013210, 0.234401}, + { 0.174258, -0.311854}, + { 0.294061, 0.263364}, + {-0.114836, 0.328189}, + { 0.041206, -0.106205}, + { 0.079227, 0.345021}, + {-0.109319, -0.242380}, + { 0.425005, -0.332397}, + { 0.009146, 0.015098}, + {-0.339084, -0.355707}, + {-0.224596, -0.189548}, + { 0.083475, 0.117028}, + { 0.295962, -0.334699}, + { 0.452998, 0.025397}, + { 0.206511, -0.104668}, + { 0.447544, -0.096004}, + {-0.108006, -0.002471}, + {-0.380810, 0.130036}, + {-0.242440, 0.186934}, + {-0.200363, 0.070863}, + {-0.344844, -0.230814}, + { 0.408660, 0.345826}, + {-0.233016, 0.305203}, + { 0.158475, -0.430762}, + { 0.486972, 0.139163}, + {-0.301610, 0.009319}, + { 0.282245, -0.458671}, + { 0.482046, 0.443890}, + {-0.121527, 0.210223}, + {-0.477606, -0.424878}, + {-0.083941, -0.121440}, + {-0.345773, 0.253779}, + { 0.234646, 0.034549}, + { 0.394102, -0.210901}, + {-0.312571, 0.397656}, + { 0.200906, 0.333293}, + { 0.018703, -0.261792}, + {-0.209349, -0.065383}, + { 0.076248, 0.478538}, + {-0.073036, -0.355064}, + { 0.145087, 0.221726} +}; diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/material.c b/xc/extras/Mesa/OpenStep/Old_NeXT/material.c new file mode 100644 index 000000000..e1324fa6c --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/material.c @@ -0,0 +1,285 @@ +/* + * (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. + */ +/* + * material.c + * This program demonstrates the use of the GL lighting model. + * Several objects are drawn using different material characteristics. + * A single light source illuminates the objects. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Initialize z-buffer, projection matrix, light source, + * and lighting model. Do not specify a material property here. + */ +void myinit(void) +{ + GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat position[] = { 0.0, 3.0, 2.0, 0.0 }; + GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 }; + GLfloat local_view[] = { 0.0 }; + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_POSITION, position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + + glClearColor(0.0, 0.1, 0.1, 0.0); +} + +/* Draw twelve spheres in 3 rows with 4 columns. + * The spheres in the first row have materials with no ambient reflection. + * The second row has materials with significant ambient reflection. + * The third row has materials with colored ambient reflection. + * + * The first column has materials with blue, diffuse reflection only. + * The second column has blue diffuse reflection, as well as specular + * reflection with a low shininess exponent. + * The third column has blue diffuse reflection, as well as specular + * reflection with a high shininess exponent (a more concentrated highlight). + * The fourth column has materials which also include an emissive component. + * + * glTranslatef() is used to move spheres to their appropriate locations. + */ + +void display(void) +{ + GLfloat no_mat[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat mat_ambient[] = { 0.7, 0.7, 0.7, 1.0 }; + GLfloat mat_ambient_color[] = { 0.8, 0.8, 0.2, 1.0 }; + GLfloat mat_diffuse[] = { 0.1, 0.5, 0.8, 1.0 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat no_shininess[] = { 0.0 }; + GLfloat low_shininess[] = { 5.0 }; + GLfloat high_shininess[] = { 100.0 }; + GLfloat mat_emission[] = {0.3, 0.2, 0.2, 0.0}; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + +/* draw sphere in first row, first column + * diffuse reflection only; no ambient or specular + */ + glPushMatrix(); + glTranslatef (-3.75, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, second column + * diffuse and specular reflection; low shininess; no ambient + */ + glPushMatrix(); + glTranslatef (-1.25, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, third column + * diffuse and specular reflection; high shininess; no ambient + */ + glPushMatrix(); + glTranslatef (1.25, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, fourth column + * diffuse reflection; emission; no ambient or specular reflection + */ + glPushMatrix(); + glTranslatef (3.75, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, first column + * ambient and diffuse reflection; no specular + */ + glPushMatrix(); + glTranslatef (-3.75, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, second column + * ambient, diffuse and specular reflection; low shininess + */ + glPushMatrix(); + glTranslatef (-1.25, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, third column + * ambient, diffuse and specular reflection; high shininess + */ + glPushMatrix(); + glTranslatef (1.25, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, fourth column + * ambient and diffuse reflection; emission; no specular + */ + glPushMatrix(); + glTranslatef (3.75, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, first column + * colored ambient and diffuse reflection; no specular + */ + glPushMatrix(); + glTranslatef (-3.75, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, second column + * colored ambient, diffuse and specular reflection; low shininess + */ + glPushMatrix(); + glTranslatef (-1.25, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, third column + * colored ambient, diffuse and specular reflection; high shininess + */ + glPushMatrix(); + glTranslatef (1.25, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, fourth column + * colored ambient and diffuse reflection; emission; no specular + */ + glPushMatrix(); + glTranslatef (3.75, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= (h * 2)) + glOrtho (-6.0, 6.0, -3.0*((GLfloat)h*2)/(GLfloat)w, + 3.0*((GLfloat)h*2)/(GLfloat)w, -10.0, 10.0); + else + glOrtho (-6.0*(GLfloat)w/((GLfloat)h*2), + 6.0*(GLfloat)w/((GLfloat)h*2), -3.0, 3.0, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=600; +int gl_height=450; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/model.c b/xc/extras/Mesa/OpenStep/Old_NeXT/model.c new file mode 100644 index 000000000..408152b71 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/model.c @@ -0,0 +1,116 @@ +/* + * (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. + */ +/* + * model.c + * This program demonstrates the use of OpenGL modeling + * transformations. Four triangles are drawn, each with + * a different transformation. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +void draw_triangle(void) +{ + glBegin(GL_LINE_LOOP); + glVertex2f(0.0, 25.0); + glVertex2f(25.0, -25.0); + glVertex2f(-25.0, -25.0); + glEnd(); +} + +/* Clear the screen. For each triangle, set the current + * color and modify the modelview matrix. + */ +void display(void) +{ + glClearColor (0.0, 0.0, 0.0, 1.0); + glClear (GL_COLOR_BUFFER_BIT); + + glLoadIdentity (); + glColor3f (1.0, 1.0, 1.0); + draw_triangle (); + + glEnable (GL_LINE_STIPPLE); + glLineStipple (1, 0xF0F0); + glLoadIdentity (); + glTranslatef (-20.0, 0.0, 0.0); + draw_triangle (); + + glLineStipple (1, 0xF00F); + glLoadIdentity (); + glScalef (1.5, 0.5, 1.0); + draw_triangle (); + + glLineStipple (1, 0x8888); + glLoadIdentity (); + glRotatef (90.0, 0.0, 0.0, 1.0); + draw_triangle (); + glDisable (GL_LINE_STIPPLE); + + glFlush(); +} + +void myinit (void) +{ + glShadeModel (GL_FLAT); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-50.0, 50.0, -50.0*(GLfloat)h/(GLfloat)w, + 50.0*(GLfloat)h/(GLfloat)w, -1.0, 1.0); + else + glOrtho (-50.0*(GLfloat)w/(GLfloat)h, + 50.0*(GLfloat)w/(GLfloat)h, -50.0, 50.0, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo1.m b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo1.m new file mode 100644 index 000000000..0bc7123c5 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo1.m @@ -0,0 +1,168 @@ +/* nextdemo.m*/ + +/* Demo of NEXTSTEP Mesa rendering */ + +/* + * See Mesa/include/GL/osmesa.h for documentation of the OSMesa functions. + * + * If you want to render BIG images you'll probably have to increase + * MAX_WIDTH and MAX_HEIGHT in src/config.h. + * + * This program is in the public domain. + * + * Brian Paul + * + * NEXTSTEP output provided by Pascal Thibaudeau + * pthibaud@frbdx11.cribx1.u-bordeaux.fr + */ + +#import <dpsclient/wraps.h> +#import <appkit/Application.h> +#import <appkit/Window.h> +#import <appkit/Menu.h> +#import <appkit/View.h> +#import <appkit/color.h> +#import <appkit/NXBitmapImageRep.h> + +#include <stdio.h> +#include <stdlib.h> +#include "GL/osmesa.h" + +#define WIDTH 480 +#define HEIGHT 480 + +static void render_image() +{ + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; + GLfloat red_mat[] = { 1.0, 0.0, 0.0, 0.5 }; + GLfloat green_mat[] = { 0.0, 1.0, 0.0, 0.5 }; + GLfloat blue_mat[] = { 0.0, 0.0, 1.0, 0.5}; + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_DEPTH_TEST); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(-2.5, 2.5, -2.5, 2.5, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); + + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + + glPushMatrix(); + glRotatef(20.0, 1.0, 0.0, 0.0); + + glPushMatrix(); + glTranslatef(-0.75, 0.5, 0.0); + glRotatef(90.0, 1.0, 0.0, 0.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red_mat ); + auxSolidTorus(0.275, 0.85); + glPopMatrix(); + + glPushMatrix(); + glTranslatef(-0.75, -0.5, 0.0); + glRotatef(270.0, 1.0, 0.0, 0.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, green_mat ); + auxSolidCone(1.0, 2.0); + glPopMatrix(); + + glPushMatrix(); + glTranslatef(0.75, 0.0, -1.0); + glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat ); + auxSolidSphere(1.0); + glPopMatrix(); + + glPopMatrix(); +} + + + +int main( int argc, char *argv[] ) +{ + OSMesaContext ctx; + void *buffer; + id myWindow, myView, myMenu, image; + char name[50]; + NXRect GR; + NXPoint position; + + NXApp=[Application new]; + + /* Create an RGBA-mode context */ + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + + /* Allocate the image buffer */ + buffer = malloc( WIDTH * HEIGHT * 4 ); + + /* Bind the buffer to the context and make it current */ + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT ); + + image = [ [ NXBitmapImageRep alloc] + initData: buffer + pixelsWide: WIDTH + pixelsHigh: HEIGHT + bitsPerSample: 8 + samplesPerPixel: 4 + hasAlpha: YES + isPlanar: NO + colorSpace: 2 + bytesPerRow: WIDTH*4 + bitsPerPixel: 32]; + + NXSetRect(&GR,100,100,WIDTH,HEIGHT); + + myWindow = [ [ Window alloc] + initContent: &GR + style: NX_TITLEDSTYLE + backing: NX_BUFFERED + buttonMask: NX_MINIATURIZEBUTTONMASK + defer: NO]; + + sprintf(name, "Graphic Rectangle %d", getpid()); + + myView = [ [ View alloc] initFrame:&GR]; + [myView setOpaque: NO]; + [myView setDrawOrigin: -WIDTH: -HEIGHT]; + [myView rotate: 180.0]; + + myMenu = [ [ Menu alloc] initTitle: "NeXT-OpenGL"]; + [myMenu addItem: "Quit" action: @selector(terminate:) keyEquivalent: 'q']; + [myMenu sizeToFit]; + + [myWindow setTitle: name]; + [myWindow display]; + [myWindow setContentView: myView]; + [myWindow makeKeyAndOrderFront: nil]; + + [NXApp setMainMenu: myMenu]; + + [myView lockFocus]; + + /* here is the Mesa call */ + render_image(); + + [image draw]; + [image free]; + + [myWindow flushWindow]; + [myView unlockFocus]; + + /* free the image buffer */ + free( buffer ); + + /* destroy the context */ + OSMesaDestroyContext( ctx ); + + [NXApp run]; + [NXApp free]; + + return 0; +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo2.m b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo2.m new file mode 100644 index 000000000..c33867059 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo2.m @@ -0,0 +1,213 @@ +/* + * (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. + */ +/* + * original name: tea.c + * This program demonstrates two-sided lighting and compares + * it with one-sided lighting. Three teapots are drawn, with + * a clipping plane to expose the interior of the objects. + * + * NEXTSTEP output provided by Pascal Thibaudeau + * pthibaud@frbdx11.cribx1.u-bordeaux.fr + */ +#import <dpsclient/wraps.h> +#import <appkit/Application.h> +#import <appkit/Window.h> +#import <appkit/Menu.h> +#import <appkit/View.h> +#import <appkit/color.h> +#import <appkit/NXBitmapImageRep.h> + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "GL/osmesa.h" + +#define WIDTH 400 +#define HEIGHT 400 + +static void render_image(void) +{ + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + +/* light_position is NOT default value */ + GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; + GLdouble eqn[4] = {1.0, 0.0, -1.0, 1.0}; + GLfloat two_side_on[] = { GL_TRUE }; + GLfloat two_side_off[] = { GL_FALSE }; + GLfloat mat_diffuse[] = { 0.8, 0.8, 0.8, 1.0 }; + GLfloat back_diffuse[] = { 0.8, 0.2, 0.8, 1.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glFrontFace (GL_CW); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho (-4.0, 4.0, -4.0*(GLfloat)HEIGHT/(GLfloat)WIDTH, + 4.0*(GLfloat)HEIGHT/(GLfloat)WIDTH, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix (); + glClipPlane (GL_CLIP_PLANE0, eqn); /* slice objects */ + glEnable (GL_CLIP_PLANE0); + + glPushMatrix (); + glTranslatef (0.0, 2.0, 0.0); + auxSolidTeapot(1.0); /* one-sided lighting */ + glPopMatrix (); + + /* two-sided lighting, but same material */ + glLightModelf (GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); + glPushMatrix (); + glTranslatef (0.0, 0.0, 0.0); + auxSolidTeapot(1.0); + glPopMatrix (); + + /* two-sided lighting, two different materials */ + glMaterialfv (GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv (GL_BACK, GL_DIFFUSE, back_diffuse); + glPushMatrix (); + glTranslatef (0.0, -2.0, 0.0); + auxSolidTeapot(1.0); + glPopMatrix (); + + glLightModelf (GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); + glDisable (GL_CLIP_PLANE0); + glPopMatrix (); + glFlush(); +} + +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, and handle input events. + */ +int main(int argc, char** argv) +{ + OSMesaContext ctx; + void *buffer; + id myWindow, myView, myMenu, image; + char name[50]; + NXRect GR; + NXPoint position; + NXApp=[Application new]; + + /* Create an RGBA-mode context */ + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + + /* Allocate the image buffer */ + buffer = malloc( WIDTH * HEIGHT * 4 ); + + /* Bind the buffer to the context and make it current */ + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT ); + + image = [ [ NXBitmapImageRep alloc] + initData: buffer + pixelsWide: WIDTH + pixelsHigh: HEIGHT + bitsPerSample: 8 + samplesPerPixel: 4 + hasAlpha: YES + isPlanar: NO + colorSpace: 2 + bytesPerRow: WIDTH*4 + bitsPerPixel: 32]; + + NXSetRect(&GR,100,100,WIDTH,HEIGHT); + + myWindow = [ [ Window alloc] + initContent: &GR + style: NX_TITLEDSTYLE + backing: NX_BUFFERED + buttonMask: NX_MINIATURIZEBUTTONMASK + defer: NO]; + + sprintf(name, "OpenGL Graphic Rectangle %d", getpid()); + + myView = [ [ View alloc] initFrame:&GR]; + [myView setOpaque: NO]; + [myView setDrawOrigin: -WIDTH: -HEIGHT]; + [myView rotate: 180.0]; + + myMenu = [ [ Menu alloc] initTitle: "NeXT-Mesa"]; + [myMenu addItem: "Quit" action: @selector(terminate:) keyEquivalent: 'q']; + [myMenu sizeToFit]; + + [myWindow setTitle: name]; + [myWindow display]; + [myWindow setContentView: myView]; + [myWindow makeKeyAndOrderFront: nil]; + + [NXApp setMainMenu: myMenu]; + + [myView lockFocus]; + + /* here is the Mesa call */ + render_image(); + + [image draw]; + [image free]; + + [myWindow flushWindow]; + [myView unlockFocus]; + + /* free the image buffer */ + free( buffer ); + + /* destroy the context */ + OSMesaDestroyContext( ctx ); + + [NXApp run]; + [NXApp free]; + + return 0; + + } + diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo3.m b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo3.m new file mode 100644 index 000000000..e89865807 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo3.m @@ -0,0 +1,257 @@ +/* + * (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. + */ +/* + * teapots.c + * This program demonstrates lots of material properties. + * A single light source illuminates the objects. + * + * NEXTSTEP output provided by Pascal Thibaudeau + * pthibaud@frbdx11.cribx1.u-bordeaux.fr + */ +#import <dpsclient/wraps.h> +#import <appkit/Application.h> +#import <appkit/Window.h> +#import <appkit/Menu.h> +#import <appkit/View.h> +#import <appkit/color.h> +#import <appkit/NXBitmapImageRep.h> + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "GL/osmesa.h" + +#define WIDTH 400 +#define HEIGHT 400 + +/* Move object into position. Use 3rd through 12th parameters + * to specify the material property. Draw a teapot. + */ +void renderTeapot (GLfloat x, GLfloat y, + GLfloat ambr, GLfloat ambg, GLfloat ambb, + GLfloat difr, GLfloat difg, GLfloat difb, + GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine) +{ + float mat[4]; + + glPushMatrix(); + glTranslatef (x, y, 0.0); + mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0; + glMaterialfv (GL_FRONT, GL_AMBIENT, mat); + mat[0] = difr; mat[1] = difg; mat[2] = difb; + glMaterialfv (GL_FRONT, GL_DIFFUSE, mat); + mat[0] = specr; mat[1] = specg; mat[2] = specb; + glMaterialfv (GL_FRONT, GL_SPECULAR, mat); + glMaterialf (GL_FRONT, GL_SHININESS, shine*128.0); + auxSolidTeapot(1.0); + glPopMatrix(); +} + + +/* Initialize depth buffer, projection matrix, light source, + * and lighting model. Do not specify a material property here. + */ +static void render_image(void) +{ + GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat position[] = { 0.0, 3.0, 3.0, 0.0 }; + + GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + GLfloat local_view[] = { 0.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_POSITION, position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view); + + glFrontFace (GL_CW); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho (0.0, 16.0, 0.0, 16.0*(GLfloat)HEIGHT/(GLfloat)WIDTH, + -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + renderTeapot (2.0, 17.0, 0.0215, 0.1745, 0.0215, + 0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6); + renderTeapot (2.0, 14.0, 0.135, 0.2225, 0.1575, + 0.54, 0.89, 0.63, 0.316228, 0.316228, 0.316228, 0.1); + renderTeapot (2.0, 11.0, 0.05375, 0.05, 0.06625, + 0.18275, 0.17, 0.22525, 0.332741, 0.328634, 0.346435, 0.3); + renderTeapot (2.0, 8.0, 0.25, 0.20725, 0.20725, + 1, 0.829, 0.829, 0.296648, 0.296648, 0.296648, 0.088); + renderTeapot (2.0, 5.0, 0.1745, 0.01175, 0.01175, + 0.61424, 0.04136, 0.04136, 0.727811, 0.626959, 0.626959, 0.6); + renderTeapot (2.0, 2.0, 0.1, 0.18725, 0.1745, + 0.396, 0.74151, 0.69102, 0.297254, 0.30829, 0.306678, 0.1); + renderTeapot (6.0, 17.0, 0.329412, 0.223529, 0.027451, + 0.780392, 0.568627, 0.113725, 0.992157, 0.941176, 0.807843, + 0.21794872); + renderTeapot (6.0, 14.0, 0.2125, 0.1275, 0.054, + 0.714, 0.4284, 0.18144, 0.393548, 0.271906, 0.166721, 0.2); + renderTeapot (6.0, 11.0, 0.25, 0.25, 0.25, + 0.4, 0.4, 0.4, 0.774597, 0.774597, 0.774597, 0.6); + renderTeapot (6.0, 8.0, 0.19125, 0.0735, 0.0225, + 0.7038, 0.27048, 0.0828, 0.256777, 0.137622, 0.086014, 0.1); + renderTeapot (6.0, 5.0, 0.24725, 0.1995, 0.0745, + 0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4); + renderTeapot (6.0, 2.0, 0.19225, 0.19225, 0.19225, + 0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4); + renderTeapot (10.0, 17.0, 0.0, 0.0, 0.0, 0.01, 0.01, 0.01, + 0.50, 0.50, 0.50, .25); + renderTeapot (10.0, 14.0, 0.0, 0.1, 0.06, 0.0, 0.50980392, 0.50980392, + 0.50196078, 0.50196078, 0.50196078, .25); + renderTeapot (10.0, 11.0, 0.0, 0.0, 0.0, + 0.1, 0.35, 0.1, 0.45, 0.55, 0.45, .25); + renderTeapot (10.0, 8.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, + 0.7, 0.6, 0.6, .25); + renderTeapot (10.0, 5.0, 0.0, 0.0, 0.0, 0.55, 0.55, 0.55, + 0.70, 0.70, 0.70, .25); + renderTeapot (10.0, 2.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, + 0.60, 0.60, 0.50, .25); + renderTeapot (14.0, 17.0, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, + 0.4, 0.4, 0.4, .078125); + renderTeapot (14.0, 14.0, 0.0, 0.05, 0.05, 0.4, 0.5, 0.5, + 0.04, 0.7, 0.7, .078125); + renderTeapot (14.0, 11.0, 0.0, 0.05, 0.0, 0.4, 0.5, 0.4, + 0.04, 0.7, 0.04, .078125); + renderTeapot (14.0, 8.0, 0.05, 0.0, 0.0, 0.5, 0.4, 0.4, + 0.7, 0.04, 0.04, .078125); + renderTeapot (14.0, 5.0, 0.05, 0.05, 0.05, 0.5, 0.5, 0.5, + 0.7, 0.7, 0.7, .078125); + renderTeapot (14.0, 2.0, 0.05, 0.05, 0.0, 0.5, 0.5, 0.4, + 0.7, 0.7, 0.04, .078125); + glFlush(); + +} + +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, and handle input events. + */ +int main(int argc, char** argv) +{ + OSMesaContext ctx; + void *buffer; + id myWindow, myView, myMenu, image; + char name[50]; + NXRect GR; + NXPoint position; + NXApp=[Application new]; + + /* Create an RGBA-mode context */ + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + + /* Allocate the image buffer */ + buffer = malloc( WIDTH * HEIGHT * 4 ); + + /* Bind the buffer to the context and make it current */ + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT ); + + image = [ [ NXBitmapImageRep alloc] + initData: buffer + pixelsWide: WIDTH + pixelsHigh: HEIGHT + bitsPerSample: 8 + samplesPerPixel: 4 + hasAlpha: YES + isPlanar: NO + colorSpace: 2 + bytesPerRow: WIDTH*4 + bitsPerPixel: 32]; + + NXSetRect(&GR,100,100,WIDTH,HEIGHT); + + myWindow = [ [ Window alloc] + initContent: &GR + style: NX_TITLEDSTYLE + backing: NX_BUFFERED + buttonMask: NX_MINIATURIZEBUTTONMASK + defer: NO]; + + sprintf(name, "Graphic Rectangle %d", getpid()); + + myView = [ [ View alloc] initFrame:&GR]; + [myView setOpaque: NO]; + [myView setDrawOrigin: -WIDTH: -HEIGHT]; + [myView rotate: 180.0]; + + myMenu = [ [ Menu alloc] initTitle: "NeXT-OpenGL"]; + [myMenu addItem: "Quit" action: @selector(terminate:) keyEquivalent: 'q']; + [myMenu sizeToFit]; + + [myWindow setTitle: name]; + [myWindow display]; + [myWindow setContentView: myView]; + [myWindow makeKeyAndOrderFront: nil]; + + [NXApp setMainMenu: myMenu]; + + [myView lockFocus]; + + /* here is the Mesa call */ + render_image(); + + [image draw]; + [image free]; + + [myWindow flushWindow]; + [myView unlockFocus]; + + /* free the image buffer */ + free( buffer ); + + /* destroy the context */ + OSMesaDestroyContext( ctx ); + + [NXApp run]; + [NXApp free]; + + return 0; + + } + diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo4.m b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo4.m new file mode 100644 index 000000000..794343bd5 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo4.m @@ -0,0 +1,206 @@ +/* + * (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. + */ +/* chess.c + * This program texture maps a checkerboard image onto + * two rectangles. The texture coordinates for the + * rectangles are 0.0 to 3.0. + * + * NEXTSTEP output provided by Pascal Thibaudeau + * pthibaud@frbdx11.cribx1.u-bordeaux.fr + */ +#import <dpsclient/wraps.h> +#import <appkit/Application.h> +#import <appkit/Window.h> +#import <appkit/Menu.h> +#import <appkit/View.h> +#import <appkit/color.h> +#import <appkit/NXBitmapImageRep.h> + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include <math.h> +#include "GL/osmesa.h" + +#define WIDTH 500 +#define HEIGHT 500 + +#define checkImageWidth 64 +#define checkImageHeight 64 +GLubyte checkImage[checkImageWidth][checkImageHeight][3]; + +void makecheckimage(void) +{ + int i, j, r, c; + + for (i = 0; i < checkImageWidth; i++) { + for (j = 0; j < checkImageHeight; j++) { + c = ((((i&0x8)==0)^((j&0x8))==0))*255; + checkImage[i][j][0] = (GLubyte) c; + checkImage[i][j][1] = (GLubyte) c; + checkImage[i][j][2] = (GLubyte) c; + } + } +} + +static void render_image(void) +{ + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + makecheckimage(); + glTexImage2D(GL_TEXTURE_2D, 0, 3, + checkImageWidth, checkImageHeight, 0, + GL_RGB, GL_UNSIGNED_BYTE, &checkImage[0][0][0]); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glEnable(GL_TEXTURE_2D); + glShadeModel(GL_FLAT); + + glViewport(0, 0, WIDTH, HEIGHT); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, 1.0*(GLfloat)WIDTH/(GLfloat)HEIGHT, 1.0, 30.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef(0.0, 0.0, -3.6); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glBegin(GL_QUADS); + glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(-2.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(0.0, 1.0, 0.0); + glTexCoord2f(3.0, 0.0); glVertex3f(0.0, -1.0, 0.0); + + glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 0.0); + glTexCoord2f(0.0, 3.0); glVertex3f(1.0, 1.0, 0.0); + glTexCoord2f(3.0, 3.0); glVertex3f(2.41421, 1.0, -1.41421); + glTexCoord2f(3.0, 0.0); glVertex3f(2.41421, -1.0, -1.41421); + glEnd(); + glFlush(); + +} + +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, and handle input events. + */ +int main(int argc, char** argv) +{ + OSMesaContext ctx; + void *buffer; + id myWindow, myView, myMenu, image; + char name[50]; + NXRect GR; + NXPoint position; + NXApp=[Application new]; + + /* Create an RGBA-mode context */ + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + + /* Allocate the image buffer */ + buffer = malloc( WIDTH * HEIGHT * 4 ); + + /* Bind the buffer to the context and make it current */ + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT ); + + image = [ [ NXBitmapImageRep alloc] + initData: buffer + pixelsWide: WIDTH + pixelsHigh: HEIGHT + bitsPerSample: 8 + samplesPerPixel: 4 + hasAlpha: YES + isPlanar: NO + colorSpace: 2 + bytesPerRow: WIDTH*4 + bitsPerPixel: 32]; + + NXSetRect(&GR,100,100,WIDTH,HEIGHT); + + myWindow = [ [ Window alloc] + initContent: &GR + style: NX_TITLEDSTYLE + backing: NX_BUFFERED + buttonMask: NX_MINIATURIZEBUTTONMASK + defer: NO]; + + sprintf(name, "OpenGL Graphic Rectangle %d", getpid()); + + myView = [ [ View alloc] initFrame:&GR]; + [myView setOpaque: NO]; + [myView setDrawOrigin: -WIDTH: -HEIGHT]; + [myView rotate: 180.0]; + + myMenu = [ [ Menu alloc] initTitle: "NeXT-Mesa"]; + [myMenu addItem: "Quit" action: @selector(terminate:) keyEquivalent: 'q']; + [myMenu sizeToFit]; + + [myWindow setTitle: name]; + [myWindow display]; + [myWindow setContentView: myView]; + [myWindow makeKeyAndOrderFront: nil]; + + [NXApp setMainMenu: myMenu]; + + [myView lockFocus]; + + /* here is the Mesa call */ + render_image(); + + [image draw]; + [image free]; + + [myWindow flushWindow]; + [myView unlockFocus]; + + /* free the image buffer */ + free( buffer ); + + /* destroy the context */ + OSMesaDestroyContext( ctx ); + + [NXApp run]; + [NXApp free]; + + return 0; + + } + diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo5.m b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo5.m new file mode 100644 index 000000000..4432b09e8 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo5.m @@ -0,0 +1,357 @@ +/* + * (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. + */ +/* + * material.c + * This program demonstrates the use of the GL lighting model. + * Several objects are drawn using different material characteristics. + * A single light source illuminates the objects. + * + * NEXTSTEP output provided by Pascal Thibaudeau + * pthibaud@frbdx11.cribx1.u-bordeaux.fr + */ +#import <dpsclient/wraps.h> +#import <appkit/Application.h> +#import <appkit/Window.h> +#import <appkit/Menu.h> +#import <appkit/View.h> +#import <appkit/color.h> +#import <appkit/NXBitmapImageRep.h> + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "GL/osmesa.h" + +#define WIDTH 600 +#define HEIGHT 450 + +/* Initialize z-buffer, projection matrix, light source, + * and lighting model. Do not specify a material property here. + */ +static void render_image(void) +{ + GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat position[] = { 0.0, 3.0, 2.0, 0.0 }; + GLfloat lmodel_ambient[] = { 0.4, 0.4, 0.4, 1.0 }; + GLfloat local_view[] = { 0.0 }; + + GLfloat no_mat[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat mat_ambient[] = { 0.7, 0.7, 0.7, 1.0 }; + GLfloat mat_ambient_color[] = { 0.8, 0.8, 0.2, 1.0 }; + GLfloat mat_diffuse[] = { 0.1, 0.5, 0.8, 1.0 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat no_shininess[] = { 0.0 }; + GLfloat low_shininess[] = { 5.0 }; + GLfloat high_shininess[] = { 100.0 }; + GLfloat mat_emission[] = {0.3, 0.2, 0.2, 0.0}; + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_POSITION, position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + + glClearColor(0.0, 0.1, 0.1, 0.0); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glViewport(0, 0, WIDTH, HEIGHT); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (WIDTH<= (HEIGHT * 2)) + glOrtho (-6.0, 6.0, -3.0*((GLfloat)HEIGHT*2)/(GLfloat)WIDTH, + 3.0*((GLfloat)HEIGHT*2)/(GLfloat)WIDTH, -10.0, 10.0); + else + glOrtho (-6.0*(GLfloat)WIDTH/((GLfloat)HEIGHT*2), + 6.0*(GLfloat)WIDTH/((GLfloat)HEIGHT*2), -3.0, 3.0, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); + + +/* draw sphere in first row, first column + * diffuse reflection only; no ambient or specular + */ + glPushMatrix(); + glTranslatef (-3.75, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, second column + * diffuse and specular reflection; low shininess; no ambient + */ + glPushMatrix(); + glTranslatef (-1.25, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, third column + * diffuse and specular reflection; high shininess; no ambient + */ + glPushMatrix(); + glTranslatef (1.25, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in first row, fourth column + * diffuse reflection; emission; no ambient or specular reflection + */ + glPushMatrix(); + glTranslatef (3.75, 3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, no_mat); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, first column + * ambient and diffuse reflection; no specular + */ + glPushMatrix(); + glTranslatef (-3.75, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, second column + * ambient, diffuse and specular reflection; low shininess + */ + glPushMatrix(); + glTranslatef (-1.25, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, third column + * ambient, diffuse and specular reflection; high shininess + */ + glPushMatrix(); + glTranslatef (1.25, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in second row, fourth column + * ambient and diffuse reflection; emission; no specular + */ + glPushMatrix(); + glTranslatef (3.75, 0.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, first column + * colored ambient and diffuse reflection; no specular + */ + glPushMatrix(); + glTranslatef (-3.75, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, second column + * colored ambient, diffuse and specular reflection; low shininess + */ + glPushMatrix(); + glTranslatef (-1.25, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, low_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, third column + * colored ambient, diffuse and specular reflection; high shininess + */ + glPushMatrix(); + glTranslatef (1.25, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, no_mat); + auxSolidSphere(1.0); + glPopMatrix(); + +/* draw sphere in third row, fourth column + * colored ambient and diffuse reflection; emission; no specular + */ + glPushMatrix(); + glTranslatef (3.75, -3.0, 0.0); + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient_color); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, no_mat); + glMaterialfv(GL_FRONT, GL_SHININESS, no_shininess); + glMaterialfv(GL_FRONT, GL_EMISSION, mat_emission); + auxSolidSphere(1.0); + glPopMatrix(); + + glFlush(); +} + +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, and handle input events. + */ +int main(int argc, char** argv) +{ + OSMesaContext ctx; + void *buffer; + id myWindow, myView, myMenu, image; + char name[50]; + NXRect GR; + NXPoint position; + NXApp=[Application new]; + + /* Create an RGBA-mode context */ + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + + /* Allocate the image buffer */ + buffer = malloc( WIDTH * HEIGHT * 4 ); + + /* Bind the buffer to the context and make it current */ + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT ); + + image = [ [ NXBitmapImageRep alloc] + initData: buffer + pixelsWide: WIDTH + pixelsHigh: HEIGHT + bitsPerSample: 8 + samplesPerPixel: 4 + hasAlpha: YES + isPlanar: NO + colorSpace: 2 + bytesPerRow: WIDTH*4 + bitsPerPixel: 32]; + + NXSetRect(&GR,100,100,WIDTH,HEIGHT); + + myWindow = [ [ Window alloc] + initContent: &GR + style: NX_TITLEDSTYLE + backing: NX_BUFFERED + buttonMask: NX_MINIATURIZEBUTTONMASK + defer: NO]; + + sprintf(name, "OpenGL Graphic Rectangle %d", getpid()); + + myView = [ [ View alloc] initFrame:&GR]; + [myView setOpaque: NO]; + [myView setDrawOrigin: -WIDTH: -HEIGHT]; + [myView rotate: 180.0]; + + myMenu = [ [ Menu alloc] initTitle: "NeXT-Mesa"]; + [myMenu addItem: "Quit" action: @selector(terminate:) keyEquivalent: 'q']; + [myMenu sizeToFit]; + + [myWindow setTitle: name]; + [myWindow display]; + [myWindow setContentView: myView]; + [myWindow makeKeyAndOrderFront: nil]; + + [NXApp setMainMenu: myMenu]; + + [myView lockFocus]; + + /* here is the Mesa call */ + render_image(); + + [image draw]; + [image free]; + + [myWindow flushWindow]; + [myView unlockFocus]; + + /* free the image buffer */ + free( buffer ); + + /* destroy the context */ + OSMesaDestroyContext( ctx ); + + [NXApp run]; + [NXApp free]; + + return 0; + + } + + diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo6.m b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo6.m new file mode 100644 index 000000000..716647980 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/nextdemo6.m @@ -0,0 +1,215 @@ +/* + * (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. + */ +/* texgen.c + * This program draws a texture mapped teapot with + * automatically generated texture coordinates. The + * texture is rendered as stripes on the teapot. + * + * NEXTSTEP output provided by Pascal Thibaudeau + * pthibaud@frbdx11.cribx1.u-bordeaux.fr + */ +#import <dpsclient/wraps.h> +#import <appkit/Application.h> +#import <appkit/Window.h> +#import <appkit/Menu.h> +#import <appkit/View.h> +#import <appkit/color.h> +#import <appkit/NXBitmapImageRep.h> + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "GL/osmesa.h" + +#define WIDTH 400 +#define HEIGHT 400 + +#define stripeImageWidth 16 +GLubyte stripeImage[3*stripeImageWidth]; + +void makeStripeImage(void) +{ + int j; + + for (j = 0; j < stripeImageWidth; j++) { + stripeImage[3*j] = (j<=4) ? 255 : 0; + stripeImage[3*j+1] = (j>4) ? 255 : 0; + stripeImage[3*j+2] = 0; + } +} + +/* glTexGen stuff: */ + +GLfloat sgenparams[] = {1.0, 1.0, 1.0, 0.0}; + +static void render_image(void) +{ + glViewport(0, 0, WIDTH, HEIGHT); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (WIDTH <= HEIGHT) + glOrtho (-3.5, 3.5, -3.5*(GLfloat)HEIGHT/(GLfloat)WIDTH, + 3.5*(GLfloat)HEIGHT/(GLfloat)WIDTH, -3.5, 3.5); + else + glOrtho (-3.5*(GLfloat)WIDTH/(GLfloat)HEIGHT, + 3.5*(GLfloat)WIDTH/(GLfloat)HEIGHT, -3.5, 3.5, -3.5, 3.5); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glClearColor (0.0, 0.0, 0.0, 0.0); + + makeStripeImage(); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexImage1D(GL_TEXTURE_1D, 0, 3, stripeImageWidth, 0, + GL_RGB, GL_UNSIGNED_BYTE, stripeImage); + + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGenfv(GL_S, GL_OBJECT_PLANE, sgenparams); + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + glEnable(GL_TEXTURE_GEN_S); + glEnable(GL_TEXTURE_1D); + glEnable(GL_CULL_FACE); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glFrontFace(GL_CW); + glCullFace(GL_BACK); + glMaterialf (GL_FRONT, GL_SHININESS, 64.0); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glPushMatrix (); + glRotatef(-45.0, -180.0, -40.0, 1.0); + auxSolidTeapot(3.0); + glPopMatrix (); + glFlush(); +} + +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, and handle input events. + */ +int main(int argc, char** argv) +{ + OSMesaContext ctx; + void *buffer; + id myWindow, myView, myMenu, image; + char name[50]; + NXRect GR; + NXPoint position; + NXApp=[Application new]; + + /* Create an RGBA-mode context */ + ctx = OSMesaCreateContext( GL_RGBA, NULL ); + + /* Allocate the image buffer */ + buffer = malloc( WIDTH * HEIGHT * 4 ); + + /* Bind the buffer to the context and make it current */ + OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, WIDTH, HEIGHT ); + + image = [ [ NXBitmapImageRep alloc] + initData: buffer + pixelsWide: WIDTH + pixelsHigh: HEIGHT + bitsPerSample: 8 + samplesPerPixel: 4 + hasAlpha: YES + isPlanar: NO + colorSpace: 2 + bytesPerRow: WIDTH*4 + bitsPerPixel: 32]; + + NXSetRect(&GR,100,100,WIDTH,HEIGHT); + + myWindow = [ [ Window alloc] + initContent: &GR + style: NX_TITLEDSTYLE + backing: NX_BUFFERED + buttonMask: NX_MINIATURIZEBUTTONMASK + defer: NO]; + + sprintf(name, "OpenGL Graphic Rectangle %d", getpid()); + + myView = [ [ View alloc] initFrame:&GR]; + [myView setOpaque: NO]; + [myView setDrawOrigin: -WIDTH: -HEIGHT]; + [myView rotate: 180.0]; + + myMenu = [ [ Menu alloc] initTitle: "NeXT-Mesa"]; + [myMenu addItem: "Quit" action: @selector(terminate:) keyEquivalent: 'q']; + [myMenu sizeToFit]; + + [myWindow setTitle: name]; + [myWindow display]; + [myWindow setContentView: myView]; + [myWindow makeKeyAndOrderFront: nil]; + + [NXApp setMainMenu: myMenu]; + + [myView lockFocus]; + + /* here is the Mesa call */ + render_image(); + + [image draw]; + [image free]; + + [myWindow flushWindow]; + [myView unlockFocus]; + + /* free the image buffer */ + free( buffer ); + + /* destroy the context */ + OSMesaDestroyContext( ctx ); + + [NXApp run]; + [NXApp free]; + + return 0; + + } + + + diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/nurbs.c b/xc/extras/Mesa/OpenStep/Old_NeXT/nurbs.c new file mode 100644 index 000000000..14c8e3dc9 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/nurbs.c @@ -0,0 +1,192 @@ +/* + * (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. + */ +/* + * nurbs.c + * This program shows a NURBS (Non-uniform rational B-splines) + * surface, shaped like a heart. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +#define S_NUMPOINTS 13 +#define S_ORDER 3 +#define S_NUMKNOTS (S_NUMPOINTS + S_ORDER) +#define T_NUMPOINTS 3 +#define T_ORDER 3 +#define T_NUMKNOTS (T_NUMPOINTS + T_ORDER) +#define SQRT2 1.41421356237309504880 + +/* initialized local data */ + +GLfloat sknots[S_NUMKNOTS] = + {-1.0, -1.0, -1.0, 0.0, 1.0, 2.0, 3.0, 4.0, + 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 9.0, 9.0}; +GLfloat tknots[T_NUMKNOTS] = {1.0, 1.0, 1.0, 2.0, 2.0, 2.0}; + +GLfloat ctlpoints[S_NUMPOINTS][T_NUMPOINTS][4] = { +{ {4.,2.,2.,1.},{4.,1.6,2.5,1.},{4.,2.,3.0,1.} }, +{ {5.,4.,2.,1.},{5.,4.,2.5,1.},{5.,4.,3.0,1.} }, +{ {6.,5.,2.,1.},{6.,5.,2.5,1.},{6.,5.,3.0,1.} }, +{ {SQRT2*6.,SQRT2*6.,SQRT2*2.,SQRT2}, + {SQRT2*6.,SQRT2*6.,SQRT2*2.5,SQRT2}, + {SQRT2*6.,SQRT2*6.,SQRT2*3.0,SQRT2} }, +{ {5.2,6.7,2.,1.},{5.2,6.7,2.5,1.},{5.2,6.7,3.0,1.} }, +{ {SQRT2*4.,SQRT2*6.,SQRT2*2.,SQRT2}, + {SQRT2*4.,SQRT2*6.,SQRT2*2.5,SQRT2}, + {SQRT2*4.,SQRT2*6.,SQRT2*3.0,SQRT2} }, +{ {4.,5.2,2.,1.},{4.,4.6,2.5,1.},{4.,5.2,3.0,1.} }, +{ {SQRT2*4.,SQRT2*6.,SQRT2*2.,SQRT2}, + {SQRT2*4.,SQRT2*6.,SQRT2*2.5,SQRT2}, + {SQRT2*4.,SQRT2*6.,SQRT2*3.0,SQRT2} }, +{ {2.8,6.7,2.,1.},{2.8,6.7,2.5,1.},{2.8,6.7,3.0,1.} }, +{ {SQRT2*2.,SQRT2*6.,SQRT2*2.,SQRT2}, + {SQRT2*2.,SQRT2*6.,SQRT2*2.5,SQRT2}, + {SQRT2*2.,SQRT2*6.,SQRT2*3.0,SQRT2} }, +{ {2.,5.,2.,1.},{2.,5.,2.5,1.},{2.,5.,3.0,1.} }, +{ {3.,4.,2.,1.},{3.,4.,2.5,1.},{3.,4.,3.0,1.} }, +{ {4.,2.,2.,1.},{4.,1.6,2.5,1.},{4.,2.,3.0,1.} } +}; + +GLUnurbsObj *theNurb; + +/* Initialize material property, light source, lighting model, + * and depth buffer. + */ +void myinit(void) +{ + GLfloat mat_ambient[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_diffuse[] = { 1.0, 0.2, 1.0, 1.0 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_shininess[] = { 50.0 }; + + GLfloat light0_position[] = { 1.0, 0.1, 1.0, 0.0 }; + GLfloat light1_position[] = { -1.0, 0.1, 1.0, 0.0 }; + + GLfloat lmodel_ambient[] = { 0.3, 0.3, 0.3, 1.0 }; + + glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); + glLightfv(GL_LIGHT0, GL_POSITION, light0_position); + glLightfv(GL_LIGHT1, GL_POSITION, light1_position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_LIGHT1); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + glEnable(GL_AUTO_NORMAL); + + theNurb = gluNewNurbsRenderer(); + + gluNurbsProperty(theNurb, GLU_SAMPLING_TOLERANCE, 25.0); + gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + glTranslatef (4., 4.5, 2.5); + glRotatef (220.0, 1., 0., 0.); + glRotatef (115.0, 0., 1., 0.); + glTranslatef (-4., -4.5, -2.5); + + gluBeginSurface(theNurb); + gluNurbsSurface(theNurb, + S_NUMKNOTS, sknots, + T_NUMKNOTS, tknots, + 4 * T_NUMPOINTS, + 4, + &ctlpoints[0][0][0], + S_ORDER, T_ORDER, + GL_MAP2_VERTEX_4); + gluEndSurface(theNurb); + + glPopMatrix(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum(-2.0, 2.0, -2.0, 2.0, 0.8, 10.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + gluLookAt(7.0,4.5,4.0, 4.5,4.5,2.0, 6.0,-3.0,2.0); +} + +#ifdef OLD_CODE +/* Main Loop + * Open window with initial window size, title bar, + * RGBA display mode, and handle input events. + */ +int main(int argc, char** argv) +{ + auxInitDisplayMode (AUX_SINGLE | AUX_RGB | AUX_DEPTH); + auxInitPosition (0, 0, 500, 500); + auxInitWindow (argv[0]); + myinit(); + auxReshapeFunc (myReshape); + auxMainLoop(display); +} +#endif + +/* + * This is how we port nurbs.c to OpenStep. Forget the aux calls, + * simply call init(), then reshape() with the window size and finally + * display(). The two size integers are global to generic.m so that it + * knows how big to make the OpenStep window. + */ + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/sphere.c b/xc/extras/Mesa/OpenStep/Old_NeXT/sphere.c new file mode 100644 index 000000000..b545a2777 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/sphere.c @@ -0,0 +1,81 @@ +/* + * (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. + */ +/* + * sphere.c + * This program draws a wire frame sphere. It uses + * glTranslatef() as a viewing transformation. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +void display (void) +{ + glClear(GL_COLOR_BUFFER_BIT); + glColor3f (1.0, 1.0, 1.0); + glPushMatrix(); +/* glTranslatef() as viewing transformation */ + glTranslatef (0.0, 0.0, -5.0); + auxWireSphere(1.0); + glPopMatrix(); + glFlush(); +} + +void myinit (void) +{ + glShadeModel (GL_FLAT); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(60.0, (GLfloat) w/(GLfloat) h, 1.0, 20.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=400; +int gl_height=400; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/surface.c b/xc/extras/Mesa/OpenStep/Old_NeXT/surface.c new file mode 100644 index 000000000..5c9795178 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/surface.c @@ -0,0 +1,143 @@ +/* + * (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. + */ +/* + * surface.c + * This program draws a NURBS surface in the shape of a + * symmetrical hill. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +GLfloat ctlpoints[4][4][3]; + +GLUnurbsObj *theNurb; + +/* + * Initializes the control points of the surface to a small hill. + * The control points range from -3 to +3 in x, y, and z + */ +void init_surface(void) +{ + int u, v; + for (u = 0; u < 4; u++) { + for (v = 0; v < 4; v++) { + ctlpoints[u][v][0] = 2.0*((GLfloat)u - 1.5); + ctlpoints[u][v][1] = 2.0*((GLfloat)v - 1.5); + + if ( (u == 1 || u == 2) && (v == 1 || v == 2)) + ctlpoints[u][v][2] = 3.0; + else + ctlpoints[u][v][2] = -3.0; + } + } +} + +/* Initialize material property and depth buffer. + */ +void myinit(void) +{ + GLfloat mat_diffuse[] = { 0.7, 0.7, 0.7, 1.0 }; + GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat mat_shininess[] = { 100.0 }; + + glClearColor (0.0, 0.0, 0.0, 1.0); + glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); + glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + + init_surface(); + + theNurb = gluNewNurbsRenderer(); + gluNurbsProperty(theNurb, GLU_SAMPLING_TOLERANCE, 25.0); + gluNurbsProperty(theNurb, GLU_DISPLAY_MODE, GLU_FILL); +} + +void display(void) +{ + GLfloat knots[8] = {0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0}; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix(); + glRotatef(330.0, 1.,0.,0.); + glScalef (0.5, 0.5, 0.5); + + gluBeginSurface(theNurb); + gluNurbsSurface(theNurb, + 8, knots, + 8, knots, + 4 * 3, + 3, + &ctlpoints[0][0][0], + 4, 4, + GL_MAP2_VERTEX_3); + gluEndSurface(theNurb); + + glPopMatrix(); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective (45.0, (GLdouble)w/(GLdouble)h, 3.0, 8.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glTranslatef (0.0, 0.0, -5.0); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/tea.c b/xc/extras/Mesa/OpenStep/Old_NeXT/tea.c new file mode 100644 index 000000000..cb2a4164d --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/tea.c @@ -0,0 +1,135 @@ +/* + * (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. + */ +/* + * tea.c + * This program demonstrates two-sided lighting and compares + * it with one-sided lighting. Three teapots are drawn, with + * a clipping plane to expose the interior of the objects. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Initialize light source. + */ +void myinit(void) +{ + GLfloat light_ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat light_diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat light_specular[] = { 1.0, 1.0, 1.0, 1.0 }; +/* light_position is NOT default value */ + GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse); + glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular); + glLightfv(GL_LIGHT0, GL_POSITION, light_position); + + glFrontFace (GL_CW); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); +} + +void display(void) +{ + GLdouble eqn[4] = {1.0, 0.0, -1.0, 1.0}; + GLfloat two_side_on[] = { GL_TRUE }; + GLfloat two_side_off[] = { GL_FALSE }; + GLfloat mat_diffuse[] = { 0.8, 0.8, 0.8, 1.0 }; + GLfloat back_diffuse[] = { 0.8, 0.2, 0.8, 1.0 }; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glPushMatrix (); + glClipPlane (GL_CLIP_PLANE0, eqn); /* slice objects */ + glEnable (GL_CLIP_PLANE0); + + glPushMatrix (); + glTranslatef (0.0, 2.0, 0.0); + auxSolidTeapot(1.0); /* one-sided lighting */ + glPopMatrix (); + + /* two-sided lighting, but same material */ + glLightModeli (GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + glMaterialfv (GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse); + glPushMatrix (); + glTranslatef (0.0, 0.0, 0.0); + auxSolidTeapot(1.0); + glPopMatrix (); + + /* two-sided lighting, two different materials */ + glMaterialfv (GL_FRONT, GL_DIFFUSE, mat_diffuse); + glMaterialfv (GL_BACK, GL_DIFFUSE, back_diffuse); + glPushMatrix (); + glTranslatef (0.0, -2.0, 0.0); + auxSolidTeapot(1.0); + glPopMatrix (); + + glLightModeli (GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); + glDisable (GL_CLIP_PLANE0); + glPopMatrix (); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-4.0, 4.0, -4.0*(GLfloat)h/(GLfloat)w, + 4.0*(GLfloat)h/(GLfloat)w, -10.0, 10.0); + else + glOrtho (-4.0*(GLfloat)w/(GLfloat)h, + 4.0*(GLfloat)w/(GLfloat)h, -4.0, 4.0, -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=500; +int gl_height=500; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/teapots.c b/xc/extras/Mesa/OpenStep/Old_NeXT/teapots.c new file mode 100644 index 000000000..959531761 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/teapots.c @@ -0,0 +1,180 @@ +/* + * (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. + */ +/* + * teapots.c + * This program demonstrates lots of material properties. + * A single light source illuminates the objects. + */ +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +/* Initialize depth buffer, projection matrix, light source, + * and lighting model. Do not specify a material property here. + */ +void myinit(void) +{ + GLfloat ambient[] = { 0.0, 0.0, 0.0, 1.0 }; + GLfloat diffuse[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat specular[] = { 1.0, 1.0, 1.0, 1.0 }; + GLfloat position[] = { 0.0, 3.0, 3.0, 0.0 }; + + GLfloat lmodel_ambient[] = { 0.2, 0.2, 0.2, 1.0 }; + GLfloat local_view[] = { 0.0 }; + + glLightfv(GL_LIGHT0, GL_AMBIENT, ambient); + glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse); + glLightfv(GL_LIGHT0, GL_POSITION, position); + glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); + glLightModelfv(GL_LIGHT_MODEL_LOCAL_VIEWER, local_view); + + glFrontFace (GL_CW); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); +} + +/* Move object into position. Use 3rd through 12th parameters + * to specify the material property. Draw a teapot. + */ +void renderTeapot (GLfloat x, GLfloat y, + GLfloat ambr, GLfloat ambg, GLfloat ambb, + GLfloat difr, GLfloat difg, GLfloat difb, + GLfloat specr, GLfloat specg, GLfloat specb, GLfloat shine) +{ + float mat[4]; + + glPushMatrix(); + glTranslatef (x, y, 0.0); + mat[0] = ambr; mat[1] = ambg; mat[2] = ambb; mat[3] = 1.0; + glMaterialfv (GL_FRONT, GL_AMBIENT, mat); + mat[0] = difr; mat[1] = difg; mat[2] = difb; + glMaterialfv (GL_FRONT, GL_DIFFUSE, mat); + mat[0] = specr; mat[1] = specg; mat[2] = specb; + glMaterialfv (GL_FRONT, GL_SPECULAR, mat); + glMaterialf (GL_FRONT, GL_SHININESS, shine*128.0); + auxSolidTeapot(1.0); + glPopMatrix(); +} + +/* First column: emerald, jade, obsidian, pearl, ruby, turquoise + * 2nd column: brass, bronze, chrome, copper, gold, silver + * 3rd column: black, cyan, green, red, white, yellow plastic + * 4th column: black, cyan, green, red, white, yellow rubber + */ +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + renderTeapot (2.0, 17.0, 0.0215, 0.1745, 0.0215, + 0.07568, 0.61424, 0.07568, 0.633, 0.727811, 0.633, 0.6); + renderTeapot (2.0, 14.0, 0.135, 0.2225, 0.1575, + 0.54, 0.89, 0.63, 0.316228, 0.316228, 0.316228, 0.1); + renderTeapot (2.0, 11.0, 0.05375, 0.05, 0.06625, + 0.18275, 0.17, 0.22525, 0.332741, 0.328634, 0.346435, 0.3); + renderTeapot (2.0, 8.0, 0.25, 0.20725, 0.20725, + 1, 0.829, 0.829, 0.296648, 0.296648, 0.296648, 0.088); + renderTeapot (2.0, 5.0, 0.1745, 0.01175, 0.01175, + 0.61424, 0.04136, 0.04136, 0.727811, 0.626959, 0.626959, 0.6); + renderTeapot (2.0, 2.0, 0.1, 0.18725, 0.1745, + 0.396, 0.74151, 0.69102, 0.297254, 0.30829, 0.306678, 0.1); + renderTeapot (6.0, 17.0, 0.329412, 0.223529, 0.027451, + 0.780392, 0.568627, 0.113725, 0.992157, 0.941176, 0.807843, + 0.21794872); + renderTeapot (6.0, 14.0, 0.2125, 0.1275, 0.054, + 0.714, 0.4284, 0.18144, 0.393548, 0.271906, 0.166721, 0.2); + renderTeapot (6.0, 11.0, 0.25, 0.25, 0.25, + 0.4, 0.4, 0.4, 0.774597, 0.774597, 0.774597, 0.6); + renderTeapot (6.0, 8.0, 0.19125, 0.0735, 0.0225, + 0.7038, 0.27048, 0.0828, 0.256777, 0.137622, 0.086014, 0.1); + renderTeapot (6.0, 5.0, 0.24725, 0.1995, 0.0745, + 0.75164, 0.60648, 0.22648, 0.628281, 0.555802, 0.366065, 0.4); + renderTeapot (6.0, 2.0, 0.19225, 0.19225, 0.19225, + 0.50754, 0.50754, 0.50754, 0.508273, 0.508273, 0.508273, 0.4); + renderTeapot (10.0, 17.0, 0.0, 0.0, 0.0, 0.01, 0.01, 0.01, + 0.50, 0.50, 0.50, .25); + renderTeapot (10.0, 14.0, 0.0, 0.1, 0.06, 0.0, 0.50980392, 0.50980392, + 0.50196078, 0.50196078, 0.50196078, .25); + renderTeapot (10.0, 11.0, 0.0, 0.0, 0.0, + 0.1, 0.35, 0.1, 0.45, 0.55, 0.45, .25); + renderTeapot (10.0, 8.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, + 0.7, 0.6, 0.6, .25); + renderTeapot (10.0, 5.0, 0.0, 0.0, 0.0, 0.55, 0.55, 0.55, + 0.70, 0.70, 0.70, .25); + renderTeapot (10.0, 2.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, + 0.60, 0.60, 0.50, .25); + renderTeapot (14.0, 17.0, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, + 0.4, 0.4, 0.4, .078125); + renderTeapot (14.0, 14.0, 0.0, 0.05, 0.05, 0.4, 0.5, 0.5, + 0.04, 0.7, 0.7, .078125); + renderTeapot (14.0, 11.0, 0.0, 0.05, 0.0, 0.4, 0.5, 0.4, + 0.04, 0.7, 0.04, .078125); + renderTeapot (14.0, 8.0, 0.05, 0.0, 0.0, 0.5, 0.4, 0.4, + 0.7, 0.04, 0.04, .078125); + renderTeapot (14.0, 5.0, 0.05, 0.05, 0.05, 0.5, 0.5, 0.5, + 0.7, 0.7, 0.7, .078125); + renderTeapot (14.0, 2.0, 0.05, 0.05, 0.0, 0.5, 0.5, 0.4, + 0.7, 0.7, 0.04, .078125); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (0.0, 16.0, 0.0, 16.0*(GLfloat)h/(GLfloat)w, + -10.0, 10.0); + else + glOrtho (0.0, 16.0*(GLfloat)w/(GLfloat)h, 0.0, 16.0, + -10.0, 10.0); + glMatrixMode(GL_MODELVIEW); +} + +int gl_width=500; +int gl_height=600; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/texgen.c b/xc/extras/Mesa/OpenStep/Old_NeXT/texgen.c new file mode 100644 index 000000000..93b5aaa54 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/texgen.c @@ -0,0 +1,129 @@ +/* + * (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. + */ +/* texgen.c + * This program draws a texture mapped teapot with + * automatically generated texture coordinates. The + * texture is rendered as stripes on the teapot. + */ + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" + +#define stripeImageWidth 32 +GLubyte stripeImage[3*stripeImageWidth]; + +void makeStripeImage(void) +{ + int j; + + for (j = 0; j < stripeImageWidth; j++) { + stripeImage[3*j] = (j<=4) ? 255 : 0; + stripeImage[3*j+1] = (j>4) ? 255 : 0; + stripeImage[3*j+2] = 0; + } +} + +/* glTexGen stuff: */ + +GLfloat sgenparams[] = {1.0, 1.0, 1.0, 0.0}; + +void myinit(void) +{ + glClearColor (0.0, 0.0, 0.0, 0.0); + + makeStripeImage(); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexImage1D(GL_TEXTURE_1D, 0, 3, stripeImageWidth, 0, + GL_RGB, GL_UNSIGNED_BYTE, stripeImage); + + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); + glTexGenfv(GL_S, GL_OBJECT_PLANE, sgenparams); + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + glEnable(GL_TEXTURE_GEN_S); + glEnable(GL_TEXTURE_1D); + glEnable(GL_CULL_FACE); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + glEnable(GL_AUTO_NORMAL); + glEnable(GL_NORMALIZE); + glFrontFace(GL_CW); + glCullFace(GL_BACK); + glMaterialf (GL_FRONT, GL_SHININESS, 64.0); +} + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glPushMatrix (); + glRotatef(45.0, 0.0, 0.0, 1.0); + auxSolidTeapot(2.0); + glPopMatrix (); + glFlush(); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho (-3.5, 3.5, -3.5*(GLfloat)h/(GLfloat)w, + 3.5*(GLfloat)h/(GLfloat)w, -3.5, 3.5); + else + glOrtho (-3.5*(GLfloat)w/(GLfloat)h, + 3.5*(GLfloat)w/(GLfloat)h, -3.5, 3.5, -3.5, 3.5); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); +} + +int gl_width=200; +int gl_height=200; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/OpenStep/Old_NeXT/texturesurf.c b/xc/extras/Mesa/OpenStep/Old_NeXT/texturesurf.c new file mode 100644 index 000000000..a8995d8f1 --- /dev/null +++ b/xc/extras/Mesa/OpenStep/Old_NeXT/texturesurf.c @@ -0,0 +1,138 @@ +/* + * (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. + */ +/* texturesurf.c + * This program uses evaluators to generate a curved + * surface and automatically generated texture coordinates. + */ + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdlib.h> +#include "glaux.h" +#include <math.h> + +GLfloat ctrlpoints[4][4][3] = { + {{ -1.5, -1.5, 4.0}, { -0.5, -1.5, 2.0}, + {0.5, -1.5, -1.0}, {1.5, -1.5, 2.0}}, + {{ -1.5, -0.5, 1.0}, { -0.5, -0.5, 3.0}, + {0.5, -0.5, 0.0}, {1.5, -0.5, -1.0}}, + {{ -1.5, 0.5, 4.0}, { -0.5, 0.5, 0.0}, + {0.5, 0.5, 3.0}, {1.5, 0.5, 4.0}}, + {{ -1.5, 1.5, -2.0}, { -0.5, 1.5, -2.0}, + {0.5, 1.5, 0.0}, {1.5, 1.5, -1.0}} +}; + +GLfloat texpts[2][2][2] = {{{0.0, 0.0}, {0.0, 1.0}}, + {{1.0, 0.0}, {1.0, 1.0}}}; + +void display(void) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glColor3f(1.0, 1.0, 1.0); + glEvalMesh2(GL_FILL, 0, 20, 0, 20); + glFlush(); +} + +#define imageWidth 64 +#define imageHeight 64 +GLubyte image[3*imageWidth*imageHeight]; + +void makeImage(void) +{ + int i, j; + float ti, tj; + + for (i = 0; i < imageWidth; i++) { + ti = 2.0*3.14159265*i/imageWidth; + for (j = 0; j < imageHeight; j++) { + tj = 2.0*3.14159265*j/imageHeight; + + image[3*(imageHeight*i+j)] = (GLubyte) 127*(1.0+sin(ti)); + image[3*(imageHeight*i+j)+1] = (GLubyte) 127*(1.0+cos(2*tj)); + image[3*(imageHeight*i+j)+2] = (GLubyte) 127*(1.0+cos(ti+tj)); + } + } +} + +void myinit(void) +{ + glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, + 0, 1, 12, 4, &ctrlpoints[0][0][0]); + glMap2f(GL_MAP2_TEXTURE_COORD_2, 0, 1, 2, 2, + 0, 1, 4, 2, &texpts[0][0][0]); + glEnable(GL_MAP2_TEXTURE_COORD_2); + glEnable(GL_MAP2_VERTEX_3); + glMapGrid2f(20, 0.0, 1.0, 20, 0.0, 1.0); + makeImage(); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexImage2D(GL_TEXTURE_2D, 0, 3, imageWidth, imageHeight, 0, + GL_RGB, GL_UNSIGNED_BYTE, image); + glEnable(GL_TEXTURE_2D); + glEnable(GL_DEPTH_TEST); + glEnable(GL_NORMALIZE); + glShadeModel (GL_FLAT); +} + +void myReshape(int w, int h) +{ + glViewport(0, 0, w, h); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + if (w <= h) + glOrtho(-4.0, 4.0, -4.0*(GLfloat)h/(GLfloat)w, + 4.0*(GLfloat)h/(GLfloat)w, -4.0, 4.0); + else + glOrtho(-4.0*(GLfloat)w/(GLfloat)h, + 4.0*(GLfloat)w/(GLfloat)h, -4.0, 4.0, -4.0, 4.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + glRotatef(85.0, 1.0, 1.0, 1.0); +} + +int gl_width=300; +int gl_height=300; + +void render_image(void) +{ + myinit(); + myReshape(gl_width,gl_height); + display(); +} diff --git a/xc/extras/Mesa/STARTUP.MK b/xc/extras/Mesa/STARTUP.MK new file mode 100644 index 000000000..fd51b0578 --- /dev/null +++ b/xc/extras/Mesa/STARTUP.MK @@ -0,0 +1,230 @@ +# MSDOS DMAKE startup file. Customize to suit your needs.
+# Assumes MKS toolkit for the tool commands, and Zortech C. Change as req'd.
+# See the documentation for a description of internally defined macro#
+# Disable warnings for macros redefined here that were given
+# on the command line.
+__.SILENT := $(.SILENT)
+.SILENT := yes
+
+# Configuration parameters for DMAKE startup.mk file
+# Set these to NON-NULL if you wish to turn the parameter on.
+_HAVE_RCS := yes # yes => RCS is installed.
+_HAVE_SCCS := # yes => SCCS is installed.
+
+# Applicable suffix definitions
+A := .lib # Libraries
+E := .exe # Executables
+F := .for # Fortran
+O := .obj # Objects
+P := .pas # Pascal
+S := .asm # Assembler sources
+V := # RCS suffix
+
+# See if these are defined
+TMPDIR := $(ROOTDIR)/tmp
+.IMPORT .IGNORE : TMPDIR SHELL COMSPEC
+
+# Recipe execution configurations
+# First set SHELL, If it is not defined, use COMSPEC, otherwise
+# it is assumed to be MKS Korn SHELL.
+.IF $(SHELL) == $(NULL)
+.IF $(COMSPEC) == $(NULL)
+ SHELL := $(ROOTDIR)/bin/sh$E
+.ELSE
+ SHELL := $(COMSPEC)
+.END
+.END
+GROUPSHELL := $(SHELL)
+
+# Now set remaining arguments depending on which SHELL we
+# are going to use. COMSPEC (assumed to be command.com) or
+# MKS Korn Shell.
+.IF $(SHELL)==$(COMSPEC)
+ SHELLFLAGS := $(SWITCHAR)c
+ GROUPFLAGS := $(SHELLFLAGS)
+ SHELLMETAS := *"?<>
+ GROUPSUFFIX := .bat
+ DIRSEPSTR := \\
+ DIVFILE = $(TMPFILE:s,/,\)
+.ELSE
+ SHELLFLAGS := -c
+ GROUPFLAGS :=
+ SHELLMETAS := *"?<>|()&][$$\#`'
+ GROUPSUFFIX := .ksh
+ .MKSARGS := yes
+ DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}})
+ DIVSEP_shell_yes := \\\
+ DIVSEP_shell_no := \\
+.END
+
+# Standard C-language command names and flags
+ CC := wcl386 # C-compiler and flags
+ CFLAGS +=
+
+ AS := tasm31 # Assembler and flags
+ ASFLAGS +=
+
+ LD = wlink # Loader and flags
+ LDFLAGS +=
+ LDLIBS =
+
+# Definition of $(MAKE) macro for recursive makes.
+ MAKE = $(MAKECMD) $(MFLAGS)
+
+# Language and Parser generation Tools and their flags
+ YACC := yacc # standard yacc
+ YFLAGS +=
+ YTAB := ytab # yacc output files name stem.
+
+ LEX := lex # standard lex
+ LFLAGS +=
+ LEXYY := lex_yy # lex output file
+
+# Other Compilers, Tools and their flags
+ PC := any_pc # pascal compiler
+ RC := anyf77 # ratfor compiler
+ FC := anyf77 # fortran compiler
+
+ CO := co # check out for RCS
+ COFLAGS += -q
+
+ AR := ar # archiver
+ ARFLAGS+= ruv
+
+ RM := del # remove a file command
+ RMFLAGS +=
+
+# Implicit generation rules for making inferences.
+# We don't provide .yr or .ye rules here. They're obsolete.
+# Rules for making *$O
+ %$O : %.c ; $(CC) $(CFLAGS) -c $<
+ %$O : %.cpp ; $(CC) $(CFLAGS) -c $<
+ %$O : %$P ; $(PC) $(PFLAGS) -c $<
+ %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\);
+ %$O : %.cl ; class -c $<
+ %$O : %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
+
+# Executables
+ %$E : %$O ; $(CC) @$(mktmp,a.lnk $(LDFLAGS) $< $(LDLIBS))
+
+# lex and yacc rules
+ %.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@
+ %.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
+
+# RCS support
+.IF $(_HAVE_RCS)
+ % : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V;- $(CO) $(COFLAGS) $@
+ .NOINFER : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V
+.END
+
+# SCCS support
+.IF $(_HAVE_SCCS)
+ % : s.% ; get $<
+ .NOINFER : s.%
+.END
+
+# Recipe to make archive files.
+%$A :
+[
+ $(AR) $(ARFLAGS) $@ $?
+ $(RM) $(RMFLAGS) $?
+]
+
+# DMAKE uses this recipe to remove intermediate targets
+.REMOVE :; $(RM) $<
+
+# AUGMAKE extensions for SYSV compatibility
+@B = $(@:b)
+@D = $(@:d)
+@F = $(@:f)
+"*B" = $(*:b)
+"*D" = $(*:d)
+"*F" = $(*:f)
+<B = $(<:b)
+<D = $(<:d)
+<F = $(<:f)
+#?B = $(?:b)
+#?F = $(?:f)
+#?D = $(?:d)
+
+# watcom dir
+WINC =C:\watcom\h\
+
+# Turn warnings back to previous setting.
+.SILENT := $(__.SILENT)
+
+# Local init file if any, gets parsed before user makefile
+.INCLUDE .IGNORE: "_startup.mk"
+
+# this is my stuff
+# what the various flags do
+# fp5 - floating point inlined for pentium
+# 5r - pentium register passing
+# s - remove stack check
+# mf - flat memory model
+# zq - operate quietly
+# wx - all warnings on
+# d1 - simple debug info, shouldn`t affect code
+# d1+ - as above, but with unused names
+# 5s - pentium stack passing
+# zp4 - pack structures to 4 bytes
+# hc - do codeview style debug info
+# oneatx - watcom recommended optimizations for pentium (see below)
+# ee ep - add epilogue, prolog hooks for profiler
+# et - add rdtsc style profiler hooks
+
+# /o optimizations
+# t -
+# e -
+# x -
+# e -
+# a -
+# n -
+# i -
+# l -
+# r -
+# + -
+
+#CFLAGS = /oanrlt /fp5 /5r /s /mf /zq /wx
+#CFLAGS = /oanrlt /d2 /fp5 /5r /mf /zq /wx
+#CFLAGS = /oanrlt /fp5 /5r /mf /zq /wx
+#CFLAGS = /d2 /fp5 /5s /mf /zq /wx
+
+# watcom pentium rec.
+#CFLAGS = /oneatx /zp4 /5r /fp5 /s /mf /wx
+#CFLAGS = /oneatx /zp4 /5r /fp5 /s /mf /wx
+
+# for debugging pentium stuff
+#CFLAGS = /d3 /zp4 /5r /fp5 /mf /wx
+
+# for vtune
+#CFLAGS = /hc /d2 /zp4 /5 /fp5 /s /mf /wx /oneatx
+
+# 486
+#CFLAGS = /oneatx /zp4 /4 /fp3 /s /mf /wx
+
+# 386
+#CFLAGS = /oneatx /zp4 /3 /fp3 /s /mf /wx
+
+# super inlining
+#CFLAGS = /d1 /otiexanl+ /fp5 /5r /s /mf /zq /wx
+
+# for mesa
+CFLAGS = /d2 /5r /fp5 /wx /DDEBUG
+#CFLAGS = /otexan /zp4 /mf /5r /fp5 /wx /d1+
+
+PROFILE = /ee /ep
+#CFLAGS += $(PROFILE)
+
+PPROF = /et
+#CFLAGS += $(PPROF)
+
+# 3dfx
+#CFLAGS += /DGLIDE_HARDWARE
+
+#CFLAGS += /D_PC_=1
+#CFLAGS += /D_586_ /D__586__
+
+ASMFLAGS = /ml /m5 /zi /p /r /t /z /w2 /kh10000 /i$(@:d)
+
+.IMPORT : WATCOM
diff --git a/xc/extras/Mesa/WIN32/NMAKE.MAK b/xc/extras/Mesa/WIN32/NMAKE.MAK new file mode 100644 index 000000000..a9a262663 --- /dev/null +++ b/xc/extras/Mesa/WIN32/NMAKE.MAK @@ -0,0 +1,662 @@ +.SILENT: + +!INCLUDE <..\mesawin32.mak> # get user directory settings for output + +help: + more < << +usage: nmake[.exe] /f nmake.mak [options] [target] +where: [target] may be any one of the following ... + (default)... shows this text + libfiles.... builds all library variations and test programs + update...... builds all variations and copies target files + to permanent storage locations + clean....... deletes all intermediate files + realclean .. deletes all intermediate files and all end-executables, + restoring directory heirarchy to 'distribution' state. + all ........ builds all targets for Mesa-based code + all.sgigl .. builds all targets for SGI for Windows OpenGL based code + all.sysgl .. builds all targets for Microsoft OpenGL based code + ---- build options ----------------- + MESAVER ................. (3.1) - version of MesaLib().tar.gz to build + NOCONSOLE .... [1 | 0] .. (0) ..- Disable console output of progs + NODEBUG ...... [1 | 0] .. (0) ..- Disable building of Debug images + NORELEASE .... [1 | 0] .. (0) ..- Disable building of Release images + USE_CTRDLL ... [1 | 0] .. (0) ..- Enable use of MSVCRT.DLL for CRTL in + USE_SYSGL .... [1 | 0 | 2](0) ..- Enable use of System OpenGL/GLU for + GLUT and Demo builds. When set to '2' it will link + against SGI OpenGL for Windows instead of Microsoft + OopenGL. + USE_ICC ...... [1 | 0] .. (0) ..- *experimental* - Use Intel C/C++ compiler + instead of Microsft compiler, works for both VC4 & VC5. + Requires prior installation of the Intel C/C++ compiler. + GD_NO_PROGS .. [1 | 0] .. (0) ..- Disable diff generation for MesaDemos. + preference to statically linking in the CRTL. Makes for + smaller files *but* requires MSVCRT.DLL at runtime. + STATIC_MESA .. [1 | 0] .. (0) ..- Meaningful only when building executables. + Indicates to the nmake.mak that exe files should be linked with + static link libs (mesa|mesaglu|mesaglut).lib instead of the default + DLL import libs. This directive trickes down into a compiler macro + definition which itself directs the mesa "gl.h" file to redefine + APIENTRY, CALLBACK, and WINGDIAPI. + ALLWARNINGS .. [1 | 0] .. (1) ..- Enable all compiler warnings. + + GLIDE2SDK ...................... - required to be defined as the path + where your Glide 2 SDK is installed. There is no default, + however you may provide it as an environment variable by + doing something like this prior to executing nmake: + + set GLIDE2SDK=C:\Glide2x + + USENASM ........................ - required to be defined as the command + required to execute NASM for assembly of .S modules in + .\src\X86. This will require the complete path if nasm + is not in your command search path. + + + ---- special targets --------------- + libfiles ........................ all *.lib and *.dll files + tests ..........(req libfiles)... all test executables + progs ..........(req libfiles)... all demonstration executables + progs.samples / progs.demos / + progs.book / progs.3dfx.demos ... individual demo program group builds + gendiffs ........................ generates complete diffs between + original distribution and locally modified source files. + gendiffs.clr .................... cleans up behind gendiffs target. + + progs.sysgl ..................... builds all demo programs linking + against GLUT32.DLL and Microsoft + OpenGL link libraries for using + Windows system OpenGL support. + + progs.sgigl ..................... builds all demos programs as progs.sysgl + however it links against GLUT.DLL built + against the SGI OpenGL for Windows. + + ---- convenience targets ----------- + allstatic ....................... builds all "standard" static lib files. + alldynamic ...................... builds all "standard" dynamic lib files, + excluding hardware accelerator versions. + allaccel ........................ builds all hardware accelerated versions. + allfx ........................... builds all 3Dfx targeted code. + alls3 ........................... builds all S3 S3DTK targeted code. + + ---- individual targets ------------ + mesa, mesaglu, mesaglut ......... static lib builds of respective code. + + mesa32 .......................... dynamic lib build of Mesa core + + fxmesa32 ........................ dynamic lib build for use on top of + 3Dfx Glide runtime (for use with + 3Dfx Voodoo based display hardware). + + s3mesa32 ........................ dynamic lib build for use on top of + S3 'S3Tk' runtime (for use with + S3 Virge based display hardware). + + glu32 ........................... dynamic lib build of GLU routines + + glut32 .......................... dynamic lib build of GLUT routines + + glut.sysgl ...................... alias lib build of glut32 using system + OpenGL/GLU routines. + + glut.sysgl.install .............. installs generated GLUT and GLUT.H into + directores specified at end of this + help screen. + + glut.sgigl ...................... alias lib build of glut32 using SGI + OopenGL for Windows GL/GLU routines + + glut.sgigl.install .............. installs generated GLUT and GLUT.H into + directores specified at end of this + help screen. + + + ---- makefile Author notes ------------------ + Mesa originated as a project of and is currently maintained by Brian Paul + (brianp@elastic.avid.com). Please look the the "canonical" internet sites + for detailed information and source distributions, either at: + + http://www.ssec.wisc.edu/~brianp/Mesa.html + + <or> + + ftp://iris.ssec.wisc.edu/pub/Mesa + + This makefile suite built against MS Visual C++ 5.0 SP3 and tested on + WindowsNT 4.0 SP3, WindowsNT 5.0b1, Windows95 OSR 2.0, and Windows98. + + ---- output directories as configured ------- + + Linking Libs . : $(LIBINSTALL) + Runtime Libs . : $(DLLINSTALL) + Header Files . : $(HDRINSTALL) + +<< + +# ----- Default / primary configuration stuff --------------------------------- + +# Makefile elections, may be selected by command line but here are the defaults +# +# MESAVER - Mesa version +# NOCONSOLE - when 1, builds executables for Windowed runtime +# + +!IF "$(NOCONSOLE)" == "" +NOCONSOLE=0 +!ENDIF + +!IF "$(NOCONSOLE)" == "1" +DOGUI=1 +!ELSE +DOGUI=0 +!ENDIF + +# used in building all of the resource files for the Mesa DLLs +# +!IF "$(MESAVER)" == "" +MESAVER=3.1 +!ENDIF + +# used in building all of the resource files for the Mesa DLLs +# +!IF "$(MESAFILEVER)" == "" +MESAFILEVER=3,1,0,0 +!ENDIF + +# Set to 1 to enable building against MSVCRT.DLL instead of LIBC.LIB +# +!IF "$(USE_CRTDLL)" == "" +USE_CRTDLL=0 +!ENDIF + +!IF "$(GD_NO_PROGS)" == "" +GD_NO_PROGS=0 +!ENDIF + +!IF "$(USE_SYSGL)" == "" +USE_SYSGL=0 +!ENDIF + +#--------------------------------------------------------------------- +# shouldn't need to play beyond here ... +#--------------------------------------------------------------------- + +!IF "$(LIBBASE)" == "" +LIBBASE=mesa +!ENDIF + +!IF "$(DLLBASE)" == "" +DLLBASE=$(LIBBASE) +!ENDIF + +!IF "$(EXEFSERIES_UP)" == "" +EXEFSERIES_UP=1 +!ENDIF + +!IF "$(EXEFILE)" == "" +EXEFILE=- +!ENDIF + +!IF "$(ALLWARNINGS)" == "" +ALLWARNINGS=1 +!ENDIF + +!IF "$(STATIC_MESA)" == "" +STATIC_MESA=0 +!ENDIF + +!IF "$(DEBUG)" == "" +DEBUG=0 +!ENDIF + +!IF "$(NODEBUG)" == "" +!IF "$(DEBUG)" == "1" +NODEBUG=0 +!ELSE +NODEBUG=1 +!ENDIF +!ENDIF + +!IF "$(NORELEASE)" == "" +!IF "$(DEBUG)" == "1" +NORELEASE=1 +!ELSE +NORELEASE=0 +!ENDIF +!ENDIF + +!IF (("$(DEBUG)" == "1") && ("$(USE_CRTDLL)" == "1")) +LIBTYPE=d-d +NORELEASE=1 +NOSTATIC=1 +!ELSEIF (("$(DEBUG)" == "1") && ("$(USE_CRTDLL)" == "0")) +LIBTYPE=d-s +NORELEASE=1 +NODYNAMIC=1 +!ELSEIF (("$(DEBUG)" == "0") && ("$(USE_CRTDLL)" == "1")) +LIBTYPE=r-d +NODEBUG=1 +NOSTATIC=1 +!ELSE +LIBTYPE=r-s +NODEBUG=1 +NODYNAMIC=1 +DEBUG=0 +!ENDIF + +# See nmake.mif file for documentations of these settings +NOPCH=1 +H_FILES= + +# Root source directory for primary Mesa lib files, check first that we are +# "in" the mesa source tree, then go extreme after that. + +!IF "$(MESAROOT)" == "" +!IF EXIST (..\include\gl\gl.h) +MESAROOT=.. +!ENDIF +!ENDIF + +!IF "$(DEBUG)" == "1" +DEBTAG=d +!ELSE +DEBTAG= +!ENDIF + +OBJDIR_R=.\$(MESAROOT)\lib +ALTLIBPATH=$(OBJDIR_R) + +# ----- Standard meta build rules --------------------------------------------- + +all: mesa mesaglu mesaglut\ + mesa32 glu32 glut32\ +!IF "$(GLIDE2SDK)" != "" + fxmesa32\ +!ENDIF + progs + +all.debug: + nmake /nologo /f nmake.mak DEBUG=1 all + +all.sysgl: glut.sysgl progs.sysgl + +all.sgigl: glut.sgigl progs.sgigl + +!IF EXIST(.\include\gl\glut.h) +CLEANSUPS = .\include +!ENDIF + +realclean: cleanprogs + echo. > ..\3dfx\demos\foo.dll + echo. > ..\book\foo.dll + echo. > ..\demos\foo.dll + echo. > ..\samples\foo.dll + echo. > ..\3dfx\demos\foo.pdb + echo. > ..\book\foo.pdb + echo. > ..\demos\foo.pdb + echo. > ..\samples\foo.pdb + del ..\3dfx\demos\*.dll + del ..\demos\*.dll + del ..\samples\*.dll + del ..\book\*.dll + del ..\3dfx\demos\*.pdb + del ..\demos\*.pdb + del ..\samples\*.pdb + del ..\book\*.pdb +!IF EXIST($(OBJDIR_R)) + nmake /nologo /f nmake.mak CLEANSUPS=$(OBJDIR_R) clean +!ELSE + nmake /nologo /f nmake.mak clean +!ENDIF + +clean: cleanroot + +cleanprogs: + echo Clearing DEBUG build files ... +!IF "$(GLIDE2SDK)" != "" + nmake /nologo /f nmake.mak DEBUG=1 EXEFILE=progs.3dfx.demos clrxfileseries +!ENDIF + nmake /nologo /f nmake.mak DEBUG=1 EXEFILE=progs.book clrxfileseries + nmake /nologo /f nmake.mak DEBUG=1 EXEFILE=progs.demos clrxfileseries + nmake /nologo /f nmake.mak DEBUG=1 EXEFILE=progs.samples clrxfileseries + echo Clearing RELEASE build files ... +!IF "$(GLIDE2SDK)" != "" + nmake /nologo /f nmake.mak DEBUG=0 EXEFILE=progs.3dfx.demos clrxfileseries +!ENDIF + nmake /nologo /f nmake.mak DEBUG=0 EXEFILE=progs.book clrxfileseries + nmake /nologo /f nmake.mak DEBUG=0 EXEFILE=progs.demos clrxfileseries + nmake /nologo /f nmake.mak DEBUG=0 EXEFILE=progs.samples clrxfileseries + +# ----- link libraries build rules -------------------------------------------- + +STATICLIBLIST=mesa.lib mesaglu.lib mesaglut.lib fxmesa.lib + +DYNAMICLIBLIST=mesa32.dll glu32.dll glut32.dll + +$(STATICLIBLIST) $(STATICLIBLIST:.lib= ): + nmake /nologo /f nmake.mak DIRECTORYNAME=$(MESAROOT)\lib directory + set STATIC_MESA=1 + set USE_CRTDLL=0 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* libupr + +$(DYNAMICLIBLIST) $(DYNAMICLIBLIST:.dll= ): + nmake /nologo /f nmake.mak DIRECTORYNAME=$(MESAROOT)\lib directory + set STATIC_MESA=0 + set USE_CRTDLL=1 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* dllupr + +glut.sysgl: + nmake /nologo /f nmake.mak USE_SYSGL=1 DEBUG=0 glut32 + +glut.sysgl.install: + nmake /nologo /f nmake.mak DIRECTORYNAME=$(HDRINSTALL)\GL directory + rem <<$(TEMP)\gsi.mak +.SILENT: + +# Linking Libs . : $(LIBINSTALL) +# Runtime Libs . : $(DLLINSTALL) +# Header Files . : $(HDRINSTALL)\GL + +install: $(LIBINSTALL)\GLUT32.LIB $(DLLINSTALL)\GLUT32.DLL\ + $(DLLINSTALL)\GLUT32.PDB $(HDRINSTALL)\GL\GLUT.H + +$(LIBINSTALL)\GLUT32.LIB: .\Release\GLUT32\GLUT32.LIB + echo $(LIBINSTALL)\GLUT32.LIB ... + copy .\Release\GLUT32\GLUT32.LIB $(LIBINSTALL)\GLUT32.LIB + +$(DLLINSTALL)\GLUT32.DLL: .\Release\GLUT32\GLUT32.DLL + echo $(LIBINSTALL)\GLUT32.DLL ... + copy .\Release\GLUT32\GLUT32.DLL $(DLLINSTALL)\GLUT32.DLL + +$(DLLINSTALL)\GLUT32.PDB: .\Release\GLUT32\GLUT32.PDB + echo $(LIBINSTALL)\GLUT32.PDB ... + copy .\Release\GLUT32\GLUT32.PDB $(DLLINSTALL)\GLUT32.PDB + +$(HDRINSTALL)\GL\GLUT.H: $(MESAROOT)\INCLUDE\GL\GLUT.H + echo $(HDRINSTALL)\GL\GLUT.H ... + copy $(MESAROOT)\INCLUDE\GL\GLUT.H $(HDRINSTALL)\GL\GLUT.H +<<KEEP + nmake /nologo /f $(TEMP)\gsi.mak install + +glut.sgigl: + nmake /nologo /f nmake.mak USE_SYSGL=2 DEBUG=1 glut32 + nmake /nologo /f nmake.mak USE_SYSGL=2 DEBUG=0 glut32 + +glut.sgigl.install: + nmake /nologo /f nmake.mak DIRECTORYNAME=$(HDRINSTALL)\GL directory + rem <<$(TEMP)\gsi.mak +.SILENT: + +# Linking Libs . : $(LIBINSTALL) +# Runtime Libs . : $(DLLINSTALL) +# Header Files . : $(HDRINSTALL)\GL + +install: $(LIBINSTALL)\GLUT.LIB $(LIBINSTALL)\GLUTd.LIB\ + $(DLLINSTALL)\GLUT.DLL $(DLLINSTALL)\GLUTd.DLL\ + $(DLLINSTALL)\GLUT.PDB $(DLLINSTALL)\GLUTd.PDB + +$(LIBINSTALL)\GLUT.LIB: .\Release\GLUT.LIB + echo $(LIBINSTALL)\GLUT.LIB ... + copy .\Release\GLUT.LIB $(LIBINSTALL)\GLUT.LIB + +$(LIBINSTALL)\GLUTd.LIB: .\Debug\GLUTd.LIB + echo $(LIBINSTALL)\GLUTd.LIB ... + copy .\Debug\GLUTd.LIB $(LIBINSTALL)\GLUTd.LIB + +$(DLLINSTALL)\GLUT.DLL: .\Release\GLUT.DLL + echo $(LIBINSTALL)\GLUT.DLL ... + copy .\Release\GLUT.DLL $(DLLINSTALL)\GLUT.DLL + +$(DLLINSTALL)\GLUTd.DLL: .\Debug\GLUTd.DLL + echo $(DLLINSTALL)\GLUTd.DLL ... + copy .\Debug\GLUTd.DLL $(DLLINSTALL)\GLUTd.DLL + +$(DLLINSTALL)\GLUT.PDB: .\Release\GLUT.PDB + echo $(LIBINSTALL)\GLUT.PDB ... + copy .\Release\GLUT.PDB $(DLLINSTALL)\GLUT.PDB + +$(DLLINSTALL)\GLUTd.PDB: .\Debug\GLUTd.PDB + echo $(DLLINSTALL)\GLUTd.PDB ... + copy .\Debug\GLUTd.PDB $(DLLINSTALL)\GLUTd.PDB + +$(HDRINSTALL)\GL\GLUT.H: $(MESAROOT)\INCLUDE\GL\GLUT.H + echo $(HDRINSTALL)\GL\GLUT.H ... + copy $(MESAROOT)\INCLUDE\GL\GLUT.H $(HDRINSTALL)\GL\GLUT.H +<<KEEP + nmake /nologo /f $(TEMP)\gsi.mak install + +update: headers $(STATICLIBLIST:.lib=.up) $(DYNAMICLIBLIST:.dll=.up) + +$(STATICLIBLIST:.lib=.up): + nmake /nologo /f nmake.mak DIRECTORYNAME=$(MESAROOT)\lib directory + set STATIC_MESA=1 + set USE_CRTDLL=0 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* libup + +$(STATICLIBLIST:.lib=.db): + nmake /nologo /f nmake.mak DIRECTORYNAME=$(MESAROOT)\lib directory + set NORELEASE=1 + set STATIC_MESA=1 + set USE_CRTDLL=0 + set DEBUG=1 + nmake /nologo /f nmake.mak $*.lib + +$(DYNAMICLIBLIST:.dll=.up): + nmake /nologo /f nmake.mak DIRECTORYNAME=$(MESAROOT)\lib directory + set STATIC_MESA=0 + set USE_CRTDLL=1 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* dllup + +$(DYNAMICLIBLIST:.dll=.db): + nmake /nologo /f nmake.mak DIRECTORYNAME=$(MESAROOT)\lib directory + set NORELEASE=1 + set STATIC_MESA=0 + set USE_CRTDLL=1 + set DEBUG=1 + nmake /nologo /f nmake.mak $*.dll + +$(DYNAMICLIBLIST:.dll=.status): + set STATIC_MESA=0 + set USE_CRTDLL=1 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* status + +$(STATICLIBLIST:.lib=.status): + set STATIC_MESA=1 + set USE_CRTDLL=0 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* status + +$(DYNAMICLIBLIST:.dll=.resources): + set STATIC_MESA=0 + set DEBUG=$(DEBUG) + set USE_CRTDLL=1 + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* resources + +libfiles: $(STATICLIBLIST:.lib= ) $(DYNAMICLIBLIST:.dll= ) + +allstatic: mesa mesaglu mesaglut + set STATIC_MESA=1 + set USE_CRTDLL=0 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak progs.book progs.samples progs.demos + +alldynamic: mesa32 glu32 glut32 + set STATIC_MESA=0 + set USE_CRTDLL=0 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak progs.book progs.samples progs.demos + +allaccel: allfx alls3 + +allfx: fxmesa32 glu32 glut32 + set STATIC_MESA=0 + set USE_CRTDLL=0 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak progs.3dfx.demos + +alls3: s3msagl32 + +fxmesa32: + nmake /nologo /f nmake.mak DIRECTORYNAME=$(MESAROOT)\lib\FX directory + set STATIC_MESA=0 + set USE_CRTDLL=1 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* dllupr + +s3mesa32: + nmake /nologo /f nmake.mak DIRECTORYNAME=$(MESAROOT)\lib\S3 directory + set STATIC_MESA=0 + set USE_CRTDLL=1 + set DEBUG=$(DEBUG) + nmake /nologo /f nmake.mak EXEFILE=- LIBBASE=$* dllupr + +# ----- convenient aliases ---------------------------------------------------- + +opengl: mesa32 + +glu: glu32 + +glut: glut32 + +s3mesa: s3mesa32 + +# ----- test/demo program build ruiles ---------------------------------------- +# NOTE: These require previous builds of the mesa libs, et. al., but are not +# made dependent upon their presence to facilitate SPEED of nmake processing. + +PROGSLIST = progs.book.p progs.demos.p progs.samples.p +PROGSLISTGL = $(PROGSLIST:.p=.sysgl) +PROGSLISTGL2 = $(PROGSLIST:.p=.sgigl) +!IF "$(GLIDE2SDK)" != "" +PROGSLISTST = $(PROGSLIST:.p=.status) progs.3dfx.demos.status +PROGSLISTM = $(PROGSLIST:.p= ) progs.3dfx.demos +!ELSE +PROGSLISTST = $(PROGSLIST:.p=.status) +PROGSLISTM = $(PROGSLIST:.p= ) +!ENDIF + +progs: $(PROGSLISTM) + +progs.sysgl: $(PROGSLISTGL) + +progs.sgigl: $(PROGSLISTGL2) + +$(PROGSLISTM): + set STATIC_MESA=$(STATIC_MESA) + set DEBUG=$(DEBUG) + set USE_CRTDLL=1 + nmake /nologo /f nmake.mak EXEFILE=$@ exefileseries libcopy + +$(PROGSLISTST): + set STATIC_MESA=$(STATIC_MESA) + set DEBUG=$(DEBUG) + set USE_CRTDLL=1 + nmake /nologo /f nmake.mak EXEFILE=$@ status + +$(PROGSLISTGL): + set USE_SYSGL=1 + nmake /nologo /f nmake.mak $* + +$(PROGSLISTGL2): + set USE_SYSGL=2 + nmake /nologo /f nmake.mak $* + +# ----- program/lib specific options ------------------------------------------ + +include\gl\glut.h: ..\include\gl\glut.h + echo include\GL\glut.h ... + nmake /nologo /f nmake.mak DIRECTORYNAME=include\GL directory + copy ..\include\GL\glut.h include\GL\glut.h + +CPPOPTS=/D__MSC__ /D__WIN32__ /DWIN32 /DWINDOWS_NT /D__i386__\ + /DNO_PARALLEL /DNO_STEREO + +!IF "$(STATIC_MESA)" == "1" +CPPOPTS=/D_STATIC_MESA $(CPPOPTS) +!ENDIF + +!IF "$(ALLWARNINGS)" != "1" +CPPOPTS=$(CPPOPTS) /DMESA_MINWARN +!ENDIF + +# ----------------------------------------------------------------------------- +!IF "$(EXEFILE)" == "-" # building a lib of some form ... +# ----------------------------------------------------------------------------- + +!IF ("$(DLLBASE)" != "glut32") +CPPOPTS=$(CPPOPTS) /I$(MESAROOT)\include +!ENDIF + +INTDIRSFX = $(LIBBASE) +SRCALT1=.\$(MESAROOT)\src +!INCLUDE .\rules\lib.$(LIBBASE) + +# ----------------------------------------------------------------------------- +!ELSEIF "$(EXEFILE)" != "" # building a set of executables ... +# ----------------------------------------------------------------------------- + +INTDIRSFX=$(EXEFILE) +SUPLIBSROOT=.\rules\$(EXEFILE) + +!IF "$(USE_SYSGL)" != "0" +CPPDEPS=include\GL\glut.h +CPPOPTS=$(CPPOPTS) /I.\include +!ELSE +CPPOPTS=$(CPPOPTS) /I$(MESAROOT)\include +!ENDIF + +!IF EXIST (.\rules\$(EXEFILE)) +!INCLUDE .\rules\$(EXEFILE) +!ENDIF + +# Use possibly redefined SRCALT1 here to copy executables +# to their respective source directories ... + +BINDIR = $(SRCALT1) + +libcopy: + rem <<$(TEMP)\libcopyf.mak +.SILENT: + +$$(TGTFILE): $$(SRCFILE) + echo $$(SRCFILE) ... + set COPYCMD=/y + copy /v $$(SRCFILE) $$(TGTFILE) + +copyfile: $$(TGTFILE) +<<KEEP +!IF "$(RUNTIMELIBS)" != "" + <<$(TEMP)\libcopyf.bat $(OBJDIR_R) $(SRCALT1) $(RUNTIMELIBS) +@echo off +set _SRCDIR=%1 +shift +set _TGTDIR=%1 +shift +:loops +nmake /nologo /f $(TEMP)\libcopyf.mak SRCFILE=%_SRCDIR%\%1 TGTFILE=%_TGTDIR% copyfile +shift +if not [%1] == [] goto loops +set _SRCDIR= +set _TGTDIR= +<<KEEP +!ENDIF + +# ----------------------------------------------------------------------------- +!ENDIF # EXEFILE keyed selection +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# ----- get final build rules ------------------------------------------------- +# ----------------------------------------------------------------------------- +!IF EXIST (nmake.mif) +!INCLUDE nmake.mif +!ELSE +!INCLUDE <nmake.mif> +!ENDIF +# ----------------------------------------------------------------------------- diff --git a/xc/extras/Mesa/WIN32/NMAKE.MIF b/xc/extras/Mesa/WIN32/NMAKE.MIF new file mode 100644 index 000000000..5996f9008 --- /dev/null +++ b/xc/extras/Mesa/WIN32/NMAKE.MIF @@ -0,0 +1,2433 @@ +# ----- Notes on usage --------------------------------------------------------# + +!IF "$(PAGER)" == "" +PAGER=more +!ENDIF + +buildhelp: + $(PAGER) < << + +o Controlling Definitions - Directories + +TEMP - temporary directory for interim files +RELDIR - target directory for release build output files +DEBDIR - target directory for debug build output files +BINDIR - target directory for EXE/DLL file updates +USEDIR - target directory for LIB file updates +INCDIR - target directory for INCLUDE file updates +INCDIRSFX - target header directory suffx (such as 'gl' for gl/glut.h) +DISTDIR - target directory for distribution file update + (default to ./dist) +OBJDIRSFX - optional intermediate file directory +PCHDDIR - target directory for Debug PCH file +PCHRDIR - target directory for Release PCH file +SRCFILES - macro that is the list of source file for the current target +SUPLIBSSRC - similar to SRCFILES but these are *all* added to every link + for an 'exefileseries' targeted build. +SUPLIBDEPS - additional dependencies correlating to SRCFILES, only for + an 'exefileseries' targeted build. +SRCPATH - source file path specification - default path to source +SRCALT1 - alternate 1 to source files +SRCALT2 - alternate 2 to source files +SRCALT3 - alternate 3 to source files +SRCALT4 - alternate 4 to source files +SRCALT5 - alternate 5 to source files (addition by TXM, alextxm@tin.it) +ALTLIBPATH - alternate link time library path + +Supported file extensions: .asm, .cpp, .cxx, .cc, .c, .a, .S + +o Controlling Definitions - Build Control + +BUILD_FOR_P6 - when 1, targeted for PPro, else for Pentium +BUILD_DLL - when 1, changes some compile flags for building DLL-based + code specific flags added to the CL command line are: + /GD - optimize for Windows DLL (vs /GA - opt for Windows App) +CPP_PCH - when 1, uses CPP to build PCH file +CPPDEPS - additional dependencies which must be built BEFORE compiling +CPPOPTS - additional options added to c/c++ compile line +CL_FULL_OPT - when 1, uses '/Ox /Ob2' instead of specific optimizations + ------------------------------------------------------------------------------ + Explanation of compiler optimization used when CL_FULL_OPT is zero (default) + ------------------------------------------------------------------------------ + /Ob2 - automatic-inlining of any suitable code + /Oa - Assume No Aliasing of pointers and data + /Oi - generate intrinsic functions instead of calls to libc routines + /Ot - favor code speed over size + /Oy - frame pointer omission, does not setup frame pointers on the stack + /Os - control stack checking calls, + /Op- - improve floating point consistency - disabled; with this option set to + '-' it causes the compiler to generate faster code which attempts to + maximize use of the fp registers and minimizing memory reads/writes. + Personally, I would like to see this turned to '/Op' to prevent fp + computation glitches, however currently this generates a tremendous + amount of compiler warnings about fp overflow in computations, and it + would significantly slow down the generated code anyway so "*sigh*" + ------------------------------------------------------------------------------ +DEBUG - when 1, enables debug build and disables release build +DEFFILE - when non nil, used during DLL linking +DLLBASE - base file name for dll (minus '32' moniker) +DLLBASEADDR - base address of DLL +DLLBASEFILE - base address reference of DLL + NOTE: Use only *one* of DLLBASEADDR or DLLBASEFILE, but not + both! +DOGUI - when 1, links executable for windows GUI subsystem +EXEFILE - test exe file name, default file for source .c/.cc/.cpp file +EXETYPE - alias for LIBTYPE, for when building EXE files only +FORCELINK - Forces link, regardless of undefined/multiply defined symbols + (useful for debugging linkage problems) +LIBBASE - base file name for library +LIBTYPE - set to desired library build type (d-s, r-s, d-d, r-d) +LINKTARGET - set to 'app' or 'dll' to specify, affects some CL.EXE options +MAKEFILE - name of source makefile +NOSTATIC - when 1, do not build static libs (libc??.lib usage) +NODYNAMIC - when 1, do not build dynamic libs (msvcrt??.dll usage) +NODEBUG - when 1, do not build debug libs +NORELEASE - when 1, do not build release libs +NOPCH - when 1, do not use PCH file +NOMULTIBUILD - when 1, disable multi-file rules (MSVC 5(+) only) +PCHINCROOT - set to file name root that is the PCH include trigger file +PCHINCFILE - set to file that is the PCH include file for c code +PCHSOURCEFILE - set to complete source file name for ansi c code + (e.g. stdinc.c) +PCHFILE - set to precompiled header file pathname for ansi c code +PCHOBJFILE - set to precompiled header file object file pathname for + ansi c code +RCFLAGS - resource compiler option flags +RCDEFS - user provided resource compiler flags +STRIPSYMBOLS - strip debugging symbols from release libs + (normally even release builds are made with debug symbols) +SMP - when 1, builds and links as multi-threaded code +USE_STD_CPP_HDRS- enables C++ exception handling and _STD_USING definition +USE_ICC - enables use of Intel C/C++ compiler instead of MS + uses: 'icl.exe' instead of 'cl.exe' + uses: 'xilink.exe' instead of 'link.exe' + prefixes link libraries with 'libm' and 'libmmt' to pull + them from the ICC install. +<< + +# ----- build options ---------------------------------------------------------# + +.SUFFIXES: .asm .cpp .cxx .cc .c .a .S + +!IF "$(OS)" == "Windows_NT" +DELTREE=rd /q /s +NULL=NUL +COPYFILE=copy /v +!ELSE +DELTREE=deltree /y +NULL=NUL +COPYFILE=copy /y/v +!ENDIF + +!IF "$(TESTEXE)" != "" +!MESSAGE Macro TESTEXE built by client "nmake.mak" file but is outdated. +EXEFILE=$(TESTEXE) +!UNDEF TESTEXE +!ENDIF + +!IF "$(NOSTATIC)" == "" +NOSTATIC=0 +!ENDIF + +!IF "$(NODYNAMIC)" == "" +NODYNAMIC=0 +!ENDIF + +!IF "$(DEBUG)" == "1" +NODEBUG=0 +NORELEASE=1 +!ELSEIF "$(DEBUG)" == "0" +NODEBUG=1 +NORELEASE=0 +!ENDIF + +!IF "$(NODEBUG)" == "" +NODEBUG=0 +!ENDIF + +!IF "$(NORELEASE)" == "" +NORELEASE=0 +!ENDIF + +!IF "$(NOMULTIBUILD)" == "" +!IF "$(DEBUG)" == "1" +NOMULTIBUILD=1 +!ELSE +NOMULTIBUILD=0 +!ENDIF +!ENDIF + +!IF "$(NOPCH)" == "" +NOPCH=0 +!ENDIF + +!IF "$(DOGUI)" == "" +DOGUI=0 +!ENDIF + +!IF "$(FORCELINK)" == "" +FORCELINK=0 +!ENDIF + +!IF "$(USE_ICC)" == "" +USE_ICC=0 +!ENDIF + +!IF "$(USE_STD_CPP_HDRS)" == "" +USE_STD_CPP_HDRS=0 +!ENDIF + +!IF "$(DOGUI)" == "1" +SUBSYSTEM=windows +!ELSE +SUBSYSTEM=console +!ENDIF + +!IF "$(PROC_EXEFILESERIES)" == "" +PROC_EXEFILESERIES=0 +!ENDIF + +!IF "$(CPP_PCH)" == "" +CPP_PCH=0 +!ENDIF + +!IF "$(TEMP)" == "" +TEMP=. +!ENDIF + +!IF "$(DEVDIR)" == "" +DEVDIR=.. +#\..\.. +!ENDIF + +!IF "$(RELDIR)" == "" +RELDIR=.\Release +!ENDIF + +!IF "$(DEBDIR)" == "" +DEBDIR=.\Debug +!ENDIF + +!IF "$(USEDIR)" == "" +USEDIR=$(DEVDIR)\sdk\lib\win32\vc +!ENDIF + +!IF "$(BINDIR)" == "" +BINDIR=$(DEVDIR)\sdk\bin +!ENDIF + +!IF "$(DISTDIR)" == "" +DISTDIR=dist +!ENDIF + +!IF "$(INCDIR)" == "" +INCDIR=$(DEVDIR)\sdk\h +!ENDIF + +!IF "$(INCDIR_L)" == "" +INCDIR_L=. +!ENDIF + +!IF "$(INCDIRSFX)" == "" +INCDIRSFX=- +!ENDIF + +!IF "$(SRCPATH)" == "" +SRCPATH=. +!ENDIF + +!IF "$(PCHINCROOT)" == "" +PCHINCROOT=stdinc +!ENDIF + +!IF "$(PCHINCFILE)" == "" +PCHINCFILE=$(PCHINCROOT).h +!ENDIF + +!IF "$(PCHSOURCEFILE)" == "" +PCHSOURCEFILE=$(PCHINCROOT).c +!ENDIF + +!IF "$(PCHINCFILEPP)" == "" +PCHINCFILEPP=$(PCHINCROOT).hpp +!ENDIF + +!IF "$(PCHSOURCEFILEPP)" == "" +PCHSOURCEFILEPP=$(PCHINCROOT).cpp +!ENDIF + +!IF "$(MAKEFILE)" == "" +MAKEFILE=nmake.mak +!ENDIF + +!IF "$(NOSTATIC)" == "1" +CRTTYPE=d +!ELSE +CRTTYPE=s +!ENDIF + +!IF "$(CRTTYPE)" == "" +CRTTYPE=s +!ENDIF + +!IF "$(LINKTARGET)" == "" +LINKTARGET=app +!ENDIF + +!IF "$(LIBBASE)" == "" +LIBBASE=mylib +!ENDIF + +!IF "$(DLLBASE)" == "" +DLLBASE=$(LIBBASE)32 +!ENDIF + +!IF "$(BUILD_DLL)" == "" +BUILD_DLL=0 +!ENDIF + +!IF "$(DIRECTORYNAME)" == "" +DIRECTORYNAME=.\directoryname.default +!ENDIF + +!IF "$(SMP)" == "" +SMP=0 +!ENDIF + +!IF "$(EXEFSERIES_UP)" == "1" +!IF "$(BINDIR)" == "" +EXEFSERIES_UP=0 +!ENDIF +!ENDIF + +!IF EXIST (nmake.mif) +NMAKE_MIF_FILE=nmake.mif +!ELSE +NMAKE_MIF_FILE=$(DEVDIR)\sdk\h\nmake.mif +!ENDIF + +!IF "$(DLLBASEADDR)" != "" +DLLBASEOPT=/base:$(DLLBASEADDR) +!ELSEIF "$(DLLBASEFILE)" != "" +DLLBASEOPT=/base:@$(DLLBASEFILE) +!ELSE +DLLBASEOPT= +!ENDIF + +!IF "$(STRIPSYMBOLS)" == "" +STRIPSYMBOLS=0 +!ENDIF + +!IF "$(CL_FULL_OPT)" == "" +CL_FULL_OPT=1 +!ENDIF + +# ----- macro resolution / error checking -------------------------------------- + +# MS DevStudio/VC5 nmake. defines the macro _NMAKE_VER as 162, nmake for +# VC 4 does not define it, we use this as a tag for conditionals to handle +# build with VC4 nmake. + +_NMAKE_VER_6=6.00.8168.0 # For reference, probably will change with a service pack +_NMAKE_VER_5=162 +_NMAKE_VER_4=0 + +!IFNDEF _NMAKE_VER +_NMAKE_VER=$(_NMAKE_VER_4) +!ENDIF + +!IF "$(EXEFILE)" == "" +EXEFILE=test +!ENDIF + +!IF ("$(SRCFILES)" == "") && ("$(EXEFILE)" != "") +SRCFILES=$(EXEFILE).c +!ELSEIF ("$(SRCFILES)" == "") && ("$(EXEFILE)" == "") +SRCFILES=main.c +!ENDIF + +OBJ = $(SRCFILES) +OBJ = $(OBJ:.cpp=.obj) +OBJ = $(OBJ:.cxx=.obj) +OBJ = $(OBJ:.cc=.obj) +OBJ = $(OBJ:.c=.obj) +OBJ = $(OBJ:.a=.obj) +OBJ = $(OBJ:.asm=.obj) +OBJ = $(OBJ:.S=.obj) + +!IF "$(RCFILE)" != "" +OBJ = $(OBJ) $(LIBBASE)$(DEBTAG).res +!ENDIF + +EXEFILESLIST = $(SRCFILES) +EXEFILESLIST = $(EXEFILESLIST:.cpp=.exe) +EXEFILESLIST = $(EXEFILESLIST:.cxx=.exe) +EXEFILESLIST = $(EXEFILESLIST:.cc=.exe) +EXEFILESLIST = $(EXEFILESLIST:.c=.exe) +EXEFILESLIST = $(EXEFILESLIST:.a=.exe) +EXEFILESLIST = $(EXEFILESLIST:.asm=.exe) +EXEFILESLIST = $(EXEFILESLIST:.S=.exe) + +!IF "$(SUPLIBSSRC)" == "" +EXESUPLIBSLIST = +!ELSE +EXESUPLIBSLIST = $(SUPLIBSSRC) +EXESUPLIBSLIST = $(EXESUPLIBSLIST:.cpp=.lib) +EXESUPLIBSLIST = $(EXESUPLIBSLIST:.cxx=.lib) +EXESUPLIBSLIST = $(EXESUPLIBSLIST:.cc=.lib) +EXESUPLIBSLIST = $(EXESUPLIBSLIST:.c=.lib) +EXESUPLIBSLIST = $(EXESUPLIBSLIST:.a=.lib) +EXESUPLIBSLIST = $(EXESUPLIBSLIST:.asm=.lib) +EXESUPLIBSLIST = $(EXESUPLIBSLIST:.S=.lib) +!ENDIF + +!IF "$(LIBTYPE)" == "" +!IF "$(NODEBUG)" == "1" +LIBTYPE=r-$(CRTTYPE) +!ELSE +LIBTYPE=d-$(CRTTYPE) +!ENDIF +!ENDIF + +!IF "$(PCHRDIR)" == "" +PCHRDIR=$(RELDIR) +!ENDIF + +!IF "$(PCHDDIR)" == "" +PCHDDIR=$(DEBDIR) +!ENDIF + +!IF "$(LIBTYPE)" == "r-s" # release build / static CRTL linkage +!IF "$(INTDIRSFX)" != "" +OBJDIR=$(RELDIR)\$(INTDIRSFX) +!ELSE +OBJDIR=$(RELDIR) +!ENDIF +PCHDIR=$(PCHRDIR) +LIBCNTRL= +LIBSFX= +EXESFX= +LIBPFX= +RCFLAGS=/DNDEBUG +!IF "$(SMP)" == "0" +CRTLIB=libc +CXXRTLIB=libcp +!ELSE +CRTLIB=libcmt +CXXRTLIB=libcpmt +LIBCNTRL=/D_MT $(LIBCNTRL) +!ENDIF # SMP +!ELSEIF "$(LIBTYPE)" == "d-s" # debug build / static CRTL linkage +!IF "$(INTDIRSFX)" != "" +OBJDIR=$(DEBDIR)\$(INTDIRSFX) +!ELSE +OBJDIR=$(DEBDIR) +!ENDIF +PCHDIR=$(PCHDDIR) +LIBCNTRL= +LIBSFX=d +EXESFX=d +LIBPFX= +RCFLAGS=/D_DEBUG +!IF "$(SMP)" == "0" +CRTLIB=libcd +CXXRTLIB=libcpd +!ELSE +CRTLIB=libcmtd +CXXRTLIB=libcpmtd +LIBCNTRL=/D_MT $(LIBCNTRL) +!ENDIF # SMP +!ELSEIF "$(LIBTYPE)" == "r-d" # release build / DLL CRTL linkage +!IF "$(INTDIRSFX)" != "" +OBJDIR=$(RELDIR)\$(INTDIRSFX) +!ELSE +OBJDIR=$(RELDIR) +!ENDIF +!IF "$(PCHRDIR)" == "$(RELDIR)" +PCHDIR=$(PCHRDIR) +!ELSE +PCHDIR=$(PCHRDIR) +!ENDIF +LIBCNTRL=/D_DLL +LIBSFX= +EXESFX= +LIBPFX=m +RCFLAGS=/DNDEBUG +CRTLIB=msvcrt +CXXRTLIB=msvcprt +!IF "$(SMP)" == "1" +LIBCNTRL=/D_MT $(LIBCNTRL) +!ENDIF # SMP +!ELSE # "$(LIBTYPE)" == "d-d" # debug build / DLL CRTL linkage +LIBTYPE=d-d +!IF "$(INTDIRSFX)" != "" +OBJDIR=$(DEBDIR)\$(INTDIRSFX) +!ELSE +OBJDIR=$(DEBDIR) +!ENDIF +!IF "$(PCHDDIR)" == "$(DEBDIR)" +PCHDIR=$(PCHDDIR) +!ELSE +PCHDIR=$(PCHDDIR) +!ENDIF +LIBCNTRL=/D_DLL +LIBSFX=d +EXESFX=d +LIBPFX=m +RCFLAGS=/D_DEBUG +CRTLIB=msvcrtd +CXXRTLIB=msvcprtd +!IF "$(SMP)" == "1" +LIBCNTRL=/D_MT $(LIBCNTRL) +!ENDIF # SMP +!ENDIF + +!IF "$(OBJDIR_R)" == "" +!IF ("$(LIBTYPE)" == "d-d") || ("$(LIBTYPE)" == "d-s") +OBJDIR_R=$(DEBDIR) +!ELSE +OBJDIR_R=$(RELDIR) +!ENDIF +!ENDIF + +!IF "$(LIBBASE)" == "mylib" +EEXELIBFILE= +!ELSE +EEXELIBFILE=$(OBJDIR)\$(LIBBASE).lib +!ENDIF + +# ----- File list transformation rules ----------------------------------------- + +filelistxform: + rem <<$(TEMP)\$* +EXEFILESLIST = $(OBJDIR)\$$(EXEFILESLIST: = $(OBJDIR)\) +OBJ = $(OBJDIR)\$$(OBJ: = $(OBJDIR)\) +!IF "$(EXESUPLIBSLIST)" != "" +EXESUPLIBSLIST = $(OBJDIR)\$$(EXESUPLIBSLIST: = $(OBJDIR)\) +!ENDIF +<<KEEP + +filelistxform.kill: + echo. > $(TEMP)\$* + del $(TEMP)\$* > $(NULL) + +!IF EXIST ($(TEMP)\filelistxform) +!INCLUDE $(TEMP)\filelistxform +!ELSE # NOT EXIST ($(TEMP)\filelistxform) +!IF ("$(LIBTYPE)" == "r-s") || ("$(LIBTYPE)" == "r-d") +EXEFILESLIST = .\Release\$(EXEFILESLIST: = .\Release\) +OBJ = .\Release\$(OBJ: = .\Release\) +!IF "$(EXESUPLIBSLIST)" != "" +EXESUPLIBSLIST = .\Release\$(EXESUPLIBSLIST: = .\Release\) +!ENDIF # EXESUPLIBSLIST conditional +!ELSE +EXEFILESLIST = .\Debug\$(EXEFILESLIST: = .\Debug\) +OBJ = .\Debug\$(OBJ: = .\Debug\) +!IF "$(EXESUPLIBSLIST)" != "" +EXESUPLIBSLIST = .\Debug\$(EXESUPLIBSLIST: = .\Debug\) +!ENDIF # EXESUPLIBSLIST conditional +!ENDIF # LIBTYPE conditional +!ENDIF # EXIST ($(TEMP)\filelistxform) + +# ----- Some final macro building ---------------------------------------------- + +!IF "$(CPP_PCH)" == "1" +PCHINCFILE=$(PCHINCFILEPP) +PCHSOURCEFILE=$(PCHSOURCEFILEPP) +!ENDIF + +!IF "$(DEFFILE)" != "" +DEFFILEOPT=/def:$(DEFFILE) +!ELSE +DEFFILEOPT= +!ENDIF + +!IF "$(PCHFILE)" == "" +!IF "$(LINKTARGET)" == "dll" +PCHFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).pch +!ELSE +PCHFILE=$(OBJDIR)\$(PCHINCROOT).pch +!ENDIF +!ENDIF + +!IF "$(PCHOBJFILE)" == "" +!IF "$(LINKTARGET)" == "dll" +PCHOBJFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).obj +!ELSE +PCHOBJFILE=$(OBJDIR)\$(PCHINCROOT).obj +!ENDIF +!ENDIF + +!IF "$(PDBFILE)" == "" +!IF "$(LINKTARGET)" == "dll" +PDBFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).pdb +!ELSE +PDBFILE=$(OBJDIR)\$(PCHINCROOT).pdb +!ENDIF +!ENDIF + +# ----- basic compiler directives ---------------------------------------------- + +CLOPTIONS=/nologo /c /GF /Gy /Zl +MLOPTIONS=/nologo /c /coff /Cx + +!IF "$(ALLWARNINGS)" == "0" +CLOPTIONS=$(CLOPTIONS) /W3 +MLOPTIONS=$(CLOPTIONS) /W3 +!ELSE +CLOPTIONS=$(CLOPTIONS) /W4 +MLOPTIONS=$(CLOPTIONS) /W4 +!ENDIF + +!IF "$(BUILD_DLL)" == "0" +CLOPTIONS=$(CLOPTIONS) /GA /Gd +!ELSE +CLOPTIONS=$(CLOPTIONS) /GD /Gd +!ENDIF + +!IF ("$(LIBTYPE)" == "d-s") || ("$(LIBTYPE)" == "d-d") +RCFLAGS=/D_DEBUG +OPTFLAGS=/D_DEBUG /Zi /Od +MLOPTFLAGS=/D_DEBUG /Zi +!ELSE +RCFLAGS=/DNDEBUG +OPTFLAGS=/DNDEBUG /Zi +MLOPTFLAGS=/DNDEBUG /Zi + +!IF "$(CL_FULL_OPT)" == "1" +OPTFLAGS = $(OPTFLAGS) /Ox /Ob2 +!ELSE +OPTFLAGS = $(OPTFLAGS) /Ob2 /Oa /Oi /Ot /Oy /Op- +!ENDIF + +!ENDIF + +# ----- Explanation of compiler optimization options --------- +# /Ob2 - automatic-inlining of any suitable code +# /Oa - Assume No Aliasing of pointers and data +# /Oi - generate intrinsic functions instead of calls to libc routines +# /Ot - favor code speed over size +# /Oy - frame pointer omission, does not setup frame pointers on the call stack +# /Os - control stack checking calls, +# /Op- - improve floating point consistency; note: this option actually is +# likely to slow down the overall code generated, however it produces +# more reliable comparisions, etc., by forcing any fp data used +# after some computations to actually be reloaded from memory +# instead of just using the 80-bit output from the previous +# computations. This also causes more flushing to memory of the results. +# ------------------------------------------------------------ + +!IF (("$(BUILD_FOR_P6)" == "0") || ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)")) +CLOPTIONS=$(CLOPTIONS) /G5 /Zp4 +MLOPTIONS=$(MLOPTIONS) /Zp4 +!ELSE +CLOPTIONS=$(CLOPTIONS) /G6 /GM /Zp8 +MLOPTIONS=$(MLOPTIONS) /Zp8 +!ENDIF + +!IF "$(USE_STD_CPP_HDRS)" == "1" +CPPOPTS=/GX /D_STD_USING $(CPPOPTS) +!ENDIF + +!IF "$(USE_ICC)" == "1" +CC=icl +LINK=xilink +ASM=ml +!ELSE +CC=cl +LINK=link +ASM=ml +!ENDIF + +!IF "$(LINKTARGET)" == "dll" +CLOPTIONS=$(CLOPTIONS) /Fd$(PDBFILE) +!IF "$(CPP_PCH)" == "1" +PCHOPTS=/Yu"$(PCHINCROOT).hpp" /Fp$(PCHFILE) +PCHOPTSC=/Yc"$(PCHINCROOT).hpp" /Fp$(PCHFILE) +!ELSE +PCHOPTS=/Yu"$(PCHINCROOT).h" /Fp$(PCHFILE) +PCHOPTSC=/Yc"$(PCHINCROOT).h" /Fp$(PCHFILE) +!ENDIF # CCP_PCH==1 +!ELSE +CLOPTIONS=$(CLOPTIONS) /Fd$(PDBFILE) +!IF "$(CPP_PCH)" == "1" +PCHOPTS=/Yu"$(PCHINCROOT).hpp" /Fp$(PCHFILE) +PCHOPTSC=/Yc"$(PCHINCROOT).hpp" /Fp$(PCHFILE) +!ELSE +PCHOPTS=/Yu"$(PCHINCROOT).h" /Fp$(PCHFILE) +PCHOPTSC=/Yc"$(PCHINCROOT).h" /Fp$(PCHFILE) +!ENDIF # CPP_PCH==1 +!ENDIF + +!IF "$(NOPCH)" == "1" +PCHFILE= +PCHOBJFILE= +PCHOPTS= +PCHOPTSC= +!ENDIF + +!IF "$(INCDIR_L)" != "." +CLOPTIONS=$(CLOPTIONS) /I$(INCDIR_L) +RCFLAGS=$(RCFLAGS) /i$(INCDIR_L) +!ENDIF + +!IF "$(RCDEFS)" != "" +RCFLAGS=$(RCFLAGS) $(RCDEFS) +!ENDIF + +!IF "$(LINKLIBPATH)" == "" +LINKLIBPATH=/libpath:$(OBJDIR) +!ELSE +LINKLIBPATH=$(LINKLIBPATH) /libpath:$(OBJDIR) +!ENDIF + +!IF "$(OBJDIR_R)" != "$(OBJDIR)" +LINKLIBPATH=/libpath:$(OBJDIR_R) $(LINKLIBPATH) +!ENDIF + +!IF "$(ALTLIBPATH)" != "" +LINKLIBPATH=/libpath:$(ALTLIBPATH) $(LINKLIBPATH) +!ENDIF + +!IF "$(FORCELINK)" == "M" +FORCELINKFLAGS=/force:multiple +!ELSEIF "$(FORCELINK)" == "U" +FORCELINKFLAGS=/force:unresolved +!ELSEIF "$(FORCELINK)" == "1" +FORCELINKFLAGS=/force +!ELSE +FORCELINKFLAGS= +!ENDIF + +# ----- Platform SDK compatability items --------------------------------------- + +CLOPTIONS=$(CLOPTIONS) /DWIN32 /D_WIN32 +CLOPTIONS=$(CLOPTIONS) /DCRTAPI1=__cdecl /DCRTAPI2=__cdecl /D_X86_=1 +CLOPTIONS=$(CLOPTIONS) /D_WIN95 /D_WIN32_WINDOWS=0x0400 /DWINVER=0x0400 + +MLOPTIONS=$(MLOPTIONS) /DWIN32 /D_WIN32 +MLOPTIONS=$(MLOPTIONS) /DCRTAPI1=__cdecl /DCRTAPI2=__cdecl /D_X86_=1 +MLOPTIONS=$(MLOPTIONS) /D_WIN95 /D_WIN32_WINDOWS=0x0400 /DWINVER=0x0400 + +#-------------------------------------------------------------------------------- +# ----- basic compilation rules ------------------------------------------------ +#-------------------------------------------------------------------------------- + +# ----- PCH file build rule ---------------------------------------------------- + +!IF "$(NOPCH)" != "1" + +$(PCHFILE): $(PCHSOURCEFILE) $(PCHINCFILE) $(PCHDIR) + $(CC) $(CLOPTIONS) $(LIBCNTRL) $(OPTFLAGS)\ + $(CPPOPTS) $(PCHOPTSC)\ + /Fo$*.obj /Fp$*.pch $(PCHSOURCEFILE) + +pch: $(PCHFILE) + +!ENDIF + +# ----- build rules, default source directory --------------------------------- + +!IF (("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") || ("$(NOMULTIBUILD)" != "1")) + +{$(SRCPATH)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCPATH)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCPATH)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCPATH)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCPATH)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ELSE + +{$(SRCPATH)\}.c{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCPATH)\}.cpp{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCPATH)\}.cc{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCPATH)\}.cxx{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCPATH)\}.asm{$(OBJDIR)\}.obj:: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ENDIF + +{$(SRCPATH)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +{$(SRCPATH)\}.rc{$(OBJDIR)\}.res: + echo $< + rc $(RCFLAGS) /fo$@ $< + +!IF "$(PROC_EXEFILESERIES)" == "1" + +# This is a special-case build rule utilized by the 'exefileseries.bin' target for +# constructing an executable from one or more sources files. +# +# LIMITATION: All source files MUST be in the same directory! +# + +{$(SRCPATH)\}.c{$(OBJDIR)\}.exe: + echo $@ + rem <<$(OBJDIR)\$(@B).mak +.SILENT: +.SUFFIXES: .asm .cpp .cxx .cc .c .a .S + +<<KEEP + echo !IF EXIST (.\Rules\$(EXEFILE).$(@B))>> $(OBJDIR)\$(@B).mak + echo !INCLUDE .\Rules\$(EXEFILE).$(@B)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(SRCFILESX:.c=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cc=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cpp=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.asm=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$(OBJDIR)\$$(XOBJ: = $(OBJDIR)\)>> $(OBJDIR)\$(@B).mak + echo !ELSE>> $(OBJDIR)\$(@B).mak + echo XOBJ=>> $(OBJDIR)\$(@B).mak + echo !ENDIF>> $(OBJDIR)\$(@B).mak + type >> $(OBJDIR)\$(@B).mak << + +SRCDIR=$(SRCPATH) + +!IF "$(EXEFSERIES_UP)" == "1" +target: $(BINDIR)\$(@B)$(EXESFX).EXE +!ELSE +target: $@ +!ENDIF + +$(BINDIR)\$(@B)$(EXESFX).EXE: $@ + echo Updating $(BINDIR)\$(@B)$(EXESFX).EXE ... + $(COPYFILE) $@ $(BINDIR)\$(@B)$(EXESFX).EXE + +$@: $(OBJDIR)\$(@B).obj $$(XOBJ) + $(LINK) /nologo /subsystem:$(SUBSYSTEM) /nodefaultlib /machine:ix86 /map:$*.map /out:$@\ + $(FORCELINKFLAGS) $(LINKLIBPATH) $(OBJDIR)\$(@B).obj $$(XOBJ) $(EXELIBS)\ + $(CRTLIB).lib kernel32.lib gdi32.lib user32.lib oldnames.lib + +{$$(SRCDIR)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $$< + +{$$(SRCDIR)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +<<KEEP + nmake /nologo /f $(OBJDIR)\$(@B).mak + +!ENDIF # "$(PROC_EXEFILESERIES)" == "1" + +#-------------------------------------------------------------------------------- +# Alternate source directory 1 build rules, defined only if SRCALT1 not null +#-------------------------------------------------------------------------------- + +!IF "$(SRCALT1)" != "" + +!IF (("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") || ("$(NOMULTIBUILD)" == "1")) + +{$(SRCALT1)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT1)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT1)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT1)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ELSE + +{$(SRCALT1)\}.c{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT1)\}.cpp{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT1)\}.cc{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT1)\}.cxx{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT1)\}.asm{$(OBJDIR)\}.obj:: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ENDIF + +{$(SRCALT1)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +{$(SRCALT1)\}.rc{$(OBJDIR)\}.res: + echo $< + rc $(RCFLAGS) /fo$@ $< + +!IF "$(PROC_EXEFILESERIES)" == "1" + +# This is a special-case build rule utilized by the 'exefileseries.bin' target for +# constructing an executable from one or more sources files. +# +# LIMITATION: All source files MUST be in the same directory! +# + +{$(SRCALT1)\}.c{$(OBJDIR)\}.exe: + echo $@ + rem <<$(OBJDIR)\$(@B).mak +.SILENT: +.SUFFIXES: .asm .cpp .cxx .cc .c .a .S + +<<KEEP + echo !IF EXIST (.\Rules\$(EXEFILE).$(@B))>> $(OBJDIR)\$(@B).mak + echo !INCLUDE .\Rules\$(EXEFILE).$(@B)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(SRCFILESX:.c=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cc=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cpp=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.asm=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$(OBJDIR)\$$(XOBJ: = $(OBJDIR)\)>> $(OBJDIR)\$(@B).mak + echo !ELSE>> $(OBJDIR)\$(@B).mak + echo XOBJ=>> $(OBJDIR)\$(@B).mak + echo !ENDIF>> $(OBJDIR)\$(@B).mak + type >> $(OBJDIR)\$(@B).mak << + +SRCDIR=$(SRCALT1) + +!IF "$(EXEFSERIES_UP)" == "1" +target: $(BINDIR)\$(@B)$(EXESFX).EXE +!ELSE +target: $@ +!ENDIF + +$(BINDIR)\$(@B)$(EXESFX).EXE: $@ + echo Updating $(BINDIR)\$(@B)$(EXESFX).EXE ... + $(COPYFILE) $@ $(BINDIR)\$(@B)$(EXESFX).EXE + +$@: $(OBJDIR)\$(@B).obj $$(XOBJ) + $(LINK) /nologo /subsystem:$(SUBSYSTEM) /nodefaultlib /machine:ix86 /map:$*.map /out:$@\ + $(FORCELINKFLAGS) $(LINKLIBPATH) $(OBJDIR)\$(@B).obj $$(XOBJ) $(EXELIBS)\ + $(CRTLIB).lib kernel32.lib gdi32.lib user32.lib oldnames.lib + +{$$(SRCDIR)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $$< + +{$$(SRCDIR)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +<<KEEP + nmake /nologo /f $(OBJDIR)\$(@B).mak + +!ENDIF # "$(PROC_EXEFILESERIES)" == "1" + +!ENDIF + +#-------------------------------------------------------------------------------- +# Alternate source directory 2 build rules, defined only if SRCALT2 not null +#-------------------------------------------------------------------------------- + +!IF "$(SRCALT2)" != "" + +!IF (("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") || ("$(NOMULTIBUILD)" != "1")) + +{$(SRCALT2)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT2)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT2)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT2)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT2)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ELSE + +{$(SRCALT2)\}.c{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT2)\}.cpp{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT2)\}.cc{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT2)\}.cxx{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT2)\}.asm{$(OBJDIR)\}.obj:: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ENDIF + +{$(SRCALT2)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +{$(SRCALT2)\}.rc{$(OBJDIR)\}.res: + echo $< + rc $(RCFLAGS) /fo$@ $< + +!IF "$(PROC_EXEFILESERIES)" == "1" + +# This is a special-case build rule utilized by the 'exefileseries.bin' target for +# constructing an executable from one or more sources files. +# +# LIMITATION: All source files MUST be in the same directory! +# + +{$(SRCALT2)\}.c{$(OBJDIR)\}.exe: + echo $@ + rem <<$(OBJDIR)\$(@B).mak +.SILENT: +.SUFFIXES: .asm .cpp .cxx .cc .c .a .S + +<<KEEP + echo !IF EXIST (.\Rules\$(EXEFILE).$(@B))>> $(OBJDIR)\$(@B).mak + echo !INCLUDE .\Rules\$(EXEFILE).$(@B)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(SRCFILESX:.c=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cc=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cpp=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.asm=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$(OBJDIR)\$$(XOBJ: = $(OBJDIR)\)>> $(OBJDIR)\$(@B).mak + echo !ELSE>> $(OBJDIR)\$(@B).mak + echo XOBJ=>> $(OBJDIR)\$(@B).mak + echo !ENDIF>> $(OBJDIR)\$(@B).mak + type >> $(OBJDIR)\$(@B).mak << + +SRCDIR=$(SRCALT2) + +!IF "$(EXEFSERIES_UP)" == "1" +target: $(BINDIR)\$(@B)$(EXESFX).EXE +!ELSE +target: $@ +!ENDIF + +$(BINDIR)\$(@B)$(EXESFX).EXE: $@ + echo Updating $(BINDIR)\$(@B)$(EXESFX).EXE ... + $(COPYFILE) $@ $(BINDIR)\$(@B)$(EXESFX).EXE + +$@: $(OBJDIR)\$(@B).obj $$(XOBJ) + $(LINK) /nologo /subsystem:$(SUBSYSTEM) /nodefaultlib /machine:ix86 /map:$*.map /out:$@\ + $(FORCELINKFLAGS) $(LINKLIBPATH) $(OBJDIR)\$(@B).obj $$(XOBJ) $(EXELIBS)\ + $(CRTLIB).lib kernel32.lib gdi32.lib user32.lib oldnames.lib + +{$$(SRCDIR)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $$< + +{$$(SRCDIR)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +<<KEEP + nmake /nologo /f $(OBJDIR)\$(@B).mak + +!ENDIF # "$(PROC_EXEFILESERIES)" == "1" + +!ENDIF + +#-------------------------------------------------------------------------------- +# Alternate source directory 3 build rules, defined only if SRCALT3 not null +#-------------------------------------------------------------------------------- + +!IF "$(SRCALT3)" != "" + +!IF (("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") || ("$(NOMULTIBUILD)" != "1")) + +{$(SRCALT3)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT3)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT3)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT3)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT3)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ELSE + +{$(SRCALT3)\}.c{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT3)\}.cpp{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT3)\}.cc{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT3)\}.cxx{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT3)\}.asm{$(OBJDIR)\}.obj:: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ENDIF + +{$(SRCALT3)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +{$(SRCALT3)\}.rc{$(OBJDIR)\}.res: + echo $< + rc $(RCFLAGS) /fo$@ $< + +!IF "$(PROC_EXEFILESERIES)" == "1" + +# This is a special-case build rule utilized by the 'exefileseries.bin' target for +# constructing an executable from one or more sources files. +# +# LIMITATION: All source files MUST be in the same directory! +# + +{$(SRCALT3)\}.c{$(OBJDIR)\}.exe: + echo $@ + rem <<$(OBJDIR)\$(@B).mak +.SILENT: +.SUFFIXES: .asm .cpp .cxx .cc .c .a .S + +<<KEEP + echo !IF EXIST (.\Rules\$(EXEFILE).$(@B))>> $(OBJDIR)\$(@B).mak + echo !INCLUDE .\Rules\$(EXEFILE).$(@B)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(SRCFILESX:.c=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cc=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cpp=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.asm=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$(OBJDIR)\$$(XOBJ: = $(OBJDIR)\)>> $(OBJDIR)\$(@B).mak + echo !ELSE>> $(OBJDIR)\$(@B).mak + echo XOBJ=>> $(OBJDIR)\$(@B).mak + echo !ENDIF>> $(OBJDIR)\$(@B).mak + type >> $(OBJDIR)\$(@B).mak << + +SRCDIR=$(SRCALT3) + +!IF "$(EXEFSERIES_UP)" == "1" +target: $(BINDIR)\$(@B)$(EXESFX).EXE +!ELSE +target: $@ +!ENDIF + +$(BINDIR)\$(@B)$(EXESFX).EXE: $@ + echo Updating $(BINDIR)\$(@B)$(EXESFX).EXE ... + $(COPYFILE) $@ $(BINDIR)\$(@B)$(EXESFX).EXE + +$@: $(OBJDIR)\$(@B).obj $$(XOBJ) + $(LINK) /nologo /subsystem:$(SUBSYSTEM) /nodefaultlib /machine:ix86 /map:$*.map /out:$@\ + $(FORCELINKFLAGS) $(LINKLIBPATH) $(OBJDIR)\$(@B).obj $$(XOBJ) $(EXELIBS)\ + $(CRTLIB).lib kernel32.lib gdi32.lib user32.lib oldnames.lib + +{$$(SRCDIR)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $$< + +{$$(SRCDIR)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +<<KEEP + nmake /nologo /f $(OBJDIR)\$(@B).mak + +!ENDIF # "$(PROC_EXEFILESERIES)" == "1" + +!ENDIF + +#-------------------------------------------------------------------------------- +# Alternate source directory 4 build rules, defined only if SRCALT4 not null +#-------------------------------------------------------------------------------- + +!IF "$(SRCALT4)" != "" + +!IF (("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") || ("$(NOMULTIBUILD)" != "1")) + +{$(SRCALT4)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT4)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT4)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT4)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT4)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ELSE + +{$(SRCALT4)\}.c{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT4)\}.cpp{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT4)\}.cc{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT4)\}.cxx{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT4)\}.asm{$(OBJDIR)\}.obj:: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ENDIF + +{$(SRCALT4)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +{$(SRCALT4)\}.rc{$(OBJDIR)\}.res: + echo $< + rc $(RCFLAGS) /fo$@ $< + +!IF "$(PROC_EXEFILESERIES)" == "1" + +# This is a special-case build rule utilized by the 'exefileseries.bin' target for +# constructing an executable from one or more sources files. +# +# LIMITATION: All source files MUST be in the same directory! +# + +{$(SRCALT4)\}.c{$(OBJDIR)\}.exe: + echo $@ + rem <<$(OBJDIR)\$(@B).mak +.SILENT: +.SUFFIXES: .asm .cpp .cxx .cc .c .a .S + +<<KEEP + echo !IF EXIST (.\Rules\$(EXEFILE).$(@B))>> $(OBJDIR)\$(@B).mak + echo !INCLUDE .\Rules\$(EXEFILE).$(@B)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(SRCFILESX:.c=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cc=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cpp=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.asm=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$(OBJDIR)\$$(XOBJ: = $(OBJDIR)\)>> $(OBJDIR)\$(@B).mak + echo !ELSE>> $(OBJDIR)\$(@B).mak + echo XOBJ=>> $(OBJDIR)\$(@B).mak + echo !ENDIF>> $(OBJDIR)\$(@B).mak + type >> $(OBJDIR)\$(@B).mak << + +SRCDIR=$(SRCALT4) + +!IF "$(EXEFSERIES_UP)" == "1" +target: $(BINDIR)\$(@B)$(EXESFX).EXE +!ELSE +target: $@ +!ENDIF + +$(BINDIR)\$(@B)$(EXESFX).EXE: $@ + echo Updating $(BINDIR)\$(@B)$(EXESFX).EXE ... + $(COPYFILE) $@ $(BINDIR)\$(@B)$(EXESFX).EXE + +$@: $(OBJDIR)\$(@B).obj $$(XOBJ) + $(LINK) /nologo /subsystem:$(SUBSYSTEM) /nodefaultlib /machine:ix86 /map:$*.map /out:$@\ + $(FORCELINKFLAGS) $(LINKLIBPATH) $(OBJDIR)\$(@B).obj $$(XOBJ) $(EXELIBS)\ + $(CRTLIB).lib kernel32.lib gdi32.lib user32.lib oldnames.lib + +{$$(SRCDIR)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $$< + +{$$(SRCDIR)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +<<KEEP + nmake /nologo /f $(OBJDIR)\$(@B).mak + +!ENDIF # "$(PROC_EXEFILESERIES)" == "1" + +!ENDIF + +#-------------------------------------------------------------------------------- +# Alternate source directory 5 build rules, defined only if SRCALT5 not null +#-------------------------------------------------------------------------------- + +!IF "$(SRCALT5)" != "" + +!IF (("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") || ("$(NOMULTIBUILD)" != "1")) + +{$(SRCALT5)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT5)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT5)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT5)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT5)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ELSE + +{$(SRCALT5)\}.c{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT5)\}.cpp{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT5)\}.cc{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT5)\}.cxx{$(OBJDIR)\}.obj:: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$(SRCALT5)\}.asm{$(OBJDIR)\}.obj:: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +!ENDIF + +{$(SRCALT5)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +{$(SRCALT5)\}.rc{$(OBJDIR)\}.res: + echo $< + rc $(RCFLAGS) /fo$@ $< + +!IF "$(PROC_EXEFILESERIES)" == "1" + +# This is a special-case build rule utilized by the 'exefileseries.bin' target for +# constructing an executable from one or more sources files. +# +# LIMITATION: All source files MUST be in the same directory! +# + +{$(SRCALT5)\}.c{$(OBJDIR)\}.exe: + echo $@ + rem <<$(OBJDIR)\$(@B).mak +.SILENT: +.SUFFIXES: .asm .cpp .cxx .cc .c .a .S + +<<KEEP + echo !IF EXIST (.\Rules\$(EXEFILE).$(@B))>> $(OBJDIR)\$(@B).mak + echo !INCLUDE .\Rules\$(EXEFILE).$(@B)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(SRCFILESX:.c=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cc=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.cpp=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$$(XOBJ:.asm=.obj)>> $(OBJDIR)\$(@B).mak + echo XOBJ=$(OBJDIR)\$$(XOBJ: = $(OBJDIR)\)>> $(OBJDIR)\$(@B).mak + echo !ELSE>> $(OBJDIR)\$(@B).mak + echo XOBJ=>> $(OBJDIR)\$(@B).mak + echo !ENDIF>> $(OBJDIR)\$(@B).mak + type >> $(OBJDIR)\$(@B).mak << + +SRCDIR=$(SRCALT5) + +!IF "$(EXEFSERIES_UP)" == "1" +target: $(BINDIR)\$(@B)$(EXESFX).EXE +!ELSE +target: $@ +!ENDIF + +$(BINDIR)\$(@B)$(EXESFX).EXE: $@ + echo Updating $(BINDIR)\$(@B)$(EXESFX).EXE ... + $(COPYFILE) $@ $(BINDIR)\$(@B)$(EXESFX).EXE + +$@: $(OBJDIR)\$(@B).obj $$(XOBJ) + $(LINK) /nologo /subsystem:$(SUBSYSTEM) /nodefaultlib /machine:ix86 /map:$*.map /out:$@\ + $(FORCELINKFLAGS) $(LINKLIBPATH) $(OBJDIR)\$(@B).obj $$(XOBJ) $(EXELIBS)\ + $(CRTLIB).lib kernel32.lib gdi32.lib user32.lib oldnames.lib + +{$$(SRCDIR)\}.c{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $$< + +{$$(SRCDIR)\}.cpp{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cc{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.cxx{$(OBJDIR)\}.obj: + $(CC) $(CLOPTIONS)\ + $(LIBCNTRL) $(OPTFLAGS) $(CPPOPTS) $(PCHOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.asm{$(OBJDIR)\}.obj: + $(ASM) $(MLOPTIONS)\ + $(LIBCNTRL) $(MLOPTFLAGS) $(MLOPTS)\ + /Fo$(OBJDIR)\ $< + +{$$(SRCDIR)\}.S{$(OBJDIR)\}.obj: + $(CC) -nologo -DNASM_ASSEMBLER /EP $< >$*.as + $(USENASM) -o $@ -f win32 $*.as + -erase $*.as + +<<KEEP + nmake /nologo /f $(OBJDIR)\$(@B).mak + +!ENDIF # "$(PROC_EXEFILESERIES)" == "1" + +!ENDIF + + +#-------------------------------------------------------------------------------- +# utility batch programs +#-------------------------------------------------------------------------------- + +$(TEMP)\copyfile.mak: $(NMAKE_MIF_FILE) + rem <<$@ +.SILENT: +.SUFFIXES: .asm .cpp .cxx .cc .c .a .S + +$$(TGTFILE): $$(SRCFILE) + echo $$(TGTFILE) ... + $(COPYFILE) $$(SRCFILE) $$(TGTFILE) > $(NULL) + +copyfile: $$(TGTFILE) + +copyfileck: + echo CopyFile Check: $$(SRCFILE) ... $$(TGTFILE) + +<<KEEP + +$(TEMP)\copyfiles.bat: $(NMAKE_MIF_FILE) + rem <<$@ +@echo off +set tgtdir=%1 +shift +set srcdir=%1 +shift +if [%1]==[] goto nofiles +if [%tgtdir%] == [-] set tgtdir= +if not [%tgtdir%] == [] set tgtdir=%tgtdir%\ +if [%srcdir%] == [-] set srcdir= +if not [%srcdir%] == [] set srcdir=%srcdir%\ +:start +nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=%SRCDIR%%1" "TGTFILE=%TGTDIR%%1" copyfile +shift +if not [%1] == [] goto start +goto endex +:nofiles +echo Error: %0 called with no files! +echo tgtdir=%tgtdir% +echo srcdir=%srcdir% +echo xargs.=%* +:endex +set tgtdir= +set srcdir= +echo. +<<KEEP + +# ----- Directory checking rules ----------------------------------------------- + +# ----- Generic directory check rule ------------------------------------------- + +$(TEMP)\mkpath.exe: nmake.mif + rem <<$(TEMP)\mkpath.c +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <direct.h> +#include <errno.h> + +int mkpath(char *); + +int main(int n, char **a) +{ + int i,rc; + + if (n<2) + return 1; + + for (i=1,rc=0;((i<n)&&(rc==0));i++) + rc = mkpath(a[i]); + + return rc; +} + +int mkpath(char *path) +{ + static char pbuf[2049]; + static char dbuf[2049]; + char *token; + + strcpy(pbuf,path); + + if ( (pbuf[0] == '/') || (pbuf[0] == '\\')) + strcpy(dbuf,"\\"); + else + strcpy(dbuf,""); + + token = strtok( pbuf, "/\\" ); + + while (token) + { + strcat(dbuf,token); + + if (dbuf[strlen(dbuf)-1] != ':') + { + FILE *fp; + + fp = fopen(dbuf,"rb"); + if (fp) fclose(fp); + + if (fp!=NULL) + { + printf("Error: [%s] is a file!\n", dbuf); + return 2; + } + + if (mkdir(dbuf)!=0) + { + switch (errno) + { + case EEXIST: + break; + default: + printf("Error creating [%s] : %s\n",dbuf,strerror(errno)); + return 2; + } + } + } + + token = strtok( NULL, "/\\" ); + if (token) strcat(dbuf,"\\"); + } + + return 0; +} +<<KEEP + $(CC) /nologo /MD /Fo$(TEMP)\ /Fe$@ $(TEMP)\mkpath.c + $(LINK) /nologo /subsystem:console /nodefaultlib /machine:ix86\ + /out:$@ $(TEMP)\mkpath.obj msvcrt.lib kernel32.lib gdi32.lib user32.lib oldnames.lib + +$(DIRECTORYNAME): $(TEMP)\mkpath.exe + if not exist "$@\$(NULL)" $(TEMP)\mkpath "$@" + +directory: $(TEMP)\mkpath.exe "$(DIRECTORYNAME)" + +# ----- Convenience direcotry checking rules ----------------------------------- + +!IF ("$(BINDIR)"!="$(DIRECTORYNAME)") +$(BINDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +!IF ("$(INCDIR)"!="$(DIRECTORYNAME)")&&("$(INCDIR)"!="$(BINDIR)") +$(INCDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +!IF ("$(USEDIR)"!="$(DIRECTORYNAME)")&&("$(USEDIR)"!="$(BINDIR)")&&("$(USEDIR)"!="$(INCDIR)") +$(USEDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +!IF ("$(RELDIR)"!="$(DIRECTORYNAME)")&&("$(RELDIR)"!="$(BINDIR)")&&("$(RELDIR)"!="$(INCDIR)")&&("$(RELDIR)"!="$(USEDIR)") +$(RELDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +!IF ("$(DEBDIR)"!="$(DIRECTORYNAME)")&&("$(DEBDIR)"!="$(BINDIR)")&&("$(DEBDIR)"!="$(INCDIR)")&&("$(DEBDIR)"!="$(USEDIR)")&&("$(DEBDIR)"!="$(RELDIR)") +$(DEBDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +!IF ("$(DISTDIR)"!="$(DIRECTORYNAME)")&&("$(DISTDIR)"!="$(BINDIR)")&&("$(DISTDIR)"!="$(INCDIR)")&&("$(DISTDIR)"!="$(USEDIR)")&&("$(DISTDIR)"!="$(RELDIR)")&&("$(DISTDIR)"!="$(DEBDIR)") +$(DISTDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +!IF ("$(OBJDIR)"!="$(DIRECTORYNAME)")&&("$(OBJDIR)"!="$(BINDIR)")&&("$(OBJDIR)"!="$(INCDIR)")&&("$(OBJDIR)"!="$(USEDIR)")&&("$(OBJDIR)"!="$(RELDIR)")&&("$(OBJDIR)"!="$(DEBDIR)")&&("$(OBJDIR)"!="$(DISTDIR)") +$(OBJDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +!IF ("$(RELDIR)"!="$(DIRECTORYNAME)")&&("$(RELDIR)"!="$(BINDIR)")&&("$(RELDIR)"!="$(INCDIR)")&&("$(RELDIR)"!="$(USEDIR)")&&("$(RELDIR)"!="$(RELDIR)")&&("$(RELDIR)"!="$(DEBDIR)")&&("$(RELDIR)"!="$(DISTDIR)")&&("$(RELDIR)"!="$(OBJDIR)") +$(RELDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +!IF ("$(DEBDIR)"!="$(DIRECTORYNAME)")&&("$(DEBDIR)"!="$(BINDIR)")&&("$(DEBDIR)"!="$(INCDIR)")&&("$(DEBDIR)"!="$(USEDIR)")&&("$(DEBDIR)"!="$(RELDIR)")&&("$(DEBDIR)"!="$(DEBDIR)")&&("$(DEBDIR)"!="$(DISTDIR)")&&("$(DEBDIR)"!="$(OBJDIR)") +$(DEBDIR): + nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory +!ENDIF + +# $(PCHDDIR): nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory + +# $(PCHRDIR): nmake /nologo /f nmake.mak "DIRECTORYNAME=$@" directory + +# ----- Header file update list ------------------------------------------------ + +headers: $(INCDIR) $(TEMP)\copyfile.mak $(TEMP)\copyfiles.bat +!IF "$(INCDIRSFX)" == "-" + $(TEMP)\copyfiles.bat $(INCDIR) $(INCDIR_L) $(H_FILES) +!ELSE + $(TEMP)\copyfiles.bat $(INCDIR)\$(INCDIRSFX) $(INCDIR_L)\$(INCDIRSFX) $(H_FILES) +!ENDIF + +headers.ck: $(INCDIR) $(TEMP)\copyfile.mak $(TEMP)\copyfiles.bat +!IF "$(INCDIRSFX)" == "-" + echo $(TEMP)\copyfiles.bat $(INCDIR) $(INCDIR_L) $(H_FILES)> $(TEMP)\headers.bat +!ELSE + echo $(TEMP)\copyfiles.bat $(INCDIR)\$(INCDIRSFX) $(INCDIR_L)\$(INCDIRSFX) $(H_FILES)> $(TEMP)\headers.bat +!ENDIF + type $(TEMP)\headers.bat + +# ----- Shared Object File dependancy directives ------------------------------- + +!IF "$(OBJDIR_R)" != "$(OBJDIR)" +obj: $(CPPDEPS) $(OBJDIR_R) $(OBJDIR) $(PCHFILE) $(OBJ) +!ELSE +obj: $(CPPDEPS) $(OBJDIR) $(PCHFILE) $(OBJ) +!ENDIF + +!IF ("$(COPYSOURCE)"!="") && ("$(COPYTARGET)"!="") +copyfile: $(TEMP)\copyfile.mak + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(COPYSOURCE)" "TGTFILE=$(COPYTARGET)" copyfile +!ENDIF + +# ----- Static Library build directives ---------------------------------------- + +$(OBJDIR)\$(LIBBASE)$(LIBSFX).lib: obj + echo $@ ... + lib /nologo /nodefaultlib /verbose /out:$@ /subsystem:$(SUBSYSTEM) @<< +$(OBJ: = +) +<< + +libbin: $(OBJDIR)\$(LIBBASE)$(LIBSFX).lib + +lib: + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) filelistxform + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) libbin + nmake /nologo /f nmake.mak filelistxform.kill + +$(USEDIR)\$(LIBPFX)$(LIBBASE)$(LIBSFX).lib: $(OBJDIR)\$(LIBBASE)$(LIBSFX).lib + echo $@ ... + $(COPYFILE) $? $@ > $(NULL) + +libup: $(USEDIR) lib $(TEMP)\copyfile.mak + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(LIBBASE)$(LIBSFX).lib" "TGTFILE=$(USEDIR)\$(LIBPFX)$(LIBBASE)$(LIBSFX).lib" copyfile + +libupck: $(USEDIR) lib $(TEMP)\copyfile.mak + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(LIBBASE)$(LIBSFX).lib" "TGTFILE=$(USEDIR)\$(LIBPFX)$(LIBBASE)$(LIBSFX).lib" copyfileck + +!IF "$(OBJDIR_R)" != "$(OBJDIR)" +libupr: $(USEDIR) lib $(TEMP)\copyfile.mak + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(LIBBASE)$(LIBSFX).lib" "TGTFILE=$(OBJDIR_R)\$(LIBBASE)$(LIBSFX).lib" copyfile +!ENDIF + +# ----- Dynamic Library build directives --------------------------------------- + +# Note: Shares 'obj' subtarget with normal 'lib' build and 'exe' build + +!IF "$(RCFILE)" != "" +$(OBJDIR)\$(LIBBASE)$(DEBTAG).res: $(RCFILE) + echo $(RCFILE) ... + rc $(RCFLAGS) /fo$@ $(RCFILE) + +resources: $(OBJDIR)\$(LIBBASE)$(DEBTAG).res +!ENDIF + +$(OBJDIR)\$(DLLBASE)$(LIBSFX).dll: obj + echo $@ ... + $(LINK) > $*.err /nologo @<<$*.rsp +/out:$@ +/opt:ref +/machine:ix86 +/debug +/pdb:$*.pdb +/map:$*.map +/dll +!IF "$(FORCELINKFLAGS)" != "" +$(FORCELINKFLAGS: = +) +!ENDIF +!IF "$(LINKLIBPATH)" != "" +$(LINKLIBPATH: = +) +!ENDIF +!IF "$(DLLBASEOPT)" != "" +$(DLLBASEOPT) +!ENDIF +!IF "$(DEFFILEOPT)" != "" +$(DEFFILEOPT) +!ENDIF +/nodefaultlib +/swaprun:cd +/swaprun:net +$(OBJ: = +) +!IF "$(DLLLIBS)" != "" +$(DLLLIBS: = +) +!ENDIF +$(CRTLIB).lib +!IF "$(USE_STD_CPP_HDRS)" == "1" +$(CXXRTLIB).lib +!ENDIF +kernel32.lib +gdi32.lib +user32.lib +oldnames.lib +<<KEEP + +dllbin: $(OBJDIR)\$(DLLBASE)$(LIBSFX).dll + +dll: $(DEFFILE) + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) filelistxform + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) BUILD_DLL=1 dllbin + nmake /nologo /f nmake.mak filelistxform.kill + +dllup: $(BINDIR) $(USEDIR) dll $(TEMP)\copyfile.mak + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).dll" "TGTFILE=$(BINDIR)\$(DLLBASE)$(LIBSFX).dll" copyfile + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).pdb" "TGTFILE=$(BINDIR)\$(DLLBASE)$(LIBSFX).pdb" copyfile + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).lib" "TGTFILE=$(USEDIR)\$(DLLBASE)$(LIBSFX).lib" copyfile + +!IF "$(OBJDIR_R)" != "$(OBJDIR)" +dllupr: dll $(TEMP)\copyfile.mak + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).dll" "TGTFILE=$(OBJDIR_R)\$(DLLBASE)$(LIBSFX).dll" copyfile + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).pdb" "TGTFILE=$(OBJDIR_R)\$(DLLBASE)$(LIBSFX).pdb" copyfile + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(DLLBASE)$(LIBSFX).lib" "TGTFILE=$(OBJDIR_R)\$(DLLBASE)$(LIBSFX).lib" copyfile +!ENDIF + +# ----- Execuable build directives (full multi-module exe) --------------------- + +# Note: Shares 'obj' subtarget with normal 'lib' build and 'dll' build + +!IF "$(PROC_EXEFILESERIES)" == "0" + +$(OBJDIR)\$(EXEFILE)$(EXESFX).exe: obj + echo $@ ... + $(LINK) > $*.err /nologo @<<$(OBJDIR)\$(EXEFILE)$(EXESFX).lnk +/debug /map:$*.map +/subsystem:$(SUBSYSTEM) $(FORCELINKFLAGS) +/nodefaultlib /swaprun:cd /swaprun:net +$(LINKLIBPATH) +/machine:ix86 +/out:$@ $(DEFFILEOPT) +$(OBJ: = +) +$(EXELIBS: = +) +$(CRTLIB).lib +!IF "$(USE_STD_CPP_HDRS)" == "1" +$(CXXRTLIB).lib +!ENDIF +kernel32.lib +gdi32.lib +user32.lib +oldnames.lib +<<KEEP + +exebin: $(OBJDIR)\$(EXEFILE)$(EXESFX).EXE + +exe: $(DEFFILE) + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) filelistxform + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) exebin + nmake /nologo /f nmake.mak filelistxform.kill + +exeup: $(BINDIR) exe $(TEMP)\copyfile.mak + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(EXEFILE)$(EXESFX).EXE" "TGTFILE=$(BINDIR)\$(EXEFILE)$(EXESFX).EXE" copyfile + +exeupck: $(BINDIR) exe $(TEMP)\copyfile.mak + nmake /nologo /f $(TEMP)\copyfile.mak "SRCFILE=$(OBJDIR)\$(EXEFILE)$(EXESFX).EXE" "TGTFILE=$(BINDIR)\$(EXEFILE)$(EXESFX).EXE" copyfileck + +!ENDIF # "$(PROC_EXEFILESERIES)" == "0" + +# ----- meta-lib build - all libs & test executable ---------------------------- + +metalib: + echo Building '$(LIBBASE)' series ... +!IF ( ("$(NODEBUG)" == "0") && ("$(NOSTATIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-s LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + lib +!ENDIF +!IF ( ("$(NODEBUG)" == "0") && ("$(NODYNAMIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + lib +!ENDIF +!IF ( ("$(NORELEASE)" == "0") && ("$(NOSTATIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-s LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + lib +!ENDIF +!IF ( ("$(NORELEASE)" == "0") && ("$(NODYNAMIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + lib +!ENDIF +!IF ( ("$(NORELEASE)" == "0") && ("$(NODYNAMIC)" == "0") && ("$(EXE)" != "") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + exe +!ENDIF + echo. + +# ----- use/bin directories update --------------------------------------------- + +metalibup: + echo Updating '$(LIBBASE)' series ... +!IF ( ("$(NORELEASE)" == "0") && ("$(NOSTATIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-s LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libup +!ENDIF +!IF ( ("$(NORELEASE)" == "0") && ("$(NODYNAMIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libup +!ENDIF +!IF ( ("$(NODEBUG)" == "0") && ("$(NOSTATIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-s LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libup +!ENDIF +!IF ( ("$(NODEBUG)" == "0") && ("$(NODYNAMIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libup +!ENDIF +!IF ( ("$(NORELEASE)" == "0") && ("$(NODYNAMIC)" == "0") && ("$(EXE)" != "") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + exeup +!ENDIF + echo. + +!IF "$(OBJDIR_R)" != "$(OBJDIR)" +metalibupr: + echo Updating '$(LIBBASE)' series (local) ... +!IF ( ("$(NORELEASE)" == "0") && ("$(NOSTATIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-s LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupr +!ENDIF +!IF ( ("$(NORELEASE)" == "0") && ("$(NODYNAMIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupr +!ENDIF +!IF ( ("$(NODEBUG)" == "0") && ("$(NOSTATIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-s LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupr +!ENDIF +!IF ( ("$(NODEBUG)" == "0") && ("$(NODYNAMIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupr +!ENDIF + echo. +!ENDIF + +metalibupck: + echo Updating '$(LIBBASE)' series ... +!IF ( ("$(NORELEASE)" == "0") && ("$(NOSTATIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-s LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupck +!ENDIF +!IF ( ("$(NORELEASE)" == "0") && ("$(NODYNAMIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupck +!ENDIF +!IF ( ("$(NODEBUG)" == "0") && ("$(NOSTATIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-s LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupck +!ENDIF +!IF ( ("$(NODEBUG)" == "0") && ("$(NODYNAMIC)" == "0") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupck +!ENDIF +!IF ( ("$(NORELEASE)" == "0") && ("$(NODYNAMIC)" == "0") && ("$(EXE)" != "") ) + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-d LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + libupck +!ENDIF + echo. + +# ----- DLL meta rule + +metadll: + echo Building '$(LIBBASE)' DLL series ... +!IF ("$(NORELEASE)" == "0") + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-$(CRTTYPE) LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + dll +!ENDIF +!IF ("$(NODEBUG)" == "0") + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-$(CRTTYPE) LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + dll +!ENDIF + echo. + +# ----- DLL meta=update rule + +metadllup: + echo Updating '$(LIBBASE)' series ... +!IF ("$(NORELEASE)" == "0") + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-$(CRTTYPE) LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + dllup +!ENDIF +!IF ("$(NODEBUG)" == "0") + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-$(CRTTYPE) LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + dllup +!ENDIF + echo. + +metadllupr: + echo Updating '$(LIBBASE)' series (local) ... +!IF ("$(NORELEASE)" == "0") + nmake /nologo /f $(MAKEFILE) LIBTYPE=r-$(CRTTYPE) LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + dllupr +!ENDIF +!IF ("$(NODEBUG)" == "0") + nmake /nologo /f $(MAKEFILE) LIBTYPE=d-$(CRTTYPE) LIBBASE=$(LIBBASE)\ + EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) DLLBASE=$(DLLBASE)\ + NOSTATIC=$(NOSTATIC) NODYNAMIC=$(NODYNAMIC)\ + NODEBUG=$(NODEBUG) NORELEASE=$(NORELEASE)\ + dllupr +!ENDIF + echo. + +# ----- Single-Step source->exe build list ------------------------------------ + +exefileseries.msg: + type << + +----- Building executable file/series -------------------------------- +$(EXEFILESLIST) +---------------------------------------------------------------------- + +<< + +!IF "$(OBJDIR_R)" != "$(OBJDIR)" +exefileseries.bin: exefileseries.msg $(CPPDEPS) $(OBJDIR_R) $(OBJDIR) $(EXESUPLIBSLIST) $(EXEFILESLIST) +!ELSE +exefileseries.bin: exefileseries.msg $(CPPDEPS) $(OBJDIR) $(EXESUPLIBSLIST) $(EXEFILESLIST) +!ENDIF + +suplibdeps: $(SUPLIBDEPS) + +exefileseries: # suplibdeps + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) filelistxform + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) PROC_EXEFILESERIES=1 exefileseries.bin + +exefilestatus: + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) filelistxform + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) status + +EXEFSERIESLIST = $(SRCFILES:.asm=.exe) +EXEFSERIESLIST = $(EXEFSERIESLIST:.cpp=.exe) +EXEFSERIESLIST = $(EXEFSERIESLIST:.cxx=.exe) +EXEFSERIESLIST = $(EXEFSERIESLIST:.cc=.exe) +EXEFSERIESLIST = $(EXEFSERIESLIST:.c=.exe) +EXEFSERIESLIST = $(EXEFSERIESLIST:.a=.exe) + +!IF "$(OBJDIR_R)" != "$(OBJDIR)" +exefileseries.copy: exefileseries.msg $(OBJDIR_R) $(OBJDIR) $(EXESUPLIBSLIST) $(EXEFILESLIST) +!ELSE +exefileseries.copy: exefileseries.msg $(OBJDIR) $(EXESUPLIBSLIST) $(EXEFILESLIST) +!ENDIF + echo Updating $(BINDIR) ... + echo. + $(TEMP)\copyfiles.bat $(BINDIR) $(OBJDIR) $(EXEFSERIESLIST) + +exefileseriesup: $(TEMP)\copyfile.mak $(TEMP)\copyfiles.bat + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) filelistxform + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) PROC_EXEFILESERIES=1 exefileseries.copy + +# ----- Clear exes from build and optional target directories ----------------- + +EXEFILESLISTCLR = $(SRCFILES:.asm=.exe) +EXEFILESLISTCLR = $(EXEFILESLISTCLR:.cpp=.exe) +EXEFILESLISTCLR = $(EXEFILESLISTCLR:.cxx=.exe) +EXEFILESLISTCLR = $(EXEFILESLISTCLR:.cc=.exe) +EXEFILESLISTCLR = $(EXEFILESLISTCLR:.c=.exe) +EXEFILESLISTCLR = $(EXEFILESLISTCLR:.a=.exe) + +!IF "$(DEBUG)" == "1" +EXEFILESLISTCLR = $(EXEFILESLISTCLR:.exe=d.exe) +!ENDIF + +clrxfileseries.msg: + echo ... cleaning $(BINDIR) ... + +$(EXEFILESLISTCLR:.exe=.execlr): + if exist "$(BINDIR)\$(@B).EXE" echo ... removing $(BINDIR)\$(@B).EXE + if exist "$(BINDIR)\$(@B).EXE" del "$(BINDIR)\$(@B).EXE" + +exefileseries.clr: clrxfileseries.msg $(EXEFILESLISTCLR:.exe=.execlr) + +clrxfileseries: + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) filelistxform + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) PROC_EXEFILESERIES=1 exefileseries.clr + nmake /nologo /f nmake.mak filelistxform.kill + +# ----- Distribution setup ---------------------------------------------------- + +!IF "$(NMAKE_MIF_FILE)" != "nmake.mif" +nmake.mif: $(NMAKE_MIF_FILE) + echo $@ ... + $(COPYFILE) $? $@ > $(NULL) +!ENDIF + +_distfiles: $(TEMP)\copyfile.mak $(TEMP)\copyfiles.bat + echo $@ not yet ready for prime time. + +_distfiles.old: +!IF "$(H_FILES)" != "" + $(TEMP)\copyfiles $(DISTDIR) . $(INCDIRSFX) $(H_FILES) +!ENDIF +!IF "$(MANIFEST)" != "" + $(TEMP)\copyfiles $(DISTDIR) . - $(MANIFEST) +!ENDIF + +distcore: $(DISTDIR) $(NMAKE_MIF_FILE) _distfiles + +# ----- Cleanup --------------------------------------------------------------- + +cleanlib: + -if exist "$(OBJDIR)\$(NULL)" $(DELTREE) $(OBJDIR) + +cleanexe: + echo. > $(EXEFILE).EXE + del $(EXEFILE).exe > $(NULL) + +cleanroot: $(RELDIR) $(DEBDIR) + -$(DELTREE) $(RELDIR) $(DEBDIR) > $(NULL) +!IF "$(CLEANSUPS)" != "" + -$(DELTREE) $(CLEANSUPS) > $(NULL) +!ENDIF + echo. > foo.ncb + del *.ncb > $(NULL) + echo. > $(TEMP)\copyfiles.bat + del $(TEMP)\copyfiles.bat > $(NULL) + echo. > $(TEMP)\copyfile.mak + del $(TEMP)\copyfile.mak > $(NULL) + +# ----- special common targets ------------------------------------------------ + +status.core: + $(PAGER) < <<$(TEMP)\nmake.status +Status Information - Directories +---------------------------------------------------------------------- +BINDIR........... = $(BINDIR) +DEBDIR........... = $(DEBDIR) +DEVDIR........... = $(DEVDIR) +DISTDIR.......... = $(DISTDIR) +INCDIR........... = $(INCDIR) +INCDIR_L......... = $(INCDIR_L) +INTDIRSFX........ = $(INTDIRSFX) +OBJDIR........... = $(OBJDIR) +OBJDIR_R......... = $(OBJDIR_R) +PCHDIR........... = $(PCHDIR) +PCHRDIR.......... = $(PCHRDIR) +PCHDDIR.......... = $(PCHDDIR) +RELDIR........... = $(RELDIR) +SRCPATH.......... = $(SRCPATH) +SRCALT1.......... = $(SRCALT1) +SRCALT2.......... = $(SRCALT2) +SRCALT3.......... = $(SRCALT3) +SRCALT4.......... = $(SRCALT4) +ALTLIBPATH....... = $(ALTLIBPATH) +TEMP............. = $(TEMP) +USEDIR........... = $(USEDIR) +---------------------------------------------------------------------- +Status Information - Build Control +---------------------------------------------------------------------- +CRTLIB........... = $(CRTLIB) +CRTTYPE.......... = $(CRTTYPE) +DEBUG............ = $(DEBUG) +DLL.............. = $(OBJDIR)\$(DLLBASE).dll +DLLBASE.......... = $(DLLBASE) +DLLIMPLIB........ = $(OBJDIR)\$(DLLBASE).lib +DOGUI............ = $(DOGUI) +EXELIBS.......... = $(EXELIBS) +EXESFX........... = $(EXESFX) +EXETYPE.......... = $(EXETYPE) +FORCELINK........ = $(FORCELINK) +LIB.............. = $(OBJDIR)\$(LIBPFX)$(LIBBASE)$(LIBSFX).lib +LIBBASE.......... = $(LIBBASE) +LIBTYPE.......... = $(LIBTYPE) +LINKTARGET....... = $(LINKTARGET) +MAKEFILE......... = $(MAKEFILE) +NODEBUG.......... = $(NODEBUG) +NODYNAMIC........ = $(NODYNAMIC) +NOPCH............ = $(NOPCH) +NORELEASE........ = $(NORELEASE) +NOSTATIC......... = $(NOSTATIC) +---------------------------------------------------------------------- +Status Information - Compiler Options +---------------------------------------------------------------------- +!IF "$(LIBCNTRL)" == "" +CLOPTIONS........ = (starts on next line) +$(CLOPTIONS) -----##---- +MLOPTIONS........ = (starts on next line) +$(MLOPTIONS) -----##---- +!ELSE +CLOPTIONS........ = (incl. LIBCNTRL, starts on next line) +$(CLOPTIONS) $(LIBCNTRL) -----##---- +MLOPTIONS........ = (incl. LIBCNTRL, starts on next line) +$(MLOPTIONS) $(LIBCNTRL) -----##---- +!ENDIF +CPP_PCH.......... = $(CPP_PCH) +CPPOPTS.......... = $(CPPOPTS) +CPPDEPS.......... = $(SPPDEPS) +DEFFILE.......... = $(DEFFILE) +EEXEOBJ.......... = $(EEXEOBJ) +H_FILES.......... = $(H_FILES) +LINKTARGET....... = $(LINKTARGET) +MAKEFILE......... = $(MAKEFILE) +MLOPTS........... = $(MLOPTS) +MLOPTFLAGS....... = $(MLOPTFLAGS) +OPTFLAGS......... = $(OPTFLAGS) +PCHINCROOT....... = $(PCHINCROOT) +PCHINCFILE....... = $(PCHINCFILE) +PCHSOURCEFILE.... = $(PCHSOURCEFILE) +PCHFILE.......... = $(PCHFILE) +PCHOBJFILE....... = $(PCHOBJFILE) +PCHOPTS.......... = $(PCHOPTS) +PCHOPTSC......... = $(PCHOTPSC) +EXEFILE.......... = $(EXEFILE) +EXEFILESLIST..... = (starts on next line) +$(EXEFILESLIST) +EXESUPLIBSLIST... = (starts on next line) +$(EXESUPLIBSLIST) +SRCFILES......... = (starts on next line) +$(SRCFILES) +SUPLIBSSRC....... = (starts on next line) +$(SUPLIBSSRC) +SUPLIBSLIST...... = (starts on next line) +$(SUPLIBSLIST) +OBJ.............. = (starts on next line) +$(OBJ) +OBJ2............. = (starts on next line) +$(OBJ2) +---------------------------------------------------------------------- +EXEFILESLIST = $(OBJDIR)\$$(EXEFILESLIST: = $(OBJDIR)\) +OBJ = $(OBJDIR)\$$(OBJ: = $(OBJDIR)\) +!IF "$(EXESUPLIBSLIST)" != "" +EXESUPLIBSLIST = $(OBJDIR)\$$(EXESUPLIBSLIST: = $(OBJDIR)\) +!ENDIF +---------------------------------------------------------------------- +<< + +status: + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) filelistxform + nmake /nologo /f nmake.mak EXEFILE=$(EXEFILE) EXETYPE=$(EXETYPE) EXEBASE=$(EXEBASE) LIBBASE=$(LIBBASE) DLLBASE=$(DLLBASE) status.core + nmake /nologo /f nmake.mak filelistxform.kill + +force: clean all diff --git a/xc/extras/Mesa/WIN32/RES/Mesa32.rc b/xc/extras/Mesa/WIN32/RES/Mesa32.rc new file mode 100644 index 000000000..8e0a6fa29 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/Mesa32.rc @@ -0,0 +1,32 @@ +#include <windows.h> + +#define IDR_VERSION1 1 +IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE + FILEVERSION 3,1,0,0 + PRODUCTVERSION 3,1,0,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + + BEGIN + VALUE "FileDescription", "mesa32 3D Graphics Library\0" + VALUE "FileVersion", "3.1\0" + VALUE "InternalName", "MESAGL32\0" + VALUE "OriginalFilename", "OPENGL32.DLL\0" + VALUE "ProductName", "OPENGL32.DLL\0" + VALUE "Comments", "Thanks to Brian Paul for making this possible\r\n\0" + VALUE "LegalCopyright", "Copyright (C) 1995-1997 Brian Paul\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/xc/extras/Mesa/WIN32/RES/fxMesa32.def b/xc/extras/Mesa/WIN32/RES/fxMesa32.def new file mode 100644 index 000000000..f64b5d285 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/fxMesa32.def @@ -0,0 +1,473 @@ +DESCRIPTION '"""Mesa 3D graphics library for Win32 Glide 2x"""' + +VERSION 3.1 + +HEAPSIZE 1048576,4096 + +EXPORTS + glAccum + glAlphaFunc + glAreTexturesResident + glArrayElement + glBegin + glBindTexture + glBitmap + glBlendFunc + glCallList + glCallLists + glClear + glClearAccum + glClearIndex + glClearColor + glClearDepth + glClearStencil + glClipPlane + glColor3b + glColor3d + glColor3f + glColor3i + glColor3s + glColor3ub + glColor3ui + glColor3us + glColor4b + glColor4d + glColor4f + glColor4i + glColor4s + glColor4ub + glColor4ui + glColor4us + glColor3bv + glColor3dv + glColor3fv + glColor3iv + glColor3sv + glColor3ubv + glColor3uiv + glColor3usv + glColor4bv + glColor4dv + glColor4fv + glColor4iv + glColor4sv + glColor4ubv + glColor4uiv + glColor4usv + glColorMask + glColorMaterial + glColorPointer + glColorTableEXT + glColorSubTableEXT + glCopyPixels + glCopyTexImage1D + glCopyTexImage2D + glCopyTexSubImage1D + glCopyTexSubImage2D + glCullFace + glDepthFunc + glDepthMask + glDepthRange + glDeleteLists + glDeleteTextures + glDisable + glDisableClientState + glDrawArrays + glDrawBuffer + glDrawElements + glDrawPixels + glEnable + glEnableClientState + glEnd + glEndList + glEvalCoord1d + glEvalCoord1f + glEvalCoord1dv + glEvalCoord1fv + glEvalCoord2d + glEvalCoord2f + glEvalCoord2dv + glEvalCoord2fv + glEvalPoint1 + glEvalPoint2 + glEvalMesh1 + glEdgeFlag + glEdgeFlagv + glEdgeFlagPointer + glEvalMesh2 + glFeedbackBuffer + glFinish + glFlush + glFogf + glFogi + glFogfv + glFogiv + glFrontFace + glFrustum + glGenLists + glGenTextures + glGetBooleanv + glGetClipPlane + glGetColorTableEXT + glGetColorTableParameterivEXT + glGetColorTableParameterfvEXT + glGetDoublev + glGetError + glGetFloatv + glGetIntegerv + glGetLightfv + glGetLightiv + glGetMapdv + glGetMapfv + glGetMapiv + glGetMaterialfv + glGetMaterialiv + glGetPixelMapfv + glGetPixelMapuiv + glGetPixelMapusv + glGetPointerv + glGetPolygonStipple + glGetString + glGetTexEnvfv + glGetTexEnviv + glGetTexGeniv + glGetTexGendv + glGetTexGenfv + glGetTexImage + glGetTexLevelParameterfv + glGetTexLevelParameteriv + glGetTexParameterfv + glGetTexParameteriv + glHint + glIndexd + glIndexf + glIndexi + glIndexs + glIndexub + glIndexdv + glIndexfv + glIndexiv + glIndexsv + glIndexubv + glIndexMask + glIndexPointer + glInterleavedArrays + glInitNames + glIsList + glIsTexture + glLightf + glLighti + glLightfv + glLightiv + glLightModelf + glLightModeli + glLightModelfv + glLightModeliv + glLineWidth + glLineStipple + glListBase + glLoadIdentity + glLoadMatrixd + glLoadMatrixf + glLoadName + glLogicOp + glMap1d + glMap1f + glMap2d + glMap2f + glMapGrid1d + glMapGrid1f + glMapGrid2d + glMapGrid2f + glMaterialf + glMateriali + glMaterialfv + glMaterialiv + glMatrixMode + glMultMatrixd + glMultMatrixf + glNewList + glNormal3b + glNormal3d + glNormal3f + glNormal3i + glNormal3s + glNormal3bv + glNormal3dv + glNormal3fv + glNormal3iv + glNormal3sv + glNormalPointer + glOrtho + glPassThrough + glPixelMapfv + glPixelMapuiv + glPixelMapusv + glPixelStoref + glPixelStorei + glPixelTransferf + glPixelTransferi + glPixelZoom + glPointSize + glPolygonMode + glPolygonOffset + glPolygonOffsetEXT + glPolygonStipple + glPopAttrib + glPopClientAttrib + glPopMatrix + glPopName + glPrioritizeTextures + glPushMatrix + glRasterPos2d + glRasterPos2f + glRasterPos2i + glRasterPos2s + glRasterPos3d + glRasterPos3f + glRasterPos3i + glRasterPos3s + glRasterPos4d + glRasterPos4f + glRasterPos4i + glRasterPos4s + glRasterPos2dv + glRasterPos2fv + glRasterPos2iv + glRasterPos2sv + glRasterPos3dv + glRasterPos3fv + glRasterPos3iv + glRasterPos3sv + glRasterPos4dv + glRasterPos4fv + glRasterPos4iv + glRasterPos4sv + glReadBuffer + glReadPixels + glRectd + glRectf + glRecti + glRects + glRectdv + glRectfv + glRectiv + glRectsv + glScissor + glIsEnabled + glPushAttrib + glPushClientAttrib + glPushName + glRenderMode + glRotated + glRotatef + glSelectBuffer + glScaled + glScalef + glShadeModel + glStencilFunc + glStencilMask + glStencilOp + glTexCoord1d + glTexCoord1f + glTexCoord1i + glTexCoord1s + glTexCoord2d + glTexCoord2f + glTexCoord2i + glTexCoord2s + glTexCoord3d + glTexCoord3f + glTexCoord3i + glTexCoord3s + glTexCoord4d + glTexCoord4f + glTexCoord4i + glTexCoord4s + glTexCoord1dv + glTexCoord1fv + glTexCoord1iv + glTexCoord1sv + glTexCoord2dv + glTexCoord2fv + glTexCoord2iv + glTexCoord2sv + glTexCoord3dv + glTexCoord3fv + glTexCoord3iv + glTexCoord3sv + glTexCoord4dv + glTexCoord4fv + glTexCoord4iv + glTexCoord4sv + glTexCoordPointer + glTexGend + glTexGenf + glTexGeni + glTexGendv + glTexGeniv + glTexGenfv + glTexEnvf + glTexEnvi + glTexEnvfv + glTexEnviv + glTexImage1D + glTexImage2D + glTexParameterf + glTexParameteri + glTexParameterfv + glTexParameteriv + glTexSubImage1D + glTexSubImage2D + glTranslated + glTranslatef + glVertex2d + glVertex2f + glVertex2i + glVertex2s + glVertex3d + glVertex3f + glVertex3i + glVertex3s + glVertex4d + glVertex4f + glVertex4i + glVertex4s + glVertex2dv + glVertex2fv + glVertex2iv + glVertex2sv + glVertex3dv + glVertex3fv + glVertex3iv + glVertex3sv + glVertex4dv + glVertex4fv + glVertex4iv + glVertex4sv + glVertexPointer + glViewport + glBlendEquationEXT + glBlendColorEXT + glVertexPointerEXT + glNormalPointerEXT + glColorPointerEXT + glIndexPointerEXT + glTexCoordPointerEXT + glEdgeFlagPointerEXT + glGetPointervEXT + glArrayElementEXT + glDrawArraysEXT + glBindTextureEXT + glDeleteTexturesEXT + glGenTexturesEXT + glPrioritizeTexturesEXT + glCopyTexSubImage3DEXT + glTexImage3DEXT + glTexSubImage3DEXT + glWindowPos4fMESA + glWindowPos2iMESA + glWindowPos2sMESA + glWindowPos2fMESA + glWindowPos2dMESA + glWindowPos2ivMESA + glWindowPos2svMESA + glWindowPos2fvMESA + glWindowPos2dvMESA + glWindowPos3iMESA + glWindowPos3sMESA + glWindowPos3fMESA + glWindowPos3dMESA + glWindowPos3ivMESA + glWindowPos3svMESA + glWindowPos3fvMESA + glWindowPos3dvMESA + glWindowPos4iMESA + glWindowPos4sMESA + glWindowPos4dMESA + glWindowPos4ivMESA + glWindowPos4svMESA + glWindowPos4fvMESA + glWindowPos4dvMESA + glResizeBuffersMESA + wglCopyContext + wglCreateContext + wglCreateLayerContext + wglDeleteContext +;wglDescribeLayerPlane + wglGetCurrentContext + wglGetCurrentDC +;wglGetLayerPaletteEntries + wglGetProcAddress + wglMakeCurrent +;wglRealizeLayerPalette +;wglSetLayerPaletteEntries + wglShareLists + wglSwapLayerBuffers + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + wglChoosePixelFormat + ChoosePixelFormat + wglDescribePixelFormat + DescribePixelFormat + wglGetPixelFormat + GetPixelFormat + wglSetPixelFormat + SetPixelFormat + wglSwapBuffers + SwapBuffers + gl3DfxSetPaletteEXT + glActiveTextureARB + glClientActiveTextureARB + glMultiTexCoord1dARB + glMultiTexCoord1dvARB + glMultiTexCoord1fARB + glMultiTexCoord1fvARB + glMultiTexCoord1iARB + glMultiTexCoord1ivARB + glMultiTexCoord1sARB + glMultiTexCoord1svARB + glMultiTexCoord2dARB + glMultiTexCoord2dvARB + glMultiTexCoord2fARB + glMultiTexCoord2fvARB + glMultiTexCoord2iARB + glMultiTexCoord2ivARB + glMultiTexCoord2sARB + glMultiTexCoord2svARB + glMultiTexCoord3dARB + glMultiTexCoord3dvARB + glMultiTexCoord3fARB + glMultiTexCoord3fvARB + glMultiTexCoord3iARB + glMultiTexCoord3ivARB + glMultiTexCoord3sARB + glMultiTexCoord3svARB + glMultiTexCoord4dARB + glMultiTexCoord4dvARB + glMultiTexCoord4fARB + glMultiTexCoord4fvARB + glMultiTexCoord4iARB + glMultiTexCoord4ivARB + glMultiTexCoord4sARB + glMultiTexCoord4svARB + fxMesaCreateContext + fxMesaCreateBestContext + fxMesaDestroyContext + fxMesaSelectCurrentBoard + fxMesaMakeCurrent + fxMesaGetCurrentContext + fxMesaSwapBuffers + fxMesaSetNearFar + fxMesaUpdateScreenSize + fxQueryHardware + fxCloseHardware + OSMesaCreateContext + OSMesaDestroyContext + OSMesaGetCurrentContext + OSMesaGetDepthBuffer + OSMesaGetIntegerv + OSMesaMakeCurrent + OSMesaPixelStore diff --git a/xc/extras/Mesa/WIN32/RES/fxMesa32.rc b/xc/extras/Mesa/WIN32/RES/fxMesa32.rc new file mode 100644 index 000000000..9c3d49e1f --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/fxMesa32.rc @@ -0,0 +1,32 @@ +#include <windows.h> + +#define IDR_VERSION1 1 +IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE + FILEVERSION 3,1,0,0 + PRODUCTVERSION 3,1,0,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + + BEGIN + VALUE "FileDescription", "fxmesa32 3D Graphics Library\0" + VALUE "FileVersion", "3.1\0" + VALUE "InternalName", "FXMESAGL32\0" + VALUE "OriginalFilename", "OPENGL32.DLL\0" + VALUE "ProductName", "OPENGL32.DLL\0" + VALUE "Comments", "Thanks to Brian Paul for making this possible\r\nRequires GLIDE2X.DLL.\0" + VALUE "LegalCopyright", "Copyright (C) 1995-1997 Brian Paul\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/xc/extras/Mesa/WIN32/RES/mesa32.def b/xc/extras/Mesa/WIN32/RES/mesa32.def new file mode 100644 index 000000000..0dbe1c266 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/mesa32.def @@ -0,0 +1,471 @@ +DESCRIPTION '"""Mesa 3D graphics library for Win32"""' + +VERSION 3.1 + +HEAPSIZE 1048576,4096 + +EXPORTS + glAccum + glAlphaFunc + glAreTexturesResident + glAreTexturesResidentEXT + glArrayElement + glArrayElementEXT + glBegin + glBindTexture + glBindTextureEXT + glBitmap + glBlendColorEXT + glBlendEquationEXT + glBlendFunc + glCallList + glCallLists + glClear + glClearAccum + glClearColor + glClearDepth + glClearIndex + glClearStencil + glClipPlane + glColor3b + glColor3bv + glColor3d + glColor3dv + glColor3f + glColor3fv + glColor3i + glColor3iv + glColor3s + glColor3sv + glColor3ub + glColor3ubv + glColor3ui + glColor3uiv + glColor3us + glColor3usv + glColor4b + glColor4bv + glColor4d + glColor4dv + glColor4f + glColor4fv + glColor4i + glColor4iv + glColor4s + glColor4sv + glColor4ub + glColor4ubv + glColor4ui + glColor4uiv + glColor4us + glColor4usv + glColorMask + glColorMaterial + glColorPointer + glColorPointerEXT + glColorSubTableEXT + glColorTableEXT + glCopyPixels + glCopyTexImage1D + glCopyTexImage2D + glCopyTexSubImage1D + glCopyTexSubImage2D + glCopyTexSubImage3D + glCopyTexSubImage3DEXT + glCullFace + glDeleteLists + glDeleteTextures + glDeleteTexturesEXT + glDepthFunc + glDepthMask + glDepthRange + glDisable + glDisableClientState + glDrawArrays + glDrawArraysEXT + glDrawBuffer + glDrawElements + glDrawPixels + glDrawRangeElements + glEdgeFlag + glEdgeFlagPointer + glEdgeFlagPointerEXT + glEdgeFlagv + glEnable + glEnableClientState + glEnd + glEndList + glEvalCoord1d + glEvalCoord1dv + glEvalCoord1f + glEvalCoord1fv + glEvalCoord2d + glEvalCoord2dv + glEvalCoord2f + glEvalCoord2fv + glEvalMesh1 + glEvalMesh2 + glEvalPoint1 + glEvalPoint2 + glFeedbackBuffer + glFinish + glFlush + glFogf + glFogfv + glFogi + glFogiv + glFrontFace + glFrustum + glGenLists + glGenTextures + glGenTexturesEXT + glGetBooleanv + glGetClipPlane + glGetColorTableEXT + glGetColorTableParameterfvEXT + glGetColorTableParameterivEXT + glGetDoublev + glGetError + glGetFloatv + glGetIntegerv + glGetLightfv + glGetLightiv + glGetMapdv + glGetMapfv + glGetMapiv + glGetMaterialfv + glGetMaterialiv + glGetPixelMapfv + glGetPixelMapuiv + glGetPixelMapusv + glGetPointerv + glGetPointervEXT + glGetPolygonStipple + glGetString + glGetTexEnvfv + glGetTexEnviv + glGetTexGendv + glGetTexGenfv + glGetTexGeniv + glGetTexImage + glGetTexLevelParameterfv + glGetTexLevelParameteriv + glGetTexParameterfv + glGetTexParameteriv + glHint + glIndexd + glIndexdv + glIndexf + glIndexfv + glIndexi + glIndexiv + glIndexMask + glIndexPointer + glIndexPointerEXT + glIndexs + glIndexsv + glIndexub + glIndexubv + glInitNames + glInterleavedArrays +; glInterleavedTextureCoordSetsEX; removed in Mesa 3.1? + glIsEnabled + glIsList + glIsTexture + glIsTextureEXT + glLightf + glLightfv + glLighti + glLightiv + glLightModelf + glLightModelfv + glLightModeli + glLightModeliv + glLineStipple + glLineWidth + glListBase + glLoadIdentity + glLoadMatrixd + glLoadMatrixf + glLoadName + glLogicOp + glMap1d + glMap1f + glMap2d + glMap2f + glMapGrid1d + glMapGrid1f + glMapGrid2d + glMapGrid2f + glMaterialf + glMaterialfv + glMateriali + glMaterialiv + glMatrixMode +; glMultiTexCoord1dEXT ; removed in Mesa 3.1? +; glMultiTexCoord1dvEXT ; removed in Mesa 3.1? +; glMultiTexCoord1fEXT ; removed in Mesa 3.1? +; glMultiTexCoord1fvEXT ; removed in Mesa 3.1? +; glMultiTexCoord1iEXT ; removed in Mesa 3.1? +; glMultiTexCoord1ivEXT ; removed in Mesa 3.1? +; glMultiTexCoord1sEXT ; removed in Mesa 3.1? +; glMultiTexCoord1svEXT ; removed in Mesa 3.1? +; glMultiTexCoord2dEXT ; removed in Mesa 3.1? +; glMultiTexCoord2dvEXT ; removed in Mesa 3.1? +; glMultiTexCoord2fEXT ; removed in Mesa 3.1? +; glMultiTexCoord2fvEXT ; removed in Mesa 3.1? +; glMultiTexCoord2iEXT ; removed in Mesa 3.1? +; glMultiTexCoord2ivEXT ; removed in Mesa 3.1? +; glMultiTexCoord2sEXT ; removed in Mesa 3.1? +; glMultiTexCoord2svEXT ; removed in Mesa 3.1? +; glMultiTexCoord3dEXT ; removed in Mesa 3.1? +; glMultiTexCoord3dvEXT ; removed in Mesa 3.1? +; glMultiTexCoord3fEXT ; removed in Mesa 3.1? +; glMultiTexCoord3fvEXT ; removed in Mesa 3.1? +; glMultiTexCoord3iEXT ; removed in Mesa 3.1? +; glMultiTexCoord3ivEXT ; removed in Mesa 3.1? +; glMultiTexCoord3sEXT ; removed in Mesa 3.1? +; glMultiTexCoord3svEXT ; removed in Mesa 3.1? +; glMultiTexCoord4dEXT ; removed in Mesa 3.1? +; glMultiTexCoord4dvEXT ; removed in Mesa 3.1? +; glMultiTexCoord4fEXT ; removed in Mesa 3.1? +; glMultiTexCoord4fvEXT ; removed in Mesa 3.1? +; glMultiTexCoord4iEXT ; removed in Mesa 3.1? +; glMultiTexCoord4ivEXT ; removed in Mesa 3.1? +; glMultiTexCoord4sEXT ; removed in Mesa 3.1? +; glMultiTexCoord4svEXT ; removed in Mesa 3.1? + glMultMatrixd + glMultMatrixf + glNewList + glNormal3b + glNormal3bv + glNormal3d + glNormal3dv + glNormal3f + glNormal3fv + glNormal3i + glNormal3iv + glNormal3s + glNormal3sv + glNormalPointer + glNormalPointerEXT + glOrtho + glPassThrough + glPixelMapfv + glPixelMapuiv + glPixelMapusv + glPixelStoref + glPixelStorei + glPixelTransferf + glPixelTransferi + glPixelZoom + glPointParameterfEXT + glPointParameterfvEXT + glPointSize + glPolygonMode + glPolygonOffset + glPolygonOffsetEXT + glPolygonStipple + glPopAttrib + glPopClientAttrib + glPopMatrix + glPopName + glPrioritizeTextures + glPrioritizeTexturesEXT + glPushAttrib + glPushClientAttrib + glPushMatrix + glPushName + glRasterPos2d + glRasterPos2dv + glRasterPos2f + glRasterPos2fv + glRasterPos2i + glRasterPos2iv + glRasterPos2s + glRasterPos2sv + glRasterPos3d + glRasterPos3dv + glRasterPos3f + glRasterPos3fv + glRasterPos3i + glRasterPos3iv + glRasterPos3s + glRasterPos3sv + glRasterPos4d + glRasterPos4dv + glRasterPos4f + glRasterPos4fv + glRasterPos4i + glRasterPos4iv + glRasterPos4s + glRasterPos4sv + glReadBuffer + glReadPixels + glRectd + glRectdv + glRectf + glRectfv + glRecti + glRectiv + glRects + glRectsv + glRenderMode + glResizeBuffersMESA + glRotated + glRotatef + glScaled + glScalef + glScissor + glSelectBuffer +; glSelectTextureCoordSetEXT ; removed in Mesa 3.1? +; glSelectTextureEXT ; removed in Mesa 3.1? +; glSelectTextureTransformEXT ; removed in Mesa 3.1? + glShadeModel + glStencilFunc + glStencilMask + glStencilOp + glTexCoord1d + glTexCoord1dv + glTexCoord1f + glTexCoord1fv + glTexCoord1i + glTexCoord1iv + glTexCoord1s + glTexCoord1sv + glTexCoord2d + glTexCoord2dv + glTexCoord2f + glTexCoord2fv + glTexCoord2i + glTexCoord2iv + glTexCoord2s + glTexCoord2sv + glTexCoord3d + glTexCoord3dv + glTexCoord3f + glTexCoord3fv + glTexCoord3i + glTexCoord3iv + glTexCoord3s + glTexCoord3sv + glTexCoord4d + glTexCoord4dv + glTexCoord4f + glTexCoord4fv + glTexCoord4i + glTexCoord4iv + glTexCoord4s + glTexCoord4sv + glTexCoordPointer + glTexCoordPointerEXT + glTexEnvf + glTexEnvfv + glTexEnvi + glTexEnviv + glTexGend + glTexGendv + glTexGenf + glTexGenfv + glTexGeni + glTexGeniv + glTexImage1D + glTexImage2D + glTexImage3D + glTexImage3DEXT + glTexParameterf + glTexParameterfv + glTexParameteri + glTexParameteriv + glTexSubImage1D + glTexSubImage2D + glTexSubImage3D + glTexSubImage3DEXT + glTranslated + glTranslatef + glVertex2d + glVertex2dv + glVertex2f + glVertex2fv + glVertex2i + glVertex2iv + glVertex2s + glVertex2sv + glVertex3d + glVertex3dv + glVertex3f + glVertex3fv + glVertex3i + glVertex3iv + glVertex3s + glVertex3sv + glVertex4d + glVertex4dv + glVertex4f + glVertex4fv + glVertex4i + glVertex4iv + glVertex4s + glVertex4sv + glVertexPointer + glVertexPointerEXT + glViewport + glWindowPos2dMESA + glWindowPos2dvMESA + glWindowPos2fMESA + glWindowPos2fvMESA + glWindowPos2iMESA + glWindowPos2ivMESA + glWindowPos2sMESA + glWindowPos2svMESA + glWindowPos3dMESA + glWindowPos3dvMESA + glWindowPos3fMESA + glWindowPos3fvMESA + glWindowPos3iMESA + glWindowPos3ivMESA + glWindowPos3sMESA + glWindowPos3svMESA + glWindowPos4dMESA + glWindowPos4dvMESA + glWindowPos4fMESA + glWindowPos4fvMESA + glWindowPos4iMESA + glWindowPos4ivMESA + glWindowPos4sMESA + glWindowPos4svMESA + OSMesaCreateContext + OSMesaDestroyContext + OSMesaGetCurrentContext + OSMesaGetDepthBuffer + OSMesaGetIntegerv + OSMesaMakeCurrent + OSMesaPixelStore + WMesaCreateContext + WMesaDestroyContext + WMesaMakeCurrent + WMesaPaletteChange + WMesaSwapBuffers + wglCopyContext + wglCreateContext + wglDeleteContext + wglCreateLayerContext + wglGetCurrentContext + wglGetCurrentDC + wglMakeCurrent + wglShareLists + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + wglDescribeLayerPlane + wglSetLayerPaletteEntries + wglGetLayerPaletteEntries + wglRealizeLayerPalette + wglSwapLayerBuffers + wglChoosePixelFormat + wglDescribePixelFormat + wglGetProcAddress + wglGetPixelFormat + wglSetPixelFormat + wglSwapBuffers diff --git a/xc/extras/Mesa/WIN32/RES/mesaglu32.def b/xc/extras/Mesa/WIN32/RES/mesaglu32.def new file mode 100644 index 000000000..c391c20d1 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/mesaglu32.def @@ -0,0 +1,58 @@ +DESCRIPTION '"""Mesa 3D graphics library GLU Routines for Win32"""' + +VERSION 3.1 + +HEAPSIZE 1048576,4096 + +EXPORTS + gluLookAt + gluOrtho2D + gluPerspective + gluPickMatrix + gluProject + gluUnProject + gluErrorString + gluScaleImage + gluBuild1DMipmaps + gluBuild2DMipmaps + gluNewQuadric + gluDeleteQuadric + gluQuadricDrawStyle + gluQuadricOrientation + gluQuadricNormals + gluQuadricTexture + gluQuadricCallback + gluCylinder + gluSphere + gluDisk + gluPartialDisk + gluNewNurbsRenderer + gluDeleteNurbsRenderer + gluLoadSamplingMatrices + gluNurbsProperty + gluGetNurbsProperty + gluBeginCurve + gluEndCurve + gluNurbsCurve + gluBeginSurface + gluEndSurface + gluNurbsSurface + gluBeginTrim + gluEndTrim + gluPwlCurve + gluNurbsCallback + gluNewTess + gluDeleteTess +; gluTessBeginPolygon +; gluTessBeginContour + gluTessVertex +; gluTessEndContour +; gluTessEndPolygon +; gluTessProperty +; gluTessNormal + gluTessCallback +; gluGetTessProperty + gluBeginPolygon + gluNextContour + gluEndPolygon + gluGetString diff --git a/xc/extras/Mesa/WIN32/RES/mesaglu32.rc b/xc/extras/Mesa/WIN32/RES/mesaglu32.rc new file mode 100644 index 000000000..92b3d5d7d --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/mesaglu32.rc @@ -0,0 +1,32 @@ +#include <windows.h> + +#define IDR_VERSION1 1 +IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE + FILEVERSION 3,1,0,0 + PRODUCTVERSION 3,1,0,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + + BEGIN + VALUE "FileDescription", "mesaglu32 Graphics Library Utility\0" + VALUE "FileVersion", "3.1\0" + VALUE "InternalName", "MESAGLU32\0" + VALUE "OriginalFilename", "GLU32.DLL\0" + VALUE "ProductName", "GLU32.DLL\0" + VALUE "Comments", "Thanks to Brian Paul for making this possible\r\n\0" + VALUE "LegalCopyright", "Copyright (C) 1995-1997 Brian Paul\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/xc/extras/Mesa/WIN32/RES/mesaglut32.def b/xc/extras/Mesa/WIN32/RES/mesaglut32.def new file mode 100644 index 000000000..db606a754 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/mesaglut32.def @@ -0,0 +1,109 @@ +DESCRIPTION '"""Mesa 3D GLUT for Win32"""' + +VERSION 3,1,0,0 + +HEAPSIZE 1048576,4096 + +EXPORTS + glutInit + glutInitDisplayMode + glutInitDisplayString + glutInitWindowPosition + glutInitWindowSize + glutMainLoop + glutCreateWindow + glutCreateSubWindow + glutDestroyWindow + glutPostRedisplay + glutSwapBuffers + glutGetWindow + glutSetWindow + glutSetWindowTitle + glutSetIconTitle + glutPositionWindow + glutReshapeWindow + glutPopWindow + glutPushWindow + glutIconifyWindow + glutShowWindow + glutHideWindow + glutFullScreen + glutSetCursor + glutWarpPointer + glutEstablishOverlay + glutRemoveOverlay + glutUseLayer + glutPostOverlayRedisplay + glutShowOverlay + glutHideOverlay + glutCreateMenu + glutDestroyMenu + glutGetMenu + glutSetMenu + glutAddMenuEntry + glutAddSubMenu + glutChangeToMenuEntry + glutChangeToSubMenu + glutRemoveMenuItem + glutAttachMenu + glutDetachMenu + glutDisplayFunc + glutReshapeFunc + glutKeyboardFunc + glutMouseFunc + glutMotionFunc + glutPassiveMotionFunc + glutEntryFunc + glutVisibilityFunc + glutIdleFunc + glutTimerFunc + glutMenuStateFunc + glutSpecialFunc + glutSpaceballMotionFunc + glutSpaceballRotateFunc + glutSpaceballButtonFunc + glutButtonBoxFunc + glutDialsFunc + glutTabletMotionFunc + glutTabletButtonFunc + glutMenuStatusFunc + glutOverlayDisplayFunc + glutWindowStatusFunc + glutSetColor + glutGetColor + glutCopyColormap + glutGet + glutDeviceGet + glutExtensionSupported + glutGetModifiers + glutLayerGet + glutBitmapCharacter + glutBitmapWidth + glutStrokeCharacter + glutStrokeWidth + glutBitmapLength + glutStrokeLength + glutWireSphere + glutSolidSphere + glutWireCone + glutSolidCone + glutWireCube + glutSolidCube + glutWireTorus + glutSolidTorus + glutWireDodecahedron + glutSolidDodecahedron + glutWireTeapot + glutSolidTeapot + glutWireOctahedron + glutSolidOctahedron + glutWireTetrahedron + glutSolidTetrahedron + glutWireIcosahedron + glutSolidIcosahedron + glutVideoResizeGet + glutSetupVideoResizing + glutStopVideoResizing + glutVideoResize + glutVideoPan + glutReportErrors diff --git a/xc/extras/Mesa/WIN32/RES/mesaglut32.rc b/xc/extras/Mesa/WIN32/RES/mesaglut32.rc new file mode 100644 index 000000000..dbf1ed3fd --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/mesaglut32.rc @@ -0,0 +1,32 @@ +#include <windows.h> + +#define IDR_VERSION1 1 +IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE + FILEVERSION 3,1,0,0 + PRODUCTVERSION 3,1,0,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + + BEGIN + VALUE "FileDescription", "mesaglut32 Graphics Library Utility Toolkit\0" + VALUE "FileVersion", "3.1\0" + VALUE "InternalName", "MESAGLUT32\0" + VALUE "OriginalFilename", "GLUT32.DLL\0" + VALUE "ProductName", "GLUT32.DLL\0" + VALUE "Comments", "Thanks to Mark Kilgard for making this possible\r\n\0" + VALUE "LegalCopyright", "Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/xc/extras/Mesa/WIN32/RES/s3Mesa32.def b/xc/extras/Mesa/WIN32/RES/s3Mesa32.def new file mode 100644 index 000000000..5c092a027 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/s3Mesa32.def @@ -0,0 +1,463 @@ +DESCRIPTION '"""Mesa 3D graphics library for Win32 S3TK"""' + +VERSION 3.1 + +HEAPSIZE 1048576,4096 + +EXPORTS + glAccum + glAlphaFunc + glAreTexturesResident + glArrayElement + glBegin + glBindTexture + glBitmap + glBlendFunc + glCallList + glCallLists + glClear + glClearAccum + glClearIndex + glClearColor + glClearDepth + glClearStencil + glClipPlane + glColor3b + glColor3d + glColor3f + glColor3i + glColor3s + glColor3ub + glColor3ui + glColor3us + glColor4b + glColor4d + glColor4f + glColor4i + glColor4s + glColor4ub + glColor4ui + glColor4us + glColor3bv + glColor3dv + glColor3fv + glColor3iv + glColor3sv + glColor3ubv + glColor3uiv + glColor3usv + glColor4bv + glColor4dv + glColor4fv + glColor4iv + glColor4sv + glColor4ubv + glColor4uiv + glColor4usv + glColorMask + glColorMaterial + glColorPointer + glColorTableEXT + glColorSubTableEXT + glCopyPixels + glCopyTexImage1D + glCopyTexImage2D + glCopyTexSubImage1D + glCopyTexSubImage2D + glCullFace + glDepthFunc + glDepthMask + glDepthRange + glDeleteLists + glDeleteTextures + glDisable + glDisableClientState + glDrawArrays + glDrawBuffer + glDrawElements + glDrawPixels + glEnable + glEnableClientState + glEnd + glEndList + glEvalCoord1d + glEvalCoord1f + glEvalCoord1dv + glEvalCoord1fv + glEvalCoord2d + glEvalCoord2f + glEvalCoord2dv + glEvalCoord2fv + glEvalPoint1 + glEvalPoint2 + glEvalMesh1 + glEdgeFlag + glEdgeFlagv + glEdgeFlagPointer + glEvalMesh2 + glFeedbackBuffer + glFinish + glFlush + glFogf + glFogi + glFogfv + glFogiv + glFrontFace + glFrustum + glGenLists + glGenTextures + glGetBooleanv + glGetClipPlane + glGetColorTableEXT + glGetColorTableParameterivEXT + glGetColorTableParameterfvEXT + glGetDoublev + glGetError + glGetFloatv + glGetIntegerv + glGetLightfv + glGetLightiv + glGetMapdv + glGetMapfv + glGetMapiv + glGetMaterialfv + glGetMaterialiv + glGetPixelMapfv + glGetPixelMapuiv + glGetPixelMapusv + glGetPointerv + glGetPolygonStipple + glGetString + glGetTexEnvfv + glGetTexEnviv + glGetTexGeniv + glGetTexGendv + glGetTexGenfv + glGetTexImage + glGetTexLevelParameterfv + glGetTexLevelParameteriv + glGetTexParameterfv + glGetTexParameteriv + glHint + glIndexd + glIndexf + glIndexi + glIndexs + glIndexub + glIndexdv + glIndexfv + glIndexiv + glIndexsv + glIndexubv + glIndexMask + glIndexPointer + glInterleavedArrays + glInitNames + glIsList + glIsTexture + glLightf + glLighti + glLightfv + glLightiv + glLightModelf + glLightModeli + glLightModelfv + glLightModeliv + glLineWidth + glLineStipple + glListBase + glLoadIdentity + glLoadMatrixd + glLoadMatrixf + glLoadName + glLogicOp + glMap1d + glMap1f + glMap2d + glMap2f + glMapGrid1d + glMapGrid1f + glMapGrid2d + glMapGrid2f + glMaterialf + glMateriali + glMaterialfv + glMaterialiv + glMatrixMode + glMultMatrixd + glMultMatrixf + glNewList + glNormal3b + glNormal3d + glNormal3f + glNormal3i + glNormal3s + glNormal3bv + glNormal3dv + glNormal3fv + glNormal3iv + glNormal3sv + glNormalPointer + glOrtho + glPassThrough + glPixelMapfv + glPixelMapuiv + glPixelMapusv + glPixelStoref + glPixelStorei + glPixelTransferf + glPixelTransferi + glPixelZoom + glPointSize + glPolygonMode + glPolygonOffset + glPolygonOffsetEXT + glPolygonStipple + glPopAttrib + glPopClientAttrib + glPopMatrix + glPopName + glPrioritizeTextures + glPushMatrix + glRasterPos2d + glRasterPos2f + glRasterPos2i + glRasterPos2s + glRasterPos3d + glRasterPos3f + glRasterPos3i + glRasterPos3s + glRasterPos4d + glRasterPos4f + glRasterPos4i + glRasterPos4s + glRasterPos2dv + glRasterPos2fv + glRasterPos2iv + glRasterPos2sv + glRasterPos3dv + glRasterPos3fv + glRasterPos3iv + glRasterPos3sv + glRasterPos4dv + glRasterPos4fv + glRasterPos4iv + glRasterPos4sv + glReadBuffer + glReadPixels + glRectd + glRectf + glRecti + glRects + glRectdv + glRectfv + glRectiv + glRectsv + glScissor + glIsEnabled + glPushAttrib + glPushClientAttrib + glPushName + glRenderMode + glRotated + glRotatef + glSelectBuffer + glScaled + glScalef + glShadeModel + glStencilFunc + glStencilMask + glStencilOp + glTexCoord1d + glTexCoord1f + glTexCoord1i + glTexCoord1s + glTexCoord2d + glTexCoord2f + glTexCoord2i + glTexCoord2s + glTexCoord3d + glTexCoord3f + glTexCoord3i + glTexCoord3s + glTexCoord4d + glTexCoord4f + glTexCoord4i + glTexCoord4s + glTexCoord1dv + glTexCoord1fv + glTexCoord1iv + glTexCoord1sv + glTexCoord2dv + glTexCoord2fv + glTexCoord2iv + glTexCoord2sv + glTexCoord3dv + glTexCoord3fv + glTexCoord3iv + glTexCoord3sv + glTexCoord4dv + glTexCoord4fv + glTexCoord4iv + glTexCoord4sv + glTexCoordPointer + glTexGend + glTexGenf + glTexGeni + glTexGendv + glTexGeniv + glTexGenfv + glTexEnvf + glTexEnvi + glTexEnvfv + glTexEnviv + glTexImage1D + glTexImage2D + glTexParameterf + glTexParameteri + glTexParameterfv + glTexParameteriv + glTexSubImage1D + glTexSubImage2D + glTranslated + glTranslatef + glVertex2d + glVertex2f + glVertex2i + glVertex2s + glVertex3d + glVertex3f + glVertex3i + glVertex3s + glVertex4d + glVertex4f + glVertex4i + glVertex4s + glVertex2dv + glVertex2fv + glVertex2iv + glVertex2sv + glVertex3dv + glVertex3fv + glVertex3iv + glVertex3sv + glVertex4dv + glVertex4fv + glVertex4iv + glVertex4sv + glVertexPointer + glViewport + glBlendEquationEXT + glBlendColorEXT + glVertexPointerEXT + glNormalPointerEXT + glColorPointerEXT + glIndexPointerEXT + glTexCoordPointerEXT + glEdgeFlagPointerEXT + glGetPointervEXT + glArrayElementEXT + glDrawArraysEXT + glBindTextureEXT + glDeleteTexturesEXT + glGenTexturesEXT + glPrioritizeTexturesEXT + glCopyTexSubImage3DEXT + glTexImage3DEXT + glTexSubImage3DEXT + glWindowPos4fMESA + glWindowPos2iMESA + glWindowPos2sMESA + glWindowPos2fMESA + glWindowPos2dMESA + glWindowPos2ivMESA + glWindowPos2svMESA + glWindowPos2fvMESA + glWindowPos2dvMESA + glWindowPos3iMESA + glWindowPos3sMESA + glWindowPos3fMESA + glWindowPos3dMESA + glWindowPos3ivMESA + glWindowPos3svMESA + glWindowPos3fvMESA + glWindowPos3dvMESA + glWindowPos4iMESA + glWindowPos4sMESA + glWindowPos4dMESA + glWindowPos4ivMESA + glWindowPos4svMESA + glWindowPos4fvMESA + glWindowPos4dvMESA + glResizeBuffersMESA + wglCopyContext + wglCreateContext + wglCreateLayerContext + wglDeleteContext +;wglDescribeLayerPlane + wglGetCurrentContext + wglGetCurrentDC +;wglGetLayerPaletteEntries + wglGetProcAddress + wglMakeCurrent +;wglRealizeLayerPalette +;wglSetLayerPaletteEntries + wglShareLists + wglSwapLayerBuffers + wglUseFontBitmapsA + wglUseFontBitmapsW + wglUseFontOutlinesA + wglUseFontOutlinesW + wglChoosePixelFormat + ChoosePixelFormat + wglDescribePixelFormat + DescribePixelFormat + wglGetPixelFormat + GetPixelFormat + wglSetPixelFormat + SetPixelFormat + wglSwapBuffers + SwapBuffers + gl3DfxSetPaletteEXT + glMultiTexCoord1dSGIS + glMultiTexCoord1dvSGIS + glMultiTexCoord1fSGIS + glMultiTexCoord1fvSGIS + glMultiTexCoord1iSGIS + glMultiTexCoord1ivSGIS + glMultiTexCoord1sSGIS + glMultiTexCoord1svSGIS + glMultiTexCoord2dSGIS + glMultiTexCoord2dvSGIS + glMultiTexCoord2fSGIS + glMultiTexCoord2fvSGIS + glMultiTexCoord2iSGIS + glMultiTexCoord2ivSGIS + glMultiTexCoord2sSGIS + glMultiTexCoord2svSGIS + glMultiTexCoord3dSGIS + glMultiTexCoord3dvSGIS + glMultiTexCoord3fSGIS + glMultiTexCoord3fvSGIS + glMultiTexCoord3iSGIS + glMultiTexCoord3ivSGIS + glMultiTexCoord3sSGIS + glMultiTexCoord3svSGIS + glMultiTexCoord4dSGIS + glMultiTexCoord4dvSGIS + glMultiTexCoord4fSGIS + glMultiTexCoord4fvSGIS + glMultiTexCoord4iSGIS + glMultiTexCoord4ivSGIS + glMultiTexCoord4sSGIS + glMultiTexCoord4svSGIS + glMultiTexCoordPointerSGIS + glSelectTextureSGIS + glSelectTextureCoordSetSGIS + OSMesaCreateContext + OSMesaDestroyContext + OSMesaGetCurrentContext + OSMesaGetDepthBuffer + OSMesaGetIntegerv + OSMesaMakeCurrent + OSMesaPixelStore diff --git a/xc/extras/Mesa/WIN32/RES/s3Mesa32.rc b/xc/extras/Mesa/WIN32/RES/s3Mesa32.rc new file mode 100644 index 000000000..4b4c686c9 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RES/s3Mesa32.rc @@ -0,0 +1,32 @@ +#include <windows.h> + +#define IDR_VERSION1 1 +IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE + FILEVERSION 3,1,0,0 + PRODUCTVERSION 3,1,0,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS 0 + FILEOS VOS_DOS_WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0 // not used +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + //language ID = U.S. English, char set = Windows, Multilingual + + BEGIN + VALUE "FileDescription", "s3MesaGL32 3D Graphics Library\0" + VALUE "FileVersion", "3.1\0" + VALUE "InternalName", "S3MESAGL32\0" + VALUE "OriginalFilename", "S3MESAGL32.DLL\0" + VALUE "ProductName", "S3MESAGL32.DLL\0" + VALUE "Comments", "Thanks to Brian Paul for making this possible\r\nRequires S3TK.DLL for S3/Virge.\0" + VALUE "LegalCopyright", "Copyright (C) 1995-1997 Brian Paul\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1252 + END +END diff --git a/xc/extras/Mesa/WIN32/RULES/lib.fxmesa b/xc/extras/Mesa/WIN32/RULES/lib.fxmesa new file mode 100644 index 000000000..21e09e84b --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.fxmesa @@ -0,0 +1,40 @@ + +!IF "$(STATIC_MESA)" == "0" +!ERROR lib.$(LIBBASE) : This file require STATIC_MESA be set to 1. +!ENDIF + +!IF "$(GLIDE2SDK)" == "" +!ERROR lib.$(LIBBASE) : 'GLIDE2SDK' environment var not set, can't find Glide SDK +!ENDIF + +LIBCOMMENTS=Requires Glide 2.x Runtime for 3Dfx Voodoo Graphics, Voodoo Rush, or Voodoo2. + +!INCLUDE .\rules\lib.mesa.core + +USE_CRTDLL=0 +STATIC_MESA=1 + +SRCALT2 = .\$(MESAROOT)\src\FX +SRCALT3 = .\$(MESAROOT)\src\OSmesa + +CPPOPTS = $(CPPOPTS) /DFX /DFX_V2 /DMESA_FX_DDRAW /DFX_SILENT /I$(GLIDE2SDK)\src\include +EXELIBS = $(GLIDE2SDK)\src\lib\win32\glide2x.lib + +SRCFILES = $(MESA_CORE)\ + fxapi.c fxcva.c fxdd.c fxddspan.c fxddtex.c fxrender.c fxsetup.c fxspan.c fxtexman.c\ + fxtrifuncs.c fxvsetup.c fxwgl.c\ + OSmesa.c + +!IF "$(NASM)" != "" + +SRCALT4 = .\$(MESAROOT)\src\X86 + +SRCFILES = $(SRCFILES) x86.c x86a.S common_x86.c common_x86asm.S mmx_blend.S 3dnow.c 3dnow_norm_raw.S\ + 3dnow_xform_masked1.S 3dnow_xform_masked2.S 3dnow_xform_masked3.S 3dnow_xform_masked4.S\ + 3dnow_xform_raw1.S 3dnow_xform_raw2.S 3dnow_xform_raw3.S 3dnow_xform_raw4.S\ + +!ENDIF + +OBJDIR_R = $(MESAROOT)\lib\FX + +# derecated ? -- fxpoints.c
\ No newline at end of file diff --git a/xc/extras/Mesa/WIN32/RULES/lib.fxmesa32 b/xc/extras/Mesa/WIN32/RULES/lib.fxmesa32 new file mode 100644 index 000000000..2fc97c0a2 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.fxmesa32 @@ -0,0 +1,41 @@ + +!IF "$(STATIC_MESA)" == "1" +!ERROR lib.$(LIBBASE) : This file require STATIC_MESA be set to 0. +!ENDIF + +!IF "$(GLIDE2SDK)" == "" +!ERROR lib.$(LIBBASE) : 'GLIDE2SDK' environment var not set, can't find Glide SDK +!ENDIF + +LIBCOMMENTS=Requires Glide 2.x Runtime for 3Dfx Voodoo Graphics, Voodoo Rush, or Voodoo2. + +!INCLUDE .\rules\lib.mesa.core + +USE_CRTDLL=1 + +SRCALT2 = .\$(MESAROOT)\src\FX +SRCALT3 = .\$(MESAROOT)\src\OSmesa + +DEFFILE = res\fxmesa32.def +RCFILE = res\fxmesa32.rc + +CPPOPTS = $(CPPOPTS) /DFX /DFX_V2 /DFX_SILENT /DMESA_FX_DDRAW /DBUILD_GL32 /I$(GLIDE2SDK)\src\include + +SRCFILES = $(MESA_CORE)\ + fxapi.c fxclip.c fxcva.c fxdd.c fxddspan.c fxddtex.c fxfastpath.c fxpipeline.c\ + fxrender.c fxsetup.c fxtexman.c fxtrifuncs.c fxvsetup.c fxwgl.c fxglidew.c\ + OSmesa.c + +!IF "$(NASM)" != "" + +SRCALT4 = .\$(MESAROOT)\src\X86 + +SRCFILES = $(SRCFILES) x86.c x86a.S common_x86.c common_x86asm.S mmx_blend.S 3dnow.c 3dnow_norm_raw.S\ + 3dnow_xform_masked1.S 3dnow_xform_masked2.S 3dnow_xform_masked3.S 3dnow_xform_masked4.S\ + 3dnow_xform_raw1.S 3dnow_xform_raw2.S 3dnow_xform_raw3.S 3dnow_xform_raw4.S\ + +!ENDIF + +DLLLIBS = $(GLIDE2SDK)\src\lib\win32\glide2x.lib ole32.lib dxguid.lib +DLLBASE = OpenGL32 +OBJDIR_R = $(MESAROOT)\lib\FX diff --git a/xc/extras/Mesa/WIN32/RULES/lib.glu32 b/xc/extras/Mesa/WIN32/RULES/lib.glu32 new file mode 100644 index 000000000..5d008c0a8 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.glu32 @@ -0,0 +1,20 @@ + +!IF "$(STATIC_MESA)" == "1" +!ERROR lib.$(LIBBASE) : This file require STATIC_MESA be set to 0. +!ENDIF + +!INCLUDE .\rules\lib.mesaglu.core + +USE_CRTDLL=1 + +DEFFILE = res\mesaglu32.def +RCFILE = res\mesaglu32.rc + +!IF "$(DEBUG)" == "1" +DLLLIBS = OpenGL32d.lib +!ELSE +DLLLIBS = OpenGL32.lib +!ENDIF + +CPPOPTS = $(CPPOPTS) /DBUILD_GLU32 +DLLBASE = GLU32 diff --git a/xc/extras/Mesa/WIN32/RULES/lib.glut32 b/xc/extras/Mesa/WIN32/RULES/lib.glut32 new file mode 100644 index 000000000..bf0edbdf7 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.glut32 @@ -0,0 +1,20 @@ + +!IF "$(STATIC_MESA)" == "1" +!ERROR lib.$(LIBBASE) : This file require STATIC_MESA be set to 0. +!ENDIF + +!INCLUDE .\rules\lib.mesaglut.core + +USE_CRTDLL=1 + +DEFFILE = res\mesaglut32.def +RCFILE = res\mesaglut32.rc + +!IF "$(DEBUG)" == "1" +DLLLIBS = GLU32d.lib OpenGL32d.lib winmm.lib +!ELSE +DLLLIBS = GLU32.lib OpenGL32.lib winmm.lib +!ENDIF + +CPPOPTS = $(CPPOPTS) /DBUILD_GLUT32 +DLLBASE = GLUT32 diff --git a/xc/extras/Mesa/WIN32/RULES/lib.mesa b/xc/extras/Mesa/WIN32/RULES/lib.mesa new file mode 100644 index 000000000..e9139cc3a --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.mesa @@ -0,0 +1,9 @@ + +!INCLUDE .\rules\lib.mesa.core + +USE_CRTDLL=0 + +SRCALT2=.\$(MESAROOT)\src\OSmesa +SRCALT3=.\$(MESAROOT)\src\Windows + +SRCFILES = $(MESA_CORE) OSmesa.c Wmesa.c wgl.c diff --git a/xc/extras/Mesa/WIN32/RULES/lib.mesa.core b/xc/extras/Mesa/WIN32/RULES/lib.mesa.core new file mode 100644 index 000000000..9d6ffb359 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.mesa.core @@ -0,0 +1,17 @@ + +SRCALT1=.\$(MESAROOT)\src + +CPPOPTS=$(CPPOPTS) /I$(MESAROOT)\src + +MESA_CORE = aatriangle.c hash.c pixeltex.c texture.c\ + accum.c debug_xform.c highpc.c points.c texutil.c alpha.c depth.c\ + hint.c polygon.c translate.c alphabuf.c dispatch.c image.c quads.c\ + triangle.c attrib.c dlist.c imaging.c rastpos.c varray.c bbox.c\ + drawpix.c light.c readpix.c vb.c bitmap.c enable.c lines.c rect.c\ + vbcull.c blend.c enums.c logic.c scissor.c vbfill.c buffers.c\ + eval.c lowpc.c shade.c vbindirect.c clip.c extensions.c masking.c\ + span.c vbrender.c colortab.c feedback.c matrix.c stages.c vbxform.c\ + config.c fog.c mem.c state.c vector.c context.c get.c mmath.c\ + stencil.c vertices.c convolve.c glapi.c pb.c teximage.c winpos.c\ + copypix.c glapinoop.c pipeline.c texobj.c xform.c cva.c glthread.c\ + pixel.c texstate.c zoom.c diff --git a/xc/extras/Mesa/WIN32/RULES/lib.mesa32 b/xc/extras/Mesa/WIN32/RULES/lib.mesa32 new file mode 100644 index 000000000..ccb49a7fe --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.mesa32 @@ -0,0 +1,24 @@ + +!IF "$(STATIC_MESA)" == "1" +!ERROR lib.$(LIBBASE) : This file require STATIC_MESA be set to 0. +!ENDIF + +LIBCOMMENTS=CPU-based Rendering usable as a direct replacement for system OpenGL32.DLL + +!INCLUDE .\rules\lib.mesa.core + +USE_CRTDLL=1 + +SRCALT2=.\$(MESAROOT)\src\Windows +SRCALT3=.\$(MESAROOT)\src\OSmesa + +DEFFILE = res\mesa32.def +RCFILE = res\mesa32.rc + +CPPOPTS = $(CPPOPTS) /DBUILD_GL32 + +SRCFILES = $(MESA_CORE)\ + Wmesa.c wgl.c\ + OSmesa.c + +DLLBASE = OpenGL32 diff --git a/xc/extras/Mesa/WIN32/RULES/lib.mesaglu b/xc/extras/Mesa/WIN32/RULES/lib.mesaglu new file mode 100644 index 000000000..bd7443002 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.mesaglu @@ -0,0 +1,4 @@ + +!INCLUDE .\rules\lib.mesaglu.core + +USE_CRTDLL=0 diff --git a/xc/extras/Mesa/WIN32/RULES/lib.mesaglu.core b/xc/extras/Mesa/WIN32/RULES/lib.mesaglu.core new file mode 100644 index 000000000..7ec3f38fd --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.mesaglu.core @@ -0,0 +1,5 @@ + +SRCALT1=.\$(MESAROOT)\src-glu + +SRCFILES = glu.c mipmap.c nurbs.c nurbscrv.c nurbssrf.c nurbsutl.c\ + project.c quadric.c polytest.c tess.c tesselat.c diff --git a/xc/extras/Mesa/WIN32/RULES/lib.mesaglut b/xc/extras/Mesa/WIN32/RULES/lib.mesaglut new file mode 100644 index 000000000..08c370b2c --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.mesaglut @@ -0,0 +1,10 @@ + +!IF "$(STATIC_MESA)" != "1" +!ERROR lib.$(LIBBASE) : This file require STATIC_MESA be set to 1. +!ENDIF + +!INCLUDE .\rules\lib.mesaglut.core + +USE_CRTDLL=0 + +CPPOPTS = /DW32_MESA $(CPPOPTS) diff --git a/xc/extras/Mesa/WIN32/RULES/lib.mesaglut.core b/xc/extras/Mesa/WIN32/RULES/lib.mesaglut.core new file mode 100644 index 000000000..f2d87e702 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/lib.mesaglut.core @@ -0,0 +1,19 @@ + +SRCALT1=.\$(MESAROOT)\src-glut + +SRCFILES = glut_8x13.c glut_9x15.c glut_bitmap.c glut_bwidth.c\ + glut_cindex.c glut_cmap.c glut_cursor.c glut_dials.c glut_dstr.c\ + glut_event.c glut_ext.c glut_fullscrn.c glut_gamemode.c glut_get.c\ + glut_hel10.c glut_hel12.c glut_hel18.c glut_init.c glut_input.c\ + glut_key.c glut_mesa.c glut_modifier.c glut_mroman.c glut_overlay.c\ + glut_roman.c glut_shapes.c glut_space.c glut_stroke.c glut_swap.c\ + glut_swidth.c glut_tablet.c glut_teapot.c glut_tr10.c glut_tr24.c\ + glut_util.c glut_vidresize.c glut_warp.c glut_win.c glut_winmisc.c\ + win32_glx.c win32_menu.c win32_util.c win32_winproc.c win32_x11.c + +!IF "$(USE_SYSGL)" != "0" +CPPDEPS=include\GL\glut.h +CPPOPTS=$(CPPOPTS) /I.\include +!ELSE +CPPOPTS=$(CPPOPTS) /I$(MESAROOT)\include +!ENDIF diff --git a/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos new file mode 100644 index 000000000..62ec5d85d --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos @@ -0,0 +1,25 @@ + +!IF "$(STATIC_MESA)" == "1" +EXELIBS = mesaglut$(LIBSFX).lib mesaglu$(LIBSFX).lib $(MESAROOT)\lib\FX\fxmesagl$(LIBSFX).lib $(GLIDE2SDK)\src\lib\win32\glide2x.lib +USE_CRTDLL = 0 +FORCELINK = 1 +!IF "$(GLIDE2SDK)" == "" +!ERROR lib.$(LIBBASE) : 'GLIDE2SDK' environment var not set, can't find Glide SDK +!ENDIF +!ELSE +EXELIBS = GLUT32$(LIBSFX).LIB GLU32$(LIBSFX).LIB $(MESAROOT)\lib\FX\OPENGL32$(LIBSFX).LIB +RUNTIMELIBS = GLUT32$(LIBSFX).DLL GLU32$(LIBSFX).DLL FX\OPENGL32$(LIBSFX).DLL +!ENDIF + +!IF ("$(USE_SYSGL)" == "0") && ("$(DEBUG)" == "1") +EXELIBS=$(EXELIBS:.lib=d.lib) +!IF "$(RUNTIMELIBS)" != "" +RUNTIMELIBS=$(RUNTIMELIBS:.dll=d.dll) +!ENDIF +!ENDIF + +SRCALT1 = .\$(MESAROOT)\3dfx\demos +EXELIBS = $(EXELIBS) winmm.lib +CPPOPTS = /DFX /DFX_SILENT $(CPPOPTS) +SUPLIBSROOT = .\rules\progs.3dfx.demos +SRCFILES = fire.c glbpaltx.c gltest.c ipers.c mesaland.c paltex.c ray.c teapot.c tunnel.c diff --git a/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.fire b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.fire new file mode 100644 index 000000000..e4486a644 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.fire @@ -0,0 +1 @@ +SRCFILESX = image.c diff --git a/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.ipers b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.ipers new file mode 100644 index 000000000..e4486a644 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.ipers @@ -0,0 +1 @@ +SRCFILESX = image.c diff --git a/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.rain b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.rain new file mode 100644 index 000000000..8625a746b --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.rain @@ -0,0 +1 @@ +SRCFILESX = particles.cxx image.c diff --git a/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.teapot b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.teapot new file mode 100644 index 000000000..b18a43442 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.teapot @@ -0,0 +1 @@ +SRCFILESX = image.c dteapot.c shadow.c diff --git a/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.tunnel b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.tunnel new file mode 100644 index 000000000..cb9999c02 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.tunnel @@ -0,0 +1 @@ +SRCFILESX = image.c sources.c diff --git a/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.tunnel2 b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.tunnel2 new file mode 100644 index 000000000..cb9999c02 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.3dfx.demos.tunnel2 @@ -0,0 +1 @@ +SRCFILESX = image.c sources.c diff --git a/xc/extras/Mesa/WIN32/RULES/progs.book b/xc/extras/Mesa/WIN32/RULES/progs.book new file mode 100644 index 000000000..5295fa297 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.book @@ -0,0 +1,38 @@ + +!IF "$(STATIC_MESA)" == "1" +EXELIBS = mesaglut$(LIBSFX).lib mesaglu$(LIBSFX).lib mesagl$(LIBSFX).lib +USE_CRTDLL = 0 +!ELSEIF "$(USE_SYSGL)" == "2" +EXELIBS = glut.lib glu.lib opengl.lib +RUNTIMELIBS = glut.dll +!ELSEIF "$(USE_SYSGL)" == "1" +EXELIBS = glut32.lib glu32.lib opengl32.lib +RUNTIMELIBS = glut32.dll +!ELSE +EXELIBS = glut32$(LIBSFX).lib glu32$(LIBSFX).lib opengl32$(LIBSFX).lib +RUNTIMELIBS = glut32$(LIBSFX).dll glu32$(LIBSFX).dll opengl32$(LIBSFX).dll +!ENDIF + +!IF ("$(USE_SYSGL)" == "0") && ("$(DEBUG)" == "1") +EXELIBS=$(EXELIBS:.lib=d.lib) +!IF "$(RUNTIMELIBS)" != "" +RUNTIMELIBS=$(RUNTIMELIBS:.dll=d.dll) +!ENDIF +!ENDIF + +!IF "$(STATIC_MESA)" == "1" +EXELIBS=$(EXELIBS) winmm.lib +!ENDIF + +SRCALT1 = .\$(MESAROOT)\book + +SRCFILES = aaindex.c aapoly.c aargb.c accanti.c accpersp.c alpha.c\ + alpha3D.c anti.c bezcurve.c bezmesh.c checker.c clip.c colormat.c\ + cube.c depthcue.c dof.c double.c drawf.c feedback.c fog.c\ + fogindex.c font.c hello.c image.c light.c lines.c list.c\ + material.c mipmap.c model.c movelight.c nurbs.c pickdepth.c\ + picksquare.c plane.c planet.c polyoff.c polys.c quadric.c robot.c\ + sccolorlight.c scene.c scenebamb.c sceneflat.c select.c smooth.c\ + stencil.c stroke.c surface.c teaambient.c teapots.c tess.c\ + tesswind.c texbind.c texgen.c texprox.c texsub.c texturesurf.c\ + torus.c trim.c unproject.c varray.c wrap.c diff --git a/xc/extras/Mesa/WIN32/RULES/progs.demos b/xc/extras/Mesa/WIN32/RULES/progs.demos new file mode 100644 index 000000000..2796c461f --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.demos @@ -0,0 +1,35 @@ + +!IF "$(STATIC_MESA)" == "1" +EXELIBS = mesaglut.lib mesaglu.lib mesagl.lib +USE_CRTDLL = 0 +!ELSEIF "$(USE_SYSGL)" == "2" +EXELIBS = glut.lib glu.lib opengl.lib +RUNTIMELIBS = glut.dll +!ELSEIF "$(USE_SYSGL)" == "1" +EXELIBS = glut32.lib glu32.lib opengl32.lib +RUNTIMELIBS = glut32.dll +!ELSE +EXELIBS = glut32$(LIBSFX).lib glu32$(LIBSFX).lib opengl32$(LIBSFX).lib +RUNTIMELIBS = glut32$(LIBSFX).dll glu32$(LIBSFX).dll opengl32$(LIBSFX).dll +!ENDIF + +!IF ("$(USE_SYSGL)" == "0") && ("$(DEBUG)" == "1") +EXELIBS=$(EXELIBS:.lib=d.lib) +!IF "$(RUNTIMELIBS)" != "" +RUNTIMELIBS=$(RUNTIMELIBS:.dll=d.dll) +!ENDIF +!ENDIF + +!IF "$(STATIC_MESA)" == "1" +EXELIBS=$(EXELIBS) winmm.lib +!ENDIF + +SRCALT1 = .\$(MESAROOT)\demos + +SRCFILES = bounce.c clearspd.c drawpix.c gamma.c gears.c glinfo.c gloss.c\ + glutfx.c morph3d.c multiarb.c pointblast.c reflect.c spectex.c tessdemo.c\ + texcyl.c texobj.c trispd.c winpos.c + +!IF "$(USE_SYSGL)" == "0" +SRCFILES = $(SRCFILES) isosurf.c osdemo.c paltex.c renormal.c +!ENDIF diff --git a/xc/extras/Mesa/WIN32/RULES/progs.samples b/xc/extras/Mesa/WIN32/RULES/progs.samples new file mode 100644 index 000000000..7a1493925 --- /dev/null +++ b/xc/extras/Mesa/WIN32/RULES/progs.samples @@ -0,0 +1,40 @@ + +!IF "$(STATIC_MESA)" == "1" +EXELIBS = mesaglut.lib mesaglu.lib mesagl.lib +USE_CRTDLL = 0 +!ELSEIF "$(USE_SYSGL)" == "2" +EXELIBS = glut.lib glu.lib opengl.lib +RUNTIMELIBS = glut.dll +!ELSEIF "$(USE_SYSGL)" == "1" +EXELIBS = glut32.lib glu32.lib opengl32.lib +RUNTIMELIBS = glut32.dll +!ELSE +EXELIBS = glut32$(LIBSFX).lib glu32$(LIBSFX).lib opengl32$(LIBSFX).lib +RUNTIMELIBS = glut32$(LIBSFX).dll glu32$(LIBSFX).dll opengl32$(LIBSFX).dll +!ENDIF + +!IF ("$(USE_SYSGL)" == "0") && ("$(DEBUG)" == "1") +EXELIBS=$(EXELIBS:.lib=d.lib) +!IF "$(RUNTIMELIBS)" != "" +RUNTIMELIBS=$(RUNTIMELIBS:.dll=d.dll) +!ENDIF +!ENDIF + +!IF "$(STATIC_MESA)" == "1" +EXELIBS=$(EXELIBS) winmm.lib +!ENDIF + +SRCALT1 = .\$(MESAROOT)\samples + +SRCFILES = accum.c bitmap1.c bitmap2.c copy.c\ + cursor.c depth.c eval.c fog.c font.c line.c logo.c nurb.c\ + olympic.c overlay.c point.c prim.c quad.c rgbtoppm.c select.c\ + shape.c sphere.c star.c stencil.c stretch.c texture.c tri.c wave.c + +!IF "$(USE_SYSGL)" == "0" +SRCFILES = $(SRCFILES) blendeq.c blendxor.c +!ENDIF + +# The following items have not been ported to the environment... + +NAUGHTY = oglinfo.c diff --git a/xc/extras/Mesa/acconfig.h b/xc/extras/Mesa/acconfig.h new file mode 100644 index 000000000..30fcf361b --- /dev/null +++ b/xc/extras/Mesa/acconfig.h @@ -0,0 +1,11 @@ +#undef HAVE_XMU +#undef USE_X86_ASM +#undef USE_3DNOW_ASM +#undef USE_KATMAI_ASM +#undef USE_MMX_ASM +#undef MESA_DEBUG +#undef FX +#undef FX_GLIDE3 +#undef GGI +#undef SVGA +#undef USE_XSHM diff --git a/xc/extras/Mesa/aclocal.m4 b/xc/extras/Mesa/aclocal.m4 new file mode 100644 index 000000000..5e2e88ce9 --- /dev/null +++ b/xc/extras/Mesa/aclocal.m4 @@ -0,0 +1,801 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + + +# serial 42 AC_PROG_LIBTOOL +AC_DEFUN(AC_PROG_LIBTOOL, +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +FILE="$FILE" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ +AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ +objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ +deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $lt_target \ +|| AC_MSG_ERROR([libtool configure failed]) + +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log +]) + +AC_DEFUN(AC_LIBTOOL_SETUP, +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +# Only perform the check for file, if the check method requires it +case "$deplibs_check_method" in +file_magic*) + if test "$file_magic_cmd" = '$FILE'; then + AC_PATH_FILE + fi + ;; +esac + +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], +[libtool_flags="$libtool_flags --enable-dlopen"]) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[libtool_flags="$libtool_flags --enable-win32-dll"]) +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +AC_ARG_WITH(pic, + [ --with-pic try to use only PIC/non-PIC objects [default=use both]], + pic_mode="$withval", pic_mode=default) +test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" +test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + + # recent cygwin and mingw systems supply a stub DllMain which the user + # can override, but on older systems we have to supply one + AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, + [AC_TRY_LINK([], + [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); + DllMain (0, 0, 0);], + [lt_cv_need_dllmain=yes],[lt_cv_need_dllmain=no])]) + + case "$lt_target/$CC" in + *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) + # old mingw systems require "-dll" to link a DLL, while more recent ones + # require "-mdll" + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -mdll" + AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, + [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) + CFLAGS="$SAVE_CFLAGS" ;; + *-*-cygwin*) + # cygwin systems need to pass --dll to the linker, and not link + # crt.o which will require a WinMain@16 definition. + lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; + esac + ;; + ]) +esac +]) + +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) + +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) + +# AC_ENABLE_SHARED - implement the --enable-shared flag +# Usage: AC_ENABLE_SHARED[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_SHARED, [dnl +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(shared, +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl +]) + +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no)]) + +# AC_ENABLE_STATIC - implement the --enable-static flag +# Usage: AC_ENABLE_STATIC[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_STATIC, [dnl +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(static, +changequote(<<, >>)dnl +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl +]) + +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no)]) + + +# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library +AC_DEFUN(AC_PATH_TOOL_PREFIX, +[AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_FILE, +[case "$FILE" in + /*) + lt_cv_path_FILE="$FILE" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_FILE="$FILE" # Let the user override the test with a dos path. + ;; + *) + ac_save_file="$FILE" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_FILE="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case "$deplibs_check_method" in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + FILE="$lt_cv_path_FILE" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <<EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + FILE="$ac_save_file" + ;; +esac]) +FILE="$lt_cv_path_FILE" +if test -n "$FILE"; then + AC_MSG_RESULT($FILE) +else + AC_MSG_RESULT(no) +fi +]) + + +# AC_PATH_FILE - find a file program which can recognise a shared library +AC_DEFUN(AC_PATH_FILE, +[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl +AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) +if test -z "$lt_cv_path_FILE"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) + else + FILE=: + fi +fi +]) + + +# AC_PROG_LD - find the path to the GNU or non-GNU linker +AC_DEFUN(AC_PROG_LD, +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + case $lt_target in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case "$ac_prog" in + # Accept absolute paths. +changequote(,)dnl + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' +changequote([,])dnl + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(ac_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$ac_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_PROG_LD_GNU +]) + +AC_DEFUN(AC_PROG_LD_GNU, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi]) +with_gnu_ld=$ac_cv_prog_gnu_ld +]) + +# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +AC_DEFUN(AC_PROG_LD_RELOAD_FLAG, +[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, +[lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +test -n "$reload_flag" && reload_flag=" $reload_flag" +]) + +# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +AC_DEFUN(AC_DEPLIBS_CHECK_METHOD, +[AC_CACHE_CHECK([how to recognise dependant libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$FILE' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [regex]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case "$host_os" in +aix4* | beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='${OBJDUMP} -f' + ;; + +freebsd*) + case "$version_type" in + freebsd-elf*) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +irix5* | irix6*) + case "$host_os" in + irix5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case "$LD" in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case "$host_cpu" in + alpha* | i*86 | sparc* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case "$host_vendor" in + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + esac + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +]) + + +# AC_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN(AC_PROG_NM, +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(ac_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi]) +NM="$ac_cv_path_NM" +AC_MSG_RESULT([$NM]) +]) + +# AC_CHECK_LIBM - check for math library +AC_DEFUN(AC_CHECK_LIBM, +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case "$lt_target" in +*-*-beos* | *-*-cygwin*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +]) + +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library, adds --enable-ltdl-convenience to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case "$enable_ltdl_convenience" in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_srcdir}/libltdl']) +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library, and adds --enable-ltdl-install to +# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor +# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed +# to be `${top_builddir}/libltdl'. Make sure you start DIR with +# '${top_builddir}/' (note the single quotes!) if your package is not +# flat, and, if you're not using automake, define top_builddir as +# appropriate in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la + INCLTDL=ifelse($#,1,-I$1,['-I${top_srcdir}/libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + INCLTDL= + fi +]) + +dnl old names +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl + +dnl This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL])dnl + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +AC_DEFUN(AM_CONFIG_HEADER, +[AC_PREREQ([2.12]) +AC_CONFIG_HEADER([$1]) +dnl When config.status generates a header, we must update the stamp-h file. +dnl This file resides in the same directory as the config header +dnl that is generated. We must strip everything past the first ":", +dnl and everything past the last "/". +AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl +ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, +<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, +<<am_indx=1 +for am_file in <<$1>>; do + case " <<$>>CONFIG_HEADERS " in + *" <<$>>am_file "*<<)>> + echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx + ;; + esac + am_indx=`expr "<<$>>am_indx" + 1` +done<<>>dnl>>) +changequote([,]))]) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + diff --git a/xc/extras/Mesa/bin/README b/xc/extras/Mesa/bin/README new file mode 100644 index 000000000..0f1a3bc82 --- /dev/null +++ b/xc/extras/Mesa/bin/README @@ -0,0 +1,48 @@ + + +The mklib.* scripts are use to make shared libraries on different +flavors of Unix (and other Unix-like OSes). But these scripts are +only used with the Makefile.X11 (and similar) makefiles. These +scripts are NOT used by GNU configure. + +In all cases, the command line arguments are: + + mklib libname major minor tiny file.o [...] + +where + libname = the library name ("libGL.so" for example) + major = the major version number ("1" for example) + minor = the minor version number ("2" for example) + tiny = the tiny version number ("310" for example) + file.o [...] = the list of one or more object files + +On most OSes, the final library name will be of the form: + libname.major.minor.tiny + +For example, + mklib libGL.so 1 2 310 file.o ... + +would generate the library named "libGL.so.1.2.310" which would be +the Mesa 3.1.0 implementation of the OpenGL 1.2 spec. + + + + +The *.py Python scripts are used to generate several Mesa source +files from a gl.spec file. The gl.spec file describes all the +OpenGL functions and extensions. From the gl.spec file we generate +the following: + +script generated file +--------------------- -------------- +gloffsets.py src/glapioffsets.h +gltable.py src/glapitable.h +glx86asm.py src/X86/glapi_x86.S + + +The gl.spec file can be obtained from the OpenGL SI codebase +in projects/ogl-sample/main/gfx/include/gl/spec/gl.spec + + +---------------------------------------------------------------------- +$Id: README,v 1.1 2000/11/30 17:31:30 dawes Exp $ diff --git a/xc/extras/Mesa/bin/mklib-emx.cmd b/xc/extras/Mesa/bin/mklib-emx.cmd new file mode 100755 index 000000000..079091d13 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib-emx.cmd @@ -0,0 +1,229 @@ +/* mklib-emx.cmd */
+/* REXX program to create DLLs for MESA 3.x */
+/* Keep this file in "DOS" text file format!! */
+
+version = "19990515"
+
+TRUE = 1
+FALSE = 0
+
+/*
+ Flags
+*/
+
+/* echo external commands being executed */
+quiet = TRUE
+
+/* get debuginfo about this utility */
+DEBUG = FALSE
+
+/* build static libraries
+ (well, they're always built, but otherwise deleted ;-) */
+BUILD_STATIC = TRUE
+
+
+/* Here the code really starts */
+Parse Arg param Major Minor Tiny Objects
+say "mklib-emx version "version
+
+if param = "" then
+ do
+ say "You shouldn't invoke mklib-emx directly."
+ exit
+ end
+
+/* We need REXXUtil functions */
+if RxFuncQuery('SysLoadFuncs') = 1 then
+ do
+ if RxFuncAdd('SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs') <> 0 then
+ do
+ say 'Sorry, your system seems to lack the REXX-Util-library !'
+ say program' can not run on this system'
+ exit
+ end
+ else
+ call SysLoadFuncs
+ end
+
+/* Check for XFree installation. Shall we check for EMX, too ? */
+env = 'OS2ENVIRONMENT'
+x11root = VALUE('X11ROOT',,env)
+if x11root = "" then
+ do
+ say "XFree86/2 is not properly installed"
+ exit
+ end
+
+/* Parse commandline arguments */
+Parse Var param base '.' extension
+_extension=Strip(Translate(extension))
+
+/* We ignore silently the actual request which format
+ the forwarder library should have. We create both
+ a.out and OMF style ones */
+DynaLibrary = Base".dll"
+ImportLibrary_a = Base".a"
+ImportLibrary_o = Base".lib"
+
+if DEBUG then
+ do
+ say "DynaLibrary: "DynaLibrary
+ Say "Major: "Major
+ Say "Minor: "Minor
+ Say "Tiny: "Tiny
+ Say "Objects: "Objects
+ end
+
+/* Check for old .def file */
+DEFFile = Base".def"
+olddef = Stream(DEFFile, 'C', 'QUERY EXISTS')
+if olddef <> "" then
+ do
+ tmpfile = SysTempFileName('.\mklib-emx.???')
+ call ExecCmd("mv "olddef" "tmpfile)
+ say "Renaming old "DEFFile" to "tmpfile
+ end
+
+/* Check for old library itself in ../lib-old/ */
+/* Check also in %X1ROOT%\XFree86\lib\ ?? */
+rc = SysFileTree("..\lib-old\"Base".dll", try_stem, "FO")
+if try_stem.0 = 1 then
+ do
+ say "Old version of library found: "try_stem.1
+ end
+
+/* Write out header for the .def file */
+call LineOut DEFFile ,,1
+call LineOut DEFFile, 'LIBRARY "'Base'"'
+call LineOut DEFFile, 'DESCRIPTION "X11R6 XFree86 'DLL' for OS/2 EMX 09c VERSION='major'.'minor'"'
+call LineOut DEFFile, 'CODE'
+call LineOut DEFFile, ' PRELOAD'
+call LineOut DEFFile, 'DATA'
+call LineOut DEFFile, ' MULTIPLE NONSHARED'
+call LineOut DEFFile, 'STACKSIZE 65536'
+if try_stem.0 = 1 then
+ call LineOut DEFFile, 'OLD "'try_stem.1'"'
+call LineOut DEFFile, 'EXPORTS'
+call LineOut DEFFile
+
+/*
+ Write out the export list for the DLL.
+ Might also have to explicitly deal with compatibility if not
+ solved otherwise.
+*/
+call CreateSymbolList
+
+/* To ease the handling we build archives of the objects
+ which might also serve as static libraries.
+ In any case we build an OMF style library to
+ ensure usage of link386 */
+StaticLibrary_a = ""
+StaticLibrary_o = ""
+try = SubWord(objects, 1, 1)
+try_ext= Translate(SubStr(try, LastPos(".", try)))
+if try_ext=".OBJ" then
+ do
+ say "OMF objects"
+ call ExecCmd("emxomfar rc "StaticLibrary_o" "objects)
+ StaticLibrary_o = base"_s.lib"
+ end
+else if try_ext=".O" then
+ do
+ say "a.out objects found. Converting to OMF ..."
+ StaticLibrary_a = base"_s.a"
+ StaticLibrary_o = base"_s.lib"
+ call ExecCmd("ar rc "StaticLibrary_a" "objects)
+ call ExecCmd("emxomf -p 32 "StaticLibrary_a)
+ end
+else
+ do
+ say "What's that?!" /* shouldn't happen */
+ exit
+ end
+
+/*
+ Put together all necessary flags for linking
+*/
+DLLFLAGS = "-s -Zomf -Zdll -Zmt -Zcrtdll -L"x11root"/XFree86/lib -Zlinker /EXEPACK:2 -Zlinker /NOO"
+if DEBUG=TRUE then
+ DLLFLAGS = DLLFLAGS" -v -Zlinker /I"
+
+/* Add dependencies for the new DLLs */
+if Translate(Base) = "MESAGL" then
+ do
+ DLLLibs = "-lX11"
+ DLLGLLIBS = ""
+ end
+else if Translate(Base) = "MESAGLU" then
+ do
+ DLLLibs = ""
+ DLLGLLIBS = "-L..\lib -lMesaGL"
+ end
+else if Translate(Base) = "GLUT" then
+ do
+ DLLLibs = "-lXmu -lXi -lX11"
+ DLLGLLIBS = "-L..\lib -lMesaGL -lMesaGLU"
+ end
+/*
+else if Translate(Base) = "GLW" then
+ do
+ DLLLibs = "-lXt -lX11"
+ DLLGLLIBS = "-L..\lib -lMesaGL -lMesaGLU"
+ end
+*/
+else
+ do
+ say "Unknown library: "Base
+ exit
+ end
+
+/* Link DLL (using link386 implicitly) */
+call ExecCmd("gcc -o "DynaLibrary" "DLLFLAGS" "StaticLibrary_o" "DEFFile" "DLLGLLIBS" "DLLLibs)
+
+/* Link static import libraries */
+call ExecCmd("emximp -o "ImportLibrary_a" "DEFFile)
+call ExecCmd("emximp -o "ImportLibrary_o" "DEFFile)
+
+/*
+ Make sure everything ends up in /lib
+*/
+call ExecCmd("mv "DynaLibrary" ..\lib")
+/* Don't move this one ! The Makefile will do this:
+ call ExecCmd("mv "ImportLibrary_a" ..\lib") */
+call ExecCmd("mv "ImportLibrary_o" ..\lib")
+call ExecCmd("mv "Base".def ..\lib")
+if BUILD_STATIC=TRUE then
+ do
+ call ExecCmd("mv "StaticLibrary_o" ..\lib")
+ if StaticLibrary_a <> "" then
+ call ExecCmd("mv "StaticLibrary_a" ..\lib")
+ end
+else
+ do
+ call ExecCmd("rm "StaticLibrary_o)
+ if StaticLibrary_a <> "" then
+ call ExecCmd("rm "StaticLibrary_a)
+ end
+
+/* Ok, done. */
+exit
+
+/* ************************ End of main program ************************ */
+
+/* Small procedures */
+
+CreateSymbolList: PROCEDURE Expose Objects DEFFile TRUE FALSE
+Olist = Objects
+call ExecCmd("emxexp "OList" >>"DEFFile)
+return
+
+ExecCmd: PROCEDURE Expose quiet TRUE FALSE
+/* Execute a command properly and return it's return value */
+Parse Arg cmdstring
+ADDRESS CMD
+if quiet=TRUE then
+"@"cmdstring
+else
+cmdstring
+ADDRESS
+return rc
diff --git a/xc/extras/Mesa/bin/mklib.aix b/xc/extras/Mesa/bin/mklib.aix new file mode 100755 index 000000000..2e128d75f --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.aix @@ -0,0 +1,156 @@ +#!/bin/ksh + +# Make an AIX shared library (tricky!!!) +# Based on a script from Athanasios G. Gaitatzes (gaitat@vnet.ibm.com) +# Improved by Greg Thompson <gregt@visix.com> -gt + +#--identification------------------------------------------------------ + +# $Id: mklib.aix,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.aix,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:56 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +# BASENAME = LIBRARY without .a suffix +BASENAME=`echo ${LIBRARY} | sed "s/\.a//g"` + +# Name of exports file +EXPFILE=${BASENAME}.exp + +# Name of temporary shared lib file +OFILE=shr.o +####OFILE=${BASENAME}.o + + +# Remove any old files from previous make +rm -f ${LIBRARY} ${EXPFILE} ${OFILE} + +# Pick a way to use nm -gt +NM=${NM-/bin/nm -eC} + +# Determine which version of AIX this is +AIXVERSION=`uname -v` + +# Pick a way to tell the linker there's no entrypoint -gt +case ${AIXVERSION} +{ + 3*) + ENTRY='-e _nostart' + ;; + 4*) + ENTRY=-bnoentry + ;; + *) + echo "Error in mklib.aix!" + exit 1 + ;; +} + + +# Other libraries which we may be dependent on. Since we make the libraries +# in the order libGL.a, libaGLU.a, libglut.a just depends on its predecessor. +# modified to make otherlibs in the form of -lfoo -gt +OTHERLIBS=`ls ../lib/*.a | sed "s/..\/lib\/lib/-l/g" | sed "s/\.a//g"` + +##echo OTHERLIBS are ${OTHERLIBS} + + +# Make exports (.exp) file header +echo "#! ${LIBRARY}" > ${EXPFILE} + +# Append list of exported symbols to exports file -gt +case ${AIXVERSION} +{ + 3*) + ${NM} ${OBJECTS} | awk -F'|' '{ + if ($3 != "extern" || substr($7,1,1) == " ") continue + sub (" *", "", $1); sub (" *", "", $7) + if ( (($7 == ".text") || ($7 == ".data") || ($7 == ".bss")) \ + && ( substr($1,1,1) != ".")) { + if (substr ($1, 1, 7) != "__sinit" && + substr ($1, 1, 7) != "__sterm") { + if (substr ($1, 1, 5) == "__tf1") + print (substr ($1, 7)) + else if (substr ($1, 1, 5) == "__tf9") + print (substr ($1, 15)) + else + print $1 + } + } + }' | sort -u >> ${EXPFILE} + ;; + + 4*) + ${NM} ${OBJECTS} | awk '{ + if ((($2 == "T") || ($2 == "D") || ($2 == "B")) \ + && ( substr($1,1,1) != ".")) { + if (substr ($1, 1, 7) != "__sinit" && + substr ($1, 1, 7) != "__sterm") { + if (substr ($1, 1, 5) == "__tf1") + print (substr ($1, 7)) + else if (substr ($1, 1, 5) == "__tf9") + print (substr ($1, 15)) + else + print $1 + } + } + }' | sort -u >> ${EXPFILE} + ;; +} + + +# This next line is a hack to allow full compatibility with IBM's OpenGL +# libraries. IBM mistakenly exports glLoadIdentity from the libGLU.a +# library. We have to do the same thing. Problem reported by Yemi Adesanya +# (adesanya@afsmail.cern.ch) and Patrick Brown (pbrown@austin.ibm.com) +if [ "${BASENAME}" = libGLU ] ; then + echo "glLoadIdentity" >> ${EXPFILE} +fi + + +# Make the shared lib file +cc -o ${OFILE} ${OBJECTS} -L../lib ${OTHERLIBS} -lX11 -lXext -lXmu -lXi -lm -lc -bE:${EXPFILE} -bM:SRE ${ENTRY} + + +# Make the .a file +ar ruv ${LIBRARY} ${OFILE} + +# Put exports file in Mesa lib directory +mv ${EXPFILE} ../lib + +# Remove OFILE +rm -f ${OFILE} + + +#NOTES +# AIX 4.x /usr/bin/nm -B patch from ssclift@mach.me.queensu.ca (Simon Clift) +# Robustified symbol extraction for AIX 3 and 4 +# Greg Thompson <gregt@visix.com> + diff --git a/xc/extras/Mesa/bin/mklib.amiga b/xc/extras/Mesa/bin/mklib.amiga new file mode 100755 index 000000000..6fd0e26ae --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.amiga @@ -0,0 +1,42 @@ +; Script for building Mesa and example programs for Amiga + +if not exists lib +makedir lib +endif + +echo "Making MESAGL.LIB" +cd src +smake amiga +cd / + +echo "Making MesaGLU.LIB" +cd src-glu +smake amiga +cd / + +echo "Making Mesaaux.LIB" +cd src-aux +smake amiga +cd / + +echo "Making Mesatk.LIB" +cd src-tk +smake amiga +cd / + +echo "Making book examples." +cd book +smake amiga +cd / + +echo "Making sample code." +cd samples +smake amiga +cd / + +echo "Making demo code." +cd demos +smake amiga +cd / + +echo "Finished making all libraries and programs." diff --git a/xc/extras/Mesa/bin/mklib.amiwin b/xc/extras/Mesa/bin/mklib.amiwin new file mode 100755 index 000000000..1ab12d781 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.amiwin @@ -0,0 +1,43 @@ +; Script for building Mesa and example programs for AmiWin +; on the Amiga. + +if not exists lib +makedir lib +endif + +echo "Making MesaGL.LIB" +cd src +smake targets +cd / + +echo "Making MesaGLU.LIB" +cd src-glu +smake targets +cd / + +echo "Making Mesaaux.LIB" +cd src-aux +smake targets +cd / + +echo "Making Mesatk.LIB" +cd src-tk +smake targets +cd / + +echo "Making book examples." +cd book +smake targets +cd / + +echo "Making sample code." +cd samples +smake targets +cd / + +echo "Making demo code." +cd demos +smake targets +cd / + +echo "Finished making all libraries and programs." diff --git a/xc/extras/Mesa/bin/mklib.ar-rcv b/xc/extras/Mesa/bin/mklib.ar-rcv new file mode 100755 index 000000000..cc76801fa --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.ar-rcv @@ -0,0 +1,41 @@ +#!/bin/sh + +# Make a standard Unix .a library file with 'ar rcv' + +#--identification------------------------------------------------------ + +# $Id: mklib.ar-rcv,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.ar-rcv,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:57 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +#ar rcv $LIBRARY $OBJECTS +ar rc $LIBRARY $OBJECTS + diff --git a/xc/extras/Mesa/bin/mklib.ar-ruv b/xc/extras/Mesa/bin/mklib.ar-ruv new file mode 100755 index 000000000..665e1ead4 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.ar-ruv @@ -0,0 +1,41 @@ +#!/bin/sh + +# Make a standard Unix .a library file with 'ar ruv' + +#--identification------------------------------------------------------ + +# $Id: mklib.ar-ruv,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.ar-ruv,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:57 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +#ar ruv $LIBRARY $OBJECTS +ar ru $LIBRARY $OBJECTS + diff --git a/xc/extras/Mesa/bin/mklib.beos b/xc/extras/Mesa/bin/mklib.beos new file mode 100755 index 000000000..11bd5bb13 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.beos @@ -0,0 +1,59 @@ +#!/bin/sh + +# Make a library file for Beos + +#--identification------------------------------------------------------ + +# $Id: mklib.beos,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.beos,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:57 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +# build system library pathnames +SYSLIBNAMES="libroot.so libbe.so libdll.a lib3DfxGlide2X.so" + +for i in `echo $BELIBRARIES | sed "s/;/ /g"` +do + for j in $SYSLIBNAMES + do + if [ -e $i/$j ] ; then SYSLIBS="$SYSLIBS $i/$j" ; fi + done +done + +# remove previous library before linking to avoid duplicate symbols +rm ../lib/$LIBRARY 2>/dev/null + +# Other libraries which we may be dependent on. Since we make the libraries +# in the order libMesaGL.a, libMesaGLU.a, libMesatk.a, libMesaaux.a each +# just depends on its predecessor. +# (code picked up from mklib.aix) +OTHERLIBS=`ls ../lib/*.so 2>/dev/null` + +mwcc -sharedlibrary -export pragma -term '' -init '' $SYSLIBS $OTHERLIBS -o $LIBRARY $OBJECTS diff --git a/xc/extras/Mesa/bin/mklib.beos-ppc b/xc/extras/Mesa/bin/mklib.beos-ppc new file mode 100755 index 000000000..ed2798e40 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.beos-ppc @@ -0,0 +1,59 @@ +#!/bin/sh + +# Make a library file for BeOS on PowerPC + +#--identification------------------------------------------------------ + +# $Id: mklib.beos-ppc,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.beos-ppc,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:58 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +# build system library pathnames +SYSLIBNAMES="libmoto.a libroot.so libbe.so glue-noinit.a init_term_dyn.o start_dyn.o lib3DfxGlide2X.so" + +for i in `echo $BELIBRARIES | sed "s/;/ /g"` +do + for j in $SYSLIBNAMES + do + if [ -e $i/$j ] ; then SYSLIBS="$SYSLIBS $i/$j" ; fi + done +done + +# remove previous library before linking to avoid duplicate symbols +rm ../lib/$LIBRARY 2>/dev/null + +# Other libraries which we may be dependent on. Since we make the libraries +# in the order libMesaGL.a, libMesaGLU.a, libMesatk.a, libMesaaux.a each +# just depends on its predecessor. +# (code picked up from mklib.aix) +OTHERLIBS=`ls ../lib/*.so 2>/dev/null` + +mwccppc -sharedlibrary -export pragma -term '' -init '' $SYSLIBS $OTHERLIBS -o $LIBRARY $OBJECTS diff --git a/xc/extras/Mesa/bin/mklib.beos-r4 b/xc/extras/Mesa/bin/mklib.beos-r4 new file mode 100755 index 000000000..eff1e7945 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.beos-r4 @@ -0,0 +1,40 @@ +#!/bin/sh + +# Make a library file for BeOS R4 + +#--identification------------------------------------------------------ + +# $Id: mklib.beos-r4,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.beos-r4,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:59 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +gcc -nostart -Xlinker -soname=$LIBRARY -L/Be/develop/lib/x86 $OBJECTS -lbe -o $LIBRARY + diff --git a/xc/extras/Mesa/bin/mklib.beos-x86 b/xc/extras/Mesa/bin/mklib.beos-x86 new file mode 100755 index 000000000..1d850f57a --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.beos-x86 @@ -0,0 +1,59 @@ +#!/bin/sh + +# Make a library file for BeOS on x86 + +#--identification------------------------------------------------------ + +# $Id: mklib.beos-x86,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.beos-x86,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:59 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +# build system library pathnames +SYSLIBNAMES="libroot.so.LIB libbe.so.LIB glue-noinit.a init_term_dyn.o start_dyn.o lib3DfxGlide2X.so.LIB" + +for i in `echo $BELIBRARIES | sed "s/;/ /g"` +do + for j in $SYSLIBNAMES + do + if [ -e $i/$j ] ; then SYSLIBS="$SYSLIBS $i/$j" ; fi + done +done + +# remove previous library before linking to avoid duplicate symbols +rm ../lib/$LIBRARY 2>/dev/null + +# Other libraries which we may be dependent on. Since we make the libraries +# in the order libMesaGL.a, libMesaGLU.a, libMesatk.a, libMesaaux.a each +# just depends on its predecessor. +# (code picked up from mklib.aix) +OTHERLIBS=`ls ../lib/*.so.LIB 2>/dev/null` + +mwccx86 -sharedlibrary -pragma 'export on' $SYSLIBS $OTHERLIBS -o $LIBRARY $OBJECTS diff --git a/xc/extras/Mesa/bin/mklib.bsdos4 b/xc/extras/Mesa/bin/mklib.bsdos4 new file mode 100755 index 000000000..d5d50b25c --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.bsdos4 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Make a BSD/OS 4.x shared library +# contributed by David MacKenzie <djm@uu.net> + +#--identification------------------------------------------------------ + + +# $Log: mklib.bsdos4,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:59 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +VERSION=$MAJOR.$MINOR + +BASENAME=`echo ${LIBRARY} | sed "s/\.a//g"` +SHLIB=${BASENAME}.so +STLIB=${BASENAME}.a + +rm -f ${SHLIB} ${STLIB} + +ar cq ${STLIB} ${OBJECTS} +ranlib ${STLIB} +gcc -shared -Wl,-h,${SHLIB} -o ${SHLIB} ${OBJECTS} + +mv ${SHLIB} ../lib
\ No newline at end of file diff --git a/xc/extras/Mesa/bin/mklib.cygnus-linux b/xc/extras/Mesa/bin/mklib.cygnus-linux new file mode 100755 index 000000000..8972b3cd5 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.cygnus-linux @@ -0,0 +1,41 @@ +#!/bin/sh + +# Make a standard .a library using Cygnus on Linux +# contributed by Stephane Rehel <rehel@worldnet.fr> + +#--identification------------------------------------------------------ + +# $Id: mklib.cygnus-linux,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.cygnus-linux,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:59 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +gnuwin32ar ruv $LIBRARY $OBJECTS + diff --git a/xc/extras/Mesa/bin/mklib.freebsd b/xc/extras/Mesa/bin/mklib.freebsd new file mode 100755 index 000000000..9234dc235 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.freebsd @@ -0,0 +1,52 @@ +#!/bin/sh + +# Make a FreeBSD shared library +# contributed by Mark Diekhans <markd@grizzly.com> + +#--identification------------------------------------------------------ + +# $Id: mklib.freebsd,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.freebsd,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:52:59 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +VERSION=$MAJOR.$MINOR + +BASENAME=`echo ${LIBRARY} | sed "s/\.a//g"` +SHLIB=${BASENAME}.so.${VERSION} +STLIB=${BASENAME}.a + +rm -f ${SHLIB} ${STLIB} + +ar cq ${STLIB} ${OBJECTS} +ranlib ${STLIB} +ld -Bshareable -o ${SHLIB} ${OBJECTS} + +mv ${SHLIB} ../lib diff --git a/xc/extras/Mesa/bin/mklib.ggi b/xc/extras/Mesa/bin/mklib.ggi new file mode 100755 index 000000000..846291a09 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.ggi @@ -0,0 +1,84 @@ +#!/bin/sh + +# Make a shared library for GGI + +#--identification------------------------------------------------------ + +# $Id: mklib.ggi,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.ggi,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.4 1999/11/30 13:02:16 brianp +# restored MAJOR version number in soname +# +# Revision 1.3 1999/11/18 15:29:52 brianp +# removed MAJOR version number from soname +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:00 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ +if [ $LIBRARY = "libglut.so" ] ; then + GGILIBS="-L/usr/X11R6/lib -L/usr/X11/lib -lggi -lX11 -lXext -lm" +fi + +if [ $LIBRARY = "libGL.so" ] ; then + GGILIBS="-L/usr/X11R6/lib -L/usr/X11/lib -lggi -lX11 -lXext -lm" +fi + +# the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de) + +VERSION="${MAJOR}.${MINOR}" + +LIBNAME=`basename $LIBRARY` +ARNAME=`basename $LIBNAME .so`.a +DIRNAME=`dirname $LIBRARY` + +gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${GGILIBS} +(cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR}) + +ln -s ${LIBNAME}.${MAJOR} ${LIBRARY} + + +# also make regular .a files, +# provided by Danek Duvall (duvall@dhduvall.student.princeton.edu) + +ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS} +ranlib ${DIRNAME}/${ARNAME} + + +# Print a reminder about shared libs: +DIR=`cd .. ; pwd` +echo +echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable" +echo +sleep 2 + + + +#### NOTES: +# One Mesa user reports having to run the "ldconfig -v" command to make +# Linux aware of the shared libs. diff --git a/xc/extras/Mesa/bin/mklib.glide b/xc/extras/Mesa/bin/mklib.glide new file mode 100755 index 000000000..70f105703 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.glide @@ -0,0 +1,85 @@ +#!/bin/sh + +# Make a Linux ELF shared library, including 3Dfx Glide libs + +#--identification------------------------------------------------------ + +# $Id: mklib.glide,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.glide,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.5 2000/07/10 23:41:18 brianp +# replace libMesaGL.so with libGL.so +# +# Revision 1.4 1999/11/30 13:02:16 brianp +# restored MAJOR version number in soname +# +# Revision 1.3 1999/11/18 15:29:52 brianp +# removed MAJOR version number from soname +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:00 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +if [ $LIBRARY = "libGL.so" ] ; then + GLIDELIBS="-L/usr/local/glide/lib -lglide2x -lm" +fi + + +# the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de) + +VERSION="${MAJOR}.${MINOR}" + +LIBNAME=`basename $LIBRARY` +ARNAME=`basename $LIBNAME .so`.a +DIRNAME=`dirname $LIBRARY` + +gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${GLIDELIBS} +(cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR}) + +ln -s ${LIBNAME}.${MAJOR} ${LIBRARY} + + +# also make regular .a files, +# provided by Danek Duvall (duvall@dhduvall.student.princeton.edu) + +ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS} +ranlib ${DIRNAME}/${ARNAME} + + +# Print a reminder about shared libs: +DIR=`cd .. ; pwd` +echo +echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable" +echo +sleep 2 + + + +#### NOTES: +# One Mesa user reports having to run the "ldconfig -v" command to make +# Linux aware of the shared libs. diff --git a/xc/extras/Mesa/bin/mklib.hpux b/xc/extras/Mesa/bin/mklib.hpux new file mode 100755 index 000000000..67002d788 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.hpux @@ -0,0 +1,54 @@ +#!/bin/sh + +# Make an HPUX shared library +# contributed by Jan Springer (springer@nessi.informatik.hab-weimar.de) + +#--identification------------------------------------------------------ + +# $Id: mklib.hpux,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.hpux,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:01 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +RUNLIB=${LIBRARY}.${MAJOR} +DEVLIB=${LIBRARY}.sl + + +#--platform------------------------------------------------------------ + +ld -b -o ${RUNLIB} +b ${RUNLIB} ${OBJECTS} +ln -s ${RUNLIB} ${DEVLIB} + +echo "Be sure to set the LPATH and SHLIB_PATH variables as shown in mklib.hpux" + + +# Comments: +# You'll need to put the following setenv's in your .cshrc or .login file: +# +# setenv LPATH .:/lib/pa1.1:/usr/lib/pa1.1:/lib:/usr/lib:/usr/lib/X11R5:/usr/lib/Motif1.2:/usr/local/xview3.2/lib:/usr/local/lib:/usr/local/lib/X11 +# setenv SHLIB_PATH ${LPATH} diff --git a/xc/extras/Mesa/bin/mklib.irix5 b/xc/extras/Mesa/bin/mklib.irix5 new file mode 100755 index 000000000..ab10ed217 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.irix5 @@ -0,0 +1,59 @@ +#!/bin/sh + +# Make an IRIX 5.x DSO + +#--identification------------------------------------------------------ + +# $Id: mklib.irix5,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.irix5,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.3 2000/07/10 23:41:18 brianp +# replace libMesaGL.so with libGL.so +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:01 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +# This is a bit of a kludge, but... +if test ${LIBRARY} = "libGL.so" ; then + # must add libXext.a to libGL.so in case one relinks a precompiled + # OpenGL program which wasn't linked with -lXext or -lm. + OBJECTS="${OBJECTS} -lXext -lm" +fi + + +ld -shared -all -o ${LIBRARY} ${OBJECTS} + + +# You may want to add the following to the ld line: +# -soname <path>$LIBNAME +# +# where LIBNAME=`basename $LIBRARY` and <path> is where you're going to +# put Mesa's libraries. This may solve problems with the runtime +# loader/linker (rld) not being able to find the library. +# For example: -soname /usr/local/lib/$LIBNAME diff --git a/xc/extras/Mesa/bin/mklib.irix6-32 b/xc/extras/Mesa/bin/mklib.irix6-32 new file mode 100755 index 000000000..50cad6572 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.irix6-32 @@ -0,0 +1,56 @@ +#!/bin/sh + +# Make an o32 IRIX 6.x DSO + +#--identification------------------------------------------------------ + +# $Id: mklib.irix6-32,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.irix6-32,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:02 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +# This is a bit of a kludge, but... +if test ${LIBRARY} = "libGL.so" ; then + # must add libXext.a to Mesa libGL.so in case one relinks a precompiled + # OpenGL program which wasn't linked with -lXext or -lm. + OBJECTS="${OBJECTS} -lXext -lm" +fi + + +ld -32 -shared -all -o ${LIBRARY} ${OBJECTS} + + +# You may want to add the following to the ld line: +# -soname <path>$LIBNAME +# +# where LIBNAME=`basename $LIBRARY` and <path> is where you're going to +# put Mesa's libraries. This may solve problems with the runtime +# loader/linker (rld) not being able to find the library. +# For example: -soname /usr/local/lib/$LIBNAME diff --git a/xc/extras/Mesa/bin/mklib.irix6-64 b/xc/extras/Mesa/bin/mklib.irix6-64 new file mode 100755 index 000000000..d34c2c1c8 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.irix6-64 @@ -0,0 +1,56 @@ +#!/bin/sh + +# Make a 64-bit IRIX 6.x DSO + +#--identification------------------------------------------------------ + +# $Id: mklib.irix6-64,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.irix6-64,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:02 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +# This is a bit of a kludge, but... +if test ${LIBRARY} = "libGL.so" ; then + # must add libXext.a to Mesa libGL.so in case one relinks a precompiled + # OpenGL program which wasn't linked with -lXext or -lm. + OBJECTS="${OBJECTS} -lXext -lm" +fi + + +ld -64 -shared -all -o ${LIBRARY} ${OBJECTS} + + +# You may want to add the following to the ld line: +# -soname <path>$LIBNAME +# +# where LIBNAME=`basename $LIBRARY` and <path> is where you're going to +# put Mesa's libraries. This may solve problems with the runtime +# loader/linker (rld) not being able to find the library. +# For example: -soname /usr/local/lib/$LIBNAME diff --git a/xc/extras/Mesa/bin/mklib.irix6-n32 b/xc/extras/Mesa/bin/mklib.irix6-n32 new file mode 100755 index 000000000..dfbd9a2a5 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.irix6-n32 @@ -0,0 +1,56 @@ +#!/bin/sh + +# Make an n32 IRIX 6.x DSO + +#--identification------------------------------------------------------ + +# $Id: mklib.irix6-n32,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.irix6-n32,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:03 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +# This is a bit of a kludge, but... +if test ${LIBRARY} = "libGL.so" ; then + # must add libXext.a to Mesa libGL.so in case one relinks a precompiled + # OpenGL program which wasn't linked with -lXext or -lm. + OBJECTS="${OBJECTS} -lXext -lm" +fi + + +ld -n32 -shared -all -o ${LIBRARY} ${OBJECTS} + + +# You may want to add the following to the ld line: +# -soname <path>$LIBNAME +# +# where LIBNAME=`basename $LIBRARY` and <path> is where you're going to +# put Mesa's libraries. This may solve problems with the runtime +# loader/linker (rld) not being able to find the library. +# For example: -soname /usr/local/lib/$LIBNAME diff --git a/xc/extras/Mesa/bin/mklib.linux b/xc/extras/Mesa/bin/mklib.linux new file mode 100755 index 000000000..9b4e09be5 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.linux @@ -0,0 +1,94 @@ +#!/bin/sh + +# Make a Linux ELF shared library + +#--identification------------------------------------------------------ + +# $Id: mklib.linux,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.linux,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.6 2000/02/16 01:09:06 brianp +# new library dependency vars +# +# Revision 1.5 1999/11/30 13:02:16 brianp +# restored MAJOR version number in soname +# +# Revision 1.4 1999/11/18 15:29:52 brianp +# removed MAJOR version number from soname +# +# Revision 1.3 1999/09/15 17:11:34 brianp +# use TINY in library name +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:03 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +# the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de) + +VERSION="${MAJOR}.${MINOR}.${TINY}" + +LIBNAME=`basename $LIBRARY` +ARNAME=`basename $LIBNAME .so`.a +DIRNAME=`dirname $LIBRARY` + +# When making shared libraries, also link with any libraries we're +# depenedant on. +if [ $LIBRARY = "libGL.so" ] ; then + EXTRA_LIBS=${GL_LIB_DEPS} +elif [ $LIBRARY = "libGLU.so" ] ; then + EXTRA_LIBS=${GLU_LIB_DEPS} +elif [ $LIBRARY = "libglut.so" ] ; then + EXTRA_LIBS=${GLUT_LIB_DEPS} +fi + +gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${EXTRA_LIBS} + +(cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR}) + +ln -s ${LIBNAME}.${MAJOR} ${LIBRARY} + + +# also make regular .a files, +# provided by Danek Duvall (duvall@dhduvall.student.princeton.edu) + +ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS} +ranlib ${DIRNAME}/${ARNAME} + + +# Print a reminder about shared libs: +DIR=`cd .. ; pwd` +echo +echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable" +echo +sleep 2 + + + +#### NOTES: +# One Mesa user reports having to run the "ldconfig -v" command to make +# Linux aware of the shared libs. diff --git a/xc/extras/Mesa/bin/mklib.mits b/xc/extras/Mesa/bin/mklib.mits new file mode 100755 index 000000000..15c3d69b6 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.mits @@ -0,0 +1,89 @@ +#!/bin/sh + +# Make a Linux ELF shared for 3Dfx Glide with threading for MITS + +#--identification------------------------------------------------------ + +# $Id: mklib.mits,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.mits,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.5 2000/07/10 23:41:18 brianp +# replace libMesaGL.so with libGL.so +# +# Revision 1.4 1999/11/30 13:02:16 brianp +# restored MAJOR version number in soname +# +# Revision 1.3 1999/11/18 15:29:52 brianp +# removed MAJOR version number from soname +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:04 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +# If we're making the libGL.so file then also link in the Glide libs. +# The -L/usr/i486-linux-libc5/lib option is specified so that licb5 is +# used on RedHat 5.x systems. This helps to fix Quake problems. This +# tip comes from Emil Briggs (briggs@tick.physics.ncsu.edu). Thanks! +if [ $LIBRARY = "libGL.so" ] ; then + GLIDELIBS="-L/usr/local/glide/lib -lglide2x -L/usr/i486-linux-libc5/lib -lm -lpthread" +fi + + +# the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de) + +VERSION="${MAJOR}.${MINOR}" + +LIBNAME=`basename $LIBRARY` +ARNAME=`basename $LIBNAME .so`.a +DIRNAME=`dirname $LIBRARY` + +gcc -shared -Wl,-soname,${LIBNAME}.${MAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS} ${GLIDELIBS} +(cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${MAJOR}) + +ln -s ${LIBNAME}.${MAJOR} ${LIBRARY} + + +# also make regular .a files, +# provided by Danek Duvall (duvall@dhduvall.student.princeton.edu) + +ar ruv ${DIRNAME}/${ARNAME} ${OBJECTS} +ranlib ${DIRNAME}/${ARNAME} + + +# Print a reminder about shared libs: +DIR=`cd .. ; pwd` +echo +echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable" +echo +sleep 2 + + + +#### NOTES: +# One Mesa user reports having to run the "ldconfig -v" command to make +# Linux aware of the shared libs. diff --git a/xc/extras/Mesa/bin/mklib.netbsd b/xc/extras/Mesa/bin/mklib.netbsd new file mode 100755 index 000000000..e41789fb8 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.netbsd @@ -0,0 +1,54 @@ +#!/bin/sh + +# Make a NetBSD shared library +# contributed by Michael Graff (explorer@flame.org) +# updated by Jarkko Hietaniemi (jarkko.hietaniemi@research.nokia.com) + +#--identification------------------------------------------------------ + +# $Id: mklib.netbsd,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.netbsd,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:04 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +set -x + +LIBRARY=`basename ${LIBRARY} .so` + +VERSION="${MAJOR}.${MINOR}" + +echo "Building PIC library $LIBRARY" +rm -f ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION} +ar cq ${LIBRARY}_pic.a ${OBJECTS} +ranlib ${LIBRARY}_pic.a + +ld -x -Bshareable -Bforcearchive -o ${LIBRARY}.so.${VERSION} ${LIBRARY}_pic.a + +cp ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION} ../lib diff --git a/xc/extras/Mesa/bin/mklib.new b/xc/extras/Mesa/bin/mklib.new new file mode 100755 index 000000000..bc3b4c601 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.new @@ -0,0 +1,46 @@ +#!/bin/sh + +# Make a XXX library file + +#--identification------------------------------------------------------ + +# $Id: mklib.new,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.new,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:04 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--debug--------------------------------------------------------------- + +#echo LIBRARY = $LIBRARY +#echo MAJOR = $MAJOR +#echo MINOR = $MINOR +#echo OBJECTS = $OBJECTS + +#--platform------------------------------------------------------------- + +Put your OS/platform-specific commands here for making static/shared libs. diff --git a/xc/extras/Mesa/bin/mklib.openbsd b/xc/extras/Mesa/bin/mklib.openbsd new file mode 100755 index 000000000..7ac673df9 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.openbsd @@ -0,0 +1,54 @@ +#!/bin/sh + +# Make a OpenBSD shared library +# contributed by thomas graichen (graichen@OpenBSD.org) + +#--identification------------------------------------------------------ + +# $Id: mklib.openbsd,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.openbsd,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:04 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +set -x + +LIBRARY=`basename $LIBRARY .so` + +VERSION="${MAJOR}.${MINOR}" + +echo "Building PIC library $LIBRARY" +rm -f ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION} +ar cq ${LIBRARY}_pic.a ${OBJECTS} +ranlib ${LIBRARY}_pic.a + +ld -x -Bshareable -Bforcearchive -o ${LIBRARY}.so.${VERSION} ${LIBRARY}_pic.a + +cp ${LIBRARY}_pic.a ${LIBRARY}.so.${VERSION} ../lib +ln -s ../lib/${LIBRARY}.so.${VERSION} ../lib/${LIBRARY}.so diff --git a/xc/extras/Mesa/bin/mklib.openstep b/xc/extras/Mesa/bin/mklib.openstep new file mode 100755 index 000000000..a6e5c4e41 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.openstep @@ -0,0 +1,39 @@ +# Make a static OpenStep .a library file with libtool + +#--identification------------------------------------------------------ + +# $Id: mklib.openstep,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.openstep,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:05 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +libtool -static -o $LIBRARY - $OBJECTS + +####/bin/cc -dynamiclib -dynamic -compatibility_version 1 -current_version 1 -install_name $LIBRARY -o $LIBRARY $OBJECTS diff --git a/xc/extras/Mesa/bin/mklib.osf1 b/xc/extras/Mesa/bin/mklib.osf1 new file mode 100755 index 000000000..57f476c04 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.osf1 @@ -0,0 +1,51 @@ +#!/bin/sh + +# Make a digital unix shared library (OSF/1) +# provided by Thomas Graichen (graichen@rzpd.de) + +#--identification------------------------------------------------------ + +# $Id: mklib.osf1,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.osf1,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:05 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------ + +VERSION="${MAJOR}.${MINOR}" + +LIBNAME=`basename $LIBRARY` +ARNAME=`basename $LIBNAME .so`.a +DIRNAME=`dirname $LIBRARY` + +rm -f ${LIBRARY}.${VERSION} +ld -o ${LIBRARY}.${VERSION} -shared -no_archive -set_version ${VERSION} -soname ${LIBNAME}.${VERSION} -expect_unresolved \* -all ${OBJECTS} +(cd $DIRNAME; ln -sf ${LIBNAME}.${VERSION} ${LIBNAME}) + +rm -f ${DIRNAME}/${ARNAME} +ar clqz ${DIRNAME}/${ARNAME} ${OBJECTS} diff --git a/xc/extras/Mesa/bin/mklib.qnx b/xc/extras/Mesa/bin/mklib.qnx new file mode 100755 index 000000000..44c6c33bf --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.qnx @@ -0,0 +1,48 @@ +#!/bin/sh + +# Make a QNX library file (from Steven Bellenot, sfb@entropy.math.fsu.edu) + + +#--identification------------------------------------------------------ + +# $Id: mklib.qnx,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.qnx,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:06 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--debug--------------------------------------------------------------- + +#echo LIBRARY = $LIBRARY +#echo MAJOR = $MAJOR +#echo MINOR = $MINOR +#echo OBJECTS = $OBJECTS + +#--platform------------------------------------------------------------- + +Put your OS/platform-specific commands here for making static/shared libs. +wlib $LIBRARY $OBJECTS diff --git a/xc/extras/Mesa/bin/mklib.solaris b/xc/extras/Mesa/bin/mklib.solaris new file mode 100755 index 000000000..181962e85 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.solaris @@ -0,0 +1,55 @@ +#!/bin/sh + +# Make a Solaris shared library +# contributed by Arno Hahma (arno@nitro.pp.utu.fi) + +#--identification------------------------------------------------------ + +# $Id: mklib.solaris,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.solaris,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:06 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +set -x + +LIBRARY=`basename $LIBRARY .a` + +VERSION=$MAJOR.$MINOR + +echo "Building shared object $LIBRARY.so.$VERSION and the archive library $LIBRARY.a" +rm -f ${LIBRARY}.a ${LIBRARY}.so.${VERSION} +ar ruv ${LIBRARY}.a ${OBJECTS} + +ld -G -o ${LIBRARY}.so.${VERSION} ${OBJECTS} + +cp ${LIBRARY}.a ${LIBRARY}.so.${VERSION} ../lib +cd ../lib +ln -s ${LIBRARY}.so.${VERSION} ${LIBRARY}.so + diff --git a/xc/extras/Mesa/bin/mklib.sunos4 b/xc/extras/Mesa/bin/mklib.sunos4 new file mode 100755 index 000000000..6d9b123f6 --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.sunos4 @@ -0,0 +1,47 @@ +#!/bin/sh + +# Make a shared lib for SunOS 4.x library file + +#--identification------------------------------------------------------ + +# $Id: mklib.sunos4,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.sunos4,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:06 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +# Usage: mklib libname major minor tiny file.o ... +# +# First argument is name of output library (LIBRARY) +# Second arg is major version number (MAJOR) +# Third arg is minor version number (MINOR) +# Fourth arg is tiny version number (TINY) +# Rest of arguments are object files (OBJECTS) + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +ld -assert pure-text -o $LIBRARY $OBJECTS diff --git a/xc/extras/Mesa/bin/mklib.sunos5 b/xc/extras/Mesa/bin/mklib.sunos5 new file mode 100755 index 000000000..9b972e9ac --- /dev/null +++ b/xc/extras/Mesa/bin/mklib.sunos5 @@ -0,0 +1,39 @@ +#!/bin/sh + +# Make a shared lib for SunOS 5.x library file + +#--identification------------------------------------------------------ + +# $Id: mklib.sunos5,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# $Log: mklib.sunos5,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.2 1999/09/15 15:10:20 brianp +# added third, tiny version number to arguments +# +# Revision 1.1 1999/08/19 13:53:06 brianp +# initial check-in (post-crash) +# + + +#--common-------------------------------------------------------------- + +LIBRARY=$1 +shift 1 + +MAJOR=$1 +shift 1 + +MINOR=$1 +shift 1 + +TINY=$1 +shift 1 + +OBJECTS=$* + +#--platform------------------------------------------------------------- + +ld -G -o $LIBRARY $OBJECTS diff --git a/xc/extras/Mesa/common.dja b/xc/extras/Mesa/common.dja new file mode 100644 index 000000000..c5eb14cd3 --- /dev/null +++ b/xc/extras/Mesa/common.dja @@ -0,0 +1,23 @@ + CC = gcc
+ LD = gcc
+ AR = ar
+ RM = del
+
+ OFLAGS = -O3 -march=pentium
+ DFLAGS = -D__DOS__ -D__MSDOS32__ -D__AMESA__
+ WFLAGS = -Wall -Wno-uninitialized
+ CFLAGS = $(WFLAGS) $(OFLAGS) $(DFLAGS)
+ LFLAGS = -s
+
+ GL_LIB = $(LIBDIR)/libGL.a
+ GLU_LIB = $(LIBDIR)/libGLU.a
+GLUT_LIB = $(LIBDIR)/libGLUT.a
+ LIBS = $(GLUT_LIB) $(GLU_LIB) $(GL_LIB)
+ LIB_DEP = $(LIBS) -lalleg
+
+
+%.o: %.c
+ $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@
+
+%.exe: %.o $(LIBS)
+ $(LD) -L$(LIBDIR) $(LFLAGS) $< $(LIB_DEP) -o $@
diff --git a/xc/extras/Mesa/conf.h.in b/xc/extras/Mesa/conf.h.in new file mode 100644 index 000000000..0cb39f4bc --- /dev/null +++ b/xc/extras/Mesa/conf.h.in @@ -0,0 +1,50 @@ +/* conf.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +#undef HAVE_XMU +#undef USE_X86_ASM +#undef USE_3DNOW_ASM +#undef USE_KATMAI_ASM +#undef USE_MMX_ASM +#undef MESA_DEBUG +#undef FX +#undef FX_GLIDE3 +#undef GGI +#undef SVGA +#undef USE_XSHM + +/* Define if you have the memcpy function. */ +#undef HAVE_MEMCPY + +/* Define if you have the memmove function. */ +#undef HAVE_MEMMOVE + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the <math.h> header file. */ +#undef HAVE_MATH_H + +/* Define if you have the <pthread.h> header file. */ +#undef HAVE_PTHREAD_H + +/* Name of package */ +#undef PACKAGE + +/* Version number of package */ +#undef VERSION + diff --git a/xc/extras/Mesa/configure b/xc/extras/Mesa/configure new file mode 100755 index 000000000..4746a9e1b --- /dev/null +++ b/xc/extras/Mesa/configure @@ -0,0 +1,5245 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-static[=PKGS] build static libraries [default=no]" +ac_help="$ac_help + --enable-fast-install[=PKGS] optimize for fast installation [default=no]" +ac_help="$ac_help + --enable-shared[=PKGS] build shared libraries [default=yes]" +ac_help="$ac_help + --with-gnu-ld assume the C compiler uses GNU ld [default=no]" +ac_help="$ac_help + --disable-libtool-lock avoid locking (might break parallel builds)" +ac_help="$ac_help + --with-pic try to use only PIC/non-PIC objects [default=use both]" +ac_help="$ac_help + --enable-debug enable full Mesa debugging [default=off]" +ac_help="$ac_help + --enable-profile enable profiling [default=off]" +ac_help="$ac_help + --enable-optimize enable extra optimization [default=on]" +ac_help="$ac_help + --enable-warn enable extended compiler warnings [default=off]" +ac_help="$ac_help + --enable-x86 enable x86 assembler [default=autodetect]" +ac_help="$ac_help + --enable-mmx enable MMX support [default=autodetect]" +ac_help="$ac_help + --enable-3dnow enable 3Dnow support [default=autodetect]" +ac_help="$ac_help + --enable-sse enable SSE support [default=no]" +ac_help="$ac_help + --enable-osmesa enable OSmesa [default=on]" +ac_help="$ac_help + --with-glide=DIR Glide is installed in DIR" +ac_help="$ac_help + --with-ggi=DIR GGI is installed in DIR" +ac_help="$ac_help + --disable-ggi-fbdev Don't build the GGIMesa fbdev target" +ac_help="$ac_help + --disable-ggi-genkgi Don't build the GGIMesa generic KGI driver" +ac_help="$ac_help + --with-svga=DIR SVGALib is installed in DIR" +ac_help="$ac_help + --with-x use the X Window System" +ac_help="$ac_help + --with-glut=DIR GLUT is installed in DIR" +ac_help="$ac_help + --enable-glut-debug enable GLUT debugging [default=off]" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=include/GL/gl.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:603: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:656: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:713: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=Mesa + +VERSION=3.4 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <<EOF +#define PACKAGE "$PACKAGE" +EOF + +cat >> confdefs.h <<EOF +#define VERSION "$VERSION" +EOF + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:759: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:772: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:785: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:798: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:811: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + +MESA_MAJOR=3 +MESA_MINOR=4 +MESA_TINY=0 +LIBGL_VERSION=1:2:0${MESA_MAJOR}0${MESA_MINOR}0${MESA_TINY} +LIBGLU_VERSION=1:1:0${MESA_MAJOR}0${MESA_MINOR}0${MESA_TINY} +LIBGLUT_VERSION=3:7:0 + + + + + + + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:844: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_static=no +fi + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_fast_install=no +fi + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:914: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:944: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:995: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1027: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 1038 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1069: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1074: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1102: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1134: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +#line 1149 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +#line 1166 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF +#line 1183 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:1214: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1219 "configure" +#include "confdefs.h" + +int main() { + +#ifndef __CYGWIN__ +#define __CYGWIN__ __CYGWIN32__ +#endif +return __CYGWIN__; +; return 0; } +EOF +if { (eval echo configure:1230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:1247: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1252 "configure" +#include "confdefs.h" + +int main() { +return __MINGW32__; +; return 0; } +EOF +if { (eval echo configure:1259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_shared=yes +fi + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1299: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 +echo "configure:1328: checking for ld used by GCC" >&5 + case $lt_target in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case "$ac_prog" in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 +echo "configure:1358: checking for GNU ld" >&5 +else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 +echo "configure:1361: checking for non-GNU ld" >&5 +fi +if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$ac_cv_path_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } +echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 +echo "configure:1396: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 +with_gnu_ld=$ac_cv_prog_gnu_ld + + +echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 +echo "configure:1413: checking for $LD option to reload object files" >&5 +if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + lt_cv_ld_reload_flag='-r' +fi + +echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 +reload_flag=$lt_cv_ld_reload_flag +test -n "$reload_flag" && reload_flag=" $reload_flag" + +echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 +echo "configure:1425: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi +fi + +NM="$ac_cv_path_NM" +echo "$ac_t""$NM" 1>&6 + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:1461: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 +echo "configure:1482: checking how to recognise dependant libraries" >&5 +if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + lt_cv_file_magic_cmd='$FILE' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [regex]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case "$host_os" in +aix4* | beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi4*) + lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (shared object|dynamic lib)' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='${OBJDUMP} -f' + ;; + +freebsd*) + case "$version_type" in + freebsd-elf*) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +irix5* | irix6*) + case "$host_os" in + irix5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case "$LD" in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-1234 dynamic lib MIPS - version 1" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case "$host_cpu" in + alpha* | i*86 | sparc* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM + lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit LMSB (shared object|dynamic lib )' ;; + esac + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +osf3* | osf4* | osf5*) + # this will be overridden with pass_all, but let us keep it just in case + lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + case "$host_vendor" in + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + motorola) + lt_cv_deplibs_check_method='file_magic ELF 0-90-9*-bit MLSB (shared object|dynamic lib) M0-90-9* Version 0-9' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + esac + ;; +esac + +fi + +echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method + +echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +echo "configure:1596: checking for object suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftest* +echo 'int i = 1;' > conftest.$ac_ext +if { (eval echo configure:1602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1622: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + + +# Only perform the check for file, if the check method requires it +case "$deplibs_check_method" in +file_magic*) + if test "$file_magic_cmd" = '$FILE'; then + echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 +echo "configure:1664: checking for ${ac_tool_prefix}file" >&5 +if eval "test \"`echo '$''{'lt_cv_path_FILE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$FILE" in + /*) + lt_cv_path_FILE="$FILE" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_FILE="$FILE" # Let the user override the test with a dos path. + ;; + *) + ac_save_file="$FILE" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_FILE="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case "$deplibs_check_method" in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + FILE="$lt_cv_path_FILE" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <<EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + FILE="$ac_save_file" + ;; +esac +fi + +FILE="$lt_cv_path_FILE" +if test -n "$FILE"; then + echo "$ac_t""$FILE" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$lt_cv_path_FILE"; then + if test -n "$ac_tool_prefix"; then + echo $ac_n "checking for file""... $ac_c" 1>&6 +echo "configure:1726: checking for file" >&5 +if eval "test \"`echo '$''{'lt_cv_path_FILE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$FILE" in + /*) + lt_cv_path_FILE="$FILE" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_FILE="$FILE" # Let the user override the test with a dos path. + ;; + *) + ac_save_file="$FILE" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_FILE="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case "$deplibs_check_method" in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + FILE="$lt_cv_path_FILE" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <<EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + FILE="$ac_save_file" + ;; +esac +fi + +FILE="$lt_cv_path_FILE" +if test -n "$FILE"; then + echo "$ac_t""$FILE" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + else + FILE=: + fi +fi + + fi + ;; +esac + +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + +# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1802: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1834: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + +# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1869: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_STRIP"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1901: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="strip" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + STRIP=":" +fi +fi + + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + : +fi + +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi + +test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" +test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 1968 "configure"' > conftest.$ac_ext + if { (eval echo configure:1969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 +echo "configure:1990: checking whether the C compiler needs -belf" >&5 +if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1995 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + lt_cv_cc_needs_belf=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + lt_cv_cc_needs_belf=no +fi +rm -f conftest* +fi + +echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + + +esac + + +# Save cache, so that ltconfig can load it +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +FILE="$FILE" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ +AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ +objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ +deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $lt_target \ +|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; } + +# Reload cache, that may have been modified by ltconfig +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:2117: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:2170: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:2198: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2203 "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 2228 "configure" +#include "confdefs.h" +#include <string.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 2246 "configure" +#include "confdefs.h" +#include <stdlib.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext <<EOF +#line 2267 "configure" +#include "confdefs.h" +#include <ctype.h> +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:2278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +for ac_hdr in math.h malloc.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2305: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2310 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:2343: checking for working const" >&5 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2348 "configure" +#include "confdefs.h" + +int main() { + +/* Ultrix mips cc rejects this. */ +typedef int charset[2]; const charset x; +/* SunOS 4.1.1 cc rejects this. */ +char const *const *ccp; +char **p; +/* NEC SVR4.0.2 mips cc rejects this. */ +struct point {int x, y;}; +static struct point const zero = {0,0}; +/* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in an arm + of an if-expression whose if-part is not a constant expression */ +const char *g = "string"; +ccp = &g + (g ? g-g : 0); +/* HPUX 7.0 cc rejects these. */ +++ccp; +p = (char**) ccp; +ccp = (char const *const *) p; +{ /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; +} +{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; +} +{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; +} +{ /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:2397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + +echo $ac_n "checking for inline""... $ac_c" 1>&6 +echo "configure:2418: checking for inline" >&5 +if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <<EOF +#line 2425 "configure" +#include "confdefs.h" + +int main() { +} $ac_kw foo() { +; return 0; } +EOF +if { (eval echo configure:2432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$ac_cv_c_inline" 1>&6 +case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF +#define inline +EOF + ;; + *) cat >> confdefs.h <<EOF +#define inline $ac_cv_c_inline +EOF + ;; +esac + +for ac_func in strchr memcpy memmove +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2460: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2465 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + +if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -Wall" +fi + +if test "x$host_os" = xTru64; then + CFLAGS=-O0 -std1 -ieee_with_no_inexact -DSHM +fi + +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + enable_debug=$enableval +else + enable_debug=no +fi + +if test "x$enable_debug" = xyes; then + cat >> confdefs.h <<\EOF +#define MESA_DEBUG 1 +EOF + + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -O0" + fi +fi + +# Check whether --enable-profile or --disable-profile was given. +if test "${enable_profile+set}" = set; then + enableval="$enable_profile" + enable_prof=$enableval +else + enable_prof=no +fi + +if test "x$enable_prof" = xyes; then + CFLAGS="$CFLAGS -DPROFILE" + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -pg" + fi +fi + +# Check whether --enable-optimize or --disable-optimize was given. +if test "${enable_optimize+set}" = set; then + enableval="$enable_optimize" + enable_optim=$enableval +else + enable_optim=yes +fi + +if test "x$enable_optim" = xyes; then + if test "x$enable_debug" = xno && test "x$enable_prof" = xno; then + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing" + case "$host" in + i*86-*-*) CFLAGS="$CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2";; + esac + fi + fi +fi + +# Check whether --enable-warn or --disable-warn was given. +if test "${enable_warn+set}" = set; then + enableval="$enable_warn" + enable_warn=$enableval +else + enable_warn=no +fi + +if test "x$enable_warn" = xyes; then + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -ansi -pedantic" + fi +fi + + +THREAD_LIBS= +echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 +echo "configure:2590: checking for pthread_create in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2598 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_create(); + +int main() { +pthread_create() +; return 0; } +EOF +if { (eval echo configure:2609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + for ac_hdr in pthread.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2628: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2633 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + + CFLAGS="$CFLAGS -D_REENTRANT" + THREAD_LIBS="$THREAD_LIBS -lpthread" +else + echo "$ac_t""no" 1>&6 +fi +done + + +else + echo "$ac_t""no" 1>&6 +fi + + + + +save_ac_ext="$ac_ext" +save_CPPFLAGS="$CPPFLAGS" +ac_ext=S +CPPFLAGS="$CPPFLAGS -I$srcdir/src/X86" + +case "$host" in +i*86-*-*) have_x86=on ;; +*) have_x86=off ;; +esac + +# Check whether --enable-x86 or --disable-x86 was given. +if test "${enable_x86+set}" = set; then + enableval="$enable_x86" + have_x86=$enableval +fi + +if test "x$have_x86" = xon; then + echo $ac_n "checking whether the binutils support cpuid""... $ac_c" 1>&6 +echo "configure:2692: checking whether the binutils support cpuid" >&5 + cp "$srcdir/src/X86/common_x86asm.S" conftest.S + if { (eval echo configure:2694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + cat >> confdefs.h <<\EOF +#define USE_X86_ASM 1 +EOF + + echo "$ac_t""yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + have_x86=off + fi + rm conftest* +fi + +have_mmx=$have_x86 +# Check whether --enable-mmx or --disable-mmx was given. +if test "${enable_mmx+set}" = set; then + enableval="$enable_mmx" + have_mmx=$enableval +fi + +if test "x$have_mmx" = xon; then + echo $ac_n "checking whether the binutils support MMX""... $ac_c" 1>&6 +echo "configure:2716: checking whether the binutils support MMX" >&5 + cp "$srcdir/src/X86/mmx_blend.S" conftest.S + if { (eval echo configure:2718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + cat >> confdefs.h <<\EOF +#define USE_MMX_ASM 1 +EOF + + echo "$ac_t""yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + echo 2>&1 "*******************************************************************************" + echo 2>&1 " The installed assembler does not supports the MMX command set." + echo 2>&1 " Update your binutils package, if you want to compile MMX support into Mesa." + echo 2>&1 "*******************************************************************************" + have_mmx=off + fi + rm conftest* +fi + +have_3dnow=$have_x86 +# Check whether --enable-3dnow or --disable-3dnow was given. +if test "${enable_3dnow+set}" = set; then + enableval="$enable_3dnow" + have_3dnow=$enableval +fi + +if test "x$have_3dnow" = xon; then + echo $ac_n "checking whether the binutils support 3Dnow""... $ac_c" 1>&6 +echo "configure:2744: checking whether the binutils support 3Dnow" >&5 + cp "$srcdir/src/X86/3dnow_norm_raw.S" conftest.S + if { (eval echo configure:2746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + cat >> confdefs.h <<\EOF +#define USE_3DNOW_ASM 1 +EOF + + echo "$ac_t""yes" 1>&6 + else + echo "$ac_t""no" 1>&6 + echo 2>&1 "*******************************************************************************" + echo 2>&1 " The installed assembler does not supports the 3Dnow! command set." + echo 2>&1 " Update your binutils package, if you want to compile 3Dnow! support into Mesa." + echo 2>&1 "*******************************************************************************" + have_3dnow=off + fi + rm conftest* +fi + +have_sse=no +# Check whether --enable-sse or --disable-sse was given. +if test "${enable_sse+set}" = set; then + enableval="$enable_sse" + have_sse=$enableval +fi + +if test "x$have_sse" = xon; then + echo $ac_n "checking whether the binutils support PentiumIII SSE""... $ac_c" 1>&6 +echo "configure:2772: checking whether the binutils support PentiumIII SSE" >&5 + cp "$srcdir/src/X86/katmai_xform_raw3.S" conftest.S + if { (eval echo configure:2774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + cat >> confdefs.h <<\EOF +#define USE_KATMAI_ASM 1 +EOF + + echo "$ac_t""yes" 1>&6 + echo 2>&1 "*******************************************************************************" + echo 2>&1 " You have decided to compile SSE support into Mesa." + echo 2>&1 " If you have a PentiumIII and want to use SSE make sure you have the" + echo 2>&1 " PIII Linux kernel-patch installed or things will fail !" + echo 2>&1 " You can get the patch from http://www.redhat.com/~dledford/linux_kernel.html" + echo 2>&1 "*******************************************************************************" + else + echo "$ac_t""no" 1>&6 + echo 2>&1 "*******************************************************************************" + echo 2>&1 " The installed assembler does not supports the SSE command set." + echo 2>&1 " Update your binutils package, if you want to compile SSE support into Mesa." + echo 2>&1 "*******************************************************************************" + have_sse=off + fi + rm conftest* +fi + +ac_ext="$save_ac_ext" +CPPFLAGS="$save_CPPFLAGS" + +have_osmesa=on +# Check whether --enable-osmesa or --disable-osmesa was given. +if test "${enable_osmesa+set}" = set; then + enableval="$enable_osmesa" + have_osmesa=$enableval +fi + + +have_fx=auto +FX_CFLAGS="" +FX_LIBS="" +# Check whether --with-glide or --without-glide was given. +if test "${with_glide+set}" = set; then + withval="$with_glide" + have_fx="$withval" +fi + +if test "x$have_fx" != xno; then + if test "x$have_fx" != xauto && test "x$have_fx" != xyes; then + FX_CFLAGS="-I$have_fx/include" + FX_LIBS="-L$have_fx/lib" + fi + withval=$have_fx # We still need it later. + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $FX_CFLAGS" + glide2hdir=nil + glide3hdir=nil + ac_safe=`echo "glide.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for glide.h""... $ac_c" 1>&6 +echo "configure:2829: checking for glide.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2834 "configure" +#include "confdefs.h" +#include <glide.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat > conftest.$ac_ext <<EOF +#line 2856 "configure" +#include "confdefs.h" +#include <glide.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "grSstControl" >/dev/null 2>&1; then + rm -rf conftest* + glide2hdir="" +else + rm -rf conftest* + glide3hdir="" +fi +rm -f conftest* + +else + echo "$ac_t""no" 1>&6 +fi + + CPPFLAGS="$save_CPPFLAGS -I/usr/include/glide -I/usr/local/include/glide" + ac_safe=`echo "glide/glide.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for glide/glide.h""... $ac_c" 1>&6 +echo "configure:2877: checking for glide/glide.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2882 "configure" +#include "confdefs.h" +#include <glide/glide.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat > conftest.$ac_ext <<EOF +#line 2904 "configure" +#include "confdefs.h" +#include <glide/glide.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "grSstControl" >/dev/null 2>&1; then + rm -rf conftest* + glide2hdir=glide +else + rm -rf conftest* + glide3hdir=glide +fi +rm -f conftest* + +else + echo "$ac_t""no" 1>&6 +fi + + CPPFLAGS="$save_CPPFLAGS -I/usr/include/glide2 -I/usr/local/include/glide2" + ac_safe=`echo "glide2/glide.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for glide2/glide.h""... $ac_c" 1>&6 +echo "configure:2925: checking for glide2/glide.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2930 "configure" +#include "confdefs.h" +#include <glide2/glide.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + glide2hdir="glide2" +else + echo "$ac_t""no" 1>&6 +fi + + CPPFLAGS="$save_CPPFLAGS -I/usr/include/glide3 -I/usr/local/include/glide3" + ac_safe=`echo "glide3/glide.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for glide3/glide.h""... $ac_c" 1>&6 +echo "configure:2959: checking for glide3/glide.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2964 "configure" +#include "confdefs.h" +#include <glide3/glide.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + glide3hdir="glide3" +else + echo "$ac_t""no" 1>&6 +fi + + if test x$glide3hdir != xnil; then + glidehdir=$glide3hdir + have_fx=yes + elif test x$glide2hdir != xnil; then + glidehdir=$glide2hdir + have_fx=yes + else + have_fx=no + fi + if test "x$have_fx" = xyes; then + if test "x$withval" != xauto; then + FX_CFLAGS="-I$withval/include/$glidehdir" + elif test "x$glidehdir" != x; then + FX_CFLAGS="-I/usr/include/$glidehdir -I/usr/local/include/$glidehdir" + fi + fi + CPPFLAGS="$save_CPPFLAGS" + + if test "x$have_fx" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $FX_LIBS" + echo $ac_n "checking for grSstControl in -lglide""... $ac_c" 1>&6 +echo "configure:3012: checking for grSstControl in -lglide" >&5 +ac_lib_var=`echo glide'_'grSstControl | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lglide -lm $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3020 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char grSstControl(); + +int main() { +grSstControl() +; return 0; } +EOF +if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + glide2lib=glide +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for main in -lglide""... $ac_c" 1>&6 +echo "configure:3050: checking for main in -lglide" >&5 +ac_lib_var=`echo glide'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lglide -lm $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3058 "configure" +#include "confdefs.h" + +int main() { +main() +; return 0; } +EOF +if { (eval echo configure:3065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + glide3lib=glide +else + echo "$ac_t""no" 1>&6 +fi + +fi + + echo $ac_n "checking for main in -lglide2""... $ac_c" 1>&6 +echo "configure:3088: checking for main in -lglide2" >&5 +ac_lib_var=`echo glide2'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lglide2 -lm $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3096 "configure" +#include "confdefs.h" + +int main() { +main() +; return 0; } +EOF +if { (eval echo configure:3103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + glide2lib=glide2 +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for main in -lglide2x""... $ac_c" 1>&6 +echo "configure:3124: checking for main in -lglide2x" >&5 +ac_lib_var=`echo glide2x'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lglide2x -lm $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3132 "configure" +#include "confdefs.h" + +int main() { +main() +; return 0; } +EOF +if { (eval echo configure:3139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + glide2lib=glide2x +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for main in -lglide3""... $ac_c" 1>&6 +echo "configure:3160: checking for main in -lglide3" >&5 +ac_lib_var=`echo glide3'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lglide3 -lm $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3168 "configure" +#include "confdefs.h" + +int main() { +main() +; return 0; } +EOF +if { (eval echo configure:3175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + glide3lib=glide3 +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for main in -lglide3x""... $ac_c" 1>&6 +echo "configure:3196: checking for main in -lglide3x" >&5 +ac_lib_var=`echo glide3x'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lglide3x -lm $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3204 "configure" +#include "confdefs.h" + +int main() { +main() +; return 0; } +EOF +if { (eval echo configure:3211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + glide3lib=glide3x +else + echo "$ac_t""no" 1>&6 +fi + + if test x$glide3lib != x; then + glidelib=$glide3lib + cat >> confdefs.h <<\EOF +#define FX_GLIDE3 1 +EOF + + elif test x$glide2lib != x; then + glidelib=$glide2lib + fi + if test "x$glidelib" = x; then + have_fx=no + else + have_fx=yes + cat >> confdefs.h <<\EOF +#define FX 1 +EOF + + FX_LIBS="$FX_LIBS -l$glidelib" + fi + LIBS="$save_LIBS" + fi + if test "x$have_fx" != xyes; then + FX_CFLAGS="" FX_LIBS="" + fi +fi + + + +have_ggi=auto +GGI_CFLAGS="" +GGI_LIBS="" +# Check whether --with-ggi or --without-ggi was given. +if test "${with_ggi+set}" = set; then + withval="$with_ggi" + have_ggi="$withval" +fi + +if test "x$have_ggi" != xno; then + if test "x$have_ggi" != xauto; then + GGI_CFLAGS="-I$have_ggi/include" + GGI_LIBS="-L$have_ggi/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GGI_CFLAGS" + ac_safe=`echo "ggi/ggi.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for ggi/ggi.h""... $ac_c" 1>&6 +echo "configure:3277: checking for ggi/ggi.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3282 "configure" +#include "confdefs.h" +#include <ggi/ggi.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_ggi=yes +else + echo "$ac_t""no" 1>&6 +have_ggi=no +fi + + CPPFLAGS="$save_CPPFLAGS" + if test "x$have_ggi" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $GGI_LIBS" + echo $ac_n "checking for main in -lggi""... $ac_c" 1>&6 +echo "configure:3314: checking for main in -lggi" >&5 +ac_lib_var=`echo ggi'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lggi -lgii -lgg $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3322 "configure" +#include "confdefs.h" + +int main() { +main() +; return 0; } +EOF +if { (eval echo configure:3329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + GGI_LIBS="$GGI_LIBS -lggi" + cat >> confdefs.h <<\EOF +#define GGI 1 +EOF + have_ggi=yes +else + echo "$ac_t""no" 1>&6 +have_ggi=no +fi + + LIBS="$save_LIBS" + fi + if test "x$have_ggi" != xyes; then + GGI_CFLAGS="" GGI_LIBS="" + else + build_ggi_fbdev_target=auto + build_ggi_genkgi_driver=auto + # Check whether --enable-ggi_fbdev or --disable-ggi_fbdev was given. +if test "${enable_ggi_fbdev+set}" = set; then + enableval="$enable_ggi_fbdev" + build_ggi_fbdev_target=$enableval +fi + + # Check whether --enable-ggi_genkgi or --disable-ggi_genkgi was given. +if test "${enable_ggi_genkgi+set}" = set; then + enableval="$enable_ggi_genkgi" + build_ggi_genkgi_driver=$enableval +fi + + + if test "x$build_ggi_fbdev_target" != "xno"; then + ac_safe=`echo "linux/fb.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for linux/fb.h""... $ac_c" 1>&6 +echo "configure:3377: checking for linux/fb.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3382 "configure" +#include "confdefs.h" +#include <linux/fb.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3387: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +build_ggi_fbdev_target=no +fi + + fi + + if test "x$build_ggi_genkgi_driver" != "xno"; then + ac_safe=`echo "kgi/kgi.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for kgi/kgi.h""... $ac_c" 1>&6 +echo "configure:3414: checking for kgi/kgi.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3419 "configure" +#include "confdefs.h" +#include <kgi/kgi.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3424: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +build_ggi_genkgi_driver=no +fi + + fi + + build_ggi_genkgi_driver=no + + echo $ac_n "checking if we should build GGIMesa's fbdev target""... $ac_c" 1>&6 +echo "configure:3451: checking if we should build GGIMesa's fbdev target" >&5 + if test "x$build_ggi_fbdev_target" = "xno"; then + echo "$ac_t""no" 1>&6 + else + GGI_DISPLAY_SUBDIRS="$GGI_DISPLAY_SUBDIRS fbdev" + build_ggi_fbdev_target=yes + echo "$ac_t""yes" 1>&6 + fi + + echo $ac_n "checking if we should build GGIMesa's generic KGI driver""... $ac_c" 1>&6 +echo "configure:3461: checking if we should build GGIMesa's generic KGI driver" >&5 + if test "x$build_ggi_genkgi_driver" = "xno"; then + echo "$ac_t""no" 1>&6 + else + GGI_DEFAULT_SUBDIRS="$GGI_DEFAULT_SUBDIRS kgi" + build_ggi_genkgi_driver=yes + echo "$ac_t""yes" 1>&6 + fi + + + +if test $build_ggi_fbdev_target = yes; then + HAVE_GGI_FBDEV_TRUE= + HAVE_GGI_FBDEV_FALSE='#' +else + HAVE_GGI_FBDEV_TRUE='#' + HAVE_GGI_FBDEV_FALSE= +fi + + +if test $build_ggi_genkgi_driver = yes; then + HAVE_GGI_GENKGI_TRUE= + HAVE_GGI_GENKGI_FALSE='#' +else + HAVE_GGI_GENKGI_TRUE='#' + HAVE_GGI_GENKGI_FALSE= +fi + fi +fi +ggi_confdir=/usr/local/etc +ggi_libdir=/usr/local/lib + + + + + +have_svga=auto +SVGA_CFLAGS="" +SVGA_LIBS="" +# Check whether --with-svga or --without-svga was given. +if test "${with_svga+set}" = set; then + withval="$with_svga" + have_svga="$withval" +fi + +if test "x$have_svga" != xno; then + if test "x$have_svga" != xauto; then + SVGA_CFLAGS="-I$have_svga/include" + SVGA_LIBS="-L$have_svga/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SVGA_CFLAGS" + ac_safe=`echo "vga.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for vga.h""... $ac_c" 1>&6 +echo "configure:3515: checking for vga.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3520 "configure" +#include "confdefs.h" +#include <vga.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_svga=yes +else + echo "$ac_t""no" 1>&6 +have_svga=no +fi + + CPPFLAGS="$save_CPPFLAGS" + if test "x$have_svga" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $SVGA_LIBS" + echo $ac_n "checking for main in -lvga""... $ac_c" 1>&6 +echo "configure:3552: checking for main in -lvga" >&5 +ac_lib_var=`echo vga'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lvga $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3560 "configure" +#include "confdefs.h" + +int main() { +main() +; return 0; } +EOF +if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SVGA_LIBS="$SVGA_LIBS -lvga" + cat >> confdefs.h <<\EOF +#define SVGA 1 +EOF + have_svga=yes +else + echo "$ac_t""no" 1>&6 +have_svga=no +fi + + LIBS="$save_LIBS" + fi + if test "x$have_svga" != xyes; then + SVGA_CFLAGS="" SVGA_LIBS="" + fi +fi + + + +# If we find X, set shell vars x_includes and x_libraries to the +# paths, otherwise set no_x=yes. +# Uses ac_ vars as temps to allow command line to override cache and checks. +# --without-x overrides everything else, but does not touch the cache. +echo $ac_n "checking for X""... $ac_c" 1>&6 +echo "configure:3606: checking for X" >&5 + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + : +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else +if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=NO ac_x_libraries=NO +rm -fr conftestdir +if mkdir conftestdir; then + cd conftestdir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat > Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +EOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case "$ac_im_incroot" in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; + esac + case "$ac_im_usrlibdir" in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; + esac + fi + cd .. + rm -fr conftestdir +fi + +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + + # First, try using that file with no special directory specified. +cat > conftest.$ac_ext <<EOF +#line 3668 "configure" +#include "confdefs.h" +#include <$x_direct_test_include> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + # Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11 \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11/include \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11 \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done +fi +rm -f conftest* +fi # $ac_x_includes = NO + +if test "$ac_x_libraries" = NO; then + # Check for the libraries. + + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3742 "configure" +#include "confdefs.h" + +int main() { +${x_direct_test_function}() +; return 0; } +EOF +if { (eval echo configure:3749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + LIBS="$ac_save_LIBS" +# First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ + /usr/X11R6/lib \ + /usr/X11R5/lib \ + /usr/X11R4/lib \ + \ + /usr/lib/X11 \ + /usr/lib/X11R6 \ + /usr/lib/X11R5 \ + /usr/lib/X11R4 \ + \ + /usr/local/X11/lib \ + /usr/local/X11R6/lib \ + /usr/local/X11R5/lib \ + /usr/local/X11R4/lib \ + \ + /usr/local/lib/X11 \ + /usr/local/lib/X11R6 \ + /usr/local/lib/X11R5 \ + /usr/local/lib/X11R4 \ + \ + /usr/X386/lib \ + /usr/x386/lib \ + /usr/XFree86/lib/X11 \ + \ + /usr/lib \ + /usr/local/lib \ + /usr/unsupported/lib \ + /usr/athena/lib \ + /usr/local/x11r5/lib \ + /usr/lpp/Xamples/lib \ + /lib/usr/lib/X11 \ + \ + /usr/openwin/lib \ + /usr/openwin/share/lib \ + ; \ +do + for ac_extension in a so sl; do + if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest* +fi # $ac_x_libraries = NO + +if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$ac_t""$have_x" 1>&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + cat >> confdefs.h <<\EOF +#define X_DISPLAY_MISSING 1 +EOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case "`(uname -sr) 2>/dev/null`" in + "SunOS 5"*) + echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 +echo "configure:3855: checking whether -R must be followed by a space" >&5 + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" + cat > conftest.$ac_ext <<EOF +#line 3858 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:3865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_nospace=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_R_nospace=no +fi +rm -f conftest* + if test $ac_R_nospace = yes; then + echo "$ac_t""no" 1>&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat > conftest.$ac_ext <<EOF +#line 3881 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:3888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_space=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_R_space=no +fi +rm -f conftest* + if test $ac_R_space = yes; then + echo "$ac_t""yes" 1>&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$ac_t""neither works" 1>&6 + fi + fi + LIBS="$ac_xsave_LIBS" + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). + echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 +echo "configure:3920: checking for dnet_ntoa in -ldnet" >&5 +ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldnet $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3928 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa(); + +int main() { +dnet_ntoa() +; return 0; } +EOF +if { (eval echo configure:3939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 +echo "configure:3961: checking for dnet_ntoa in -ldnet_stub" >&5 +ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldnet_stub $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3969 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa(); + +int main() { +dnet_ntoa() +; return 0; } +EOF +if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to dickey@clark.net. + echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 +echo "configure:4009: checking for gethostbyname" >&5 +if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4014 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +gethostbyname(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_gethostbyname=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_gethostbyname=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_gethostbyname = no; then + echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +echo "configure:4058: checking for gethostbyname in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <<EOF +#line 4066 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname(); + +int main() { +gethostbyname() +; return 0; } +EOF +if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says simon@lia.di.epfl.ch: it contains + # gethostby* variants that don't use the nameserver (or something). + # -lsocket must be given before -lnsl if both are needed. + # We assume that if connect needs -lnsl, so does gethostbyname. + echo $ac_n "checking for connect""... $ac_c" 1>&6 +echo "configure:4107: checking for connect" >&5 +if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4112 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +connect(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_connect=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_connect=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_connect = no; then + echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 +echo "configure:4156: checking for connect in -lsocket" >&5 +ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat > conftest.$ac_ext <<EOF +#line 4164 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect(); + +int main() { +connect() +; return 0; } +EOF +if { (eval echo configure:4175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. + echo $ac_n "checking for remove""... $ac_c" 1>&6 +echo "configure:4199: checking for remove" >&5 +if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4204 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_remove) || defined (__stub___remove) +choke me +#else +remove(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_remove=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_remove=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_remove = no; then + echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 +echo "configure:4248: checking for remove in -lposix" >&5 +ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lposix $LIBS" +cat > conftest.$ac_ext <<EOF +#line 4256 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove(); + +int main() { +remove() +; return 0; } +EOF +if { (eval echo configure:4267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo $ac_n "checking for shmat""... $ac_c" 1>&6 +echo "configure:4291: checking for shmat" >&5 +if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4296 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shmat) || defined (__stub___shmat) +choke me +#else +shmat(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_shmat=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_shmat=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_shmat = no; then + echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 +echo "configure:4340: checking for shmat in -lipc" >&5 +ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lipc $LIBS" +cat > conftest.$ac_ext <<EOF +#line 4348 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat(); + +int main() { +shmat() +; return 0; } +EOF +if { (eval echo configure:4359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +else + echo "$ac_t""no" 1>&6 +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS="$LDFLAGS" + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. + echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 +echo "configure:4392: checking for IceConnectionNumber in -lICE" >&5 +ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat > conftest.$ac_ext <<EOF +#line 4400 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char IceConnectionNumber(); + +int main() { +IceConnectionNumber() +; return 0; } +EOF +if { (eval echo configure:4411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +else + echo "$ac_t""no" 1>&6 +fi + + LDFLAGS="$ac_save_LDFLAGS" + +fi + +X_LIBADD="" +if test "x$have_x" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $X_LIBS $X_PRE_LIBS" + echo $ac_n "checking for XmuRegisterExternalAgent in -lXmu""... $ac_c" 1>&6 +echo "configure:4440: checking for XmuRegisterExternalAgent in -lXmu" >&5 +ac_lib_var=`echo Xmu'_'XmuRegisterExternalAgent | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lXmu $LIBS" +cat > conftest.$ac_ext <<EOF +#line 4448 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XmuRegisterExternalAgent(); + +int main() { +XmuRegisterExternalAgent() +; return 0; } +EOF +if { (eval echo configure:4459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_LIBADD="$X_LIBADD -lXmu" +else + echo "$ac_t""no" 1>&6 +fi + + LIBS="$save_LIBS" +fi +X_LIBADD="$X_LIBADD -lXext -lXi -lX11" + + +ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6 +echo "configure:4486: checking for sys/shm.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4491 "configure" +#include "confdefs.h" +#include <sys/shm.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define USE_XSHM 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + + +have_glut=auto +GLUT_CFLAGS="" +GLUT_LIBS="" +# Check whether --with-glut or --without-glut was given. +if test "${with_glut+set}" = set; then + withval="$with_glut" + have_glut="$withval" +fi + +if test "x$have_glut" != xno; then + if test "x$have_glut" != xauto; then + GLUT_CFLAGS="-I$have_glut/include" + GLUT_LIBS="-L$have_glut/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GLUT_CFLAGS" + ac_safe=`echo "GL/glut.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for GL/glut.h""... $ac_c" 1>&6 +echo "configure:4539: checking for GL/glut.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4544 "configure" +#include "confdefs.h" +#include <GL/glut.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + have_glut=yes +else + echo "$ac_t""no" 1>&6 +have_glut=no +fi + + CPPFLAGS="$save_CPPFLAGS" + if test "x$have_glut" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $GLUT_LIBS" + echo $ac_n "checking for main in -lglut""... $ac_c" 1>&6 +echo "configure:4576: checking for main in -lglut" >&5 +ac_lib_var=`echo glut'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lglut $LIBS" +cat > conftest.$ac_ext <<EOF +#line 4584 "configure" +#include "confdefs.h" + +int main() { +main() +; return 0; } +EOF +if { (eval echo configure:4591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + GLUT_LIBS="$GLUT_LIBS -lglut" + have_glut=yes +else + echo "$ac_t""no" 1>&6 +have_glut=no +fi + + LIBS="$save_LIBS" + fi +fi +need_glut=no +if test "x$have_glut" != xyes; then + GLUT_CFLAGS="" GLUT_LIBS="" + echo $ac_n "checking for GLUT sources""... $ac_c" 1>&6 +echo "configure:4620: checking for GLUT sources" >&5 + if test -d src-glut; then + echo "$ac_t""yes" 1>&6 + need_glut=yes + GLUT_LIBS="\$(top_builddir)/src-glut/libglut.la" + + # Check whether --enable-glut-debug or --disable-glut-debug was given. +if test "${enable_glut_debug+set}" = set; then + enableval="$enable_glut_debug" + enable_glut_debug=$enableval +else + enable_glut_debug=no +fi + + if test "x$enable_glut_debug" != xyes; then + GLUT_CFLAGS="$GLUT_CFLAGS -DNDEBUG" + fi + + else + echo "$ac_t""no" 1>&6 + echo "configure: warning: Sorry, GLUT not found. Demos might not work." 1>&2 + echo "configure: warning: Please ignore the warnings about missing Makefiles" 1>&2 + GLUT_LIBS="-lglut" + fi +else + echo "configure: warning: GLUT is already installed." 1>&2 + echo "configure: warning: Use --without-glut to build and install Mesa's own version of GLUT." 1>&2 +fi + + + +have_demos=no +echo $ac_n "checking for Mesa demos sources""... $ac_c" 1>&6 +echo "configure:4653: checking for Mesa demos sources" >&5 +if test -d book && test -d demos && test -d images && \ + test -d samples && test -d xdemos; then + echo "$ac_t""yes" 1>&6 + have_demos=yes +else + echo "$ac_t""no" 1>&6 + echo "configure: warning: Please ignore the warnings about missing Makefiles" 1>&2 +fi + + + +if test $have_3dnow = on; then + HAVE_3DNOW_TRUE= + HAVE_3DNOW_FALSE='#' +else + HAVE_3DNOW_TRUE='#' + HAVE_3DNOW_FALSE= +fi + + +if test $have_sse = on; then + HAVE_SSE_TRUE= + HAVE_SSE_FALSE='#' +else + HAVE_SSE_TRUE='#' + HAVE_SSE_FALSE= +fi + + +if test $have_mmx = on; then + HAVE_MMX_TRUE= + HAVE_MMX_FALSE='#' +else + HAVE_MMX_TRUE='#' + HAVE_MMX_FALSE= +fi + + +if test $have_x86 = on; then + HAVE_X86_TRUE= + HAVE_X86_FALSE='#' +else + HAVE_X86_TRUE='#' + HAVE_X86_FALSE= +fi + + +if test $have_fx = yes; then + HAVE_FX_TRUE= + HAVE_FX_FALSE='#' +else + HAVE_FX_TRUE='#' + HAVE_FX_FALSE= +fi + + +if test $have_ggi = yes; then + HAVE_GGI_TRUE= + HAVE_GGI_FALSE='#' +else + HAVE_GGI_TRUE='#' + HAVE_GGI_FALSE= +fi + + +if test $have_osmesa = on; then + HAVE_OSMESA_TRUE= + HAVE_OSMESA_FALSE='#' +else + HAVE_OSMESA_TRUE='#' + HAVE_OSMESA_FALSE= +fi + + +if test $have_svga = yes; then + HAVE_SVGA_TRUE= + HAVE_SVGA_FALSE='#' +else + HAVE_SVGA_TRUE='#' + HAVE_SVGA_FALSE= +fi + + +if test $have_x = yes; then + HAVE_X11_TRUE= + HAVE_X11_FALSE='#' +else + HAVE_X11_TRUE='#' + HAVE_X11_FALSE= +fi + + +if test $need_glut = yes; then + NEED_GLUT_TRUE= + NEED_GLUT_FALSE='#' +else + NEED_GLUT_TRUE='#' + NEED_GLUT_FALSE= +fi + + +if test $have_demos = yes; then + HAVE_DEMOS_TRUE= + HAVE_DEMOS_FALSE='#' +else + HAVE_DEMOS_TRUE='#' + HAVE_DEMOS_FALSE= +fi + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile +include/Makefile +include/GL/Makefile +src/Makefile +src/FX/Makefile +src/FX/X86/Makefile +src/GGI/Makefile +src/GGI/include/Makefile +src/GGI/include/ggi/Makefile +src/GGI/include/ggi/mesa/Makefile +src/GGI/ggimesa.conf +src/GGI/default/Makefile +src/GGI/default/genkgi.conf +src/GGI/display/Makefile +src/GGI/display/fbdev.conf +src/OSmesa/Makefile +src/SVGA/Makefile +src/X/Makefile +src/X86/Makefile +src-glu/Makefile +src-glut/Makefile +book/Makefile +demos/Makefile +samples/Makefile +xdemos/Makefile +util/Makefile +ggi/demos/Makefile +ggi/ggiglut/Makefile + conf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@LIBGL_VERSION@%$LIBGL_VERSION%g +s%@LIBGLU_VERSION@%$LIBGLU_VERSION%g +s%@LIBGLUT_VERSION@%$LIBGLUT_VERSION%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@CC@%$CC%g +s%@CPP@%$CPP%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@LN_S@%$LN_S%g +s%@OBJEXT@%$OBJEXT%g +s%@EXEEXT@%$EXEEXT%g +s%@RANLIB@%$RANLIB%g +s%@STRIP@%$STRIP%g +s%@LIBTOOL@%$LIBTOOL%g +s%@THREAD_LIBS@%$THREAD_LIBS%g +s%@FX_CFLAGS@%$FX_CFLAGS%g +s%@FX_LIBS@%$FX_LIBS%g +s%@HAVE_GGI_FBDEV_TRUE@%$HAVE_GGI_FBDEV_TRUE%g +s%@HAVE_GGI_FBDEV_FALSE@%$HAVE_GGI_FBDEV_FALSE%g +s%@HAVE_GGI_GENKGI_TRUE@%$HAVE_GGI_GENKGI_TRUE%g +s%@HAVE_GGI_GENKGI_FALSE@%$HAVE_GGI_GENKGI_FALSE%g +s%@ggi_confdir@%$ggi_confdir%g +s%@ggi_libdir@%$ggi_libdir%g +s%@GGI_CFLAGS@%$GGI_CFLAGS%g +s%@GGI_LIBS@%$GGI_LIBS%g +s%@SVGA_CFLAGS@%$SVGA_CFLAGS%g +s%@SVGA_LIBS@%$SVGA_LIBS%g +s%@X_CFLAGS@%$X_CFLAGS%g +s%@X_PRE_LIBS@%$X_PRE_LIBS%g +s%@X_LIBS@%$X_LIBS%g +s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g +s%@X_LIBADD@%$X_LIBADD%g +s%@GLUT_CFLAGS@%$GLUT_CFLAGS%g +s%@GLUT_LIBS@%$GLUT_LIBS%g +s%@HAVE_3DNOW_TRUE@%$HAVE_3DNOW_TRUE%g +s%@HAVE_3DNOW_FALSE@%$HAVE_3DNOW_FALSE%g +s%@HAVE_SSE_TRUE@%$HAVE_SSE_TRUE%g +s%@HAVE_SSE_FALSE@%$HAVE_SSE_FALSE%g +s%@HAVE_MMX_TRUE@%$HAVE_MMX_TRUE%g +s%@HAVE_MMX_FALSE@%$HAVE_MMX_FALSE%g +s%@HAVE_X86_TRUE@%$HAVE_X86_TRUE%g +s%@HAVE_X86_FALSE@%$HAVE_X86_FALSE%g +s%@HAVE_FX_TRUE@%$HAVE_FX_TRUE%g +s%@HAVE_FX_FALSE@%$HAVE_FX_FALSE%g +s%@HAVE_GGI_TRUE@%$HAVE_GGI_TRUE%g +s%@HAVE_GGI_FALSE@%$HAVE_GGI_FALSE%g +s%@HAVE_OSMESA_TRUE@%$HAVE_OSMESA_TRUE%g +s%@HAVE_OSMESA_FALSE@%$HAVE_OSMESA_FALSE%g +s%@HAVE_SVGA_TRUE@%$HAVE_SVGA_TRUE%g +s%@HAVE_SVGA_FALSE@%$HAVE_SVGA_FALSE%g +s%@HAVE_X11_TRUE@%$HAVE_X11_TRUE%g +s%@HAVE_X11_FALSE@%$HAVE_X11_FALSE%g +s%@NEED_GLUT_TRUE@%$NEED_GLUT_TRUE%g +s%@NEED_GLUT_FALSE@%$NEED_GLUT_FALSE%g +s%@HAVE_DEMOS_TRUE@%$HAVE_DEMOS_TRUE%g +s%@HAVE_DEMOS_FALSE@%$HAVE_DEMOS_FALSE%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile +include/Makefile +include/GL/Makefile +src/Makefile +src/FX/Makefile +src/FX/X86/Makefile +src/GGI/Makefile +src/GGI/include/Makefile +src/GGI/include/ggi/Makefile +src/GGI/include/ggi/mesa/Makefile +src/GGI/ggimesa.conf +src/GGI/default/Makefile +src/GGI/default/genkgi.conf +src/GGI/display/Makefile +src/GGI/display/fbdev.conf +src/OSmesa/Makefile +src/SVGA/Makefile +src/X/Makefile +src/X86/Makefile +src-glu/Makefile +src-glut/Makefile +book/Makefile +demos/Makefile +samples/Makefile +xdemos/Makefile +util/Makefile +ggi/demos/Makefile +ggi/ggiglut/Makefile +"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <<EOF + CONFIG_HEADERS="conf.h" +EOF +cat >> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <<EOF + + +EOF +cat >> $CONFIG_STATUS <<\EOF +test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/xc/extras/Mesa/configure.in b/xc/extras/Mesa/configure.in new file mode 100644 index 000000000..110e4de38 --- /dev/null +++ b/xc/extras/Mesa/configure.in @@ -0,0 +1,529 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.13) +AC_INIT(include/GL/gl.h) + +dnl ------------------------------------------ +AM_INIT_AUTOMAKE(Mesa, 3.4) +MESA_MAJOR=3 +MESA_MINOR=4 +MESA_TINY=0 +LIBGL_VERSION=1:2:0${MESA_MAJOR}0${MESA_MINOR}0${MESA_TINY} +LIBGLU_VERSION=1:1:0${MESA_MAJOR}0${MESA_MINOR}0${MESA_TINY} +LIBGLUT_VERSION=3:7:0 +AC_SUBST(LIBGL_VERSION) +AC_SUBST(LIBGLU_VERSION) +AC_SUBST(LIBGLUT_VERSION) + +AM_CONFIG_HEADER(conf.h) +AC_CANONICAL_HOST +AC_DISABLE_STATIC +AC_DISABLE_FAST_INSTALL +dnl AM_MAINTAINER_MODE + +dnl ------------------------------------------ +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AM_PROG_LIBTOOL +AC_PROG_INSTALL +AC_PROG_MAKE_SET + +dnl ------------------------------------------ +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(math.h malloc.h) + +dnl ------------------------------------------ +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE +AC_CHECK_FUNCS(strchr memcpy memmove) + +if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -Wall" +fi + +dnl ------------------------------------------ +dnl Checks for host system characteristics +if test "x$host_os" = xTru64; then + CFLAGS=-O0 -std1 -ieee_with_no_inexact -DSHM +fi + +AC_ARG_ENABLE(debug, +[ --enable-debug enable full Mesa debugging [default=off]], + enable_debug=$enableval, enable_debug=no) +if test "x$enable_debug" = xyes; then + AC_DEFINE(MESA_DEBUG) + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -O0" + fi +fi + +AC_ARG_ENABLE(profile, +[ --enable-profile enable profiling [default=off]], + enable_prof=$enableval, enable_prof=no) +if test "x$enable_prof" = xyes; then + CFLAGS="$CFLAGS -DPROFILE" + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -pg" + fi +fi + +AC_ARG_ENABLE(optimize, +[ --enable-optimize enable extra optimization [default=on]], + enable_optim=$enableval, enable_optim=yes) +if test "x$enable_optim" = xyes; then + dnl Optimization flags + if test "x$enable_debug" = xno && test "x$enable_prof" = xno; then + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing" + case "$host" in + i*86-*-*) CFLAGS="$CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2";; + esac + fi + fi +fi + +AC_ARG_ENABLE(warn, +[ --enable-warn enable extended compiler warnings [default=off]], + enable_warn=$enableval, enable_warn=no) +if test "x$enable_warn" = xyes; then + if test "x$GCC" = xyes; then + CFLAGS="$CFLAGS -ansi -pedantic" + fi +fi + +dnl Checks for library functions. + +THREAD_LIBS= +AC_CHECK_LIB(pthread, pthread_create, + AC_CHECK_HEADERS(pthread.h, [ + CFLAGS="$CFLAGS -D_REENTRANT" + THREAD_LIBS="$THREAD_LIBS -lpthread"]) +) +AC_SUBST(THREAD_LIBS) + +dnl Check for drivers +dnl ------------------------------------------ + +dnl Necessary for assembler sources +save_ac_ext="$ac_ext" +save_CPPFLAGS="$CPPFLAGS" +ac_ext=S +CPPFLAGS="$CPPFLAGS -I$srcdir/src/X86" + +dnl x86 assembler +case "$host" in +i*86-*-*) have_x86=on ;; +*) have_x86=off ;; +esac + +AC_ARG_ENABLE(x86, +[ --enable-x86 enable x86 assembler [default=autodetect]], + have_x86=$enableval) +if test "x$have_x86" = xon; then + AC_MSG_CHECKING(whether the binutils support cpuid) + cp "$srcdir/src/X86/common_x86asm.S" conftest.S + if AC_TRY_EVAL(ac_compile); then + AC_DEFINE(USE_X86_ASM) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + have_x86=off + fi + rm conftest* +fi + +dnl ------------------------------------------ +dnl MMX support +have_mmx=$have_x86 +AC_ARG_ENABLE(mmx, +[ --enable-mmx enable MMX support [default=autodetect]], + have_mmx=$enableval) +if test "x$have_mmx" = xon; then + AC_MSG_CHECKING(whether the binutils support MMX) + cp "$srcdir/src/X86/mmx_blend.S" conftest.S + if AC_TRY_EVAL(ac_compile); then + AC_DEFINE(USE_MMX_ASM) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + echo 2>&1 "*******************************************************************************" + echo 2>&1 " The installed assembler does not supports the MMX command set." + echo 2>&1 " Update your binutils package, if you want to compile MMX support into Mesa." + echo 2>&1 "*******************************************************************************" + have_mmx=off + fi + rm conftest* +fi + +dnl ------------------------------------------ +dnl 3Dnow support +have_3dnow=$have_x86 +AC_ARG_ENABLE(3dnow, +[ --enable-3dnow enable 3Dnow support [default=autodetect]], + have_3dnow=$enableval) +if test "x$have_3dnow" = xon; then + AC_MSG_CHECKING(whether the binutils support 3Dnow) + cp "$srcdir/src/X86/3dnow_norm_raw.S" conftest.S + if AC_TRY_EVAL(ac_compile); then + AC_DEFINE(USE_3DNOW_ASM) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + echo 2>&1 "*******************************************************************************" + echo 2>&1 " The installed assembler does not supports the 3Dnow! command set." + echo 2>&1 " Update your binutils package, if you want to compile 3Dnow! support into Mesa." + echo 2>&1 "*******************************************************************************" + have_3dnow=off + fi + rm conftest* +fi + +dnl ------------------------------------------ +dnl SSE support +have_sse=no +AC_ARG_ENABLE(sse, +[ --enable-sse enable SSE support [default=no]], + have_sse=$enableval) +if test "x$have_sse" = xon; then + AC_MSG_CHECKING(whether the binutils support PentiumIII SSE) + cp "$srcdir/src/X86/katmai_xform_raw3.S" conftest.S + if AC_TRY_EVAL(ac_compile); then + AC_DEFINE(USE_KATMAI_ASM) + AC_MSG_RESULT(yes) + echo 2>&1 "*******************************************************************************" + echo 2>&1 " You have decided to compile SSE support into Mesa." + echo 2>&1 " If you have a PentiumIII and want to use SSE make sure you have the" + echo 2>&1 " PIII Linux kernel-patch installed or things will fail !" + echo 2>&1 " You can get the patch from http://www.redhat.com/~dledford/linux_kernel.html" + echo 2>&1 "*******************************************************************************" + else + AC_MSG_RESULT(no) + echo 2>&1 "*******************************************************************************" + echo 2>&1 " The installed assembler does not supports the SSE command set." + echo 2>&1 " Update your binutils package, if you want to compile SSE support into Mesa." + echo 2>&1 "*******************************************************************************" + have_sse=off + fi + rm conftest* +fi + +ac_ext="$save_ac_ext" +CPPFLAGS="$save_CPPFLAGS" + +dnl ------------------------------------------ +dnl OSmesa driver +have_osmesa=on +AC_ARG_ENABLE(osmesa, + [ --enable-osmesa enable OSmesa [default=on]], + have_osmesa=$enableval) + +dnl ------------------------------------------ +dnl Glide driver +have_fx=auto +FX_CFLAGS="" +FX_LIBS="" +AC_ARG_WITH(glide, +[ --with-glide=DIR Glide is installed in DIR], have_fx="$withval") +if test "x$have_fx" != xno; then + if test "x$have_fx" != xauto && test "x$have_fx" != xyes; then + FX_CFLAGS="-I$have_fx/include" + FX_LIBS="-L$have_fx/lib" + fi + withval=$have_fx # We still need it later. + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $FX_CFLAGS" + glide2hdir=nil + glide3hdir=nil + AC_CHECK_HEADER(glide.h, + AC_EGREP_HEADER(grSstControl, glide.h, glide2hdir="", + glide3hdir="") ) + CPPFLAGS="$save_CPPFLAGS -I/usr/include/glide -I/usr/local/include/glide" + AC_CHECK_HEADER(glide/glide.h, + AC_EGREP_HEADER(grSstControl, glide/glide.h, glide2hdir=glide, + glide3hdir=glide) ) + CPPFLAGS="$save_CPPFLAGS -I/usr/include/glide2 -I/usr/local/include/glide2" + AC_CHECK_HEADER(glide2/glide.h, glide2hdir="glide2") + CPPFLAGS="$save_CPPFLAGS -I/usr/include/glide3 -I/usr/local/include/glide3" + AC_CHECK_HEADER(glide3/glide.h, glide3hdir="glide3") + if test x$glide3hdir != xnil; then + glidehdir=$glide3hdir + have_fx=yes + elif test x$glide2hdir != xnil; then + glidehdir=$glide2hdir + have_fx=yes + else + have_fx=no + fi + if test "x$have_fx" = xyes; then + if test "x$withval" != xauto; then + FX_CFLAGS="-I$withval/include/$glidehdir" + elif test "x$glidehdir" != x; then + FX_CFLAGS="-I/usr/include/$glidehdir -I/usr/local/include/$glidehdir" + fi + fi + CPPFLAGS="$save_CPPFLAGS" + + if test "x$have_fx" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $FX_LIBS" + AC_CHECK_LIB(glide, grSstControl, glide2lib=glide, + AC_CHECK_LIB(glide, main, glide3lib=glide, , -lm), -lm) + AC_CHECK_LIB(glide2, main, glide2lib=glide2, , -lm) + AC_CHECK_LIB(glide2x, main, glide2lib=glide2x, , -lm) + AC_CHECK_LIB(glide3, main, glide3lib=glide3, , -lm) + AC_CHECK_LIB(glide3x, main, glide3lib=glide3x, , -lm) + if test x$glide3lib != x; then + glidelib=$glide3lib + AC_DEFINE(FX_GLIDE3) + elif test x$glide2lib != x; then + glidelib=$glide2lib + fi + if test "x$glidelib" = x; then + have_fx=no + else + have_fx=yes + AC_DEFINE(FX) + FX_LIBS="$FX_LIBS -l$glidelib" + fi + LIBS="$save_LIBS" + fi + if test "x$have_fx" != xyes; then + FX_CFLAGS="" FX_LIBS="" + fi +fi +AC_SUBST(FX_CFLAGS) +AC_SUBST(FX_LIBS) + +dnl ------------------------------------------ +dnl GGI driver +have_ggi=auto +GGI_CFLAGS="" +GGI_LIBS="" +AC_ARG_WITH(ggi, +[ --with-ggi=DIR GGI is installed in DIR], have_ggi="$withval") +if test "x$have_ggi" != xno; then + if test "x$have_ggi" != xauto; then + GGI_CFLAGS="-I$have_ggi/include" + GGI_LIBS="-L$have_ggi/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GGI_CFLAGS" + AC_CHECK_HEADER(ggi/ggi.h, have_ggi=yes, have_ggi=no) + CPPFLAGS="$save_CPPFLAGS" + if test "x$have_ggi" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $GGI_LIBS" + AC_CHECK_LIB(ggi, main, GGI_LIBS="$GGI_LIBS -lggi" + AC_DEFINE(GGI) have_ggi=yes, have_ggi=no, -lgii -lgg) + LIBS="$save_LIBS" + fi + if test "x$have_ggi" != xyes; then + GGI_CFLAGS="" GGI_LIBS="" + else + build_ggi_fbdev_target=auto + build_ggi_genkgi_driver=auto + AC_ARG_ENABLE(ggi_fbdev, + [ --disable-ggi-fbdev Don't build the GGIMesa fbdev target], + build_ggi_fbdev_target=$enableval) + AC_ARG_ENABLE(ggi_genkgi, + [ --disable-ggi-genkgi Don't build the GGIMesa generic KGI driver], + build_ggi_genkgi_driver=$enableval) + + if test "x$build_ggi_fbdev_target" != "xno"; then + AC_CHECK_HEADER(linux/fb.h, , build_ggi_fbdev_target=no) + fi + + if test "x$build_ggi_genkgi_driver" != "xno"; then + AC_CHECK_HEADER(kgi/kgi.h, , build_ggi_genkgi_driver=no) + fi + + build_ggi_genkgi_driver=no + + AC_MSG_CHECKING(if we should build GGIMesa's fbdev target) + if test "x$build_ggi_fbdev_target" = "xno"; then + AC_MSG_RESULT(no) + else + GGI_DISPLAY_SUBDIRS="$GGI_DISPLAY_SUBDIRS fbdev" + build_ggi_fbdev_target=yes + AC_MSG_RESULT(yes) + fi + + AC_MSG_CHECKING(if we should build GGIMesa's generic KGI driver) + if test "x$build_ggi_genkgi_driver" = "xno"; then + AC_MSG_RESULT(no) + else + GGI_DEFAULT_SUBDIRS="$GGI_DEFAULT_SUBDIRS kgi" + build_ggi_genkgi_driver=yes + AC_MSG_RESULT(yes) + fi + + AM_CONDITIONAL(HAVE_GGI_FBDEV, test $build_ggi_fbdev_target = yes) + AM_CONDITIONAL(HAVE_GGI_GENKGI, test $build_ggi_genkgi_driver = yes) + fi +fi +ggi_confdir=/usr/local/etc +ggi_libdir=/usr/local/lib +AC_SUBST(ggi_confdir) +AC_SUBST(ggi_libdir) +AC_SUBST(GGI_CFLAGS) +AC_SUBST(GGI_LIBS) + +dnl ------------------------------------------ +dnl SVGALib driver +have_svga=auto +SVGA_CFLAGS="" +SVGA_LIBS="" +AC_ARG_WITH(svga, +[ --with-svga=DIR SVGALib is installed in DIR], have_svga="$withval") +if test "x$have_svga" != xno; then + if test "x$have_svga" != xauto; then + SVGA_CFLAGS="-I$have_svga/include" + SVGA_LIBS="-L$have_svga/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $SVGA_CFLAGS" + AC_CHECK_HEADER(vga.h, have_svga=yes, have_svga=no) + CPPFLAGS="$save_CPPFLAGS" + if test "x$have_svga" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $SVGA_LIBS" + AC_CHECK_LIB(vga, main, SVGA_LIBS="$SVGA_LIBS -lvga" + AC_DEFINE(SVGA) have_svga=yes, have_svga=no) + LIBS="$save_LIBS" + fi + if test "x$have_svga" != xyes; then + SVGA_CFLAGS="" SVGA_LIBS="" + fi +fi +AC_SUBST(SVGA_CFLAGS) +AC_SUBST(SVGA_LIBS) + +dnl ------------------------------------------ +dnl X11 driver +AC_PATH_XTRA +X_LIBADD="" +if test "x$have_x" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $X_LIBS $X_PRE_LIBS" + AC_CHECK_LIB(Xmu, XmuRegisterExternalAgent, X_LIBADD="$X_LIBADD -lXmu") + LIBS="$save_LIBS" +fi +X_LIBADD="$X_LIBADD -lXext -lXi -lX11" +AC_SUBST(X_LIBADD) + +dnl Check for USE_XSHM +AC_CHECK_HEADER(sys/shm.h, AC_DEFINE(USE_XSHM)) + +dnl ------------------------------------------ +dnl Check for GLUT +have_glut=auto +GLUT_CFLAGS="" +GLUT_LIBS="" +AC_ARG_WITH(glut, +[ --with-glut=DIR GLUT is installed in DIR], have_glut="$withval") +if test "x$have_glut" != xno; then + if test "x$have_glut" != xauto; then + GLUT_CFLAGS="-I$have_glut/include" + GLUT_LIBS="-L$have_glut/lib" + fi + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GLUT_CFLAGS" + AC_CHECK_HEADER(GL/glut.h, have_glut=yes, have_glut=no) + CPPFLAGS="$save_CPPFLAGS" + if test "x$have_glut" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS $GLUT_LIBS" + AC_CHECK_LIB(glut, main, GLUT_LIBS="$GLUT_LIBS -lglut" + have_glut=yes, have_glut=no) + LIBS="$save_LIBS" + fi +fi +need_glut=no +if test "x$have_glut" != xyes; then + GLUT_CFLAGS="" GLUT_LIBS="" + AC_MSG_CHECKING(for GLUT sources) + if test -d src-glut; then + AC_MSG_RESULT(yes) + need_glut=yes + GLUT_LIBS="\$(top_builddir)/src-glut/libglut.la" + + AC_ARG_ENABLE(glut-debug, +[ --enable-glut-debug enable GLUT debugging [default=off]], + enable_glut_debug=$enableval, enable_glut_debug=no) + if test "x$enable_glut_debug" != xyes; then + GLUT_CFLAGS="$GLUT_CFLAGS -DNDEBUG" + fi + + else + AC_MSG_RESULT(no) + AC_MSG_WARN([Sorry, GLUT not found. Demos might not work.]) + AC_MSG_WARN(Please ignore the warnings about missing Makefiles) + GLUT_LIBS="-lglut" + fi +else + AC_MSG_WARN(GLUT is already installed.) + AC_MSG_WARN(Use --without-glut to build and install Mesa's own version of GLUT.) +fi +AC_SUBST(GLUT_CFLAGS) +AC_SUBST(GLUT_LIBS) + +dnl ------------------------------------------ +dnl Check for demos +have_demos=no +AC_MSG_CHECKING(for Mesa demos sources) +if test -d book && test -d demos && test -d images && \ + test -d samples && test -d xdemos; then + AC_MSG_RESULT(yes) + have_demos=yes +else + AC_MSG_RESULT(no) + AC_MSG_WARN(Please ignore the warnings about missing Makefiles) +fi + +dnl ------------------------------------------ +AM_CONDITIONAL(HAVE_3DNOW, test $have_3dnow = on) +AM_CONDITIONAL(HAVE_SSE, test $have_sse = on) +AM_CONDITIONAL(HAVE_MMX, test $have_mmx = on) +AM_CONDITIONAL(HAVE_X86, test $have_x86 = on) +AM_CONDITIONAL(HAVE_FX, test $have_fx = yes) +AM_CONDITIONAL(HAVE_GGI, test $have_ggi = yes) +AM_CONDITIONAL(HAVE_OSMESA, test $have_osmesa = on) +AM_CONDITIONAL(HAVE_SVGA, test $have_svga = yes) +AM_CONDITIONAL(HAVE_X11, test $have_x = yes) +AM_CONDITIONAL(NEED_GLUT, test $need_glut = yes) +AM_CONDITIONAL(HAVE_DEMOS, test $have_demos = yes) + +dnl ------------------------------------------ +AC_OUTPUT( +Makefile +include/Makefile +include/GL/Makefile +src/Makefile +src/FX/Makefile +src/FX/X86/Makefile +src/GGI/Makefile +src/GGI/include/Makefile +src/GGI/include/ggi/Makefile +src/GGI/include/ggi/mesa/Makefile +src/GGI/ggimesa.conf +src/GGI/default/Makefile +src/GGI/default/genkgi.conf +src/GGI/display/Makefile +src/GGI/display/fbdev.conf +src/OSmesa/Makefile +src/SVGA/Makefile +src/X/Makefile +src/X86/Makefile +src-glu/Makefile +src-glut/Makefile +book/Makefile +demos/Makefile +samples/Makefile +xdemos/Makefile +util/Makefile +ggi/demos/Makefile +ggi/ggiglut/Makefile +) diff --git a/xc/extras/Mesa/descrip.mms b/xc/extras/Mesa/descrip.mms new file mode 100644 index 000000000..0348e4249 --- /dev/null +++ b/xc/extras/Mesa/descrip.mms @@ -0,0 +1,22 @@ +# Makefile for Mesa for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + +macro : + @ macro="" +.ifdef NOSHARE +.else + @ if f$getsyi("HW_MODEL") .ge. 1024 then macro= "/MACRO=(SHARE=1)" +.endif + $(MMS)$(MMSQUALIFIERS)'macro' all + +all : + if f$search("lib.dir") .eqs. "" then create/directory [.lib] + set default [.src] + $(MMS)$(MMSQUALIFIERS) + set default [-.src-glu] + $(MMS)$(MMSQUALIFIERS) +# PIPE is avalailable on VMS7.0 and higher. For lower versions split the +#command in two conditional command. JJ + if f$search("[-]SRC-GLUT.DIR") .nes. "" then pipe set default [-.src-glut] ; $(MMS)$(MMSQUALIFIERS) + if f$search("[-]DEMOS.DIR") .nes. "" then pipe set default [-.demos] ; $(MMS)$(MMSQUALIFIERS) + diff --git a/xc/extras/Mesa/docs/CONFIG b/xc/extras/Mesa/docs/CONFIG new file mode 100644 index 000000000..84d267d6f --- /dev/null +++ b/xc/extras/Mesa/docs/CONFIG @@ -0,0 +1,120 @@ + + Mesa config file documentation + + +As of Mesa 3.1 beta 2, a config file can be used to configure various +Mesa parameters. For example, extensions can be enable/disabled, +glHints can be specified, etc. More config options will be added +in the future. + +The config file uses a Lisp-like syntax. + +Here's Keith's description of the file with a few examples. + + + +;; -*-lisp-*- +;; +;; KW: New mesa configuration file, syntax following a lisp style. +;; +;; valid syntax: +;; +;; (config-mesa version configs) +;; +;; where: +;; version - is the version number of mesa for which the configuration +;; was written. Future versions will use this to check for upwards +;; compatibility. There is however no guarentee that old configurations +;; will continue to be respected. +;; +;; configs - is a list of valid configuration lists, as specified by: +;; +;; (default-hint variable value) +;; (disable-extension name) +;; (fx-catch-signals {true|false}) +;; +;; Mesa will look for an environment variable MESA_CONFIG, and try to +;; execute that profile. Otherwise, it will fallback to the profile +;; with the same name as the current mesa version. As default +;; profiles should normally be empty or near-empty, this should be +;; sufficiently powerful. +;; + + +;; Guareenteed to be an empty config. +;; +(config-mesa empty ()) + + +;; Default profile - should normally be an empty list of +;; configurations. +;; +(config-mesa mesa3.1beta1 ()) + + +(config-mesa no-cva ((disable-extension GL_EXT_compiled_vertex_array))) + + +;; Turn off some compliance for the sake of speed. +;; +(config-mesa quake2 + ( + ;; Quake2 likes this extension, but it really hurts performance if + ;; you don't also disable software fallbacks, below. (And do + ;; something else to stop the eye-space calculations too...) + ;; + (disable-extension GL_EXT_point_parameters) + + ;; These hints are honoured only by the 3dfx driver - the X driver + ;; continues to function even if you specify hardware-only + ;; rendering. + ;; + ;(default-hint GL_ALLOW_DRAW_OBJ_HINT_PGI GL_TRUE) ; wishful thinking + ;(default-hint GL_ALLOW_DRAW_WIN_HINT_PGI GL_TRUE) ; allow 3dfx +hardware... + ;(default-hint GL_ALLOW_DRAW_SPN_HINT_PGI GL_FALSE) ; no software spans + ;(default-hint GL_ALLOW_DRAW_MEM_HINT_PGI GL_FALSE) ; no softare pixels + + ;; Lock in the hints specified above. + ;; + (disable-extension GL_PGI_misc_hints))) + + +;; Turn off some compliance for the sake of speed. +;; +(config-mesa quake2b + ( + ;; Quake2 likes this extension, but it really hurts performance if + ;; you don't also disable software fallbacks, below. (And do + ;; something else to stop the eye-space calculations too...) + ;; + ;(disable-extension GL_EXT_point_parameters) + + ;; These hints are honoured only by the 3dfx driver - the X driver + ;; continues to function even if you specify hardware-only + ;; rendering. + ;; + (default-hint GL_ALLOW_DRAW_OBJ_HINT_PGI GL_TRUE) ; wishful thinking + (default-hint GL_ALLOW_DRAW_WIN_HINT_PGI GL_TRUE) ; allow 3dfx +hardware... + (default-hint GL_ALLOW_DRAW_SPN_HINT_PGI GL_FALSE) ; no software spans + (default-hint GL_ALLOW_DRAW_MEM_HINT_PGI GL_FALSE) ; no softare pixels + + ;; Lock in the hints specified above. + ;; + (disable-extension GL_PGI_misc_hints))) + + +;; Just some reminders for me. +;; +(config-mesa todo-list + ( + ;; Allows us to slot in simpler lighting routines - not + ;; implemented. + ;; + (default-hint GL_STRICT_POINT_DISTANCE_HINT_MESA GL_FALSE) + (default-hint GL_STRICT_LIGHTING_HINT_PGI GL_FALSE))) + + +---------------------------------------------------------------------- +$Id: CONFIG,v 1.1 2000/11/30 17:31:36 dawes Exp $ diff --git a/xc/extras/Mesa/docs/CONFORM b/xc/extras/Mesa/docs/CONFORM new file mode 100644 index 000000000..6e5c3e3a4 --- /dev/null +++ b/xc/extras/Mesa/docs/CONFORM @@ -0,0 +1,754 @@ + +I (Brian Paul) have been given the OpenGL conformance tests for the +purpose of testing Mesa. The test source code can not be disclosed. + +Below are the results of testing Mesa 3.4 beta as of November 1, 2000. +The results are identical to Mesa 3.3. + +The tests were run using the software X11 device driver on a 24-bit +display. Using 16-bit or 8-bit display modes results in some conformance +failures. That's almost certainly because of dithering errors. + +Mesa's antialiased line algorithm will have to be rewritten to +pass the remaining conformance failures. + + +----------------------------------------------------------------------------- + + +COVERAGE TESTS +-------------- + +Test that all API functions accept the spec'd parameters and reject +illegal parameters. Results of each test is either pass or fail. + +covgl test: passed. + +covglu test: can't compile; Mesa doesn't have GLU 1.2 + +covglx test: passed. + +primtest: 292159 Combinations tested. Passed. + + + + +GL CONFORMANCE TEST +=================== + +Render test images, read them back, then test for expected results. + + +---------------------------------------------------------------------- +% conform -v 2 + +OpenGL Conformance Test +Version 1.1.1 + +Setup Report. + Verbose level = 2. + Random number seed = 1. + Path inactive. + +Visual Report. + Display ID = 34. Indirect Rendering. + Double Buffered. + RGBA (8, 8, 8, 0). + Stencil (8). + Depth (16). + Accumulation (16, 16, 16, 16). + +Epsilon Report. + zero error epsilon = 0.000122. + RGBA error epsilon = 0.00404, 0.00404, 0.00404, 0.000122. + Depth buffer error epsilon = 0.000137. + Stencil plane error epsilon = 0.00404. + Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137. + +Default State test passed. +Must Pass test passed. +Divide By Zero test passed. +Viewport Clamp test passed. +Matrix Stack test passed. +Matrix Stack Mixing test passed. +Vertex Order test passed. +Transformations test passed. +Transformation Normal test passed. +Viewport Transformation test passed. +Buffer Clear test passed. +Buffer Corners test passed. +Buffer Color test passed. +Color Ramp test passed. +Mask test passed. +Buffer Invariance test passed. +Accumulation Buffer test passed. +Select test passed. +Feedback test passed. +Scissor test passed. +Alpha Plane Function test passed. +Stencil Plane Clear test passed. +Stencil Plane Corners test passed. +Stencil Plane Operation test passed. +Stencil Plane Function test passed. +Depth Buffer Clear test passed. +Depth Buffer Function test passed. +Blend test passed. +Dither test passed. +LogicOp Function test does not exist for an RGB visual. +DrawPixels test passed. +CopyPixels test passed. +Bitmap Rasterization test passed. +Point Rasterization test passed. +Anti-aliased Point test passed. +Line Rasterization test passed. +Line Stipple test passed. +Anti-aliased Line test passed. +Horizontal and Vertical Line test passed. +Triangle Rasterization test passed. +Triangle Tile test passed. +Triangle Stipple test passed. +Anti-aliased Triangles test passed. +Quad Rasterization test passed. +Polygon Face test passed. +Polygon Cull test passed. +Polygon Stipple test passed. +Polygon Edge test passed. +Ambient Light test passed. +Ambient Material test passed. +Ambient Scene test passed. +Attenuation Constants test passed. +Attenuation Position test passed. +Diffuse Light test passed. +Diffuse Material test passed. +Diffuse Material Normal test passed. +Diffuse Material Positioning test passed. +Emissive Material test passed. +Specular Exponent test passed. +Specular Exponent Normal test passed. +Specular Local Eye Half Angle test passed. +Specular Light test passed. +Specular Material test passed. +Specular Normal test passed. +Spot Positioning test passed. +Spot Exponent and Positioning test passed. +Spot Exponent and Direction test passed. +Fog Exponential test passed. +Fog Linear test passed. +Texture Decal test passed. +Texture Border test passed. +Mipmaps Selection test passed. +Mipmaps Interpolation test passed. +Display Lists test passed. +Evaluator test passed. +Evaluator Color test passed. + +Conform passed. + +---------------------------------------------------------------------- +% conform -v 2 -p 1 + +OpenGL Conformance Test +Version 1.1.1 + +Setup Report. + Verbose level = 2. + Random number seed = 1. + Path level = 1. + +Visual Report. + Display ID = 34. Indirect Rendering. + Double Buffered. + RGBA (8, 8, 8, 0). + Stencil (8). + Depth (16). + Accumulation (16, 16, 16, 16). + +Epsilon Report. + zero error epsilon = 0.000122. + RGBA error epsilon = 0.00404, 0.00404, 0.00404, 0.000122. + Depth buffer error epsilon = 0.000137. + Stencil plane error epsilon = 0.00404. + Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137. + +Default State test passed. +Must Pass test passed. +Divide By Zero test passed. +Viewport Clamp test passed. +Matrix Stack test passed. +Matrix Stack Mixing test passed. +Vertex Order test passed. +Transformations test passed. +Transformation Normal test passed. +Viewport Transformation test passed. +Buffer Clear test passed. +Buffer Corners test passed. +Buffer Color test passed. +Color Ramp test passed. +Mask test passed. +Buffer Invariance test passed. +Accumulation Buffer test passed. +Select test passed. +Feedback test passed. +Scissor test passed. +Alpha Plane Function test passed. +Stencil Plane Clear test passed. +Stencil Plane Corners test passed. +Stencil Plane Operation test passed. +Stencil Plane Function test passed. +Depth Buffer Clear test passed. +Depth Buffer Function test passed. +Blend test passed. +Dither test passed. +LogicOp Function test does not exist for an RGB visual. +DrawPixels test passed. +CopyPixels test passed. +Bitmap Rasterization test passed. +Point Rasterization test passed. +Anti-aliased Point test passed. +Line Rasterization test passed. +Line Stipple test passed. +Anti-aliased Line test passed. +Horizontal and Vertical Line test passed. +Triangle Rasterization test passed. +Triangle Tile test passed. +Triangle Stipple test passed. +Anti-aliased Triangles test passed. +Quad Rasterization test passed. +Polygon Face test passed. +Polygon Cull test passed. +Polygon Stipple test passed. +Polygon Edge test passed. +Ambient Light test passed. +Ambient Material test passed. +Ambient Scene test passed. +Attenuation Constants test passed. +Attenuation Position test passed. +Diffuse Light test passed. +Diffuse Material test passed. +Diffuse Material Normal test passed. +Diffuse Material Positioning test passed. +Emissive Material test passed. +Specular Exponent test passed. +Specular Exponent Normal test passed. +Specular Local Eye Half Angle test passed. +Specular Light test passed. +Specular Material test passed. +Specular Normal test passed. +Spot Positioning test passed. +Spot Exponent and Positioning test passed. +Spot Exponent and Direction test passed. +Fog Exponential test passed. +Fog Linear test passed. +Texture Decal test passed. +Texture Border test passed. +Mipmaps Selection test passed. +Mipmaps Interpolation test passed. +Display Lists test passed. +Evaluator test passed. +Evaluator Color test passed. + +Conform passed. + +---------------------------------------------------------------------- +% conform -v 2 -p 2 + +OpenGL Conformance Test +Version 1.1.1 + +Setup Report. + Verbose level = 2. + Random number seed = 1. + Path level = 2. + +Visual Report. + Display ID = 34. Indirect Rendering. + Double Buffered. + RGBA (8, 8, 8, 0). + Stencil (8). + Depth (16). + Accumulation (16, 16, 16, 16). + +Epsilon Report. + zero error epsilon = 0.000122. + RGBA error epsilon = 0.00404, 0.00404, 0.00404, 0.000122. + Depth buffer error epsilon = 0.000137. + Stencil plane error epsilon = 0.00404. + Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137. + +Default State test passed. +Must Pass test passed. +Divide By Zero test passed. +Viewport Clamp test passed. +Matrix Stack test passed. +Matrix Stack Mixing test passed. +Vertex Order test passed. +Transformations test passed. +Transformation Normal test passed. +Viewport Transformation test passed. +Buffer Clear test passed. +Buffer Corners test passed. +Buffer Color test passed. +Color Ramp test passed. +Mask test passed. +Buffer Invariance test passed. +Accumulation Buffer test passed. +Select test passed. +Feedback test passed. +Scissor test passed. +Alpha Plane Function test passed. +Stencil Plane Clear test passed. +Stencil Plane Corners test passed. +Stencil Plane Operation test passed. +Stencil Plane Function test passed. +Depth Buffer Clear test passed. +Depth Buffer Function test passed. +Blend test passed. +Dither test passed. +LogicOp Function test does not exist for an RGB visual. +DrawPixels test passed. +CopyPixels test passed. +Bitmap Rasterization test passed. +Point Rasterization test passed. +Anti-aliased Point test passed. +Line Rasterization test passed. +Line Stipple test passed. +Anti-aliased Line test failed. + File - lineaa.c, line - 165. + Coverage is 1.99216, initial coverage was 0.996078. Error margin is + 0.655922. + State Report. (Current) <-> (Default) + GL_ATTRIB_STACK_DEPTH (State Information) + 1.00 <-> 0.00 + GL_BLEND (State Information) + GL_TRUE <-> GL_FALSE + GL_BLEND_DST (State Information) + GL_LINES <-> GL_NONE + GL_BLEND_SRC (State Information) + GL_SRC_ALPHA <-> GL_LINES + GL_CURRENT_COLOR (State Information) + 1.00 0.00 0.00 1.00 <-> 1.00 1.00 1.00 1.00 + GL_DITHER (State Information) + GL_FALSE <-> GL_TRUE + GL_LINE_SMOOTH (State Information) + GL_TRUE <-> GL_FALSE + GL_LINE_STIPPLE_PATTERN (State Information) + 0.00 <-> 65535.00 + GL_LOGIC_OP (State Information) + GL_TRUE <-> GL_FALSE + GL_PROJECTION_MATRIX (State Information) + +0.020 +0.000 +0.000 +0.000 <-> +1.000 +0.000 +0.000 +0.000 + +0.000 +0.020 +0.000 +0.000 <-> +0.000 +1.000 +0.000 +0.000 + +0.000 +0.000 -1.000 +0.000 <-> +0.000 +0.000 +1.000 +0.000 + -1.000 -1.000 +0.000 +1.000 <-> +0.000 +0.000 +0.000 +1.000 + GL_POLYGON_STIPPLE (State Information) + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + 0 0 0 0 0 0 0 0 <-> FF FF FF FF FF FF FF FF + Path Report. + Alias Path inactive. + Alpha Path inactive. + Blend Path inactive. + Depth Path inactive. + Dither Path active. + Fog Path inactive. + LogicOp Path active. + Function = GL_COPY. + Shade model Path = GL_SMOOTH. + Stencil Path inactive. + Stipple Path inactive. +Horizontal and Vertical Line test passed. +Triangle Rasterization test passed. +Triangle Tile test passed. +Triangle Stipple test passed. +Anti-aliased Triangles test passed. +Quad Rasterization test passed. +Polygon Face test passed. +Polygon Cull test passed. +Polygon Stipple test passed. +Polygon Edge test passed. +Ambient Light test passed. +Ambient Material test passed. +Ambient Scene test passed. +Attenuation Constants test passed. +Attenuation Position test passed. +Diffuse Light test passed. +Diffuse Material test passed. +Diffuse Material Normal test passed. +Diffuse Material Positioning test passed. +Emissive Material test passed. +Specular Exponent test passed. +Specular Exponent Normal test passed. +Specular Local Eye Half Angle test passed. +Specular Light test passed. +Specular Material test passed. +Specular Normal test passed. +Spot Positioning test passed. +Spot Exponent and Positioning test passed. +Spot Exponent and Direction test passed. +Fog Exponential test passed. +Fog Linear test passed. +Texture Decal test passed. +Texture Border test passed. +Mipmaps Selection test passed. +Mipmaps Interpolation test passed. +Display Lists test passed. +Evaluator test passed. +Evaluator Color test passed. + +Conform failed. + Anti-aliased Line test (Test number #36) failed. + +---------------------------------------------------------------------- +% conform -v 2 -p 3 + +OpenGL Conformance Test +Version 1.1.1 + +Setup Report. + Verbose level = 2. + Random number seed = 1. + Path level = 3. + +Visual Report. + Display ID = 34. Indirect Rendering. + Double Buffered. + RGBA (8, 8, 8, 0). + Stencil (8). + Depth (16). + Accumulation (16, 16, 16, 16). + +Epsilon Report. + zero error epsilon = 0.000122. + RGBA error epsilon = 0.00404, 0.00404, 0.00404, 0.000122. + Depth buffer error epsilon = 0.000137. + Stencil plane error epsilon = 0.00404. + Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137. + +Default State test passed. +Must Pass test passed. +Divide By Zero test passed. +Viewport Clamp test passed. +Matrix Stack test passed. +Matrix Stack Mixing test passed. +Vertex Order test passed. +Transformations test passed. +Transformation Normal test passed. +Viewport Transformation test passed. +Buffer Clear test passed. +Buffer Corners test passed. +Buffer Color test passed. +Color Ramp test passed. +Mask test passed. +Buffer Invariance test passed. +Accumulation Buffer test passed. +Select test passed. +Feedback test passed. +Scissor test passed. +Alpha Plane Function test passed. +Stencil Plane Clear test passed. +Stencil Plane Corners test passed. +Stencil Plane Operation test passed. +Stencil Plane Function test passed. +Depth Buffer Clear test passed. +Depth Buffer Function test passed. +Blend test passed. +Dither test passed. +LogicOp Function test does not exist for an RGB visual. +DrawPixels test passed. +CopyPixels test passed. +Bitmap Rasterization test passed. +Point Rasterization test passed. +Anti-aliased Point test passed. +Line Rasterization test passed. +Line Stipple test passed. +Anti-aliased Line test failed. + File - lineaa.c, line - 165. + Coverage is 1.99216, initial coverage was 0.996078. Error margin is + 0.655922. + State Report. (Current) <-> (Default) + GL_ATTRIB_STACK_DEPTH (State Information) + 1.00 <-> 0.00 + GL_BLEND (State Information) + GL_TRUE <-> GL_FALSE + GL_BLEND_DST (State Information) + GL_LINES <-> GL_NONE + GL_BLEND_SRC (State Information) + GL_SRC_ALPHA <-> GL_LINES + GL_CURRENT_COLOR (State Information) + 1.00 0.00 0.00 1.00 <-> 1.00 1.00 1.00 1.00 + GL_DITHER (State Information) + GL_FALSE <-> GL_TRUE + GL_FOG (State Information) + GL_TRUE <-> GL_FALSE + GL_FOG_COLOR (State Information) + 1.00 1.00 1.00 1.00 <-> 0.00 0.00 0.00 0.00 + GL_FOG_DENSITY (State Information) + 0.00 <-> 1.00 + GL_FOG_MODE (State Information) + GL_EXP2 <-> GL_EXP + GL_LINE_SMOOTH (State Information) + GL_TRUE <-> GL_FALSE + GL_LINE_STIPPLE (State Information) + GL_TRUE <-> GL_FALSE + GL_LINE_STIPPLE_REPEAT (State Information) + 10.00 <-> 1.00 + GL_POLYGON_STIPPLE (State Information) + GL_TRUE <-> GL_FALSE + GL_PROJECTION_MATRIX (State Information) + +0.020 +0.000 +0.000 +0.000 <-> +1.000 +0.000 +0.000 +0.000 + +0.000 +0.020 +0.000 +0.000 <-> +0.000 +1.000 +0.000 +0.000 + +0.000 +0.000 -1.000 +0.000 <-> +0.000 +0.000 +1.000 +0.000 + -1.000 -1.000 +0.000 +1.000 <-> +0.000 +0.000 +0.000 +1.000 + GL_SHADE_MODEL (State Information) + GL_FLAT <-> GL_SMOOTH + GL_STENCIL_FUNC (State Information) + GL_GEQUAL <-> GL_ALWAYS + GL_STENCIL_REF (State Information) + 1.00 <-> 0.00 + GL_STENCIL_TEST (State Information) + GL_TRUE <-> GL_FALSE + GL_STENCIL_VALUE_MASK (State Information) + 0.00 <-> 255.00 + Path Report. + Alias Path inactive. + Alpha Path inactive. + Blend Path inactive. + Depth Path active. + Clear value = 0.000000. + Range = 0.000000, 1.000000. + Function = GL_ALWAYS. + Dither Path active. + Fog Path active. + RGBA color = 1.000000, 1.000000, 1.000000, 1.000000. + Color Index = 0.0. + Density = 0.000000. + Start and end values = 0.000000, 1.000000. + Mode = GL_EXP2. + LogicOp Path inactive. + Shade model Path = GL_FLAT. + Stencil Path active. + Clear value = 0. + Mask value = FF. + Function = GL_GEQUAL, reference = 1, mask = 0. + Op1 = GL_KEEP, op2 = GL_KEEP, op3 = GL_KEEP. + Stipple Path active. + Line stipple = FFFF, repeat = 10. + Polygon stipple = FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF + FF, FF, FF, FF, FF, FF, FF, FF +Horizontal and Vertical Line test passed. +Triangle Rasterization test passed. +Triangle Tile test passed. +Triangle Stipple test passed. +Anti-aliased Triangles test passed. +Quad Rasterization test passed. +Polygon Face test passed. +Polygon Cull test passed. +Polygon Stipple test passed. +Polygon Edge test passed. +Ambient Light test passed. +Ambient Material test passed. +Ambient Scene test passed. +Attenuation Constants test passed. +Attenuation Position test passed. +Diffuse Light test passed. +Diffuse Material test passed. +Diffuse Material Normal test passed. +Diffuse Material Positioning test passed. +Emissive Material test passed. +Specular Exponent test passed. +Specular Exponent Normal test passed. +Specular Local Eye Half Angle test passed. +Specular Light test passed. +Specular Material test passed. +Specular Normal test passed. +Spot Positioning test passed. +Spot Exponent and Positioning test passed. +Spot Exponent and Direction test passed. +Fog Exponential test passed. +Fog Linear test passed. +Texture Decal test passed. +Texture Border test passed. +Mipmaps Selection test passed. +Mipmaps Interpolation test passed. +Display Lists test passed. +Evaluator test passed. +Evaluator Color test passed. + +Conform failed. + Anti-aliased Line test (Test number #36) failed. + +---------------------------------------------------------------------- +% conform -v 2 -p 4 + +OpenGL Conformance Test +Version 1.1.1 + +Setup Report. + Verbose level = 2. + Random number seed = 1. + Path level = 4. + +Visual Report. + Display ID = 34. Indirect Rendering. + Double Buffered. + RGBA (8, 8, 8, 0). + Stencil (8). + Depth (16). + Accumulation (16, 16, 16, 16). + +Epsilon Report. + zero error epsilon = 0.000122. + RGBA error epsilon = 0.00404, 0.00404, 0.00404, 0.000122. + Depth buffer error epsilon = 0.000137. + Stencil plane error epsilon = 0.00404. + Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137. + +Default State test passed. +Must Pass test passed. +Divide By Zero test passed. +Viewport Clamp test passed. +Matrix Stack test passed. +Matrix Stack Mixing test passed. +Vertex Order test passed. +Transformations test passed. +Transformation Normal test passed. +Viewport Transformation test passed. +Buffer Clear test passed. +Buffer Corners test passed. +Buffer Color test passed. +Color Ramp test passed. +Mask test passed. +Buffer Invariance test passed. +Accumulation Buffer test passed. +Select test passed. +Feedback test passed. +Scissor test passed. +Alpha Plane Function test passed. +Stencil Plane Clear test passed. +Stencil Plane Corners test passed. +Stencil Plane Operation test passed. +Stencil Plane Function test passed. +Depth Buffer Clear test passed. +Depth Buffer Function test passed. +Blend test passed. +Dither test passed. +LogicOp Function test does not exist for an RGB visual. +DrawPixels test passed. +CopyPixels test passed. +Bitmap Rasterization test passed. +Point Rasterization test passed. +Anti-aliased Point test passed. +Line Rasterization test passed. +Line Stipple test passed. +Anti-aliased Line test passed. +Horizontal and Vertical Line test passed. +Triangle Rasterization test passed. +Triangle Tile test passed. +Triangle Stipple test passed. +Anti-aliased Triangles test passed. +Quad Rasterization test passed. +Polygon Face test passed. +Polygon Cull test passed. +Polygon Stipple test passed. +Polygon Edge test passed. +Ambient Light test passed. +Ambient Material test passed. +Ambient Scene test passed. +Attenuation Constants test passed. +Attenuation Position test passed. +Diffuse Light test passed. +Diffuse Material test passed. +Diffuse Material Normal test passed. +Diffuse Material Positioning test passed. +Emissive Material test passed. +Specular Exponent test passed. +Specular Exponent Normal test passed. +Specular Local Eye Half Angle test passed. +Specular Light test passed. +Specular Material test passed. +Specular Normal test passed. +Spot Positioning test passed. +Spot Exponent and Positioning test passed. +Spot Exponent and Direction test passed. +Fog Exponential test passed. +Fog Linear test passed. +Texture Decal test passed. +Texture Border test passed. +Mipmaps Selection test passed. +Mipmaps Interpolation test passed. +Display Lists test passed. +Evaluator test passed. +Evaluator Color test passed. + +Conform passed. + + + + +GLX CONFORMANCE TEST +==================== + +% conformx -v 2 + +OpenGL X Conformance Test +Version 1.1.1 + +Setup Report. + Verbose level = 2. + Random number seed = 1. + Path inactive. + +Visual Report. + Display ID = 34. Direct Rendering. + Double Buffered. + RGBA (8, 8, 8, 0). + Stencil (8). + Depth (16). + Accumulation (16, 16, 16, 16). + +Epsilon Report. + zero error epsilon = 0.000122. + RGBA error epsilon = 0.00404, 0.00404, 0.00404, 0.000122. + Depth buffer error epsilon = 0.000137. + Stencil plane error epsilon = 0.00404. + Accumulation error epsilon = 0.000137, 0.000137, 0.000137, 0.000137. + +Default State test passed. +glReadPixels() test passed. +Font test passed. + +Conformx passed. + + +NOTE: conformx passes for all machine path levels (-p option). + + +----------------------------------------------------------------------------- +$Id: CONFORM,v 1.1 2000/11/30 17:31:36 dawes Exp $ diff --git a/xc/extras/Mesa/docs/COPYRIGHT b/xc/extras/Mesa/docs/COPYRIGHT new file mode 100644 index 000000000..7952e1e65 --- /dev/null +++ b/xc/extras/Mesa/docs/COPYRIGHT @@ -0,0 +1,155 @@ + + Mesa Copyright Information + + +The Mesa distribution consists of several components. Different copyrights +apply to different components. For example, GLUT is copyrighted by Mark +Kilgard, some demo programs are copyrighted by SGI, some of the Mesa +device drivers are copyrighted by the respective authors. + +Through version 3.0, the core Mesa library was been distributed under the +GNU Library General Public License. + +In Mesa 3.1 (and later) the core library instead uses the XFree86 copyright. +The copyright was being changed so that Mesa could be integrated into the +XFree86 X server in order to support 3D hardware acceleration. Mesa will +still also be supported as a stand-alone library. + +If you have contributed code to Mesa in the past and don't want your +code included in the non-GNU LGPL version please contact Brian to +have your code removed. + + + + +Common questions about the copyright change +------------------------------------------- + +Q1. Why was the copyright changed? + +A1. Mesa is being integrated with XFree86 (the free X server for Linux +and other Unix-like operating systems) in order to better support +3D hardware on Linux. All code used in XFree86 must use the XFree86 +copyright. 3D hardware acceleration on Linux is long overdue. The +Mesa copyright change will allow better hardware support on Linux in +the near future. + + +Q2. Is it legal to change the copyright? + +A2. Yes, since I (Brian Paul) hold the copyright. + + +Q3. I contributed code to Mesa while under the GNU copyright and don't +agree with the new copyright. What can I do? + +A3. I'll remove any such code upon request. So far, no one has made +this request. + + +Q4. The XFree86 copyright allows people/companies to release binary-only +works derived from the Mesa code. Isn't that bad? + +A4. It's somewhat unfortunate, but acceptable. However, it really is in a +company's best interest to keep modification to open-source software in the +open-source domain. See the open-source essays written by Eric Raymond for +the reasoning. Also note that any such concerns can be applied to the +XFree86 project as well. It seems to be doing well. + + + +Attention Contributors +---------------------- + +If you want to contribute to the Mesa project please consider the +copyright issues. If you contribute a bug fix or new feature to +an existing component you should agree to the copyright on that +component before submitting the bug fix or feature code. + +If you want to contribute a new component, such as a new device +driver or demo program, then you can put whatever copyright you want +on your code. Insert the copyright into all files to avoid confusion. + + + + +Mesa component copyrights +------------------------- + +Component Files Primary Author Copyright +------------------------------------------------------------------------------- +core Mesa code src/*.[ch] Brian Paul See below (*) + include/GL/gl.h + +GLU library src-glu/* Brian Paul GNU-LGPL + include/GL/glu.h + +GLX driver src/X/* Brian Paul See below (*) + include/GL/glx.h + include/GL/xmesa.h + +OS/Mesa driver src/OSmesa/* Brian Paul See below (*) + include/GL/osmesa.h + +3Dfx driver src/FX/* David Bucciarelli GNU-LGPL + include/GL/fxmesa.h + +MGL driver src/MGL/* SciTech, Inc SciTech copyright + include/GL/mglmesa.h + +Windows driver src/Windows/* Li Wei copyright by Li Wei + include/GL/wmesa.h + +SVGA driver src/SVGA/* Brian Paul GNU-LGPL + include/GL/svgamesa.h + +DOS driver src/DOS/* Charlie Wallace GNU-LGPL + include/GL/dosmesa.h + +GGI driver src/GGI/* Uwe Maurer GNU-LGPL + include/GL/ggimesa.h + +S3 driver src/S3/* S3, Inc. S3 copyright + +BeOS R4 driver src/BeOS/* Brian Paul See below (*) + +GLUT src-glut/* Mark Kilgard Mark's copyright + include/GL/*glut*.h + +demo programs demos/* various see source file + +X demos xdemos/* Brian Paul see source file + +SGI demos samples/* SGI SGI copyright + +RedBook demos book/* SGI SGI copyright + + + +(*) Main Mesa Copyright +----------------------- + +Mesa code without an explicit copyright is covered by the following +copyright: + +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. + +---------------------------------------------------------------------- +$Id: COPYRIGHT,v 1.1 2000/11/30 17:31:37 dawes Exp $ diff --git a/xc/extras/Mesa/docs/DEVINFO b/xc/extras/Mesa/docs/DEVINFO new file mode 100644 index 000000000..facee2710 --- /dev/null +++ b/xc/extras/Mesa/docs/DEVINFO @@ -0,0 +1,148 @@ + + + Information for Mesa developers + + +Adding Extentions +----------------- + +To add a new GL extension to Mesa you have to do the following. + + Edit include/GL/gl.h and add + - new enum tokens + - new API function entry points + - #define GL_EXT_the_extension_name 1 + + If adding a new API function (call it glNewFunctionEXT): + - insert glNewFunctionEXT()into src/apiext.h + - edit src/types.h and add NewFunction to the gl_api_table struct + - implement gl_NewFunction() in the appropriate src file + - hook gl_NewFunction() into pointers.c + - add display list support in dlist.c for save_NewFunction() + - add glNewFunctionEXT to gl_GetProcAddress() in extensions.c or + in the device driver's GetProcAddress() function if appropriate + + If adding new GL state be sure to update get.c and enable.c + + Document the extension in the README file. Either include a pointer + to the extension spec or write an extension spec and put it in the + Mesa/docs/ directory. + + + +Coding Style +------------ + +Mesa's code style has changed over the years. Here's the latest. + +Comment your code! It's extremely important that open-source code be +well documented. Also, strive to write clean, easily understandable code. + +3-space indentation + +If you use tabs, set them to 8 columns + +Brace example: + + if (condition) { + foo; + } + else { + bar; + } + +Here's the GNU indent command which will best approximate my preferred style: + + indent -br -i3 -npcs infile.c -o outfile.c + + +Local variable name example: localVarName (no underscores) + +Constants and macros are ALL UPPERCASE, with _ between words + +Global vars not allowed. + +Function name examples: + glFooBar() - a public GL entry point + _mesa_FooBar() - the internal immediate mode function + save_FooBar() - retained mode (display list) function in dlist.c + foo_bar() - a static (private) function + _mesa_foo_bar() - an internal Mesa function + + + +Writing a Device Driver +----------------------- + +XXX to do + + + +Making a New Mesa Release +------------------------- + +These are the instructions for making a new Mesa release. + +Be sure to do a "cvs update -d ." in the Mesa directory to +get all the latest files. + +Update the version strings in src/get.c, src-glu/glu.c, and +src/X/fakeglx.c to return the new Mesa version number. + +Edit the docs/RELNOTES file to document what's new in the release. +Edit the docs/VERSIONS file too. +Update the docs/IAFA-PACKAGE file. + +Edit the GNU configure stuff to change versions numbers as needed: +Update the version string (second argument) in the line +"AM_INIT_AUTOMAKE(Mesa, 3.3)". +Remove the leading `dnl' from the line "dnl AM_MAINTAINER_MODE". +For both LIBGL_VERSION and LIBGLU_VERSION (libGL and libGLU version) do: +* If the library source code has changed at all since the last + update, then increment REVISION (`C:R:A' becomes `C:R+1:A'). +* If any interfaces have been added, removed, or changed since the + last update, increment CURRENT, and set REVISION to 0. +* If any interfaces have been added since the last public release, + then increment AGE. +* If any interfaces have been removed since the last public release, + then set AGE to 0. + +Run "fixam -f" to disable automatic dependency tracking. +Run the bootstrap script to generate the configure script. +(Requires autoconf 2.13 and automake 1.4, available from ftp.gnu.org) + +Edit Make-config and change the MESA_MAJOR and/or MESA_MINOR versions. + +Edit Makefile.X11 and verify DIRECTORY is set correctly. The Mesa +sources must be in that directory (or there must be a symbolic link). + +Edit Makefile.X11 and verify that LIB_NAME and DEMO_NAME are correct. +If it's a beta release, be sure the bump up the beta release number. + +cp Makefile.X11 to Makefile so that the old-style Mesa makefiles +still work. ./configure will overwrite it if that's what the user runs. + +Make a symbolic link from $(DIRECTORY) to Mesa. For example, +ln -s Mesa Mesa-3.3 This is needed in order to make a correct +tar file in the next step. + +Make the distribution files. From inside the Mesa directory: + make -f Makefile.X11 lib_tar + make -f Makefile.X11 demo_tar + make -f Makefile.X11 lib_zip + make -f Makefile.X11 demo_zip + +Copy the distribution files to a temporary directory, unpack them, +compile everything, and run some demos to be sure everything works. + +Upload the *.tar.gz and *.zip files to ftp.mesa3d.org + +Update the web site. CJ Beyer (cj@styx.phy.vanderbilt.edu) can +help with this and uploading to the ftp site. + +Make the announcement to mesa-dev@mesa3d.org, mesa@iqm.unicamp.br, +mesa-announce@iqm.unicamp.br and other sites. + + +---------------------------------------------------------------------- +$Id: DEVINFO,v 1.1 2000/11/30 17:31:37 dawes Exp $ diff --git a/xc/extras/Mesa/docs/IAFA-PACKAGE b/xc/extras/Mesa/docs/IAFA-PACKAGE new file mode 100644 index 000000000..3e30cca76 --- /dev/null +++ b/xc/extras/Mesa/docs/IAFA-PACKAGE @@ -0,0 +1,9 @@ +Title: The Mesa 3-D graphics library +Version: 3.4 +Description: A 3-D graphics library which uses the OpenGL API. +Author: Brian Paul brianp@mesa3d.org +Maintained-by: Brian Paul brianp@mesa3d.org +Maintained-at: www.mesa3d.org +Platforms: Almost anything with an ANSI C compiler. +Copying-Policy: Freely Redistributable +Keywords: Mesa, OpenGL, 3-D graphics library diff --git a/xc/extras/Mesa/docs/INSTALL b/xc/extras/Mesa/docs/INSTALL new file mode 100644 index 000000000..e677da012 --- /dev/null +++ b/xc/extras/Mesa/docs/INSTALL @@ -0,0 +1,236 @@ + + Mesa compilation and installation instructions + + +Mesa now uses GNU autoconfig for compilation and installation. +Previous (before version 3.1), traditional Makefiles were used to +compile Mesa. + +You now have the choice of how you want to build Mesa: + + NEW-STYLE: Basically, type "./configure" followed by "make" + This should work on most Unix-like operating systems. + For more details, see the NEW-STYLE section below. + + OLD-STYLE: Simply type "make" and you'll see a list of supported + system configurations. Pick one and type "make <config>" + For more details, see the OLD-STYLE section below. + + + +=============================================================================== +NEW-STYLE Mesa compilation and installation instructions begin here +------------------------------------------------------------------------------- + +0) If you've downloaded Mesa via CVS there will not be a "configure" + script. You'll have to run the "bootstrap" script first. This script + may not work on any OS other than Linux. + +1) Run the configure script + + ./configure [options] + +For Linux, it is recommended that you use: + ./configure --prefix=/usr +So that the headers and libs are located according to the Linux/OpenGL +standard spec at http://oss.sgi.com/projects/ogl-sample/ABI/ + +Possible options are: + +--prefix=DIR + The toplevel directory of the hierachy in which Mesa + will be installed (DIR/include,DIR/lib etc.). + The default is "/usr/local". + +--sysconfdir=DIR + The directory where Mesa configuration files + will be stored. The default is "$prefix/etc". + You may want to overwrite the default with --sysconfdir=/etc. + +--enable-static + Enable building of static libraries. + Static libraries are NOT built by default. + +--disable-shared + Disable building of shared libraries. + Shared libraries are built by default. + +--with-pic +--without-pic + In normal operation, libtool will build shared libraries from + PIC objects and static archives from non-PIC objects, except where one + or the other is not provided by the target host. By specifying + --with-pic you are asking libtool to build static archives from + PIC objects, and similarly by specifying --without-pic you are asking + libtool to build shared libraries from non-PIC objects. + libtool will only honour this flag where it will produce a + working library, otherwise it reverts to the default. + +--enable-debug + Enable debugging messages (disabled by default). + +--enable-profile + Enable profiling (disabled by default). + +--disable-optimize + Disable extra optimizations (enabled by default, + i.e., optimize for maximum performance). + +--enable-warn + Enable extended compiler warnings (disabled by default). + +--enable-x86[=ARG] +--disable-x86 + Enable/disable x86 assembler support to speed up Mesa + (autodetected by default). You may set `on' or `off'. + +--enable-3dnow[=ARG] +--disable-3dnow + Enable/disable 3Dnow support to speed up Mesa + (autodetected by default). You may set `on' or `off'. + +--enable-mmx[=ARG] +--disable-mmx + Enable/disable MMX support to speed up Mesa + (autodetected by default). You may set `on' or `off'. + +--enable-sse[=ARG] +--disable-sse + Enable/disable SSE support to speed up Mesa + (autodetected by default). You may set `on' or `off'. + If you have a PentiumIII and want to use SSE make sure you have the + PIII Linux kernel-patch installed or things will fail! + You can get the patch from http://www.redhat.com/~dledford/linux_kernel.html + +--with-glide[=DIR] +--without-glide + Enable/disable support for Glide (autodetected by default). + DIR is the installation directory of Glide. + If Glide cannot be found, the driver won't be built. + +--with-glut[=DIR] +--without-glut + Don't/use already-installed GLUT (autodetected by default). + DIR is the installation directory of Glut. + If GLUT cannot be found, the version shipped with Mesa will be built. + +--with-ggi[=DIR] +--without-ggi + Enable/disable support for GGI (autodetected by default). + DIR is the installation directory of GGI. + If GGI cannot be found, the driver won't be built. + +--disable-ggi-fbdev + Don't build the GGI fbdev target (autodetected by default). + +--disable-ggi-genkgi + Don't build the GGI generic KGI driver (autodetected by default). + +--disable-ggi-savage4 + Don't build the GGI Savage4 KGI driver (autodetected by default). + +--disable-osmesa + Disable OSmesa (offscreen rendering) support (enabled by default). + +--with-svga[=DIR] +--without-svga + Enable/disable support for SVGALib (autodetected by default). + DIR is the installation directory of SVGALib. + If SVGALib cannot be found, the driver won't be built. + +--x-includes=DIR + Search for the X include files in DIR. + +--x-libraries=DIR + Search for the X library files in DIR. + +User specific compiler options can be set using the shell variable +CFLAGS. For instance, + CFLAGS="-g -O2" ./configure +(on some systems: env CFLAGS="-g -O2" ./configure) +sets the compiler flags to "-g -O2". + +For more options run "./configure --help" and read INSTALL.GNU. + + +2) To build the Mesa libraries run: + + make + +Optionally, you can strip the libraries using + + make strip + +Now make sure that you have the permissions to install Mesa in the +specified directories, for example, by becoming super user ("su") +Then run: + + make install + +Mesa is now installed. +Please don't move the installed files but rerun all installation +steps if you want to use other directories. + + +3) To test whether Mesa works properly you might want to run the Mesa demos: + + make check + +Builds all demos. + + make exec + +Builds and executes all demos. + + + + + + +=============================================================================== +OLD-STYLE Mesa compilation and installation instructions begin here +------------------------------------------------------------------------------- + +To build Mesa on most Unix-like operations systems, start by typing +"make" alone. You'll see a list of supported system configurations. +Choose one, call it <config>, type "make <config>". + +For system-specific information check out these files in the docs/ +directory: + + System README file + ----------------- ------------ + Unix/X11 README.X11 + Windows 95/N% README.WIN32 + DOS README.DOS + Linux/Windows w/ 3Dfx hardware README.3DFX + Linux with GGI README.GGI + Linux with threading README.MITS + Amigas with Amiwin README.AMIWIN + BeOS README.BEOS + LynxOS README.LYNXOS + SciTech MGL README.MGL + IBM OS/2 README.OS2 + Windows w/ S3 Virge hardware README.VIRGE + VMS README.VMS + Allegro DJGPP README.DJA + Direct3D driver README.D3D + + +Header and library files: + After you've compiled Mesa and tried the demos I recommend the following + procedure for "installing" Mesa on Unix systems. This is in compliance + with the Linux/OpenGL standard base specification. + See http://oss.sgi.com/projects/ogl-sample/ABI/ + + Copy the Mesa include/GL directory to /usr/local/include: + cp -r include/GL /usr/include + + Copy the Mesa library files to /usr/local/lib: + cp lib/* /usr/lib + + (actually, use "cp -d" on Linux to preserve symbolic links) + + +=============================================================================== +$Id: INSTALL,v 1.1 2000/11/30 17:31:37 dawes Exp $ diff --git a/xc/extras/Mesa/docs/INSTALL.GNU b/xc/extras/Mesa/docs/INSTALL.GNU new file mode 100644 index 000000000..b42a17ac4 --- /dev/null +++ b/xc/extras/Mesa/docs/INSTALL.GNU @@ -0,0 +1,182 @@ +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/xc/extras/Mesa/docs/MESA_copy_sub_buffer.spec b/xc/extras/Mesa/docs/MESA_copy_sub_buffer.spec new file mode 100644 index 000000000..ad6b00c05 --- /dev/null +++ b/xc/extras/Mesa/docs/MESA_copy_sub_buffer.spec @@ -0,0 +1,88 @@ +Name + + MESA_copy_sub_buffer + +Name Strings + + GLX_MESA_copy_sub_buffer + +Contact + + Brian Paul (brian 'at' mesa3d.org) + +Status + + Shipping since Mesa 2.6 in February, 1998. + +Version + + Last Modified Date: 8 June 2000 + +Number + + 215 + +Dependencies + + OpenGL 1.0 or later is required. + GLX 1.0 or later is required. + +Overview + + The glxCopySubBufferMESA() function copies a rectangular region + of the back color buffer to the front color buffer. This can be + used to quickly repaint 3D windows in response to expose events + when the back color buffer cannot be damaged by other windows. + +IP Status + + Open-source; freely implementable. + +Issues + + None. + +New Procedures and Functions + + void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, + int x, int y, int width, int height ); + +New Tokens + + None. + +Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) + + Add to section 3.3.10 Double Buffering: + + The function + + void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable, + int x, int y, int width, int height ); + + may be used to copy a rectangular region of the back color buffer to + the front color buffer. This can be used to quickly repaint 3D windows + in response to expose events when the back color buffer cannot be + damaged by other windows. + + <x> and <y> indicates the lower-left corner of the region to copy and + <width> and <height> indicate the size in pixels. Coordinate (0,0) + corresponds to the lower-left pixel of the window, like glReadPixels. + +GLX Protocol + + None at this time. The extension is implemented in terms of ordinary + Xlib protocol inside of Mesa. + +Errors + + None. + +New State + + None. + +Revision History + + 8 June 2000 - initial specification + diff --git a/xc/extras/Mesa/docs/MESA_pixmap_colormap.spec b/xc/extras/Mesa/docs/MESA_pixmap_colormap.spec new file mode 100644 index 000000000..56a2c7c82 --- /dev/null +++ b/xc/extras/Mesa/docs/MESA_pixmap_colormap.spec @@ -0,0 +1,90 @@ +Name + + MESA_pixmap_colormap + +Name Strings + + GLX_MESA_pixmap_colormap + +Contact + + Brian Paul (brian 'at' mesa3d.org) + +Status + + Shipping since Mesa 1.2.8 in May, 1996. + +Version + + Last Modified Date: 8 June 2000 + +Number + + 216 + +Dependencies + + OpenGL 1.0 or later is required. + GLX 1.0 or later is required. + +Overview + + Since Mesa allows RGB rendering into drawables with PseudoColor, + StaticColor, GrayScale and StaticGray visuals, Mesa needs a colormap + in order to compute pixel values during rendering. + + The colormap associated with a window can be queried with normal + Xlib functions but there is no colormap associated with pixmaps. + + The glXCreateGLXPixmapMESA function is an alternative to glXCreateGLXPixmap + which allows specification of a colormap. + +IP Status + + Open-source; freely implementable. + +Issues + + None. + +New Procedures and Functions + + GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ); + +New Tokens + + None. + +Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) + + Add to section 3.4.2 Off Screen Rendering + + The Mesa implementation of GLX allows RGB rendering into X windows and + pixmaps of any visual class, not just TrueColor or DirectColor. In order + to compute pixel values from RGB values Mesa requires a colormap. + + The function + + GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ); + + allows one to create a GLXPixmap with a specific colormap. The image + rendered into the pixmap may then be copied to a window (which uses the + same colormap and visual) with the expected results. + +GLX Protocol + + None since this is a client-side extension. + +Errors + + None. + +New State + + None. + +Revision History + + 8 June 2000 - initial specification diff --git a/xc/extras/Mesa/docs/MESA_release_buffers.spec b/xc/extras/Mesa/docs/MESA_release_buffers.spec new file mode 100644 index 000000000..34de0146c --- /dev/null +++ b/xc/extras/Mesa/docs/MESA_release_buffers.spec @@ -0,0 +1,85 @@ +Name + + MESA_release_buffers + +Name Strings + + GLX_MESA_release_buffers + +Contact + + Brian Paul (brian 'at' mesa3d.org) + +Status + + Shipping since Mesa 2.0 in October, 1996. + +Version + + Last Modified Date: 8 June 2000 + +Number + + 217 + +Dependencies + + OpenGL 1.0 or later is required. + GLX 1.0 or later is required. + +Overview + + Mesa's implementation of GLX is entirely implemented on the client side. + Therefore, Mesa cannot immediately detect when an X window or pixmap is + destroyed in order to free any ancilliary data associated with the window + or pixmap. + + The glxMesaReleaseBuffers() function can be used to explicitly indicate + when the back color buffer, depth buffer, stencil buffer, and/or accum- + ulation buffer associated with a drawable can be freed. + +IP Status + + Open-source; freely implementable. + +Issues + + None. + +New Procedures and Functions + + Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); + +New Tokens + + None. + +Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) + + The function + + Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d ); + + causes all software ancilliary buffers (back buffer, depth, stencil, + accum, etc) associated with the named drawable to be immediately + deallocated. True is returned if <d> is a valid Mesa GLX drawable, + else False is returned. After calling glXReleaseBuffersMESA, the + drawable should no longer be used for GL rendering. Results of + attempting to do so are undefined. + + +GLX Protocol + + None, since this is a client-side operation. + +Errors + + None. + +New State + + None. + +Revision History + + 8 June 2000 - initial specification diff --git a/xc/extras/Mesa/docs/MESA_resize_buffers.spec b/xc/extras/Mesa/docs/MESA_resize_buffers.spec new file mode 100644 index 000000000..7a2e1c491 --- /dev/null +++ b/xc/extras/Mesa/docs/MESA_resize_buffers.spec @@ -0,0 +1,82 @@ +Name + + MESA_resize_buffers + +Name Strings + + GL_MESA_resize_buffers + +Contact + + Brian Paul, brianp 'at' mesa3d.org + +Status + + Shipping (since Mesa version 2.2) + +Version + + $Id: MESA_resize_buffers.spec,v 1.1 2000/11/30 17:31:36 dawes Exp $ + +Number + + 196 + +Dependencies + + Mesa 2.2 or later is required. + +Overview + + Mesa is often used as a client library with no integration with + the computer's window system (an X server, for example). And since + Mesa does not have an event loop nor window system callbacks, it + cannot properly respond to window system events. In particular, + Mesa cannot automatically detect when a window has been resized. + + Mesa's glViewport command queries the current window size and updates + its internal data structors accordingly. This normally works fine + since most applications call glViewport in responce to window size + changes. + + In some situations, however, the application may not call glViewport + when a window size changes but would still like Mesa to adjust to + the new window size. This extension exports a new function to solve + this problem. + +New Procedures and Functions + + void glResizeBuffersMESA( void ) + +New Tokens + + none + +Additions to the OpenGL Specification (no particular section) + + The glResizeBuffersMESA command may be called when the client + determines that a window has been resized. Calling + glResizeBuffersMESA causes Mesa to query the current window size + and adjust its internal data structures. This may include + reallocating depth, stencil, alpha and accumulation buffers. + +Additions to the AGL/GLX/WGL Specifications + + None + +Errors + + INVALID_OPERATION is generated if ResizeBuffersMESA is called betweeen + Begin and End. + +New State + + None. + +New Implementation Dependent State + + None. + +Revision History + + * Revision 1.0 - Initial specification diff --git a/xc/extras/Mesa/docs/MESA_set_3dfx_mode.spec b/xc/extras/Mesa/docs/MESA_set_3dfx_mode.spec new file mode 100644 index 000000000..baea030c1 --- /dev/null +++ b/xc/extras/Mesa/docs/MESA_set_3dfx_mode.spec @@ -0,0 +1,85 @@ +Name + + MESA_set_3dfx_mode + +Name Strings + + GLX_MESA_set_3dfx_mode + +Contact + + Brian Paul (brian 'at' mesa3d.org) + +Status + + Shipping since Mesa 2.6 in February, 1998. + +Version + + Last Modified Date: 8 June 2000 + +Number + + 218 + +Dependencies + + OpenGL 1.0 or later is required. + GLX 1.0 or later is required. + +Overview + + The Mesa Glide driver allows full-screen rendering or rendering into + an X window. The glXSet3DfxModeMESA() function allows an application + to switch between full-screen and windowed rendering. + +IP Status + + Open-source; freely implementable. + +Issues + + None. + +New Procedures and Functions + + GLboolean glXSet3DfxModeMESA( GLint mode ); + +New Tokens + + GLX_3DFX_WINDOW_MODE_MESA 0x1 + GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +Additions to Chapter 3 of the GLX 1.3 Specification (Functions and Errors) + + The Mesa Glide device driver allows either rendering in full-screen + mode or rendering into an X window. An application can switch between + full-screen and window rendering with the command: + + GLboolean glXSet3DfxModeMESA( GLint mode ); + + <mode> may either be GLX_3DFX_WINDOW_MODE_MESA to indicate window + rendering or GLX_3DFX_FULLSCREEN_MODE_MESA to indicate full-screen mode. + + GL_TRUE is returned if <mode> is valid and the operation completed + normally. GL_FALSE is returned if <mode> is invalid or if the Glide + driver is not being used. + + Note that only one drawable and context can be created at any given + time with the Mesa Glide driver. + +GLX Protocol + + None since this is a client-side extension. + +Errors + + None. + +New State + + None. + +Revision History + + 8 June 2000 - initial specification diff --git a/xc/extras/Mesa/docs/MESA_window_pos.spec b/xc/extras/Mesa/docs/MESA_window_pos.spec new file mode 100644 index 000000000..b0cc99e1e --- /dev/null +++ b/xc/extras/Mesa/docs/MESA_window_pos.spec @@ -0,0 +1,127 @@ +Name + + MESA_window_pos + +Name Strings + + GL_MESA_window_pos + +Contact + + Brian Paul, brianp 'at' mesa3d.org + +Status + + Shipping (since Mesa version 1.2.8) + +Version + + $Id: MESA_window_pos.spec,v 1.1 2000/11/30 17:31:36 dawes Exp $ + +Number + + 197 + +Dependencies + + OpenGL 1.0 is required. + The extension is written against the OpenGL 1.2 Specification + +Overview + + In order to set the current raster position to a specific window + coordinate with the RasterPos command, the modelview matrix, projection + matrix and viewport must be set very carefully. Furthermore, if the + desired window coordinate is outside of the window's bounds one must + rely on a subtle side-effect of the Bitmap command in order to circumvent + frustum clipping. + + This extension provides a set of functions to directly set the + current raster position, bypassing the modelview matrix, the + projection matrix and the viewport to window mapping. Furthermore, + clip testing is not performed. + + This greatly simplifies the process of setting the current raster + position to a specific window coordinate prior to calling DrawPixels, + CopyPixels or Bitmap. + +New Procedures and Functions + + void WindowPos2dMESA(double x, double y) + void WindowPos2fMESA(float x, float y) + void WindowPos2iMESA(int x, int y) + void WindowPos2sMESA(short x, short y) + void WindowPos2ivMESA(const int *p) + void WindowPos2svMESA(const short *p) + void WindowPos2fvMESA(const float *p) + void WindowPos2dvMESA(const double *p) + void WindowPos3iMESA(int x, int y, int z) + void WindowPos3sMESA(short x, short y, short z) + void WindowPos3fMESA(float x, float y, float z) + void WindowPos3dMESA(double x, double y, double z) + void WindowPos3ivMESA(const int *p) + void WindowPos3svMESA(const short *p) + void WindowPos3fvMESA(const float *p) + void WindowPos3dvMESA(const double *p) + void WindowPos4iMESA(int x, int y, int z, int w) + void WindowPos4sMESA(short x, short y, short z, short w) + void WindowPos4fMESA(float x, float y, float z, float w) + void WindowPos4dMESA(double x, double y, double z, double ) + void WindowPos4ivMESA(const int *p) + void WindowPos4svMESA(const short *p) + void WindowPos4fvMESA(const float *p) + void WindowPos4dvMESA(const double *p) + +New Tokens + + none + +Additions to Chapter 2 of the OpenGL 1.2 Specification (OpenGL Operation) + + - (2.12, p. 41) Insert after third paragraph: + + Alternately, the current raster position may be set by one of the + WindowPosMESA commands: + + void WindowPos{234}{sidf}MESA( T coords ); + void WindowPos{234}{sidf}vMESA( T coords ); + + WindosPos4MESA takes four values indicating x, y, z, and w. + WindowPos3MESA (or WindowPos2MESA) is analaguos, but sets only + x, y, and z with w implicitly set to 1 (or only x and y with z + implicititly set to 0 and w implicitly set to 1). + + WindowPosMESA operates like RasterPos except that the current modelview + matrix, projection matrix and viewport parameters are ignored and the + clip test operation always passes. The current raster position values + are directly set to the parameters passed to WindowPosMESA. The current + color, color index and texture coordinate update the current raster + position's associated data. + +Additions to the AGL/GLX/WGL Specifications + + None + +GLX Protocol + + Not specified at this time. However, a protocol message very similar + to that of RasterPos is expected. + +Errors + + INVALID_OPERATION is generated if WindowPosMESA is called betweeen + Begin and End. + +New State + + None. + +New Implementation Dependent State + + None. + +Revision History + + * Revision 1.0 - Initial specification + * Revision 1.1 - Minor clean-up (7 Jan 2000, Brian Paul) + diff --git a/xc/extras/Mesa/docs/README b/xc/extras/Mesa/docs/README new file mode 100644 index 000000000..19cd3580b --- /dev/null +++ b/xc/extras/Mesa/docs/README @@ -0,0 +1,513 @@ + + Mesa 3.4 + (stable release version) + + Copyright (C) 1995-2000 Brian Paul + + www.mesa3d.org + + +Disclaimer +========== + +Mesa is a 3-D graphics library with an API which is very similar to that +of OpenGL*. To the extent that Mesa utilizes the OpenGL command syntax +or state machine, it is being used with authorization from Silicon Graphics, +Inc. However, the author makes no claim that Mesa is in any way a +compatible replacement for OpenGL or associated with Silicon Graphics, Inc. +Those who want a licensed implementation of OpenGL should contact a licensed +vendor. + +While Mesa is not a licensed OpenGL implementation, it is currently +being tested with the OpenGL conformance tests. For the current +conformance status see the CONFORM file included in the Mesa distribution. + +* OpenGL(R) is a registered trademark of Silicon Graphics, Inc. + + + +Author +====== + +Brian Paul +brian@mesa3d.org + + + +Copyright Information +===================== + +See the docs/COPYRIGHT file. + + + +Introduction +============ + +While Mesa uses the OpenGL API and mimics its semantics, it is +important to understand that Mesa is not a real implementation of OpenGL +since it is not licensed. That said, Mesa is still a viable alternative +to OpenGL. Most OpenGL applications should run with Mesa without code +changes. + +The first six years of Mesa development were done during my spare time +from August 1993 to August 1999. Now, much of the Mesa development +work is done during my working hours with Precision Insight, Inc. + +The core library was originally written on an Amiga using the DCC compiler. +Later, development was moved to an SGI workstation. Current development +is done on PC/Linux systems. + +Mesa works on most Unix workstations with ANSI C and X11. There are also +drivers for Amiga, Microsoft Windows, Macintosh, MS DOS, NeXT, BeOS and +other systems. Unix/X11 is still the best-supported platform. + +Since the OpenGL API is used, OpenGL documentation can serve as the +documentation for Mesa's core functions. Visit http://www.opengl.org/ +for extensive OpenGL information. + +The primary design goal of this library has been correctness. Performance +has been a secondary (but still very important!) priority. At this point, +most common rendering operations have been optimized a great deal. +However, if you find an obscure code path that isn't as fast as you +think it could be (like glDrawPixels with lookup tables and a crazy +blend mode) send a note to the author; it might not be hard to improve +the path. Better yet, try optimizing that path yourself and send a patch. + + + +Getting the software +==================== + +Mesa can be downloaded from +http://sourceforge.net/project/filelist.php?group_id=3 or from +http://www.mesa3d.org/ + +Since version 2.3, Mesa is distributed in two pieces: main library code +and demos. If you're upgrading from a previous version of Mesa or you're not +interested in the demos you can just download the core Mesa archive file. + +Mesa is available in at least three archive formats: + +1. GNU zip/tar + + Download MesaLib-3.4.tar.gz and optionally MesaDemos-3.4.tar.gz + Unpack with: + gzcat MesaLib-3.4.tar.gz | tar xf - + gzcat MesaDemos-3.4.tar.gz | tar xf - + or + gunzip MesaLib-3.4.tar.gz ; tar xf MesaLib-3.4.tar + gunzip MesaDemos-3.4.tar.gz ; tar xf MesaLib-3.4.tar + or + tar zxf MesaLib-3.4.tar.gz + tar zxf MesaDemos-3.4.tar.gz + + If you don't have gzcat try zcat instead. + +2. Unix compressed/tar + + Download MesaLib-3.4.tar.Z and optionally MesaDemos-3.4.tar.Z + Unpack with: + zcat MesaLib-3.4.tar.Z | tar xf - + zcat MesaDemos-3.4.tar.Z | tar xf - + +3. ZIP format + + Download MesaLib-3.4.zip and optionally MesaDemos-3.4.zip + Unpack with: + unzip MesaLib-3.4.zip + unzip MesaDemos-3.4.zip + + +Note, there may be other package formats on the Mesa ftp/web site. + + +After unpacking you'll have these files (and more): + +docs/README - this file +docs/README.* - detailed information for specific OS/hardware systems +docs/COPYRIGHT - copyright info +docs/VERSIONS - version history +docs/RELNOTES - release notes for the new version +docs/CONFORM - results of conformance testing +Makefile.X11 - "old" top-level Makefile for X11-based systems +Make-config - "old" system configurations used by the Makefiles +bin/mklib.* - shell scripts for making shared libraries for some systems +include/ - client include files +lib/ - client libraries, created during installation +src/ - source code for core library +src-glu/ - source code for utility library +util/ - handly utility functions +widgets-mesa/ - Mesa widgets for Xt/Motif +widgets-sgi/ - SGI OpenGL widgets for Xt/Motif + +and if you downloaded and unpacked the demos: + +src-glut/ - source code for GLUT toolkit +demos/ - GLUT demos +xdemos/ - X11 and SVGA demo programs +samples/ - sample OpenGL programs from SGI +book/ - example programs from the OpenGL Programming Guide, + converted to GLUT by Mark Kilgard, from GLUT distribution. +images/ - image files +3Dfx/ - 3Dfx demos and tests +mtdemos/ - multi-threading demos + + + +GLUT +==== + +Mesa 2.5 and later includes Mark Kilgard's GLUT library (GL Utility Toolkit). +GLUT is built automatically on systems which support it. + +The GLUT tests, demos, examples, etc are not included, just the main library. +To obtain the latest complete release of GLUT please visit +http://reality.sgi.com/employees/mjk_asd/glut3/glut3.html + + + +Compiling and Installation +========================== + +See the INSTALL file for instructions. + + + +Using the Library +================= + +Performance tips for software rendering: + 1. Turn off smooth shading when you don't need it (glShadeModel) + 2. Turn off depth buffering when you don't need it. + 3. Turn off dithering when not needed. + 4. Use double buffering as it's often faster than single buffering + 5. Compile in the X Shared Memory extension option if it's supported + on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for + your system in the Make-config file. + 6. Recompile Mesa with more optimization if possible. + 7. Try to maximize the amount of drawing done between glBegin/glEnd pairs. + 8. Use the MESA_BACK_BUFFER variable to find best performance in double + buffered mode. (X users only) + 9. Optimized polygon rasterizers are employed when: + rendering into back buffer which is an XImage + RGB mode, not grayscale, not monochrome + depth buffering is GL_LESS, or disabled + flat or smooth shading + dithered or non-dithered + no other rasterization operations enabled (blending, stencil, etc) + 10. Optimized line drawing is employed when: + rendering into back buffer which is an XImage + RGB mode, not grayscale, not monochrome + depth buffering is GL_LESS or disabled + flat shading + dithered or non-dithered + no other rasterization operations enabled (blending, stencil, etc) + 11. Textured polygons are fastest when: + using a 3-component (RGB), 2-D texture + minification and magnification filters are GL_NEAREST + texture coordinate wrap modes for S and T are GL_REPEAT + GL_DECAL environment mode + glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST ) + depth buffering is GL_LESS or disabled + 12. Lighting is fastest when: + Two-sided lighting is disabled + GL_LIGHT_MODEL_LOCAL_VIEWER is false + GL_COLOR_MATERIAL is disabled + No spot lights are used (all GL_SPOT_CUTOFFs are 180.0) + No local lights are used (all position W's are 0.0) + All material and light coefficients are >= zero + 13. XFree86 users: if you want to use 24-bit color try starting your + X server in 32-bit per pixel mode for better performance. That is, + start your X server with + startx -- -bpp 32 + instead of + startx -- -bpp 24 + 14. Try disabling dithering with the MESA_NO_DITHER environment variable. + If this env var is defined Mesa will disable dithering and the + command glEnable(GL_DITHER) will be ignored. + + +Debugging: + Normally Mesa records but does not notify the user of errors. It is up + to the application to call glGetError to check for errors. Mesa supports + an environment variable, MESA_DEBUG, to help with debugging. If MESA_DEBUG + is defined, a message will be printed to stdout whenever an error occurs. + + More extensive error checking is done when Mesa is compiled with the + DEBUG symbol defined. You'll have to edit the Make-config file and + add -DDEBUG to the CFLAGS line for your system configuration. You may + also want to replace any optimization flags with the -g flag so you can + use your debugger. After you've edited Make-config type 'make clean' + before recompiling. + + In your debugger you can set a breakpoint in gl_error() to trap Mesa + errors. + + There is a display list printing/debugging facility. See the end of + src/dlist.c for details. + + +Fortran bindings: + Fortan bindings are no longer included with Mesa. William F. Mitchell + (william.mitchell@nist.gov) has developed a new set of Mesa/OpenGL and + GLUT bindings for Fortran. See http://math.nist.gov/f90gl for more + information. + + +Off-screen rendering: + Mesa 1.2.4 introduced off-screen rendering, a facility for generating + 3-D imagery without having to open a window on your display. Mesa's + simple off-screen rendering interface is completely operating system + and window system independent so programs which use off-screen rendering + should be very portable. This new feature effectively enables you to + use Mesa as an off-line, batch-oriented renderer. + + The "OSMesa" API provides 3 functions for making off-screen renderings: + OSMesaCreateContext(), OSMesaMakeCurrent(), and OSMesaDestroyContext(). + See the Mesa/include/GL/osmesa.h header for more information. See the + demos/osdemo.c file for an example program. There is no facility for + writing images to files. + + If you want to generate large images (larger than 1280x1024) you'll + have to edit the src/config.h file to change MAX_WIDTH and MAX_HEIGHT + then recompile Mesa. Image size should only be limited by available + memory. + + +Profiling (may no longer work in Mesa 3.1 or later, sorry): + Mesa 1.2.6 introduced a simple profiling facility. It counts and + measures the time spent in a number of important rendering operations + and prints the information in a report before your program exits. + + By default, profiling is disabled. To enable it, add -DPROFILE to + the appropriate CFLAGS entry in the Make-config file, then recompile + Mesa. In general, you should only enable profiling during program + development to gain insight into Mesa's performance. Mesa runs a bit + slower when profiling is enabled because it requires frequent polling + of the system clock. + + The profiling report will be printed when glXDestroyContext is called + _if_ the MESA_PROFILE environment variable is set. You must be sure + glXDestroyContext is called before exiting to get the profile report. + The report will be printed to stdout and includes: + + glBegin/glEnd - number of glBegin/glEnd pairs called, total time, + and rate in pairs/second. + vertexes transformed - number of vertices transformed, lit, clip- + tested, fogged, and mapped to window coordinates, total time, + and rate in vertexes/second. + points rasterized - number of points drawn, time, and rate. + lines rasterized - number of lines drawn, time, and rate. + polygons rasterized - number of polygons drawn, time and rate. + overhead - time between glBegin/glEnd not accounted for by vertexes, + points, lines, and polygons. This is time spent executing + glVertex, glNormal, glColor, etc, clipping, primitive assembly, + and user code between glBegin/glEnd. + glClear - number of glClears executed, total time and clears/second. + SwapBuffers - number of swaps executed, total time and swaps/second. + + Note that the real point, line, and polygon rates should be computed by + adding in the vertex transformation and overhead time factors. + + +Extensions: + Mesa supports quite a few OpenGL extensions. The set of available + extensions depends on the device driver you're using. Run the glinfo + program to learn which extensions are available on your computer. + + There are a few Mesa-specific extensions: + + GL_MESA_window_pos + + This extension adds the glWindowPos*MESA() functions. These functions + are convenient alternatives to glRasterPos*() because they set the + current raster position to a specific window coordinate, bypassing the + usual modelview, projection and viewport transformations. This is + especially useful for setting the position for glDrawPixels() or + glBitmap() to a specific window coordinate. + + See the docs/MESA_window_pos.spec file for details. + + GL_MESA_resize_buffers + + This extension adds the glResizeBuffersMESA() function. When this + function is called, Mesa checks if the color buffer (window) has + been resized. If it has, Mesa reallocates the ancillary (depth, + stencil, accum) buffers. + + Normally, Mesa checks for window size changes whenever glViewport() + is called. In some applications it may not be appropriate to call + glViewport() when the window is resized. Such applications should + call glResizeBuffersMESA() instead so the ancillary buffers are + correctly updated. + + See the docs/MESA_resize_buffers.spec file for more details. + This extension is new in version 2.2. + + +Runtime Configuration File: + See the CONFIG file for information on how to setup a Mesa runtime + config file. + + +Version 2.x features: + Version 2.x of Mesa implements the OpenGL 1.1 API with the following + new features. + + Texture mapping: + glAreTexturesResident + glBindTexture + glCopyTexImage1D + glCopyTexImage2D + glCopyTexSubImage1D + glCopyTexSubImage2D + glDeleteTextures + glGenTextures + glIsTexture + glPrioritizeTextures + glTexSubImage1D + glTexSubImage2D + + Vertex Arrays: + glArrayElement + glColorPointer + glDrawElements + glEdgeFlagPointer + glIndexPointer + glInterleavedArrays + glNormalPointer + glTexCoordPointer + glVertexPointer + + Client state management: + glDisableClientState + glEnableClientState + glPopClientAttrib + glPushClientAttrib + + Misc: + glGetPointer + glIndexub + glIndexubv + glPolygonOffset + + +Version 3.x features: + Version 3.x of Mesa implements the OpenGL 1.2 API with the following + new features: + + BGR, BGRA and packed pixel formats + New texture border clamp mode + glDrawRangeElements() + standard 3-D texturing + advanced MIPMAP control + separate specular color interpolation + + +Summary of environment variables: + MESA_DEBUG - if defined, error messages are printed to stderr + MESA_NO_DITHER - disable dithering, overriding glEnable(GL_DITHER) + MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only) + MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only) + MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only) + MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only) + MESA_GAMMA - gamma correction coefficients (X only) + MESA_PROFILE - enable reporting of performance measurements + MESA_XSYNC - enable synchronous X behavior (for X debugging only) + + + +Mailing List +============ + +Visit the Mesa web site at http://www.mesa3d.org to join the mailing +lists. There is a user's list and developer's list. + + + +Reporting Bugs +============== + +If you think you've found a bug in Mesa: + + 1. Check if there's a new version of Mesa to download. + + 2. Check if the bug has already been reported in the Mesa bug + database at http://www.mesa3d.org + + 3. If you've found a new bug, submit it to the bug database. + Provide as much information as possible! Check back on the + bug report from time to time to monitor its status. + + 4. Please provide small test programs when possible. + + +The following people have made contributions to the Mesa project +and may be able to help with specific problems: + +Area Contact +---------------------- ------------------------------------------- +GLU polygon tessellator Gareth Hugues gareth@precisioninsight +GLU NURBS Bogdan Sikorski bogdan@cira.it +Evaluators Bernd Barsuhn bernd@berlin.muc.de +Xt/Motif widgets Thorsten Ohl ohl@crunch.ikp.physik.th-darmstadt.de + and Jeroen van der Zijp jvz@cyberia.cfdrc.com +Fortran bindings William Mitchell william.mitchell@nist.gov +Amiga driver Stefan Zivkovic d94sz@efd.lth.se +Amiwin driver Victor Ng-Thow-Hing victorng@dgp.toronto.edu +Macintosh driver Miklos Fazekas boga@augusta.elte.hu +NeXT driver Pascal Thibaudeau pthibaud@frbdx11.cribx1.u-bordeaux.fr +OS/2 driver Darren Abbott abbott@hiwaay.net +VMS support Jouk Jansen joukj@crys.chem.uva.nl +Windows 95/NT driver Theodore A. Jump tjump@spgs.com +MS-DOS driver Charlie Wallace cwallace@dreamworks.com +BeOS driver Tinic Uro 5uro@informatik.uni-hamburg.de +GLX encoder/decoder Steven Parker sparker@taz.cs.utah.edu +SciTech MGL driver Kendall Bennett KendallB@scitechsoft.com +Cygnus Win32 support No maintainer. Any volunteers? +S3 Virge driver rkoduri@s3.com or pcgamedev@s3.com +Allegro DJGPP driver Bernhard Tschirren bernie-t@geocities.com +Direct3D driver Leigh McRae leigh@altsoftware.com +GGI driver Jon Taylor jtaylor@creaf.com +Mailing list help Pedro Vazquez vazquez@iqm.unicamp.br + +None of the people on this list are under any obligation to respond to bug +reports. However, they have been pretty helpful so far. + + + +Why is it the library called Mesa? +================================== + +Why not? More obvious names were considered but had to be rejected: +FreeGL (too similar to the trademarked name OpenGL), Free3D (too similar +to DEC's Open3D). Also, I'm tired of acronyms. + + + +Contributors +============ + +Many people have contributed to Mesa. I really appreciate the help! +See the Mesa web site for a list of past and current contributors. + +If you want to help with Mesa, first join the Mesa developer's +mailing list. Then post a message explaining what you might like +to help with. The Mesa web page has a list of a few work items +which you may consider. + +Anyone is welcome to contribute code to the Mesa project, provided you +agree to the copyright terms of the relevant code. See the COPYRIGHT +file. + +If you're contribution code to the Mesa library itself: + 1. Try to write clean code (uniform indentation, comments, meaningful + identifiers, etc). It must be readable and maintainable! + 2. Test your code. On several occations I've incorporated code from + users which later turned out to have bugs. Now, I'm pretty hesitant + to use code which doesn't look good. + + +-------------------------------------------------------------------------- +$Id: README,v 1.1 2000/11/30 17:31:37 dawes Exp $ diff --git a/xc/extras/Mesa/docs/README.3DFX b/xc/extras/Mesa/docs/README.3DFX new file mode 100644 index 000000000..ad7cb7850 --- /dev/null +++ b/xc/extras/Mesa/docs/README.3DFX @@ -0,0 +1,598 @@ + + 3Dfx Glide device driver for Mesa 3.4 + (see below for FAQ) + + + +What do you need ? +------------------ + + - A PC with a 3Dfx Voodoo1/2 Graphics or Voodoo Rush based board + (Pure3D, Monster 3D, R3D, Obsidian, Stingray 128/3D, etc.). + The Quantum3D Obsidian3D-2 X-24 requires some special env. setting + under Linux (more information in the "Useful Glide Environment + Variables"); + + - Mesa 3.1; + + - The 3Dfx Glide library 2.3 or later for your OS (the 2.4 works fine). + The Voodoo2 requires the Glide library 2.51. The Glide 3.1 is not + compatible with the Glide 2.x so it doesn't work with the current + version of the driver; + + - A compiler supported by the Glide library (Micro$oft VC++ (tested), + Watcom (tested), GCC for Linux (tested), etc.); + + - A lot of patience, this is an alpha release. + + - It's nice to have two monitors - one for your normal graphics + card and one for your 3Dfx card. If something goes wrong with + an application using the 3Dfx hardware you can still see your + normal screen in order to recover. + + + +Tested on: +---------- + Windows 95 - David Bucciarelli + Windows NT - Henri Fousse + MS-DOS + Linux - Daryll Strauss, Brian Paul, David Bucciarelli + FreeBSD + BeOS - Duncan Wilcox + MacOS - Fazekas Miklos + + +What is able to do ? +-------------------- + + - It is able accelerate points, lines and polygon with flat + shading, gouraud shading, Z-buffer, texture mapping, blending, fog and + antialiasing (when possible). There is also the support for rendering + in a window with a slow trick for the Voodoo Graphics (available only + for Linux) and at full speed with the Voodoo Rush chipset. + Under Linux is also possible to switch on-the-fly between the fullscreen + and in-window rendering hack. + There is also the support for using more than one Voodoo Graphics in the + some application/PC (you can create one context for each board and use + multiple video outputs for driving monitors, videoprojectors or HMDs). + The driver is able to fallback to pure software rendering when afeature + isn't supported by the Voodoo hardware (however software rendering is + very slow compared to hardware supported rendering) + + + +How to compile: +--------------- + +Linux: +------ + Here are the basic steps for using the 3Dfx hardware with Mesa + on Linux: + + - You'll need the Glide library and headers. Mesa expects: + /usr/local/glide/include/*.h // all the Glide headers + /usr/local/glide/lib/libglide2x.so + + If your Glide libraries and headers are in a different directory + you'll have to modify the Mesa-config and mklib.glide files. + + - Unpack the MesaLib-3.1.tar.gz and MesaDemos-3.1.tar.gz archives; + + - If you're going to use a newer Mesa/Glide driver than v0.27 then + unpack the new driver archive over the Mesa directory. + + - In the Mesa-3.1 directory type "make linux-glide" + + - Compilation _should_ finish without errors; + + - Set your LD_LIBRARY_PATH environment variable so that the + libglide2x.so and Mesa library files can be found. For example: + setenv LD_LIBRARY_PATH "/usr/local/glide/lib:/SOMEDIR/Mesa-3.1/lib" + + - You'll have to run Glide-based programs as root or set the suid + bit on executables; + + - Try a demo: + cd gdemos + su + setenv MESA_GLX_FX f + ./gears (hit ESC to exit) + + - You can find the demos especially designed for the Voodoo driver in + in the Mesa-3.1/3Dfx/demos directory (type "make" in order to compile + everything). + +MacOS: +------ + Check the WEB page at http://valerie.inf.elte.hu/~boga/Mesa.html + +MS Windows: +----------- + + For the MSVC++: + - The glide2x.lib have to be in the default MSVC++ lib directory; + + - The Glide headers have to be in the default MSVC++ include directory; + + - You must have the vcvars32.bat script in your PATH; + + - Go to the directory Mesa-3.1 and run the mesafx.bat; + + - The script will compile everything (Mesa-3.1/lib/OpenGL32.{lib,dll}, + Mesa-3.1/lib/GLU32.{lib,dll}, Mesa-3.1/lib/GLUT32.{lib,dll} and + Voodoo demos); + + - At the end, you will be in the Mesa-3.1/3Dfx/demos directory; + + - Try some demo (fire.exe, teapot.exe, etc.) in order to check if + everything is OK (you can use Alt-Tab or Ctrl-F9 to switch between + the Voodoo screen and the windows desktop); + + - Remember to copy the Mesa OpenGL32.dll, GLU32.dll and GLUT32.dll in the + some directory were you run your Mesa based applications. + + - I think that you can easy change the Makefile.fx files in order + to work with other kind of compilers; + + - To discover how open the 3Dfx screen, read the sources under + the Mesa-3.1/3Dfx/demos directory. You can use the GLUT library or + the Diego Picciani's wgl emulator. + + NOTE: the MSVC++ 5.0 optimizer is really buggy. Also if you install the + SP3, you could have some problem (you can disable optimization in order + solve these kind of problems). + + +Doing more with Mesa & Linux Glide: +----------------------------------- + + The MESA_GLX_FX environment variable can be used to coax most + GLX-based programs into using Glide (and the __GLUT library + is GLX-based__). + + Full-screen 3Dfx rendering: + --------------------------- + + 1. Set the MESA_GLX_FX variable to "fullscreen": + + ksh: + export MESA_GLX_FX = "fullscreen" + csh: + setenv MESA_GLX_FX fullscreen + + 2. As root, run a GLX-based program (any GLUT demo on Linux). + + 3. Be careful: once the 3Dfx screen appears you won't be able + to see the GLUT windows on your X display. This can make using + the mouse tricky! One solution is to hook up your 3Dfx card to + a second monitor. If you can do this then set these env vars + first: + + setenv SST_VGA_PASS 1 + setenv SST_NOSHUTDOWN + + or for the Voodoo2: + + setenv SSTV2_VGA_PASS 1 + setenv SSTV2_NOSHUTDOWN + + Rendering into an X window with the help of the Voodoo hardware: + ---------------------------------------------------------------- + + 1. Start your X server in 16 bpp mode (XFree86: startx -- -bpp 16) + in order to have the best performance and the best visual + quality. However you can use any visual depth supported by X. + + 2. Set the following environment variables: + export MESA_GLX_FX="window" # to enable window rendering + export SST_VGA_PASS=1 # to stop video signal switching + export SST_NOSHUTDOWN=1 # to stop video signal switching + OR + setenv MESA_GLX_FX window + setenv SST_VGA_PASS 1 + setenv SST_NOSHUTDOWN 1 + + (the Voodoo2 requires to use "SSTV2_" instead "SST_"). + + 3. As root, try running a GLX-based program + + How does it work? We use the 3Dfx hardware to do rendering then + copy the image from the 3Dfx frame buffer into an X window when + the SwapBuffers() function is called. The problem with this + idea is it's slow. The image must be copied from the 3Dfx frame + buffer to main memory then copied into the X window (and when the X + visual depth doesn't match the Voodoo framebufffer bit per pixel, it + is required also a pixel format translation). + + NOTE: the in-window rendering feature only works with double-buffering. + + + On the fly switching between in window rendering and full screen rendering + -------------------------------------------------------------------------- + + The Mesa 2.6 has introduced the capability of switching + on-the-fly between the fullscreen/fullspeed rendering and the in-window + hack and vice versa. The on-the-fly switching requires a direct support + by the application but it is really easy to add. You have to start + your X server in 16 bpp mode and to add the following lines to your + application: + + #if defined(FX) && define(XMESA) + #include <GL/xmesa.h> + + static int fullscreen=1; + #endif + + ... + + /* In the GLUT keyboard event callback */ + + #if defined(FX) && !define(WIN32) + case ' ': + fullscreen=(!fullscreen); + XMesaSetFXmode(fullscreen ? XMESA_FX_FULLSCREEN : XMESA_FX_WINDOW); + break; + #endif + ... + + See the 3Dfx/demos/tunnel.c program + for an example. You have to set the -DXMESA flag in the Makefile's COPTS + to enable it. + + Rendering into an X window with the X11 software driver: + -------------------------------------------------------- + + Set the MESA_GLX_FX variable to "disable" your GLX-based program will use + the X11 software driver (the 3Dfx hardware isn't used at all). + + + +Useful Glide Environment Variables: +----------------------------------- + + - To disable the 3Dfx logo, set the FX_GLIDE_NO_SPLASH variable. + + - To disable video signal switching: + setenv SST_VGA_PASS 1 + setenv SST_NOSHUTDOWN + or for the Voodoo2: + setenv SSTV2_VGA_PASS 1 + setenv SSTV2_NOSHUTDOWN + + - To set the default screen refresh rate: + setenv SST_SCREENREFRESH=75 + + the supported values are 60, 70, 72, 75, 80, 85, 90, 100, 120. + + - To force the Mesa library to swap buffers as fast as possible, + without any vertical blanking synchronization (useful for benchmarks): + setenv FX_GLIDE_SWAPINTERVAL 0 + setenv SST_SWAP_EN_WAIT_ON_VIDSYNC 0 + + - You can slight improve the performances of your Voodoo1 board with + the following env. var.: + setenv SST_FASTMEM 1 + setenv SST_PCIRD 1 + setenv SST_GRXCLK 57 + + (don't use this setting with the Quantum3D 100SB or with any other + SLI configuration: it will hang everything !). + The following setting can be used with the Voodoo2: + setenv SSTV2_FASTMEM_RAS_READS=1 + setenv SSTV2_FASTPCIRD=1 + setenv SSTV2_GRXCLK=95 + + - The Quantum3D Obsidian3D-2 X-24 requires some special env. setting + in order to work under Linux: + + export SSTV2_FT_CLKDEL=5 + export SSTV2_TF0_CLKDEL=7 + export SSTV2_TF1_CLKDEL=7 + export SSTV2_TF2_CLKDEL=7 + export SSTV2_SLIM_VIN_CLKDEL=3 + export SSTV2_SLIM_VOUT_CLKDEL=2 + export SSTV2_SLIS_VIN_CLKDEL=3 + export SSTV2_SLIS_VOUT_CLKDEL=2 + + (Thanks to Phil Ross for this trick). + + + + +The Mesa/Voodoo Environment Variables: +-------------------------------------- + + - Only for Windows/Voodoo Rush users, if you define the + env. var. MESA_WGL_FX: + export MESA_WGL_FX=fullscreen + you will get fullscreen rendering; + + - Only for Windows/Voodoo Rush users, if you define the + env. var. MESA_WGL_FX: + export MESA_WGL_FX=window + you will get window rendering (default value); + + - Only for Linux users, you can find more informations about + the env. var. MESA_GLX_FX in the "Doing more with Mesa & Linux Glide" + section; + + - If you define the env. var. MESA_FX_SWAP_PENDING: + export MESA_FX_SWAP_PENDING=4 + you will able to set the maximum number of swapbuffers + commands in the Voodoo FIFO after a swapbuffer (default value: 2); + + - If you define the env. var. MESA_FX_INFO: + export MESA_FX_INFO=1 + you will get some useful statistic. + + - If you define the env. var. MESA_FX_NO_SIGNALS: + export MESA_FX_NO_SIGNALS=1 + Mesa/FX will not install atexit() or signal() handlers. + + + +Know BUGS and Problems: +----------------------- + + - fog doesn't work in the right way when using the glDepthRange() function; + + - Maximum texture size: 256x256 (this is an hardware limit); + + - Texture border aren't yet supported; + + - A GL_BLEND in a glTexEnv() is not supported (it is an hardware limit); + + - Use the glBindTexture extension (standard in OpenGL 1.1) for texture + mapping (the old way: glTexImage inside a display list, download + the texture map each time that you call the display list !!!); + + - Stencil buffer and Accumulation buffer are emulated in software (they are not + directly supported by the Hardware); + + - Color index mode not implemented (this is an hardware limit); + + - Thre is an know bug in the Linux Glide library so the in-window-rendering hack + and any other operations that requires to read the Voodoo frame buffer + (like the accumulation buffer support) doesn't work on Voodoo SLI cards. + + - The driver switch to pure software (_slow_) rendering when: + + - Stencil enabled; + - Using the Accumulation buffer; + - Blend enabled and blend equation != GL_FUNC_ADD_EXT; + - Color logic operation enabled and color logic operation != GL_COPY; + - Using GL_SEPARATE_SPECULAR_COLOR; + - The four values of glColorMask() aren't the some; + - Texture 1D or 3D enabled; + - Texture function is GL_BLEND; + - Using the Multitexture extension with Voodoo cards with only one TMU; + - Using the Multitexture extension with Voodoo cards with more than + one TMU, and texture function isn't GL_MODULATE; + - Point size is != 1.0 or point params vector != (1.0,0.0,0.0); + - Line width != 1.0 or using stipple lines. + - Using polygon offset or stipple polygons; + + NOTE: this is list is not yet complete. + + +Hints and Special Features: +--------------------------- + + - Under Linux and with a Voodoo Graphics board, you can use + XMesaSetFXmode(XMESA_FX_FULLSCREEN or XMESA_FX_WINDOW) in order to + switch on the fly between fullscreen rendering and the in-window-rendering + hack. + + - The driver is able to use all the texture memory available: 2/4MB on + Voodoo1 boards and 8MB (!) on high-end Voodoo1 and Voodoo2 boards. + + - Trilinear filtering is fully supported on Voodoo boards with two TMUs + (high-end Voodoo1 boards and Voodoo2 boards). When only one TMU is + available the driver fallback to bilinear filter also if you ask + for trilinear filtering. + + - The Voodoo driver support multiple Voodoo Graphics boards in the + some PC. Using this feature, you can write applications that use + multiple monitors, videoprojectors or HMDs for the output. See + Mesa-3.1/3Dfx/demos/tunnel2.c for an example of how setup one + context for each board. + + - The v0.19 introduces a new powerful texture memory manager: the + texture memory is used as a cache of the set of all defined texture + maps. You can now define several MBs of texture maps also with a 2MB + of texture memory (the texture memory manager will do automatically + all the swap out/swap in + texture memory work). The new texture memory manager has also + solved a lot of other bugs/no specs compliance/problems + related to the texture memory usage. + + - Use triangles and quads strip: they are a LOT faster than sparse + triangles and quads. + + - The Voodoo driver supports the GL_EXT_paletted_texture. it works + only with GL_COLOR_INDEX8_EXT, GL_RGBA palettes and the alpha value + is ignored because this is a limitation of the the current Glide + version and of the Voodoo hardware. See Mesa-3.1/3Dfx/demos/paltex.c for + a demo of this extension. + + - The Voodoo driver directly supports 3Dfx Global Palette extension. + It was written for GLQuake and I think that it isn't a good idea + to use this extension for any other purpose (it is a trick). See + Mesa-3.1/3Dfx/demos/glbpaltex.c for a demo of this extension. + + - The Voodoo driver chooses the screen resolution according to the + requested window size. If you open a 640x480 window, you will get + a 640x480 screen resolution, if you open a 800x600 window, you + will get a 800x600 screen resolution, etc. + Most GLUT demos support the '-geometry' option, so you can choose + the screen resolution: 'tunnel -geometry 800x600'. + Clearly, you Voodoo board must have enough framebuffer RAM (otherwise + the window creation will fail). + + - The glGetString(GL_RENDERER) returns more information + about the hardware configuration: "Mesa Glide <version> + <Voodoo_Graphics|Voodoo_Rush|UNKNOWN> <num> CARD/<num> FB/ + <num> TM/<num> TMU/<NOSLI|SLI>" + where: <num> CARD is the card used for the current context, + <num> FB is the number of MB for the framebuffer, + <num> TM is the number of MB for the texture memory, + <num> TMU is the number of TMU. You can try to run + Mesa/demos/glinfo in order to have an example of the output. + +Did you find a lot BUGs and problems ? Good, send me an email. + + + +FAQ: +---- + +For a complete FAQ check the Bernd Kreimeier's Linux 3Dfx HOWTO +available at http://www.gamers.org/dEngine/xf3D (it includes also +a lot of informations not strictly related to Linux, so it can be +useful also if you don't use Linux) + +1. What is 3Dfx? + +3Dfx Interactive, Inc. is the company which builds the VooDoo 3-D graphics +chipset (and others) used in popular PC cards such as the Diamond Monster 3D +and the Orchid Righteous 3D (more informations at http://www.3dfx.com). + + +2. What is Glide? + +Glide is a "thin" programming interface for the 3Dfx hardware. It was +originally written for Windows/Intel but has been ported to Linux/Intel +by Daryll Strauss. + +3Dfx, Inc. should be applauded for allowing the Linux version of Glide +to be written. + +You can directly program with the Glide library if you wish. You can +obtain Glide from the "Developer" section of the 3Dfx website: www.3dfx.com +There's a Linux/Glide newsgroup at news://news.3dfx.com/3dfx.glide.linux + + +3. What is fxmesa? + +"fxmesa" is the name of the Mesa device driver for the 3Dfx Glide library. +It was written by David Bucciarelli and others. It works on both Linux +and Windows. Basically, it allows you to write and run OpenGL-style programs +on the 3Dfx hardware. + + +4. What is GLQuake? + +Quake is a very popular game from id software, Inc. See www.idsoftware.com +GLQuake is a version of Quake written for OpenGL. There is now a Linux +version of GLQuake with works with the Mesa/3Dfx/Glide combo. + +Here's what you need to run GLQuake on Linux: + PC with 100MHz Pentium or better + a 3Dfx-based card + Mesa 3.1 libraries: libMesaGL.so libMesaGLU.so + Glide 2.4 libraries: libglide2x.so libtexus.so + GLQuake for Linux. + +Also, the windows version of GLQuake works fine with the Mesa OpenGL32.dll, +you have only to copy the Mesa-3.1/lib/OpenGL32.dll in the GLQuake directory +in order to test 'MesaQuake'. + + +5. What is GLUT? + +GLUT is Mark Kilgard's OpenGL Utility Toolkit. It provides an API for +writing portable OpenGL programs with support for multiple windows, pop- +up menus, event handling, etc. + +Check the Mark's home page for more informations (http://reality.sgi.com/mjk_asd). + +Every OpenGL programmer should check out GLUT. + +GLUT on Linux uses GLX. + + +6. What is GLX? + +GLX is the OpenGL extension to the X Window System. I defines both a +programming API (glX*() functions) and a network protocol. Mesa implements +an emulation of GLX on Linux. A real GLX implementation would requires +hooks into the X server. The 3Dfx hardware can be used with GLX-based +programs via the MESA_GLX_FX environment variable. + + +7. Is the Voodoo driver able to use the 4Mb texture memory of +the Pure3D boards ? + +Yes, the Voodoo driver v0.20 includes the support for Voodoo +Graphics boards with more than 2Mb of texture memory. + + +8. Do the Voodoo driver support the Voodoo Rush under Windows ? + +Yes, Diego Picciani has developed the support for the Voodoo +Rush but David Bucciarelli has a Pure3D and a Monster3D and Brian Paul +has a Monster3D, so the new versions of the Mesa/Voodoo sometime are +not tested with the Voodoo Rush. + + +9. Do the Voodoo driver support the Voodoo Rush under Linux ? + +No because the Linux Glide doesn't (yet) support the Voodoo Rush. + + +10. Can I sell my Mesa/Voodoo based software and include +a binary copy of the Mesa in order to make the software +working out of the box ? + +Yes. + + +11. Which is the best make target for compiling the Mesa for +Linux GLQuake ('make linux-glide', 'make linux-386-glide', etc.) ? + +'make linux-386-opt-glide' for Voodoo1 and 'make linux-386-opt-V2-glide' +for Voodoo2 boards because it doesn't include the '-fPIC' +option (4-5% faster). + + +12. Can I use a Mesa compiled with a 'make linux-386-opt-V2-glide' +for my applications/programs/demos ? + +Yes, there is only one constrain: you can't run two Mesa applications +at the some time. This isn't a big issue with the today Voodoo Graphics. + + +Thanks to: +---------- + +Henri Fousse (he has written several parts of the v0.15 and the old GLUT + emulator for Win); + +Diego Picciani (he has developed all the Voodoo Rush support and the wgl + emulator); + +Daryll Strauss (for the Linux Glide and the first Linux support); + +Brian Paul (of course); + +Dave 'Zoid' Kirsch (for the Linux GLQuake and Linux Quake2test/Q2 ports) + +Bernd Kreimeier (for the Linux 3Dfx HOWTO and for pushing companies to offer + a better Linux support) + +3Dfx and Quantum3D (for actively supporting Linux) + +The most update places where find Mesa VooDoo driver related informations are +the Mesa mailing list and my driver WEB page +(http://www-hmw.caribel.pisa.it/fxmesa/index.shtml) + + +David Bucciarelli (davibu@tin.it) + +Humanware s.r.l. +Via XXIV Maggio 62 +Pisa, Italy +Tel./Fax +39-50-554108 +email: info.hmw@plus.it +www: www-hmw.caribel.pisa.it diff --git a/xc/extras/Mesa/docs/README.AMIWIN b/xc/extras/Mesa/docs/README.AMIWIN new file mode 100644 index 000000000..47cf696cc --- /dev/null +++ b/xc/extras/Mesa/docs/README.AMIWIN @@ -0,0 +1,181 @@ +AMIGA AMIWIN PORT of MESA: THE OPENGL SOFTWARE EMULATION +======================================================== +Port by Victor Ng-Thow-Hing (victorng@dgp.toronto.edu) +Original Author (Brian Paul (brianp@ssec.wisc.edu) + +Dec.1 , 1995: Port of release Mesa 1.2.5 + - Modifications made to minimize changes to Mesa distribution. + +Nov.25, 1995: Port of release Mesa 1.2.4 + + +HISTORY +======= +As a 3D graphics progammer, I was increasingly frustrated to see OpenGL +appearing on so many platforms EXCEPT the Amiga. Up to now, the task +of porting OpenGL directly from native Amiga drawing routines seemed like +a daunting task. However, two important events made this port possible. + +First of all, Brian Paul wrote Mesa, the OpenGL software emulator that +can be found on many platforms - except the Amiga and Atari (who cares +about the latter!). This was pretty ironic considering that Mesa was +originally prototyped on an Amiga! The second great event was when +Holger Kruse developed AmiWin, the X11R6 server for the Amiga (definitely +register for this great piece of software) and released a development kit +so one could compile X programs with SAS/C. + +Since Mesa had X routines as its primitive drawing operations, this made +a marriage of Mesa and Amiwin feasible. I copied over the sources from +an ftp site, played with the code, wrote some Smakefiles, and voila, +I had OpenGL programs displaying on my Amiga. + +Although the speed is nothing to be impressed about, this port can be +potentially useful to those who want to quickly test their code in +wireframe or perhaps learn more about programming with the OpenGL API. + +I hope Amiga developers will continue to write excellent software for +their machine, especially more X clients for Amiwin. If you have any +solutions so some of my problems in the porting notes, please send me +some email! + +See you around, +Vic. + +HOW TO CREATE THE LIBRARIES AND SAMPLE CODE +=========================================== + +Just run the shell script mklib.amiwin in the mesa directory. This will +make all the libraries and copy them into the mesa/lib directory. If you +don't want to compile everything, just go to the desired directory and +type smake in that directory. + +Change any of the variables in the smakefiles as necessary. You will REQUIRE +the Amiwin development kit to compile these libraries since you need X11.LIB +and the shareable X libraries. Some examples require the AmiTCP4.0 +net.lib static link library and related header files for unix related +header files and functions like sleep(). + +HOW TO USE THE MESA LIBRARIES +============================= + +Study the Smakefiles in the demos, samples and book directories for the +proper SAS/C options and linkable libraries to use. Basically aux calls +require Mesaaux.LIB, gl calls require MesaGL.LIB, glu calls MesaGLU.LIB, +tk calls Mesatk.LIB. There is a preliminary port of MesaGLUT.LIB toolkit +available in the lib directory with the other Mesa libraries. However, +it seems to cause crashes on some of the sample code. Someone else may want +to attempt a more stable port. + +PORTING NOTES TO AMIWIN +======================= + +My strategy of porting was to leave as much of the code untouched as +possible. I surrounded any amiga specific changes with +#ifdef AMIWIN ... #endif or #ifndef AMIWIN ... #endif preprocessor +symbols. The code was ported on an Amiga 2000, with Fusion 40 accelerator +and a Picasso II graphics card. The SAS/C 6.56 compiler was used, with +the AmiWin 2.16 X development kit. + +All compilations were done for a 68040 CPU with 68882 math coprocessor for +maximum speed. Please edit the smakefile for other compilers. +I wrote smakefiles for the directories I ported. I omitted the Windows +and Widgets directories. The former is for MS Windows and the latter +requires Motif, which is not easily available for the Amiga. + +Here are the changes I did per directory: + +* mesa +Nov. 25, 1995 v 1.2.4 + - added a mklib.amiwin shell script that will make all the libraries and + sample code for Mesa + - created this readme file: readme.AMIGA + +* mesa/include +Dec. 1, 1995 v 1.2.5 + - added the following to GL/xmesa.h + #ifdef AMIWIN + #include <pragmas/xlib_pragmas.h> + extern struct Library *XLibBase; + #endif +NET CHANGE: xmesa.h + +* mesa/src +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, glx.c + This prevents undefined symbols errors during the linking phase for + X library calls + - created smakefile +Dec. 1, 1995 v 1.2.5 + - removed AMIWIN includes from xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, + glx.c since they are now defined in include/GL/xmesa.h +NET CHANGE: smakefile + +* mesa/src-tk +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + private.h + - created smakefile +Dec. 1, 1995 v 1.2.5 + - removed AMIWIN includes from private.h since it is now defined in + include/GL/xmesa.h +NET CHANGE: smakefile + +* mesa/src-glu +Nov. 25, 1995 v 1.2.4 + - created smakefile +NET CHANGE: smakefile + +* mesa/src-aux +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + glaux.c + - created smakefile +NET CHANGE: glaux.c, smakefile + +* mesa/demos +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + xdemo.c, glxdemo.c, offset.c + - created smakefile + - put #ifndef AMIWIN ... #endif around sleep() calls in xdemo.c since + they are not part of AmigaDOS. +Dec. 1, 1995 v 1.2.5 + - removed AMIWIN defines from xdemo.c, glxdemo.c, offset.c since + already defined in include/GL/xmesa.h + - modified Smakefile to include header and includes from the AmiTCP4.0 + net.lib linkable library to provide unix-compatible sys/time.h and + the sleep() function + - removed AMIWIN defines in xdemo.c since sleep() now defined +NET CHANGE: smakefile + +* mesa/samples +Nov. 25, 1995 v 1.2.4 + - added the necessary pragma calls for X functions to the following: + oglinfo.c + - created smakefile + - put #ifndef AMIWIN ... #endif around sleep() in blendxor.c + - removed olympic from smakefile targets since <sys/time.h> not defined +Dec. 1, 1995 v 1.2.5 + - removed AMIWIN defines from oglinfo.c, since already defined in + include/GL/xmesa.h + - modified Smakefile to include header and includes from the AmiTCP4.0 + net.lib linkable library to provide unix-compatible sys/time.h and + the sleep() function + - removed AMIWIN defines in blendxor.c for sleep() + - added AMIWIN defines around _MACHTEN_ in olympic.c since xrandom() + functions are not defined in any libraries + - added olympic back into the Smakefile targets +NET CHANGE: smakefile, olympic.c + +* mesa/book +Nov. 25, 1995 v 1.2.4 +- created smakefile +- removed accpersp and dof from smakefile targets since the SAS/C compile seems to + confuse the near,far variables with near/far memory models. +NET CHANGE: smakefile + +* mesa/windows +Dec. 1, 1995 v 1.2.5 +- Removed directory to save space since this is only needed for Windows based + machines. diff --git a/xc/extras/Mesa/docs/README.BEOS b/xc/extras/Mesa/docs/README.BEOS new file mode 100644 index 000000000..7b2df8ba8 --- /dev/null +++ b/xc/extras/Mesa/docs/README.BEOS @@ -0,0 +1,102 @@ + + Mesa / BeOS Information + + + +Introduction + +Mesa 3.1 features a new driver for the BeOS. The new driver implements +a clone of the BGLView class. This class, derived from BView, allows +OpenGL rendering into a BeOS window. + +Any application which uses the BGLView should be able to use Mesa +instead of Be's OpenGL without changing any code. + +Since Be's OpenGL implementation (as of R4) is basically just the +SGI sample implementation, it's pretty slow. You'll see that Mesa +is considerably faster. + + + +Source Code + +The source code for the driver is in Mesa-3.1/src/BeOS/GLView.cpp +It's not 100% finished at this time but many GLUT-based demos are +working. No optimizations have been made at this time. + + + +Compiling + +In the Mesa-3.x directory type "make -f Makefile.X11 beos-r4". +When it finishes the libMesaGL.so and libMesaGLU.so libraries for +BeOS will be in the Mesa-3.x/lib/ directory. + + + +Example Programs + +Look in the Mesa-3.x/BeOS/ directory for one or two BGLView demo +programs. They should have been compiled along with the Mesa +library. + + + +GLUT + +A version of GLUT 2.5 for BeOS can be found in src-glut.beos/. +The original distribution can be obtained from +http://home.beoscentral.com/jehamby/Glut-3.5-x86.zip + +This is a special version of GLUT adapted for the BeOS. I don't +believe Mark Kilgard's normal GLUT distribution includes BeOS +support. + +It seems that you have to recompile GLUT with libMesaGL.so instead +of libGL.so in order for everything to work. I'm not sure why. + + + +Special Features + +Mesa's implementation of the BGLView class has an extra member +function: CopySubBufferMESA(). It basically works like SwapBuffers() +but it only copies a sub region from the back buffer to the front +buffer. This is a useful optimization for some applications. +If you use this method in your code be sure that you check at runtime +that you're actually using Mesa (with glGetString) so you don't +cause a fatal error when running with Be's OpenGL. + + + +Work Left To Do + +Color index mode is not implemented yet. + +Reading pixels from the front buffer not implemented yet. + +There is also a BGLScreen class in BeOS for full-screen OpenGL +rendering. This should also be implemented for Mesa. + + + +Old BeOS Driver + +Mesa 2.6 had an earlier BeOS driver. It was based on Mesa's Off-screen +rendering interface, not BGLView. If you're interested in the older +driver you should get Mesa 2.6. + + + +BeOS and Glide + +Mesa 3.0 supported the 3Dfx/Glide library on Beos. Download Mesa 3.0 +if interested. Ideally, the 3Dfx/Glide support should be updated to +work with the new Mesa 3.1 BGLView implementation. + +The Glide library hasn't been updated for BeOS R4, to my knowledge, as +of February, 1999. + + +---------------------------------------------------------------------- +$Id: README.BEOS,v 1.1 2000/11/30 17:31:36 dawes Exp $ diff --git a/xc/extras/Mesa/docs/README.D3D b/xc/extras/Mesa/docs/README.D3D new file mode 100644 index 000000000..b41fcb620 --- /dev/null +++ b/xc/extras/Mesa/docs/README.D3D @@ -0,0 +1,124 @@ + + DirectX 6 Driver for Mesa 3.0 + + +This software is distributed under the terms of the GNU Library +General Public License, see the LICENSE file for details. + + + +What do you need ? +------------------ + + - A PC with a DirectX 6 video driver installed. + + - Mesa 3.0 + + - The 3Dfx Glide library 2.3 or later for your OS (the 2.4 works fine). + The Voodoo2 requires the Glide library 2.51. The Glide 3.0 is not + compatible with the Glide 2.x so it doesn't work with the current + version of the driver; + + - Visual C++ 5.0 is only compiler test but others should be ok with + changes to the makefiles (CFLAGS/LFLAGS). + + - DirectX 6 SDK (was a MS download but not sure if still available). + + - SoftIce or another debugger that will get DPF's is nice. + + +Tested on: +---------- + Windows 95 + Windows 98 + Windows NT 5.0 (beta 2) + + +What is able to do ? +-------------------- + + - the driver will try and use DirectX to rasterize the OpenGL primitives + that are sent to the driver. The driver will fall back to SW if the rendering + context is too big. The fallback to SW still uses DirectDraw. If the driver + fails to support and operation (accum, stencil, etc) then it will try and get + Mesa to render it in SW. DirectX 6 features that are unsupported by the + installed DirectX 6 driver will be mapped to some other best fit feature. + + +How to compile: +--------------- + + These instructions assume you have Visual C++ installed. + + You might need to increase you enviroment space. You can do this by + adding the following statement to you config.sys. + + shell=C:\COMMAND.COM C:\ /p /e:8198 + + Next setup you compiler enviroment by running vcvars32.bat in the Visual C++ + 'bin' directoy. + + c:\DevStudio\VC\bin\vcvars32.bat + + Modify the D3D makefile to point at your SDK install. Example has the SDK + installed on my 'f' drive in the root. + + file: \Mesa-3.0\src\makefile.d3d + + SDKROOT=f:\mssdk + + Now you can simply make the project. If you look in the makefile you can see + I have some different targets like 'install'. + + nmake /f makefile.d3d + + +FAQ: +---- + + 1) I don't think the driver is using my DirectX driver. + + This maybe true as the current version will only select the Primary D3D driver + installed. If you 3D card is the secondary (3dfx) then your out of luck for this + release. + + 2) The driver seems like its not HW accelerated. + + If you have a video card with limited memory then you might want to try and + change your destop resolution to a low setting (640x480x16) so that the 3D part + of the card has more resources. Remeber the driver can't make the card better... + + 3) Nothing works. + + Make sure you have a DirectX '6' driver installed. Check you driver docs for this + info or use the SDK info utilities. + The final 'dll' is named opengl32.dll and is either in the same directory as the + OpenGL program or in your system directory (x:\windows\system or x:\winnt\system32). + Check your destop resolution. Most DirectX 6 drivers will only support 16bit and + 32bit color depth. To find out for sure you can check the DirectX Info Viewer in + the SDK. + + + 4) Rendering doesn't look right. + + Sometimes this is because the card doesn't support a feature that that is required. + This is usually due to unsupported alpha functions (test/blend) or texture mapping. + Some cards suffer from too small of an alpha channel. The driver does its best to + fallback on unsupported features. This is not to say the driver may not have a bug(s). + + 5) Textures look bad. + + No mipmapping in this release. + + +Thanks to: +---------- + +Brian Paul + + + + +Leigh McRae (leigh@altsoftware.com) +February 9, 1999 + diff --git a/xc/extras/Mesa/docs/README.DJA b/xc/extras/Mesa/docs/README.DJA new file mode 100644 index 000000000..a5f7bb8a9 --- /dev/null +++ b/xc/extras/Mesa/docs/README.DJA @@ -0,0 +1,69 @@ +
+INTRODUCTION
+~~~~~~~~~~~~
+This is an Allegro (DJGPP) driver for MESA. This release also includes a
+"skeletal" version of GLUT for DJGPP. It was developed for the sole
+purpose of compiling the sample programs. It NOT AT ALL a complete
+version of GLUT!
+
+ALL CODE IS SUBJECT TO THE MESA COPYRIGHT AGREEMENT.
+
+
+CONTACT INFORMATION
+~~~~~~~~~~~~~~~~~~~
+
+ Name: Bernhard Tschirren
+ Email: bernie-t@geocities.com
+ WWW: http://www.cs.curtin.edu.au/~tschirre/
+ http://www.geocities.com/SiliconValley/7259/
+
+
+REQUIRED FILES
+~~~~~~~~~~~~~~
+ You will need MESA, of course. I have only tested it with version
+ 3.0, but it will probably work with later versions as well. It will
+ NOT work with earlier versions due to major changes to the MESA
+ driver interface.
+ AVAILABLE AT: http://www.ssec.wisc.edu/~brianp/Mesa.html
+
+ You will also need DJGPP and "Allegro 3.0 + WIP". It will NOT work
+ with the release version of Allegro 3.0 because I'm using some new
+ features that weren't present in the first release.
+ AVAILABLE AT: http://www.talula.demon.co.uk/allegro/
+
+
+INSTALLATION
+~~~~~~~~~~~~
+ Unzip into the MESA directory, and type "make -f Makefile.dja" to
+ compile all libraries and samples.
+
+ If you get compiler (or linker) errors, make sure that you have
+ "Allegro 3.0 + WIP" and that DJGPP\INCLUDE has the new allegro.h,
+ and that DJGPP\LIB has the new liballeg.a.
+
+
+BUGS & OTHER SHORTCOMINGS
+~~~~~~~~~~~~~~~~~~~~~~~~~
+ src/allegro/direct.h:
+ Somehow the line demo (samples/line.c) only works in
+ double-buffer mode. The anti-aliased lines appear fat when using
+ direct mode. This is obviously a bug in direct.h - but I cannot
+ find it :(
+
+ src-glut.dja/*:
+ Only the basics work - main loop and keyboard/mouse input.
+ Windows, menus and fonts DO NOT WORK, and will NEVER be
+ implemented (at least not by me). This version of GLUT was only
+ created to allow the MESA sample programs to compile.
+
+ include/GL/glut.h:
+ This file clashes with the REAL glut.h (by Mark J. Kilgard).
+ Unfortunately, you cannot have both installed at the same time.
+ A backup exists (include/GL/glut_h.dja) in case you accidentally
+ copy Mark's glut.h over this one.
+
+
+Good Luck
+
+ Bernie (02/11/1998)
+
diff --git a/xc/extras/Mesa/docs/README.DOS b/xc/extras/Mesa/docs/README.DOS new file mode 100644 index 000000000..5d177045f --- /dev/null +++ b/xc/extras/Mesa/docs/README.DOS @@ -0,0 +1,121 @@ +Mesa 2.2 MSDOS Port Revision 0.9.1
+----------------------------------
+
+I`ve setup an ftp site to get the latest versions of mesa msdos
+its at 206.103.168.10 login mesa password mesa
+rememberr though those are likely to be beta/alpha versions,
+the one you get from brian paul`s homepage is the release version.
+
+I`ll stick dmake.exe (3.80) there too..
+
+Watcom C Build Instructions ----------------------------------------------------
+
+To compile with Watcom C 10.x do in each of
+mesa/src mesa/src-tk mesa/src-aux mesa/src-glu do this
+
+make sure you have a \etc\startup.mk, i`ve supplied mine in
+case you need it, watch you don`t overwrite your own.
+
+dmake -f makefile.dos
+
+Demos can be built with the mesados.bat use, edit the mesados.bat first
+and make any changes for your system !
+
+mesados <demo_name>
+
+eg. mesados wave
+
+will build wave.exe
+
+DJGPP Build Instructions -------------------------------------------------------
+
+To compile the libs, demos, and samples with DJGPP do:
+
+make -f makefile.dj
+
+
+VESA Instructions --------------------------------------------------------------
+
+To use the VESA support you *need* to get hold of Scitechs SuperVGA KIT library
+from http://wwww.scitechsoft.com, also make sure you remove the # from the
+#CFLAGS += UNIVBE in the src/makefile.dos line, I`m more than sure i can`t
+distribute the files required with DOS Mesa. Its a very good library and makes
+VESA intergration very easy.
+
+Currently the DJGPP version has no VESA support. I`m working on it, djgpp
+has some really bad tools, ld is very poor add a.out support back !.
+
+Some of the demos won`t build out of the box as they use near and far as
+variable names, which are reserved words on DOS compilers. Some other
+demos use unix style time() functions which some dos compilers don`t support.
+
+--------------------------------------------------------------------------------
+
+I use dmake because wmake, make and nmake all suck big time, dmake
+is excellent and is unix friendly. I`ll send the .exe to anyone
+who wants it, or make it available at my website..
+
+I use Denis Vadura`s Dmake 3.80PL
+
+If anyone hassles me enough i might rewrite the makefiles for wmake at
+least.
+
+A couple of the demos don`t work yet....
+
+--------------------------------------------------------------------------------
+
+Things I (or some kind soul) need to do..
+
+Change the key handler, i have a keyboard interrupt already made just
+needs integration. (the one in there is really poor and is temporary)
+
+The RGB mode is really a 256 colour mode, it allocates the first 256
+colours used. then tries to map them to others allocated later. Currently
+it isn`t that good, its difficult to make up a palette that will effectively
+work for all situations, its not really effective at the moment.
+
+General improvements.
+
+GLX support.
+
+Does anyone really want mode13 support ? Do i need to fix up the RGB
+mode of 320x200x256 ? email me at cwallace@dreamworks.com and nag me
+or any other wishlist stuff for modes.
+
+Better Glide support, thanks to brian bruning and gary mctaggart
+at 3dfx for the dual board and the support.
+
+Change Scitech SuperVGA KIT to MGL ( thanks to tom and kendall at scitech for
+sending me a copy )
+
+MsVC support.
+
+Figure out a way of guessing the resolution , I`m more than likely
+going to change the way it works, so that it first tries for 3DFX,
+then Vesa, then mode13.
+
+--------------------------------------------------------------------------------
+
+Long Live OpenGL(tm) and kudos to brian paul for Mesa.
+
+--------------------------------------------------------------------------------
+
+Revision History
+
+v0.0 10/30/96 Initial DOS 320x200x256 Using Mesa 1.2.8
+v0.1 11/05/96 Ported to Mesa 2.0
+v0.3 11/12/96 Ported to Mesa 2.1
+v0.4 11/12/96 Started to assemble for release.
+v0.5 11/28/96 Small changes for release.
+v0.6 Sun 12-08-1996 Added VESA support.
+v0.7 Sun 12-08-1996 Cleaned up, should be able to compile without Watcom.
+v0.8 Sun 12-28-1996 Built for DJGPP. ( time traveller )
+v0.9 Thu 01-09-1997 Added 3DFX Glide support.
+v0.9.1 Fri 02-28-1997 Integrated into 2.2.7 beta
+
+Charlie Wallace - Software Scientist, Dreamworks SKG Interactive
+--------------------------------------------------------------------------------
+http://www.geocities.com/~charlie_x cwallace@dreamworks.com
+ charlie_x@geocities.com
+ charlie__x@msn.com
+ charlie@trespasser.com
diff --git a/xc/extras/Mesa/docs/README.GGI b/xc/extras/Mesa/docs/README.GGI new file mode 100644 index 000000000..ddb67725f --- /dev/null +++ b/xc/extras/Mesa/docs/README.GGI @@ -0,0 +1,26 @@ +GGIMesa for LibGGI 2.x + +Requirements: +------------- +LibGGI 2.0 or greater + +Installation: +------------- +To install GGIMesa, follow the instructions in INSTALL.GNU. If you +wish to install GGIGLUT as well, first install GGIMesa and then run + +make +make install (must be root) + +in ggi/ggiglut. + +Notes: +------ + +* Set the environment variables GGIMESA_DEBUG and/or GGIGLUT_DEBUG +to 255 to see lots of debugging output. + +* GGIGLUT contains support for all of the GLUT 3.6 API except for the +high-level primitive drawing functions, but many of the functions (in +particular the menu drawing functions) are just stubs. + diff --git a/xc/extras/Mesa/docs/README.LYNXOS b/xc/extras/Mesa/docs/README.LYNXOS new file mode 100644 index 000000000..e3ab9804b --- /dev/null +++ b/xc/extras/Mesa/docs/README.LYNXOS @@ -0,0 +1,64 @@ + +Mesa 3.0 for LynxOS builds in the following way: + +make lynxos + +This will build all the libraries and demo applications. You should have +around 400 megabytes free for everything since everything is done with +static +libraries. + +Before using this make file however, you should perform the following +actions: +0) cd to the Mesa-3.0 directory +1) Copy the GL directory under the include directory to /usr/include. +2) Copy the files in the lib directory to /lib. +3) Make links so that the Mesa libraries look like ordinary OpenGL +libraries +in /lib. This is important for compatibility with other OpenGL apps. This +is done as follows: + +cd /lib +ln -s libMesaGL.a libGL.a +ln -s libMesaGLU.a libGLU.a + +Mesa 3.0 includes the GLUT (GL Utility Toolkit) by default. +The demo applications are done using this toolkit. + +Mesa makefiles for building their apps could be used as well, but the +following one is much more concise. Note that the order of the X libraries +is important to the linker so that all symbols get resolved correctly. +Changing the order may result in having to list a library twice to make +sure all linkages are made correctly. + +----cut here for Makefile ----- + +FILES = your_app.x + +SPECIAL_INCLUDES = -I/usr/include/GL + +SPECIAL_CFLAGS = -g -ansi -pedantic -funroll-loops -ffast-math -DSHM + +SPECIAL_LIBS = -lglut -lGLU -lGL -lm -L/usr/X11/lib -lXext -lXmu -lXi \ +-lX11 -lbsd -g + +STANDARD_OFILES = $(FILES:.x=.o) + +%.o: %.c + gcc -c $(SPECIAL_CFLAGS) $(SPECIAL_INCLUDES) $< -o $@ + +all: $(STANDARD_OFILES) + gcc -o your_app $(STANDARD_OFILES) $(SPECIAL_LIBS) + + +----cut here for Makefile----- + +I have tested Mesa under LynxOS 3.0 and 3.01. It should build fine under +other +versions as well. Note, however, that LynxOS versions prior to 3.0 are not +binary compatible, so you will have to rebuild from source. + + +Vik Sohal +vik@lynx.com +January 13, 1999 diff --git a/xc/extras/Mesa/docs/README.MINGW32 b/xc/extras/Mesa/docs/README.MINGW32 new file mode 100644 index 000000000..44c55aa02 --- /dev/null +++ b/xc/extras/Mesa/docs/README.MINGW32 @@ -0,0 +1,53 @@ +August 30, 1998 -- Paul Garceau
+Updated January 13, 2000 -- Paul Garceau (pgarceau@teleport.com)
+
+DISCLAIMER: I make this port of the Mesa 3-D Graphics Library as a service
+to the general public. I can, in no way support or make any guarantee that the
+build will work for your system.
+
+ The associated packages and batch files I have included as part of the GCC-2.95.2/Mingw32 extension are provided "As-is" with out any guarantee of support or functionality from this author.
+
+ Feel free to modify or change things as you see fit, just remember that
+I can't support any modifications you might want to make to the files which I
+have included OR the lgpl protected Mesa 3-D Graphics Library.
+
+ I recommend using GCC-2.95.2/Mingw32 which is available at Mumit Khans' ftp site:
+
+ (ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/)
+
+ This build has been tested under WinNT4/SP6. Win9x and WinNT5 remain untested by me. I have not tested any of the demos included with Mesa3d.
+
+ I recommend using the GCC-2.95.2/Mingw32.
+
+ ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/gcc-2.95.2
+
+ Much thanks to the combined efforts of Mumit Khan, Jan-Jaap Vanderhagen
+and Colin Peters for making it possible for the Mingw32 toolchain to exist. Also, thanks go out to Stephane Rehel for the work that was completed on the Cygwin build.
+
+Installing GCC-2.95.2/Mingw32 Build:
+
+ a) Open the file archive (either tar.gz or .zip extensions)
+
+ b) Decide the directory you want to move the archived files to.
+
+ d) Extract the files from the archive.
+
+ e) Edit the mingw32.bat file to accomodate your choice of directory structure.
+
+ %mesaroot%: This is your root directory (Mesa-3.3)
+ %mesasrc%: This is the Mesa-3.3 src directory (Mesa-3.3\src)
+ %mesalib%: This is where the build will put libGL.a and libGLU.a
+
+Running the Build:
+
+ Open your Command Prompt or MS-DOS prompt.
+ Go to your Mesa-3.3 'root' directory
+ At the command line type: mingw32
+
+ That's all there is to it.
+
+ Enjoy!
+
+ Peace,
+
+ Paul G. (pgarceau@teleport.com)
\ No newline at end of file diff --git a/xc/extras/Mesa/docs/README.MITS b/xc/extras/Mesa/docs/README.MITS new file mode 100644 index 000000000..a89176a62 --- /dev/null +++ b/xc/extras/Mesa/docs/README.MITS @@ -0,0 +1,102 @@ + + Mesa 3.0 MITS Information + + +This software is distributed under the terms of the GNU Library +General Public License, see the LICENSE file for details. + + +This document is a preliminary introduction to help you get +started. For more detaile information consult the web page. + +http://10-dencies.zkm.de/~mesa/ + + + +Version 0.1 (Yes it's very alpha code so be warned!) +Contributors: + Emil Briggs (briggs@bucky.physics.ncsu.edu) + David Bucciarelli (tech.hmw@plus.it) + Andreas Schiffler (schiffler@zkm.de) + + + +1. Requirements: + Mesa 3.0. + An SMP capable machine running Linux 2.x + libpthread installed on your machine. + + +2. What does MITS stand for? + MITS stands for Mesa Internal Threading System. By adding + internal threading to Mesa it should be possible to improve + performance of OpenGL applications on SMP machines. + + +3. Do applications have to be recoded to take advantage of MITS? + No. The threading is internal to Mesa and transparent to + applications. + + +4. Will all applications benefit from the current implementation of MITS? + No. This implementation splits the processing of the vertex buffer + over two threads. There is a certain amount of overhead involved + with the thread synchronization and if there is not enough work + to be done the extra overhead outweighs any speedup from using + dual processors. You will not for example see any speedup when + running Quake because it uses GL_POLYGON and there is only one + polygon for each vertex buffer processed. Test results on a + dual 200 Mhz. Pentium Pro system show that one needs around + 100-200 vertices in the vertex buffer before any there is any + appreciable benefit from the threading. + + +5. Are there any parameters that I can tune to try to improve performance. + Yes. You can try to vary the size of the vertex buffer which is + define in VB_MAX located in the file src/vb.h from your top level + Mesa distribution. The number needs to be a multiple of 12 and + the optimum value will probably depend on the capabilities of + your machine and the particular application you are running. + + +6. Are there any ways I can modify the application to improve its + performance with the MITS? + Yes. Try to use as many vertices between each Begin/End pair + as possbile. This will reduce the thread synchronization + overhead. + + +7. What sort of speedups can I expect? + On some benchmarks performance gains of up to 30% have been + observerd. Others may see no gain at all and in a few rare + cases even some degradation. + + +8. What still needs to be done? + Lots of testing and benchmarking. + A portable implementation that works within the Mesa thread API. + Threading of additional areas of Mesa to improve performance + even more. + + + +Installation: + + 1. This assumes that you already have a working Mesa 3.0 installation + from source. + 2. Place the tarball MITS.tar.gz in your top level Mesa directory. + 3. Unzip it and untar it. It will replace the following files in + your Mesa source tree so back them up if you want to save them. + + + README.MITS + Make-config + Makefile + mklib.glide + src/vbxform.c + src/vb.h + + 4. Rebuild Mesa using the command + + make linux-386-glide-mits + diff --git a/xc/extras/Mesa/docs/README.NeXT b/xc/extras/Mesa/docs/README.NeXT new file mode 100644 index 000000000..1ad9a9e5c --- /dev/null +++ b/xc/extras/Mesa/docs/README.NeXT @@ -0,0 +1,6 @@ +The NeXT support has now been incorporated into the OpenStep support. +You can build NeXT libraries simply by typing "make next", though before +linking they will need to be ranlib'd by hand. For more information see +the README.OpenStep file, together with the README files in OpenStep/Old_Demos. + +-Pete French. (pete@ohm.york.ac.uk) 28/5/1998 diff --git a/xc/extras/Mesa/docs/README.OS2 b/xc/extras/Mesa/docs/README.OS2 new file mode 100644 index 000000000..b3374ea23 --- /dev/null +++ b/xc/extras/Mesa/docs/README.OS2 @@ -0,0 +1,96 @@ + README for port of Mesa 3.x to XFree86 on OS/2 (X/2) + (as of 19990514) + + + Contents: + + 1) Binary release + 2) Building from sources + 3) History + 4) Todo + 5) Mesa Home Page + + +1) Binary release + + Though the Mesa sources should build in a quite reasonable time even on + a 585 class machine a binary relase is available (check topic 4) for an URL) + This package includes: + + - lib/MesaGL.dll, MesaGL.a + - lib/MesaGLU.dll, MesaGLU.a + - lib/glut.dll, glut.a + - include/GL/*.h + + Installing this in your XFree86 tree will enable you to build and + run all applications compatible with Mesa (and the current DLL + interface, of course ;-) + As usual the OMF-style libraries can be created using emxomf. + (e.g. "emxomf foo.a" creates the foo.lib omf-style library). + The static libraries are rarely used and you have to rebuild + Mesa to get them. They're a supported target, so you get + them in a straightforward way (see below). + + The testing of these libraries was limited to the supplied + demos/examples and a quite small number of third-party apps. + No warranty ... as usual ... ;-) + + +2) Instructions to build Mesa 3.x for XFree86/OS2 from sources: + + Except the official Mesa source distribution you need: + - a recent version of XFree86 (3.3.x or above) including + the programming libraries + - EMX 0.9c (0.9d might work, never checked) + - GNU make + - REXX (!) + + The creation of the DLLs as well as of the static libraries + (if you want to have them) is handled in "mklib-emx.cmd", + a small REXX script. Perhaps not the best idea, but this + way it fits best in the scheme used to build libraries + on all platforms in Mesa 3.x. + + To actually build the libraries and demos, check mklib-emx.cmd + and modify it as desired. Then type + make os2-x11 + and wait for completion ;-) + + +3) History + + Initially Darren Abbott (abbott@hiwaay.net) ported Mesa versions 2.x + to XFree86 OS/2. This port might still be available from + http://fly.HiWAAY.net/~abbott/xfree86-os2/xfree86.html + + The current port picked up things during the beta test for 3.0. + No major changes in the source were done. The build mechanism under OS/2 + has been made very similar to other platforms (if you treat mklib-emx.cmd + as a "black box"). + Advantage is that X/2 is now a valid target and all files are + integrated in the official source distribution. + Disadvantage is that this port (i.e. the DLLs' interface itself) is + definitly NOT COMPATIBLE to those of version 2.x. + It's uncertain whether this would be at all possible but since there + a _very_ few those apps it's not worth to find out anyway. + Also some libs (MesaTK, MesaAUX) are withdrawn from the Mesa distribution, + and accordingly from the OS/2 port. + +4) Todo + + By now binary compatiblity is ensured by using the function names + as entry points instead of ordinals. This might cost performance and + is subject to change in future. In addition the supplied X86 assembler + source is not used yet. + +5) Mesa Home Page + + You can get the source code and more information about Mesa from + http://www.mesa3d.org/ + + The OS/2 ports should be available from + http://r350.ee.ntu.edu.tw/~hcchu/os2/ports + +-- +Alexander Mai +st002279@hrzpub.tu-darmstadt.de diff --git a/xc/extras/Mesa/docs/README.OpenStep b/xc/extras/Mesa/docs/README.OpenStep new file mode 100644 index 000000000..a566eca67 --- /dev/null +++ b/xc/extras/Mesa/docs/README.OpenStep @@ -0,0 +1,35 @@ +This is a port of the GL and GLU libraries to NeXT/Apple object +orientated systems. As these systems have their own window handling +systems we simply use the offscreen rendering capability of Mesa +to generate bitmaps which may then be displayed by the application +with a View as required. Example pieces of code may be found in the +OpenStep directory. + +Sadly there are now a proliferation of different system that we need to +support compilation for: The original NextStep system, The OpenStep +system, the Rhapsody/Mac OS X system and also the windows implementations +of the latter two systems. This version of the code has been compiled and +tested under the following architectures: + + NextStep 3.3 + OpenStep 4.2 + Rhapsody DR2 + WebObjects for NT 3.5 + WebObjects for NT 4.0 + +All tests were done with Intel processors. Feedback on other systems would, +however, be appreciated ! + +On UNIX systems simply type "make openstep". Under Windows systems +with WebObjects run the "win32-openstep.sh" script from within the Bourne +shell provided with the development environment. In both cases this will +build the libraries and place them into the "lib" directory. Some examples +may be found in the OpenStep directory showing how to use the code in an +actual application (MesaView) as well as some command line demos. + +The CC variable may be specified on the command line for doing such things +as building FFAT libraries or using alternative compilers to the standard 'cc' +e.g. make CC='cc -arch m68k -arch i386' openstep" will build the libraries +with both intel and motorola architectures. + +-Pete French. (pete@ohm.york.ac.uk) 7/6/1999 diff --git a/xc/extras/Mesa/docs/README.QUAKE b/xc/extras/Mesa/docs/README.QUAKE new file mode 100644 index 000000000..cc55ad78e --- /dev/null +++ b/xc/extras/Mesa/docs/README.QUAKE @@ -0,0 +1,208 @@ + + Info on using Mesa 3.0 with Linux Quake I and Quake II + + + +Disclaimer +---------- + +I am _not_ a Quake expert by any means. I pretty much only run it to +test Mesa. There have been a lot of questions about Linux Quake and +Mesa so I'm trying to provide some useful info here. If this file +doesn't help you then you should look elsewhere for help. The Mesa +mailing list or the news://news.3dfx.com/3dfx.linux.glide newsgroup +might be good. + +Again, all the information I have is in this file. Please don't email +me with questions. + +If you have information to contribute to this file please send it to +me at brianp@elastic.avid.com + + + +Linux Quake +----------- + +You can get Linux Quake from http://www.idsoftware.com/ + +Quake I and II for Linux were tested with, and include, Mesa 2.6. You +shouldn't have too many problems if you simply follow the instructions +in the Quake distribution. + + + +RedHat 5.0 Linux problems +------------------------- + +RedHat Linux 5.x uses the GNU C library ("glibc" or "libc6") whereas +previous RedHat and other Linux distributions use "libc5" for its +runtime C library. + +Linux Quake I and II were compiled for libc5. If you compile Mesa +on a RedHat 5.x system the resulting libMesaGL.so file will not work +with Linux Quake because of the different C runtime libraries. +The symptom of this is a segmentation fault soon after starting Quake. + +If you want to use a newer version of Mesa (like 3.x) with Quake on +RedHat 5.x then read on. + +The solution to the C library problem is to force Mesa to use libc5. +libc5 is in /usr/i486-linux-libc5/lib on RedHat 5.x systems. + +Emil Briggs (briggs@tick.physics.ncsu.edu) nicely gave me the following +info: + +> I only know what works on a RedHat 5.0 distribution. RH5 includes +> a full set of libraries for both libc5 and glibc. The loader ld.so +> uses the libc5 libraries in /usr/i486-linux-libc5/lib for programs +> linked against libc5 while it uses the glibc libraries in /lib and +> /usr/lib for programs linked against glibc. +> +> Anyway I changed line 41 of mklib.glide to +> GLIDELIBS="-L/usr/local/glide/lib -lglide2x -L/usr/i486-linux-libc5/lib" +> +> And I started quake2 up with a script like this +> #!/bin/csh +> setenv LD_LIBRARY_PATH /usr/i486-linux-libc5/lib +> setenv MESA_GLX_FX f +> ./quake2 +set vid_ref gl +> kbd_mode -a +> reset + + +I've already patched the mklib.glide file. You'll have to start Quake +with the script shown above though. + + + +********************** + +Daryll Strauss writes: + +Here's my thoughts on the problem. On a RH 5.x system, you can NOT build +a libc5 executable or library. Red Hat just doesn't include the right +stuff to do it. + +Since Quake is a libc5 based application, you are in trouble. You need +libc5 libraries. + +What can you do about it? Well there's a package called gcc5 that does +MOST of the right stuff to compile with libc5. (It brings back older +header files, makes appropriate symbolic links for libraries, and sets +up the compiler to use the correct directories) You can find gcc5 here: +ftp://ecg.mit.edu/pub/linux/gcc5-1.0-1.i386.rpm + +No, this isn't quite enough. There are still a few tricks to getting +Mesa to compile as a libc5 application. First you have to make sure that +every compile uses gcc5 instead of gcc. Second, in some cases the link +line actually lists -L/usr/lib which breaks gcc5 (because it forces you +to use the glibc version of things) + +If you get all the stuff correctly compiled with gcc5 it should work. +I've run Mesa 3.0B6 and its demos in a window with my Rush on a Red Hat +5.1 system. It is a big hassle, but it can be done. I've only made Quake +segfault, but I think that's from my libRush using the wrong libc. + +Yes, mixing libc5 and glibc is a major pain. I've been working to get +all my libraries compiling correctly with this setup. Someone should +make an RPM out of it and feed changes back to Brian once they get it +all working. If no one else has done so by the time I get the rest of my +stuff straightened out, I'll try to do it myself. + + - |Daryll + + + +********************* + +David Bucciarelli (tech.hmw@plus.it) writes: + +I'm using the Mesa-3.0beta7 and the RedHat 5.1 and QuakeII is +working fine for me. I had only to make a small change to the +Mesa-3.0/mklib.glide file, from: + + + GLIDELIBS="-L/usr/local/glide/lib -lglide2x +-L/usr/i486-linux-libc5/lib -lm" + +to: + + GLIDELIBS="-L/usr/i486-linux-libc5/lib -lglide2x" + +and to make two symbolic links: + +[david@localhost Mesa]$ ln -s libMesaGL.so libMesaGL.so.2 +[david@localhost Mesa]$ ln -s libMesaGLU.so libMesaGLU.so.2 + +I'm using the Daryll's Linux glide rpm for the Voodoo2 and glibc (it +includes also the Glide for the libc5). I'm not using the /dev/3Dfx and +running QuakeII as root with the following env. var: + +export +LD_LIBRARY_PATH=/dsk1/home/david/src/gl/Mesa/lib:/usr/i486-linux-libc5/lib + +I think that all problems are related to the glibc, Quake will never +work if you get the following output: + +[david@localhost Mesa]$ ldd lib/libMesaGL.so + libglide2x.so => /usr/lib/libglide2x.so (0x400f8000) + libm.so.6 => /lib/libm.so.6 (0x40244000) + libc.so.6 => /lib/libc.so.6 (0x4025d000) + /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000) + +You must get the following outputs: + +[david@localhost Mesa]# ldd lib/libMesaGL.so + libglide2x.so => /usr/i486-linux-libc5/lib/libglide2x.so +(0x400f3000) + +[root@localhost quake2]# ldd quake2 + libdl.so.1 => /lib/libdl.so.1 (0x40005000) + libm.so.5 => /usr/i486-linux-libc5/lib/libm.so.5 (0x40008000) + libc.so.5 => /usr/i486-linux-libc5/lib/libc.so.5 (0x40010000) + +[root@localhost quake2]# ldd ref_gl.so + libMesaGL.so.2 => +/dsk1/home/david/src/gl/Mesa/lib/libMesaGL.so.2 (0x400eb000) + libglide2x.so => /usr/i486-linux-libc5/lib/libglide2x.so +(0x401d9000) + libX11.so.6 => /usr/i486-linux-libc5/lib/libX11.so.6 +(0x40324000) + libXext.so.6 => /usr/i486-linux-libc5/lib/libXext.so.6 +(0x403b7000) + libvga.so.1 => /usr/i486-linux-libc5/lib/libvga.so.1 +(0x403c1000) + libm.so.5 => /usr/i486-linux-libc5/lib/libm.so.5 (0x403f5000) + libc.so.5 => /usr/i486-linux-libc5/lib/libc.so.5 (0x403fd000) + + +*********************** + +Steve Davies (steve@one47.demon.co.uk) writes: + + +Try using: + + export LD_LIBRARY_PATH=/usr/i486-linux-libc5/lib + ./quake2 +set vid_ref gl + +to start the game... Works for me, but assumes that you have the +compatability libc5 RPMs installed. + + +*************************** + +WWW resources - you may find additional Linux Quake help at these URLs: + + +http://quake.medina.net/howto + +http://webpages.mr.net/bobz + +http://www.linuxgames.com/quake2/ + + + +---------------------------------------------------------------------- +$Id: README.QUAKE,v 1.1 2000/11/30 17:31:36 dawes Exp $ diff --git a/xc/extras/Mesa/docs/README.THREADS b/xc/extras/Mesa/docs/README.THREADS new file mode 100644 index 000000000..fb6e0ff3d --- /dev/null +++ b/xc/extras/Mesa/docs/README.THREADS @@ -0,0 +1,52 @@ + + +Mesa Threads README +------------------- + +Thread safety was introduced in Mesa 2.6 by John Stone and +Christoph Poliwoda. + +It was redesigned in Mesa 3.3 so that thread safety is +supported by default (on systems which support threads, +that is). There is no measurable penalty on single +threaded applications. + +NOTE that the only _driver_ which is thread safe at this time +is the OS/Mesa driver! + + +At present the mthreads code supports three thread APIS: + 1) POSIX threads (aka pthreads). + 2) Solaris / Unix International threads. + 3) Win32 threads (Win 95/NT). + +Support for other thread libraries can be added src/glthread.[ch] + + +In order to guarantee proper operation, it is +necessary for both Mesa and application code to use the same threads API. +So, if your application uses Sun's thread API, then you should build Mesa +using one of the targets for Sun threads. + +The mtdemos directory contains some example programs which use +multiple threads to render to osmesa rendering context(s). + +Linux users should be aware that there exist many different POSIX +threads packages. The best solution is the linuxthreads package +(http://pauillac.inria.fr/~xleroy/linuxthreads/) as this package is the +only one that really supports multiprocessor machines (AFAIK). See +http://pauillac.inria.fr/~xleroy/linuxthreads/README for further +information about the usage of linuxthreads. + +If you are interested in helping with thread safety work in Mesa +join the Mesa developers mailing list and post your proposal. + + +Regards, + John Stone -- j.stone@acm.org johns@cs.umr.edu + Christoph Poliwoda -- poliwoda@volumegraphics.com + + +Version info: + Mesa 2.6 - initial thread support. + Mesa 3.3 - thread support mostly rewritten (Brian Paul) diff --git a/xc/extras/Mesa/docs/README.VMS b/xc/extras/Mesa/docs/README.VMS new file mode 100644 index 000000000..9cb4724eb --- /dev/null +++ b/xc/extras/Mesa/docs/README.VMS @@ -0,0 +1,28 @@ + +VMS support contributed by Jouk Jansen (joukj@hrem.stm.tudelft.nl) + + +The latest version was tested on a VMSAlpha7.2 system using DECC6.0, but +probably also works for other versions. + +At the moment only the libraries LIBMESGL.EXE/LIBMESGL.OLB, +LIBMESAGLU.EXE/LIBMESAGLU.OLB and LIBGLUT.EXE/LIBGLUT.OLB and the demos of the +directory [.DEMOS] can be build. +However, feel free to create the missing "decrip.mms-files" in the other +directories. + + The make files were tested +using the DIGITAL make utility called MMS. There is also a public domain +clone available (MMK) and I think, but it is not tested, that this +utility will give (hardly) any problem. + +To make everything just type MMS (or MMK) in the main directory of +mesagl. For MMS the deafult makefile is called descrip.mms, and +that is what I have called it. I included alse some config files, +all having mms somewhere in the name which all the makefiles need +(just as your unix makefiles). + +On Alpha platforms at default a sharable images for the libraries are created. +To get a static library make it by typing MMS/MACRO=(NOSHARE=1). +On VAX platforms only static libraries can be build. + diff --git a/xc/extras/Mesa/docs/README.WIN32 b/xc/extras/Mesa/docs/README.WIN32 new file mode 100644 index 000000000..65e4fc2b6 --- /dev/null +++ b/xc/extras/Mesa/docs/README.WIN32 @@ -0,0 +1,623 @@ +
+ Mesa/Readme.win32
+
+ Last Updated: Sunday, September 19th, 1999 - tjump@tertius.com
+
+*** What's New
+
+- Updated for Mesa 3.1beta3/CVS. Debug and Release command-line builds of
+ Mesa, fxMesa, GLU, GLUT and all sample programs DLL-based. Manual
+ executions tests with minimum requisite results (aka: things looked like
+ I expected them to).
+
+ What did you expect, complete regression testing maybe?
+
+- NASM build support. Any file in the project coded as a .S file will
+ automatically be recognized and built as a NASM-source assember file.
+
+ To enable building using NASM, set the environment variable NASM to
+ indicate that command to execute to run nasm on a file. If NASM is in
+ your command search path then all this needs be set to is 'nasmw' -
+ otherwise you will need to include the complete drive and directory path.
+
+ NASM may be retrieved here: http://www.web-sites.co.uk/nasm/
+
+- DevStudio projects suspended for compatability reasons: projects modified
+ by DevStudio 6 are not compatible with DevStudio 5.
+
+ These will slowly be rebuilt and put into CVS as I can.
+
+- Build environment change: The Glide SDK is no longer assumed to be in
+ the global INCLUDE/LIB environment vars, it is required that you set the
+ value 'GLIDE2X' as either an environment variable pointing to your Glide
+ SDK install directory or that you configure that as a build option to
+ nmake.exe when building fxmesagl32. Examples:
+
+ nmake /f nmake.mak GLIDE2X=g:\sdk\glide2x fxmesagl32
+
+ <or>
+
+ nmake /f nmake.mak GLIDE2X=g:\sdk\glide2x allfx
+
+ <or>
+
+ nmake /f nmake.mak GLIDE2X=g:\sdk\glide2x progs.3dfx.demos
+
+ The DevStudio workspace files for 3Dfx OpenGL require the definition of
+ GLIDE2SDK as an environment variable pointing to where your copy of the
+ Glide SDK has been installed. Adding this to your AUTOEXEC.BAT would do
+ so (change the directories to match):
+
+ SET GLIDE2SDK=G:\SDK\GLIDE2X
+
+*** Legalese
+
+These build files are provided as-is and are submitted to be included with
+the "Mesa 3-D Graphics Library" package as (currently) maintained by Brian
+Paul. These project build files are 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.
+
+These project files are distributed in the hope that they 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.
+
+*** Maintenance Responsiblity and Technical Support
+
+While these files are now part of the Mesa core distribution please do NOT
+contact Mr. Paul for help with them if you encounter problems as he can't
+help you (currently). I will, however, attempt my straightforward best in
+assisting anyone with using these files on their system. I can NOT
+guarantee instant responses owing to other responsiblities, but I do try
+dang hard to answer any mail w/in 24 hours. I may be contacted at the
+above email address for the forseeable future.
+
+-Ted
+mailto://tjump@tertius.com
+http://www.tertius.com/tjump
+
+*** General Information
+
+These build files facilitate convenient building of many variants of Mesa,
+both as static link libraries (including mesaglu) and as dynamic link
+libraries that in some cases may be used as "drop-in" replacements for
+OpenGL32.DLL on both Windows95 and Windows NT.
+
+The construction of the Win32 command-line build files and projects has
+been something of a pet project of mine, and is based upon my own
+"standard" Win32 build environment as supplied by the "nmake.mif" file.
+They have been tested under Windows95 OSR2, Windows NT 4.0SP3, and Windows
+NT 5.0 beta 1. The libraries that they generated have been tested (via the
+demo programs) in a *limited* fashion on the above three systems, including
+the 3Dfx versions.
+
+The reason I went with command-line build environment instead of the more
+convenient IDE-based project files is for two reasons: 1. These appear to
+have some amount of portability between versions (the nmake syntax hasn't
+changed much since Microsoft C 7.0) while the IDE project files seem to
+change drastically each version. and 2. These are readable with any ascii
+editor and such are better self-documentation of the file relationships for
+more people such that it will facilitate supporting other Win32 compilers.
+
+While these files only deal with building for x86 targeted code it *should*
+be possible to add the necessary logic to them to build for the other MSVC
+supported CPU targets, I simply have no hardware to test them on nor the
+alternative compilers to build with.
+
+*** Prerequisites for use
+
+1. You must have a 32-bit Microsoft compiler installed. I have tested
+this with Visual C 5.0 (SP3) and Visual C 4.2, but with minor
+(possibly no) modification to the nmake.mak and nmake.mif files this
+sequence should work on Visual C 2.0 also. The workspace files
+(mesalib.dsw and mesademos-*.dsw) and their included project files
+(*.dsp) are specific to the DevStudio IDE - I have made no attempt at
+building a VC4 IDE project set as I do not use that any more. Note
+that the VC workspace files NO LONGER use NORE are dependant upon the
+nmake.mak and nmake.mif files for construction of definition (*.DEF)
+and resource (*.RC) files.
+
+*** Visual C 4.x Users Warning ****
+
+Note that early editions of VC4 do NOT have header files current enough
+for use building this code base. If you are using VC4 you will either need
+to get an update to version 4.2 *or* you may download the Platform SDK
+directly from Microsoft's web site (www.microsoft.com) and update your
+build environment that way.
+
+*** Visual C 4.x Users Warning ****
+
+2. You must have the PATH, INCLUDE, and LIB environment variables set
+properly. With VC5 you can easily get this by executing the VCVARS32.BAT
+file that was created for you upon installation. It is found in the
+DevStudio\VC\BIN directory, wherever you installed DevStudio. VC4 provides
+a similar batch file in it's BIN directory also.
+
+3. (optional) If you're going to build for 3Dfx/Voodoo you will need to
+have previously installed the Glide SDK version 2.3 or later, if I
+recall. This may be retrieved from www.3dfx.com for no money and some
+download time. ;-) These build files assume that you have the Glide SDK
+added to the respective environment variables (LIB and INCLUDE).
+
+4. (optional) If you're going to build for S3/Virge you will need the S3
+Developers Toolkit which may be downloaded from www.s3.com for the price of
+registering on-line and some time. NOTE: I can build the s3mesa.dll file to
+completion, however the compilation of s3mesa.c currently generates a large
+amount of compiler warnings and between that and the fact that I can not at
+all test it I can make no claims to it's ability to execute. Again, like
+the 3Dfx version before this, these build files assume you have the S3Dtk H
+and LIB files in the path of their respective environment variables.
+Note 2: As of Mesa3.0beta6 I have build files, both command-line and IDE,
+which should be able to build the s3mesa code base if it weren't for updates
+being required in the S3 DD code support (Mesa-3.0/src/s3 directory).
+
+I advise putting any include and lib files for secondary toolkits (Glide,
+S3Tk, whatever) in their respective environment variables *before* the
+Microsoft-assigned default values.
+
+*** FAQ: Frequenty Asked Questions and Other Important Information ***
+
+- When running the 3Dfx demos under Windows NT, they crash on exit, what's
+ up?
+
+ This is apparently a problem in Glide itself. The workaround is to go to
+ your C:\WINNT\SYSTEM32 directory and rename the file FXOEM2X.DLL to
+ FXOEM2X.DL_ to prevent Glide from loading and initializing it upon
+ startup. This is known to be an issue with cards that do not have "TV
+ out" and is known to cause crashes on Diamond Monster II 8M and 3Dfx
+ Reference boards, all using 3Dfx Reference Drivers version 2.53. Other
+ hardware/driver combinations will also likely exhibit this behavior.
+
+- I'm having a problem building Mesa for static library linking.
+
+ This was caused by some incomplete testing on my part, and a fix is now
+ available in the form of an add-on to the base Mesa 3.0 release. The
+ file to get is:
+
+ via FTP download from: iris.ssec.wisc.edu
+ you want to go here: /pub/Mesa/patches_to_3.0/
+ you want to get file: Mesa-3.0-w32-static-fixes.tar.gz
+
+ This required a minor addition to INCLUDE/GL for a clean solution, the
+ file "include/gl/mesa_wgl.h" is automatically included by
+ "include/gl/gl.h" when a Win32 non-DLL build is in progress to provide
+ prototypes for the various wgl functions.
+
+ The only remaining hitch in this setup is that the 3Dfx build is not yet
+ running as a static build, because of problems with conflicts in
+ existance of the various GDI functions like ChoosePixelFormat,
+ etc. *sigh*
+
+ Anyway, the "allstatic" target now works as expected and builds all
+ book/sample/demos programs to boot. ;^)
+
+- How do I get fxMesa to render in a window on the desktop instead of only
+ full-screen?
+
+ Use the Microsoft Windows fxMesa-in-a-window hack!
+
+ Seriously, if you want fxMesaGL to render using the 3Dfx Voodoo1 or
+ Voodoo2 hardware into a window on the desktop then all you need to do is
+ set the MESA_WGL_FX environment variable to anything other than
+ "fullscreen" and it will render into a window. If you wish to go
+ fullscreen then you only need to NOT have the environment variable, or
+ have it set to "fullscreen". You may also switch at runtime between
+ fullscreen-mode and windowed by pressing ALT-ENTER on the keyboard
+ (unless the application using Mesa does something with those keystrokes,
+ of course).
+
+ As of 8/13/98 this should be running a LOT better for more people as a
+ low-compatability item was cleaned up which prevented it from working on
+ many (most?) display drivers under Windows 9x.
+
+- I have my 3Dfx card hooked to it's own monitor and I want the output to
+ stay on even if I switch to another program, is this possible?
+
+ If the Glide environment variable SST_DUALHEAD is set to '1' then fxMesa
+ will never disable the Voodoo output on a Voodoo1 or Voodoo2 display
+ regardless of whether the fxMesa application is "current" or not. This
+ works regardless of whether it's rendering using the window hack
+ mentioned above or not.
+
+- I want to run the Mesa demos on my Intel740 card using it's own OpenGL
+ acceleration, how do I do this?
+
+ Build GLUT standalone for use with system OpenGL and GLU drivers!
+
+ The Command-line project supports building all test/demo programs against
+ these drivers also! This allows you full use of GLUT on Windows using
+ hardware accelerated OpenGL. Wheee! This includes the "3dfx/demos"
+ directory of which only two programs will not run on "standard"
+ opengl. Note that there are a few of the sample programs which will NOT
+ work without Mesa as they directly call into Mesa instead of using the
+ extension mechanism.
+
+*** Included programs that exhibit unfortunate or bad behavior
+
+- demos/bounce - doesn't run on high-colors screens? It's requesting an
+ INDEX display from GLUT and that fails on my true-color desktop. Changing
+ this to _RGB let's the program work, but it doesn't display
+ properly. This is probably just an idiosyncracy of my machine though, as
+ if I test the program using GLUT for System OpenGL on my Intel740 OpenGL
+ accelerated machine it's just hunky-dory.
+
+- demos/glutfx - runs, but crashes on exit (but not on my Intel740 machine)
+
+- demos/texobj - runs, but crashes on exit if ESC is pressed. Exits cleanly
+ if the Close box on the window frame is pressed with the mouse. Go figure.
+
+- book/aaindex - doesn't run, can't get pixel format, because it wants an
+ INDEX display maybe (but is okay on my Intel740 machine)?
+
+- most of the book/* demos don't respond to ESC being pressed.
+
+- 3dfx/demos/* - all demos run, however they all crash on exit. I've traced
+ this so far as to determine the call it's happening with. The crash comes
+ from within Glide during the processing of the grGlideShutdown() call, as
+ in invalid memory reference exception. I'm wondering if this is because
+ of some state or processing not being completed before the call. Dunno,
+ but putting grSstIdle() in just before grGlideShutdown() does NOT fix the
+ problem.
+
+- 3dfx/demos/tunnel2 - does not run on my system even with SLI mode
+ disabled. Hmmmm, maybe I need to disconnect my Voodoo2 cards?
+
+*** Important Notes and Changing Default values
+
+- The optimizer settings have been manually reworked in both command line
+ and DevStudio IDE files to hopefully prevent possible irrational code on
+ the part of the code generator. Formerly, it was configured for "/Ox",
+ now it is configured for safer handling at a slight potential performance
+ cost. This may not be required for Visual Studio 6 but I can't test that
+ (yet).
+
+- These files build with the code targeted for Pentium processors and
+ 8-byte structure padding.
+
+- The IDE-built programs seem to be "happier" in that the command line
+ build of the 3Dfx demo "fire" will grenade on exit (?). Otherwise pretty
+ much everything may be built with either interface.
+
+- The currently configured Mesa version is 3.1, and MesaDemos version is
+ the same. To change this permanently you will need to edit NMAKE.MAK and
+ change the lines that look like this (they start o/a line 116):
+
+ # Currently, Mesa is at rev 3.1 ...
+ #
+ !IF "$(MESAVER)" == ""
+ MESAVER=3.1
+ !ENDIF
+
+ # used in building all of the resource files for the Mesa DLLs
+ #
+ !IF "$(MESAFILEVER)" == ""
+ MESAFILEVER=3,1,0,0
+ !ENDIF
+
+- Currently the build files are configured to be used from a Win32
+ directory that is included inside the main Mesa-3.1 heirarchy.
+
+- The build files are smart enough to find the files for the core lib, glu,
+ glut, and the various demo programs if they are unpacked in the current
+ Mesa-3.1 heirarchy, like this:
+
+ \Mesa-3.1
+ \Mesa-3.1\src
+ \Mesa-3.1\src-glu
+ \Mesa-3.1\src-glut
+ \Mesa-3.1\Win32
+ \Mesa-3.1\samples
+ \Mesa-3.1\demos
+ \Mesa-3.1\book
+ \Mesa-3.1\3Dfx\demos
+
+ ... should work. This arose because my initial build tests for the
+ demo files were done before MesaDemos 2.6 had been released.
+
+- With the exception of the static link libraries generated by this file
+ set (mesagl.lib, mesaglu.lib, mesaglut.lib) all DLLs and executables are
+ built against the "Multithreaded DLL" runtime - this means that they
+ require MSVCRT.DLL or MSVCRTD.DLL in the path to execute.
+
+ ** CHANGED 8/11/98 ***
+
+ Note also that the demos are all built aginst the "OpenGL32, GLU32, and
+ GLUT32" and as such they are fairly agnostic wrt: building against Mesa
+ for CPU-rendering, Mesa-for-3Dfx, Mesa-for-S3, or System OpenGL.
+
+ If you want to build them for use on your system and your display card
+ provides full OpenGL acceleration (Permedia, Intel740, Intergraph,
+ whatever) then you only need to build GLUT prior to building any of the
+ demo programs. For convenience, the GLUT project is included in each of
+ the demo projects Workspace files for the DevStudio IDE builds BUT it is
+ not automatically built - you still need to build it first manually.
+
+ Note that if you have GLUT already installed on your system (gl/glut.h in
+ yoru INCLUDE path, glut32.lib/glut32d.lib in your LIB path, and the DLL
+ in your PATH) then you do NOT need to build GLUT prior to the test
+ programs.
+
+- The 3Dfx build of Mesa has primarily been tested with Quake 2 and it runs
+ (mostly) fine on my PC (take that for what you want it)...
+
+ ** CHANGED 8/11/98 ***
+
+ There is still something going on that causes Glide to crash on shutdown,
+ when I run fxMesa under Windows NT, however it does not appear to occur
+ under Windows 9x on either Voodoo1 or Voodoo2 cards. *sigh*
+
+- I can not test the S3 build as I have no machines available with Virge
+ based display cards.
+
+- The multithreaded test code is *not* built as it requires pthreads and I
+ have as of yet spent not time trying to get that running. The latest word
+ that I saw WRT threading support on win32 was that they are intending to
+ support it natively within Win32 - so I'm waiting it out until they get
+ it done.
+
+- Similarly, the 'xdemos' are not currently built because I haven't gotten
+ around to building the client libs for native win32 and getting it all
+ setup for use.
+
+*** Output Files
+
+All final output files (DLL/LIB) are placed in the Mesa-3.1/lib directory,
+with the exception of the fxMesaGL32 build which is placed in
+Mesa-3./lib/FX and the executable images which are placed in their source
+directories.
+
+To be able to execute the various test programs, you will need to copy the
+requisite DLL files into the same directory as the EXE files. Note that
+most of the 3Dfx/demos/* programs WILL run with the non-FX build of Mesa -
+just very slowly. The two programs which are hard-linked with the FX build
+and will not run without it are "glbpaltx" which uses "gl3DfxSetPaletteEXT"
+directly instead of via the extensions mechanism and "tunnel2" which uses
+"fxMesaSelectCurrentBoard" API for selecting between multiple 3Dfx cards
+installed in one system. Likewise, "paltex" directly uses the
+"glColorTableEXT" extension and thus may not run on anything except
+Mesa. If these applications used the proper extension mechanism they could
+then be used on more than "just" fxMesa to good effect (for example, the
+rest of the "3Dfx/demos" run just peachy on the Intel740 card in my test
+machine) under WinNT.
+
+Because I'm anal about my computer and it's organization, and I like to
+prevent collision between builds, each of the subprojects has their own
+intermediate file directory inside .\win32\release (for example, when
+building mesagl.lib all of it's intermediate files will be found in
+.\win32\release\lib.mesagl). This makes it very easy to cleanup as you
+only need to remove .\win32\release.
+
+*** Okay, Enough, how do I build with this stuff already Ted!
+
+Okay, no major calamity here. The basic way to use the project file is to
+call it via NMAKE from the command line. The format is:
+
+ nmake[.exe] /f nmake.mak [options] [target]
+
+The most likely [options] values you will use may be any combination of the
+following:
+
+ DEBUG=1 or DEBUG=0
+ USE_CRTDLL=1 or USE_CRTDLL=0
+
+ Note that all three of these options are OFF by default.
+
+The [target] includes but is not limited to the following (for full details
+please peruse the NMAKE.MAK and NMAKE.MIF files - but be warned that
+NMAKE.MIF is rather large and sometimes hard to follow):
+
+ --- convenience targets ---
+
+ all - builds everything
+ libfiles - builds all linking library files
+ progs - builds all executable images
+
+ --- library files, static and dynamic ---
+
+ mesagl - static lib build of Mesa core.
+ mesaglu - static lib build of MesaGLU core.
+ mesaglut - static lib build of Mesa GLUT core.
+
+ mesagl32 - dynamic lib build of Mesa core.
+
+ mesaglu32 - dynamic lib build of GLU core, generates
+ GLU32.DLL and/or GLU32d.DLL.
+
+ mesaglut32 - dynamic lib build of GLUT core, generates
+ GLUT32.DLL and/or GLUT32d.dll.
+
+ --- hardware accelerated mesa builds ---
+
+ fxmesagl32 - builds Mesa for use on top of the 3Dfx
+ Glide runtime libs
+
+ s3mesagl32 - builds mesa for use on top of the S3
+ 'S3Tk' runtime libs.
+
+ --- executable images ---
+
+ progs.book - builds all programs in \book directory
+ progs.demos - builds all programs in \demos directory
+ progs.samples - builds all programs in \samples directory
+
+ These targets generate all of the programs in their respective
+ directories and link the executables against OpenGL32.DLL,
+ GLU32.DLL, and GLUT32.DLL (or their debug equivalents).
+
+ progs.3dfx.demos - builds all programs in \3dfx\demos directory
+
+ This target generates the 3Dfx/Demo executables, linking them
+ against GLUT32.DLL, GLU32.DLL, OPENGL32.DLL and are thus NOT
+ hard-bound to using Mesa per-se as you can simply NOT build the
+ Mesa core and GLU libraries.
+
+ --- Microsoft/SGI OpenGL-based GLUT and Demo program builds ----
+
+ *** IMPORTANT SAFETY TIP: If you're going to build these variants of
+ GLUT then DO NOT build any other target libraries in this package
+ first, OR from the command line run the "nmake /f nmake.mak clean"
+ command first! This is because generation of the GLUT for SGI
+ OpenGL target libraries conflicts in naming with the static build
+ libraries of Mesa and it's supporting GLUT build.
+
+ Currently, you may build GLUT as either GLUT32.DLL or GLUT.DLL for
+ use running against either Microsoft or SGI OpenGL for Window,
+ respectively. This allows for the general use of GLUT 3.7 on Windows
+ systems with fully compliant OpenGL.
+
+ You can build the GLUT DLL files either with the command line by
+ issuing either of these commands:
+
+ nmake /f nmake.mak glut.sysgl
+
+ <or>
+
+ nmake /f nmake.mak glut.sgigl
+
+ OR by using the DevStudio MesaLib Worksapce build the GLUT_SGIGL or
+ GLUT_SYSGL projects within the DevStudio IDE.
+
+ Unfortunately, the only way to build the test programs against this
+ build of GLUT is via the command line, and I will NOT be making
+ duplicate demo program projects for the IDE as it's just not worth it,
+ sorry.
+
+ To build the test programs against either MS or SGI OpenGL, you do so
+ via either of these two commands:
+
+ nmake /f nmake.mak progs.sysgl
+
+ <or>
+
+ nmake /f nmake.mak progs.sgigl
+
+ To use the GLUT-for-system-OpenGL in your own programs, you need to do
+ three things by way of preparation, after building GLUT of course:
+
+ 1. Copy include\gl\glut.h to somewhere in your %INCLUDE% path, one
+ likely candidate location would be in your
+ "DevStudio\VC\INCLUDE\GL" directory.
+
+ 2. Copy the linking libraries to somewhere in your %LIB% path, one
+ likely candidate location would be in your "DevStudio\VC\LIB"
+ directory. The linking libraries you need to copy are as
+ follows:
+
+ .\Release\GLUT32.LIB
+ .\Release\GLUT.LIB
+ .\Debug\GLUT32.LIB
+ .\Debug\GLUT.LIB
+
+ 3. Copy the runtime libraries to somewhere in your %PATH%, one
+ likely candidate location would be in WINDOWS\SYSTEM. the files
+ that you should copy are as follows:
+
+ .\Release\GLUT32.DLL
+ .\Release\GLUT32.PDB
+ .\Release\GLUT.DLL
+ .\Release\GLUT.PDB
+ .\Debug\GLUT32d.DLL
+ .\Debug\GLUT32d.PDB
+ .\Debug\GLUTd.DLL
+ .\Debug\GLUTd.PDB
+
+Some examples are in order ...
+
+ ... build all dynamic-link libs using MSVCRT.DLL for C runtime:
+
+ nmake /f nmake.mak USE_CRTDLL=1 alldynamic
+
+ ... To build all library variants and all test and demonstration
+ programs with the default settings you do this:
+
+ nmake /f nmake.mak all
+
+ ... to build all static link libs and nothing else you do this:
+
+ nmake /f nmake.mak allstatic
+
+ ... to build all non-accelerated dynamic link libs you do this:
+
+ nmake /f nmake.mak alldynamic
+
+ ... to build all 3Dfx targeted dynamic link libs you do this:
+
+ nmake /f nmake.mak allaccel
+
+ ... to build all S3 Virge targetd dynamic link libs you do this:
+
+ nmake /f nmake.mak alls3
+
+ ... to build all libraries, static and dynamic, in all versions
+ you do this:
+
+ nmake /f nmake.mak libfiles
+
+ ... to subsequently build all demo and test programs you do this:
+
+ nmake /f nmake.mak progs
+
+ ... to cleanup all intermediate files you do this:
+
+ nmake /f clean
+
+You get the picture. (I hope) ;^) You may also specify specify
+single targets in a convenient fashion. The rule is simple, any of the
+above named lib files, static or dynamic, may be built by providing it's
+name on the command line as the target. Examples:
+
+ ... to build only Mesa as OpenGL32.DLL ...
+
+ nmake /f nmake.mak opengl32
+
+ ... to build only Mesa on top of the 3Dfx Glide API ...
+
+ nmake /f nmake.mak fxMesaGL32
+ <or>
+ nmake /f nmake.mak fxMesaGL
+
+ ... to build only Mesa on top of the S3 Toolkit ...
+
+ nmake /f nmake.mak s3MesaGL32
+ <or>
+ nmake /f nmake.mak s3mesaGL
+
+*** Revision history for ./win32 project files
+
+1/18/98 - initial cut submitted and included with core mesa
+2/5/98 - fixed internal dependency within nmake.mif upon there being
+ a $(DEVDIR) variable to make some temporary batch files
+ dependant upon (thanks to Keven T. McDonnell for finding
+ that there was this particular bug). I also updated the
+ build files for 2.6beta6.
+2/8/98 - added DevStudio workspace and project files for all lib
+ files and some test programs. Updated readme.win32.
+6/25/98 - initial revision for Mesa 3.0, does not include IDE files,
+ not everything is running. *sigh*
+7/20/98 - Mesa 3.0beta6 rev of all build files, all libs built and
+ minimally tested, all demo programs built and minimally
+ tested to within limits of my PC. ;^) Eveything looks
+ MUCH better now ...
+7/30/98 - Minor updates/edits based upon feedback from
+ Eero Pajarre <epajarre@koti.tpo.fi>. These updates include a fix
+ to the Mesa-on-3Dfx build such that Quake-II now runs almost
+ properly on my system. It runs, just *very* slowly and with *no*
+ textures. Hmmm. Doesn't make any difference whether Quake is set
+ to use 8-bit textures or not.
+8/13/98 - Lots of build cleanups, minor bug fixes in fxwgl.c, and
+ compatability fix in fxapi.c for in-window rendering using 3Dfx
+ hardware.
+8/26/98 - Final revisions for Mesa 3 release checked
+9/22/98 - Fixed static builds for all but fxMesaGL32 and s3MesaGL32 targets
+9/29/98 - Reorganized FAQ information and added Added faq entry about Glide
+ bug under NT (crash on exit) and a workaround.
+11/21/98 - Updated files for Mesa 3.1 beta 1
+ Updated fxMesa window-hack code
+ Updated fxMesa resolution support to handle 1600x1200 & 1280x1024
+7/9/99 - Rev'd for Mesa 3.1 beta 2
\ No newline at end of file diff --git a/xc/extras/Mesa/docs/README.X11 b/xc/extras/Mesa/docs/README.X11 new file mode 100644 index 000000000..2f239959e --- /dev/null +++ b/xc/extras/Mesa/docs/README.X11 @@ -0,0 +1,326 @@ + + Mesa 3.4 Unix/X11 Information + + + +Installation +============ + +There are two ways to compile Mesa on Unix/X11 systems: + +1. The old way: + First type 'make' alone to see the list of system + configurations currently supported. If you see your configuration on the + list, type 'make <config>'. Most popular Unix/X workstations are currently + supported. + + If your system configuration is not listed by 'make', you'll have to modify + the top-level Makefile and Make-config files. There are instructions in + each file. + + +2. The new way: + Type './configure' and then 'make'. This uses GNU autoconfig. + See docs/INSTALL for more details. + + +The top-level makefile will execute the makefiles in a number of sub- +directories. When finished, the Mesa libraries will be in the Mesa-3.3/lib/ +directory. A few GLUT demos in the demos/ directory should be ready to run. + +If you also downloaded and unpacked the demos there should be executables +in the "xdemos/", "samples/", and "book/" directories for you to try out. + +If you have compilation problems you should try to fix them and return the +patches to the author. + + +Notes on assembly language optimizations: + + When using the old-style Makefiles, you can specify a configuration + that uses X86 assembly language optimizations (linux-3dnow for example). + + The detection of MMX, 3DNow!, PIII/SSE, etc capability is done at + runtime. That means you can compile Mesa for 3DNow! optimizations + even if you don't have an AMD CPU. + + However, your Linux binutils and assembler must understand the + special instructions in order to compile them. If you have + compilation problems, try upgrading your binutils. + + +Header and library files: + After you've compiled Mesa and tried the demos I recommend the following + procedure for "installing" Mesa. + + Copy the Mesa include/GL directory to /usr/local/include: + cp -r include/GL /usr/local/include + + Copy the Mesa library files to /usr/local/lib: + cp lib/* /usr/local/lib + + (actually, use "cp -d" on Linux to preserve symbolic links) + + +Xt/Motif widgets: + If you want to use Mesa or OpenGL in your Xt/Motif program you can build + the widgets found in either the widgets-mesa or widgets-sgi directories. + The former were written for Mesa and the later are the original SGI + widgets. Look in those directories for more information. + + +Notes: + HP users: a Mesa user reports that the HP-UX 10.01 C compiler has + a bug which effects glReadPixels. A patch for the compiler (PHSS_5743) is + available. Otherwise be sure your compiler is version 10.13 or later. + + QNX users: if you have problems running the demos try setting the + stack size to 200K or larger with -N200K, for example. + + SunOS 5.x users: The X shared memory extension may not work + correctly. If Mesa prints an error message to the effect of "Shared memory + error" then you'll have to append the following three lines to the end of + your /etc/system file then reboot: + set shmsys:shminfo_shmmax = 0x2000000 + set shmsys:shminfo_shmmni = 0x1000 + set shmsys:shminfo_shmseg = 0x100 + + + +Using the library +================= + +Configuration options: + The file src/config.h has many parameters which you can adjust such + as maximum number of lights, clipping planes, maximum texture size, + etc. In particular, you may want to change DEPTH_BITS from 16 to 32 + if a 16-bit depth buffer isn't precise enough for your application. + + +Shared libraries: + If you compile shared libraries you may have to set an environment + variable to specify where the Mesa libraries are located. On Linux and + Sun systems for example, set the LD_LIBRARY_PATH variable to include + /your-dir/Mesa-2.6/lib. Otherwise, when you try to run a demo it + may fail with a message saying that one or more libraries couldn't be + found. + + +Remote display of OpenGL/GLX programs: + As of version 1.2.3, Mesa's header files use the same GLenum and GLUenum + values as SGI's (and most/all other vendor's) OpenGL headers. This means + you can freely mix object files compiled with OpenGL or Mesa headers. + In fact, on systems with dynamic runtime linkers it's possible to dynam- + ically link with Mesa or OpenGL shared libraries at runtime, without + recompiling or relinking anything! + + Using IRIX 5.x as an example, you can run SGI's OpenGL demos with the + Mesa shared libraries as follows. Let's assume you're installing Mesa + in /usr/local/Mesa and using the C-shell: + % cd /usr/local/Mesa + % make irix5-dso + % setenv _RLD_LIST "/usr/local/Mesa/lib/libGL.so:DEFAULT" + % /usr/demos/bin/ideas_ogl // this is a test + + You can now run OpenGL executables on almost any X display! There may + be some problems from the fact that Mesa supports many X visual types + that an OpenGL client may not expect (grayscale for example). In this + case the application may abort, print error messages, or just behave + strangely. You may have to experiment with the MESA_RGB_VISUAL envi- + ronment variable. + + +Xt/Motif Widgets: + Two versions of the Xt/Motif OpenGL drawing area widgets are included: + + widgets-sgi/ SGI's stock widgets + widgets-mesa/ Mesa-tuned widgets + + Look in those directories for details + + +Togl: + Togl is an OpenGL/Mesa widget for Tcl/Tk. + See http://togl.sourceforge.net for more information. + + + +X Display Modes: + Mesa supports RGB(A) rendering into almost any X visual type and depth. + + The glXChooseVisual function tries its best to pick an appropriate visual + for the given attribute list. However, if this doesn't suit your needs + you can force Mesa to use any X visual you want (any supported by your + X server that is) by setting the MESA_RGB_VISUAL and MESA_CI_VISUAL + environment variables. When an RGB visual is requested, glXChooseVisual + will first look if the MESA_RGB_VISUAL variable is defined. If so, it + will try to use the specified visual. Similarly, when a color index + visual is requested, glXChooseVisual will look for the MESA_CI_VISUAL + variable. + + The format of accepted values is: <visual-class> <depth> + Here are some examples: + + using the C-shell: + % setenv MESA_RGB_VISUAL "TrueColor 8" // 8-bit TrueColor + % setenv MESA_CI_VISUAL "PseudoColor 12" // 12-bit PseudoColor + % setenv MESA_RGB_VISUAL "PseudoColor 8" // 8-bit PseudoColor + + using the KornShell: + $ export MESA_RGB_VISUAL="TrueColor 8" + $ export MESA_CI_VISUAL="PseudoColor 12" + $ export MESA_RGB_VISUAL="PseudoColor 8" + + +Double buffering: + Mesa can use either an X Pixmap or XImage as the backbuffer when in + double buffer mode. Using GLX, the default is to use an XImage. The + MESA_BACK_BUFFER environment variable can override this. The valid + values for MESA_BACK_BUFFER are: Pixmap and XImage (only the first + letter is checked, case doesn't matter). + + A pixmap is faster when drawing simple lines and polygons while an + XImage is faster when Mesa has to do pixel-by-pixel rendering. If you + need depth buffering the XImage will almost surely be faster. Exper- + iment with the MESA_BACK_BUFFER variable to see which is faster for + your application. + + +Colormaps: + When using Mesa directly or with GLX, it's up to the application writer + to create a window with an appropriate colormap. The aux, tk, and GLUT + toolkits try to minimize colormap "flashing" by sharing colormaps when + possible. Specifically, if the visual and depth of the window matches + that of the root window, the root window's colormap will be shared by + the Mesa window. Otherwise, a new, private colormap will be allocated. + + When sharing the root colormap, Mesa may be unable to allocate the colors + it needs, resulting in poor color quality. This can happen when a + large number of colorcells in the root colormap are already allocated. + To prevent colormap sharing in aux, tk and GLUT, define the environment + variable MESA_PRIVATE_CMAP. The value isn't significant. + + +Gamma correction: + To compensate for the nonlinear relationship between pixel values + and displayed intensities, there is a gamma correction feature in + Mesa. Some systems, such as Silicon Graphics, support gamma + correction in hardware (man gamma) so you won't need to use Mesa's + gamma facility. Other systems, however, may need gamma adjustment + to produce images which look correct. If in the past you thought + Mesa's images were too dim, read on. + + Gamma correction is controlled with the MESA_GAMMA environment + variable. Its value is of the form "Gr Gg Gb" or just "G" where + Gr is the red gamma value, Gg is the green gamma value, Gb is the + blue gamma value and G is one gamma value to use for all three + channels. Each value is a positive real number typically in the + range 1.0 to 2.5. The defaults are all 1.0, effectively disabling + gamma correction. Examples using csh: + + % setenv MESA_GAMMA "2.3 2.2 2.4" // separate R,G,B values + % setenv MESA_GAMMA "2.0" // same gamma for R,G,B + + The demos/gamma.c program may help you to determine reasonable gamma + value for your display. With correct gamma values, the color intensities + displayed in the top row (drawn by dithering) should nearly match those + in the bottom row (drawn as grays). + + Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well + on HP displays using the HP-ColorRecovery technology. + + Mesa implements gamma correction with a lookup table which translates + a "linear" pixel value to a gamma-corrected pixel value. There is a + small performance penalty. Gamma correction only works in RGB mode. + Also be aware that pixel values read back from the frame buffer will + not be "un-corrected" so glReadPixels may not return the same data + drawn with glDrawPixels. + + For more information about gamma correction see: + http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html + + +Overlay Planes + + Overlay planes in the frame buffer are supported by Mesa but require + hardware and X server support. To determine if your X server has + overlay support you can test for the SERVER_OVERLAY_VISUALS property: + + xprop -root | grep SERVER_OVERLAY_VISUALS + + +HPCR glClear(GL_COLOR_BUFFER_BIT) dithering + + If you set the MESA_HPCR_CLEAR environment variable then dithering + will be used when clearing the color buffer. This is only applicable + to HP systems with the HPCR (Color Recovery) system. + + +Extensions: + The following OpenGL GLX extensions are currently implemented: + + GLX_EXT_visual_info - GLX visual and transparent pixel extension + GLX_EXT_visual_rating - GLX visual caveats + + For detailed information about the extensions see www.opengl.org + + There are four Mesa-specific GL/GLX extensions at this time. + + GLX_MESA_pixmap_colormap + + This extension adds the GLX function: + + GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual, + Pixmap pixmap, Colormap cmap ) + + It is an alternative to the standard glXCreateGLXPixmap() function. + Since Mesa supports RGB rendering into any X visual, not just True- + Color or DirectColor, Mesa needs colormap information to convert RGB + values into pixel values. An X window carries this information but a + pixmap does not. This function associates a colormap to a GLX pixmap. + See the xdemos/glxpixmap.c file for an example of how to use this + extension. + + GLX_MESA_release_buffers + + Mesa associates a set of ancillary (depth, accumulation, stencil and + alpha) buffers with each X window it draws into. These ancillary + buffers are allocated for each X window the first time the X window + is passed to glXMakeCurrent(). Mesa, however, can't detect when an + X window has been destroyed in order to free the ancillary buffers. + + The best it can do is to check for recently destroyed windows whenever + the client calls the glXCreateContext() or glXDestroyContext() + functions. This may not be sufficient in all situations though. + + The GLX_MESA_release_buffers extension allows a client to explicitly + deallocate the ancillary buffers by calling glxReleaseBuffersMESA() + just before an X window is destroyed. For example: + + #ifdef GLX_MESA_release_buffers + glXReleaseBuffersMESA( dpy, window ); + #endif + XDestroyWindow( dpy, window ); + + This extension is new in Mesa 2.0. + + GLX_MESA_copy_sub_buffer + + This extension adds the glXCopySubBufferMESA() function. It works + like glXSwapBuffers() but only copies a sub-region of the window + instead of the whole window. + + This extension is new in Mesa version 2.6 + + + +Summary of X-related environment variables: + MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only) + MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only) + MESA_BACK_BUFFER - specifies how to implement the back color buffer (X only) + MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only) + MESA_GAMMA - gamma correction coefficients (X only) + + +---------------------------------------------------------------------- +$Id: README.X11,v 1.1 2000/11/30 17:31:36 dawes Exp $ diff --git a/xc/extras/Mesa/docs/RELNOTES-3.1 b/xc/extras/Mesa/docs/RELNOTES-3.1 new file mode 100644 index 000000000..8f230dc25 --- /dev/null +++ b/xc/extras/Mesa/docs/RELNOTES-3.1 @@ -0,0 +1,146 @@ + + Mesa 3.1 release notes + + PLEASE READ!!!! + + +New copyright +------------- + +Mesa 3.1 will be distributed under an XFree86-style copyright instead +of the GNU LGPL. + + +New directories +--------------- + +All documentation files are now in the docs/ directory. +All shell scripts are now in the bin/ directory. + + +New library names +----------------- + +Formerly, the main Mesa library was named libMesaGL.so (or libMesaGL.a) +and the GLU library was named libMesaGLU.so (or libMesaGLU.a). + +Now, the main library is named libGL.so (or libGL.a) and the GLU library +is named libGLU.so (or libGLU.a). + +The change allows Mesa to be more easily substituted for OpenGL. +Specifically, the linker/loader on some Unix-like systems won't +allow libMesaGL.so to be used instead of libGL.so if the application +was linked with the former. + +Warning: if you have another OpenGL implementation installed on your +system (i.e. you have another OpenGL libGL.so) you'll have to be +carefull about which library (OpenGL or Mesa) you link against. Be +aware of -L linker flags and the value of the LD_LIBRARY_PATH environment +variable. + + +New library versioning +---------------------- + +Previously, the Mesa GL library was named libMesaGL.so.3.0 +To better support Linux/OpenGL standards, the Mesa GL library is now +named libGL.so.1.2.030100 This indicates version 1.2 of the OpenGL spec +and Mesa implementation 3.1.0 + +In the long term this will allow better interoperability with other +OpenGL implementations, especially on Linux. In the short term, +OpenGL apps may have to be relinked to use the new library naming. + + + +New makefiles +------------- + +The old Makefiles found in the various directories have been renamed +to Makefile.X11 in order to prevent filename collisions with autoconfig- +generated Makefiles. + +The top-level Makefile simply includes Makefile.X11 +If your top-level Makefile get's overwritten/destroyed you can restore +it by copying Makefile.X11 to Makefile + + +New extensions +-------------- + +GL_EXT_stencil_wrap + Implements two new stencil operations: GL_INCR_WRAP_EXT and + GL_DECR_WRAP_EXT which allow stencil increment and decrement + without clamping. + +GL_INGR_blend_func_separate + Allows specification of blend factors for RGB and Alpha independently. + (INGR = Intergraph) + +GL_ARB_multitexture + Multiple simultaneous textures. (ARB = Architecture Review Board) + +GL_NV_texgen_reflection + nVidia texgen extension for better reflection mapping. + +GL_PGI_misc_hints + Assorted transformation hints. + +GL_EXT_compiled_vertex_array + Compiled vertex arrays. + +GL_EXT_clip_volume_hint + Allows one to disable clip volume (frustum) testing. + + + +Extensions removed +------------------ + +GL_EXT_multitexture - obsolete in favor of GL_ARB_multitexture + + + +Config file +----------- + +By default, /etc/mesa.conf will be read when Mesa starts. This +file controls default hints, enable/disable of extensions, and +more. See the CONFIG file for documentation. + + + +Optimizations +------------- + +Keith Whitwell has contributed significant optimizations to Mesa's +vertex transformation code. Basically, the whole transformation +stage of Mesa has been rewritten. + +It's impossible to give a speedup factor. You'll just have to +try your app and see how it performs. + + + +Device Driver changes +--------------------- + +A bunch of new device driver functions have been added. See src/dd.h +Keith Harrison contributed many of them. I've been planning on adding +a bunch of functions like these to make writing hardware drivers easier. +More such function will probably be added in the near future. + + + +Miscellaneous +------------- + +util/glstate.c has some handy functions for debugging. Basically, it +offers a simple function for printing GL state variables. It's not +finished yet. There's a LOT more GLenum records to be added (see the +code). Anyone want to help? + + + +---------------------------------------------------------------------- +$Id: RELNOTES-3.1,v 1.1 2000/11/30 17:31:36 dawes Exp $ diff --git a/xc/extras/Mesa/docs/RELNOTES-3.2 b/xc/extras/Mesa/docs/RELNOTES-3.2 new file mode 100644 index 000000000..13ed5d7f5 --- /dev/null +++ b/xc/extras/Mesa/docs/RELNOTES-3.2 @@ -0,0 +1,12 @@ + + Mesa 3.2 release notes + + PLEASE READ!!!! + + +Mesa 3.2 is a stabilization of the Mesa 3.1 release. No new features +have been added. For a list of bug fixes please read the VERSIONS file. + + +---------------------------------------------------------------------- +$Id: RELNOTES-3.2,v 1.1 2000/11/30 17:31:36 dawes Exp $ diff --git a/xc/extras/Mesa/docs/RELNOTES-3.2.1 b/xc/extras/Mesa/docs/RELNOTES-3.2.1 new file mode 100644 index 000000000..63e95e450 --- /dev/null +++ b/xc/extras/Mesa/docs/RELNOTES-3.2.1 @@ -0,0 +1,32 @@ + + Mesa 3.2.1 release notes + + PLEASE READ!!!! + + + +The Mesa 3.2.1 release mainly just fixes bugs since the 3.2 release. +See the VERSIONS file for the exact list. + + + +GLU Polygon Tessellator +----------------------- + +The GLU tessellator has been reverted back to the version included +with Mesa 3.0 since it's more stable. The Mesa 3.1/3.2 tessellator +implemented the GLU 1.3 specification but suffered from a number of +bugs. + +Mesa implements GLU 1.1. + +Ideally, people should use the GLU 1.3 library included in SGI's +OpenGL Sample Implementation (SI) available from +http://oss.sgi.com/projects/ogl-sample/ +People are working to make easy-to-install Linux RPMs of the +GLU library. + + + +---------------------------------------------------------------------- +$Id: RELNOTES-3.2.1,v 1.1 2000/11/30 17:31:37 dawes Exp $ diff --git a/xc/extras/Mesa/docs/RELNOTES-3.3 b/xc/extras/Mesa/docs/RELNOTES-3.3 new file mode 100644 index 000000000..c1343f808 --- /dev/null +++ b/xc/extras/Mesa/docs/RELNOTES-3.3 @@ -0,0 +1,271 @@ + + Mesa 3.3 release notes + + July 21, 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.2.1) designate stable releases. + +Mesa 3.3 has a undergone many internal changes since version 3.2 +and features a lot of new extensions. 3.3 is expected to be pretty +stable, but perhaps not as stable as 3.2 which has been used by +thousands of users over the past months. + +Everyone is encouraged to try Mesa 3.3. Bugs should be reported to +the Mesa bug database on www.sourceforge.net. + + + +Header file / GLenum changes +---------------------------- + +The gl.h and glu.h headers now use #defines to define all GL_* tokens +instead of C-language enums. This change improves Mesa/OpenGL +interoperability. + + + +New API dispatch code +--------------------- + +The core Mesa gl* functions are now implemented with a new dispatch +(jump table) which will allow simultaneous direct/indirect rendering. + +The code is found in the glapi*.[ch] files. + +Of interest: the actual "glFooBar" functions are generated with +templatized code defined in glapitemp.h and included by glapi.c +The glapitemp.h template should be reusable for all sorts of OpenGL +projects. + +The new dispatch code has also optimized with x86 assembly code. +This optimization eliminates copying the function arguments during +dispatch. + + + +New thread support +------------------ + +Thread support in Mesa has been rewritten. The glthread.[ch] files +replace mthreads.[ch]. Thread safety is always enabled (on platforms +which support threads, that is). There is virtually no performance +penalty for typical single-thread applications. See the glapi.c +file for details. + +The Xlib driver (XMesa) is now thread-safe as well. Be sure to +call XInitThreads() in your app first. See the xdemos/glthreads.c +demo for an example. + + + +Make configuration changes +-------------------------- + +If you use the old-style (non GNU automake) method to build Mesa note +that several of the configuration names have changed: + + Old name New name + ------------- ---------------- + linux-elf linux + linux linux-static + linux-386-elf linux-386 + linux-386 linux-386-static + etc. + + + +New extensions +-------------- + +GL_ARB_transpose_matrix + Adds glLoadTransposeMatrixARB() and glMultTransposeMatrixARB() + functions. + +GL_ARB_texture_cube_map + For cube-based reflection mapping. + +GL_EXT_texture_add_env + Adds GL_ADD texture environment mode. + See http://www.berkelium.com/OpenGL/EXT/texture_env_add.txt + +GL_EXT_texture_lod_bias + Allows mipmapped texture blurring and sharpening. + +GLX_EXT_visual_rating extension + This extension has no effect in stand-alone Mesa (used for DRI). + +GL_HP_occlusion_test + Used for bounding box occlusion testing (see demos/occlude.c). + +GL_SGIX_pixel_texture / GL_SGIS_pixel_texture + Lets glDraw/CopyPixels draw a texture coordinate image. + +GL_SGI_color_matrix + Adds a color matrix and another set of scale and bias parameters + to the glDraw/CopyPixels paths. + +GL_SGI_color_table + Adds additional color tables to the glDraw/Read/CopyPixels paths. + +GL_EXT_histogram + Compute histograms for glDraw/Read/CopyPixels. + +GL_EXT_blend_func_separate + This is the same as GL_INGR_blend_func_separate. + +GL_ARB_texture_cube_mapping + 6-face cube mapping, nicer than sphere mapping + +GL_EXT_texture_env_combine + For advanced texture environment effects. + + +Documentation for all these functions can be found at +http://oss.sgi.com/projects/ogl-sample/registry/ + + + +GLX_SGI_make_current_read functionality +--------------------------------------- + +The functionality of this extension is needed for GLX 1.3 (and required +for the Linux/OpenGL standards base). + +Implementing this function required a **DEVICE DRIVER CHANGE**. +The old SetBuffer() function has been replaced by SetReadBuffer() and +SetDrawBuffer(). All device drivers will have to be updated because +of this change. + +The new function, glXMakeContextCurrent(), in GLX 1.3 now works in Mesa. +The xdemos/wincopy.c program demonstrates it. + + + +Image-related code changes +-------------------------- + +The imaging path code used by glDrawPixels, glTexImage[123]D, +glTexSubImage[123], etc has been rewritten. It's now faster, +uses less memory and has several bug fixes. This work was +actually started in Mesa 3.1 with the glTexImage paths but has now +been carried over to glDrawPixels as well. + + + +Device driver interface changes +------------------------------- + +Added new functions for hardware stencil buffer support: + WriteStencilSpan + ReadStencilSpan + WriteStencilPixels + ReadStencilPixels + + +Removed old depth buffer functions: + AllocDepthBuffer + DepthTestSpan + DepthTestPixels + ReadDepthSpanFloat + ReadDepthSpanInt + + +Added new depth buffer functions: + WriteDepthSpan + ReadDepthSpan + WriteDepthPixels + ReadDepthPixels + + These functions always read/write 32-bit GLuints. This will allow + drivers to have anywhere from 0 to 32-bit Z buffers without + recompiling for 16 vs 32 bits as was previously needed. + + +New texture image functions + The entire interface for texture image specification has been updated. + With the new functions, it's optional for Mesa to keep an internal copy + of all textures. Texture download should be a lot faster when the extra + copy isn't made. + +Misc changes + TexEnv now takes a target argument + Removed UseGlobalTexturePalette (use Enable function instead) + + +Also added + ReadPixels + CopyPixels + + +The SetBufffer function has been replaced by SetDrawBuffer and +SetReadBuffer functions. This lets core Mesa independently +specify which buffer is to be used for reading and which for +drawing. + +The Clear function's mask parameter has changed. Instead of +mask being the flags specified by the user to glClear, the +mask is now a bitmask of the DD_*_BIT flags in dd.h. Now +multiple color buffers can be specified for clearing (ala +glDrawBuffers). The driver's Clear function must also +check the glColorMask glIndexMask, and glStencilMask settings +and do the right thing. See the X/Mesa, OS/Mesa, or FX/Mesa +drivers for examples. + + +The depth buffer changes shouldn't be hard to make for existing +drivers. In fact, it should simply the code. Be careful with +the depthBits value passed to gl_create_context(). 1 is a bad +value! It should normally be 0, 16, 24, or 32. + + +gl_create_framebuffer() takes new arguments which explicitly tell +core Mesa which ancillary buffers (depth, stencil, accum, alpha) +should be implemented in software. Mesa hardware drivers should +carefully set these flags depending on which buffers are in the +graphics card. + + + +Internal constants +------------------ + +Point and line size range and granularity limits are now stored +in the gl_constants struct, which is the Const member of GLcontext. +The limits are initialized from values in config.h but may be +overridden by device drivers to reflect the limits of that driver's +hardware. + +Also added constants for NumAuxBuffers and SubPixelBits. + + + +OpenGL Conformance +------------------ + +Mesa now passes all the OpenGL 1.1 conformance tests, except for +antialiased lines. AA lines fail on some, but not all, the tests. +In order to fix the remaining failures, a new AA line algorithm will +be needed (which computes coverage values for end-point fragments). +This will be done for Mesa 3.5/3.6. + + + +OpenGL 1.2 GL_ARB_imaging subset +-------------------------------- + +Mesa 3.3 implements all the features of GL_ARB_imaging except for +image convolution. This will (hopefully) be done for Mesa 3.5/3.6. + + + +---------------------------------------------------------------------- +$Id: RELNOTES-3.3,v 1.1 2000/11/30 17:31:37 dawes Exp $ diff --git a/xc/extras/Mesa/docs/RELNOTES-3.4 b/xc/extras/Mesa/docs/RELNOTES-3.4 new file mode 100644 index 000000000..400f17b31 --- /dev/null +++ b/xc/extras/Mesa/docs/RELNOTES-3.4 @@ -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 2000/11/30 17:31:37 dawes Exp $ diff --git a/xc/extras/Mesa/docs/VERSIONS b/xc/extras/Mesa/docs/VERSIONS new file mode 100644 index 000000000..231e26387 --- /dev/null +++ b/xc/extras/Mesa/docs/VERSIONS @@ -0,0 +1,777 @@ +$Id: VERSIONS,v 1.1 2000/11/30 17:31:36 dawes Exp $ + + +Mesa Version History +==================== + +1.0 beta February 1995 + Initial release + +1.1 beta March 4, 1995 + Changes: + faster point and line drawing (2x faster) + more systems supported, better Makefiles + Renamed lib*.a files to avoid collisions + many small bug fixes + New: + pseudo-GLX functions added + new implementation of evaluators (eval2.c) + GLUT support + +1.1.1 beta March 7, 1995 + Changes: + Reverted from eval2.c to eval.c due to FPE on Linux + more speed improvements + more Makefile changes + +1.1.2 beta March 14, 1995 + New: + implementation of SGI's blending extensions + glXUseXFont implemented + added MESA_DEBUG environment variable support + Changes: + Using eval2.c again + more FPE-prevention checks (0-length normals are OK) + a few small bug fixes + much faster pixel logic ops! + faster transformation arithmetic + +1.1.3 beta March 31, 1995 + New: + gluScaleImage() and gluBuild2DMipMaps() implemented + Mesa widgets for Xt/Motif + blendEXT demos + added environment variables for selecting visuals + Changes: + almost all GLUT demos work correctly now + faster X device driver functions + more bug fixes + +1.1.4 beta April 20, 1995 + Bug fixes: + - missing #define SEEK_SET in src-tk/image.c + - compile glShadeModel into display lists + - fixed pow() domain error in src/light.c + - fixed "flickering bitmaps" in double buffer mode + - fixed tk.h and aux.h for C++ + - state of LIGHT_MODEL_LOCAL_VIEWER was inverted + New features: + - MUCH, MUCH nicer dithering in 8-bit RGB mode + - updated widgets and widget demos + - Implemented GLXPixmap functions + - Added GLU 1.1 and GLX 1.1 functions + - Changed the X/Mesa interface API, more versatile + - Implemented gluPartialDisk() + +1.2 May 22, 1995 + Bug fixes: + - IRIX 4.x makefile problem + - modified tk to share root colormap as needed + - gluLookAt normalization problem + - suppress Expose, NoExpose events in swapbuffers + - glBitmap() and glDrawPixels() clipping + New features: + - GL_BLEND, GL_MODULATE, GL_DECAL, and GL_REPLACE_EXT texture + modes implemented + - texture maps stored more efficiently + - texture maps can be compiled into display lists + - Bogdan Sikorski's GLU polygon tesselation code + - Linas Vepstas's sweep and extrusion library + - glXCreateContext()'s shareList parameter works as it's supposed to. + XMesaCreateContext() updated to accept a shareList parameter too. + - Mesa can be compiled with real OpenGL .h files + - MESA_BACK_BUFFER environment variable + - better GLX error checking + +1.2.1 June 22, 1995 + Bug fixes: + - X/Mesa double buffer window resize crash + - widgets now pass PointerMotion events + - X/Mesa incorrect default clear color and drawing color + - more robust X MIT-SHM support in X/Mesa + - glTexImage( format=GL_LUMINANCE ) didn't work + - GL_LINE mode polygons with line width > 1.0 could cause a crash + - numerous feedback bugs + - glReadPixels() from depth buffer was wrong + - error prone depth and stencil buffer allocation + New features: + - Preliminary Microsoft Windows driver + - Implemented a number of missing functions: glEvalCoord[12][df]v(), + glGet...(), etc. + - Added a few missing symbols to gl.h and glu.h + - Faster rendering of smooth-shaded, RGBA, depth-buffered polygons. + - Faster rendering of lines when width=2.0 + - Stencil-related functions now work in display lists + Changes: + - renamed aux.h as glaux.h (MS-DOS names can't start with aux) + - most filenames are in 8.3 format to accomodate MS-DOS + - use GLubytes to store arrays of colors instead of GLints + +1.2.2 August 2, 1995 + New features: + - texture mapped points and lines + - NURBS! (but not 100% complete) + - viewports may safely extend beyond window boundaries + - MESA_PRIVATE_CMAP environment variable + - Grayscale X display support + - two new demos: demos/gears.c and demos/shadow.c + - MachTen for Macintosh configuration + Bug fixes: + - glGet*(GL_DEPTH_BITS) returned bytes, not bits + - point, line, and bitmap rasterization suffered from roundoff errors + - fixed a division by zero error in line clippping + - occasional wrong default background color really fixed! + - glDepthFunc(GL_ALWAYS) with glDepthMask(GL_FALSE) didn't work + - gluBuild2DMipmaps malloc problem fixed + - view volume clipping of smooth shaded lines resulted in bad colors + Changes: + - new visual selection method in glXChooseVisual() + - improved GLU quadric functions + - call XSync for glFinish and XFlush for glFlush + - glVertex() calls now use a function pointer to avoid conditionals + - removed contrib directory from Mesa tar file (available on ftp site) + - AIX shared library support + - Removed GLUenum type as it's not in OpenGL + +1.2.3 September 26, 1995 + New features: + - Mesa header files now equivalent to SGI OpenGL headers + - Support for HP's Color Recovery dithering displays + - Faster vertex transformation + - Faster raster operations into X windows under certain conditions + - New configurations: HP w/ shared libs, Ultrix w/ GCC, Data General + - 4-bit visuals now supported + Bug fixes: + - glScissor bug fixed + - round-off errors in clipping lines against clip planes fixed + - byte swapping between hosts and display servers implemented + - glGetError() can be called without a current rendering context + - problem with accidentally culled polygons is fixed + - fixed some widget compilation problems + +1.2.4 November 17, 1995 + New features: + - More speed improvements (lighting, fogging, polygon drawing) + - Window system and OS-independent off-screen rendering + - Preliminary Fortran bindings + - glPolygonOffsetEXT implemented + - glColorMask and glIndexMask now fully implemented + - glPixelZoom implemented + - display lists fully implemented + - gamma correction + - dithering in 8-bit TrueColor/DirectColor visuals + Changes: + - Improved device driver interface + - tk.h renamed to gltk.h to avoid conflicts with Tcl's Tk + - Dithering support moved from core into device driver + Bug fixes: + - glEnable/Disable( GL_LIGHTING ) didn't always take effect + - glReadPixels byte swapping was broken + - glMaterial with pname==GL_AMBIENT_AND_DIFFUSE was broken + - duplicate glColor4b() prototype in GL/gl.h removed + - stripes in wave -ci demo fixed + - GL_LINEAR_MIPMAP_NEAREST had wrong value + - bugs in HP Color Recovery support fixed + - fixed bug when blending lines, points, bitmaps outside of window + +1.2.5 November 30, 1995 + New Features: + - updated MS Windows driver + - new implementation of StaticGray/GrayScale visual support + Bug fixes: + - pixelzooming with gamma correction or blending didn't work + - HP color recovery visual wasn't being picked by glXChooseVisual + - glClear didn't always observe glColorMask changes + - olympic and offset demos didn't compile on some Suns + - texcoord clamping wasn't correct + - a polygon optimization introduced an occasional sampling problem + +1.2.6 January 26, 1996 + New Features: + - faster line and polygon rendering under certain conditions. See + Performance Tips 9 and 10 in README + - profiling + - lighting is a bit faster + - better perspective corrected texture mapping + - Amiga AmiWin (X11) support + - preliminary Linux SVGA driver + Changes: + - now using a 16-bit depth buffer, faster, smaller + - GL_NORMALIZE is disabled by default + Bug fixes: + - projective texture mapping + - fixed a memory leak in the context destroy function + - GL_POLYGON with less than 3 vertices caused a crash + - glGet*() returned wrong result for GL_INDEX_MODE + - reading pixels from an unmapped X window caused a BadMatch error + +1.2.7 March 5, 1996 + New: + - faster lighting + - faster 16-bit TrueColor rendering on Linux + - faster 32-bit TrueColor rendering on Linux, HP, IBM + - non-depth-buffered XImage polygons are faster + - vertex array extension + - software alpha planes + - updated Macintosh driver + - new NeXT driver + - GLU quadric functions generate texture coordinates + - reflect.c demo - reflective, textured surface demo + Changes: + - gamma correction code moved into the X driver for better performance + Bug fixes: + - multiple glClipPlane()'s didn't work reliably + - glPolygonMode() didn't always work + - glCullFace( GL_FRONT_AND_BACK ) didn't work + - texture mapping with gamma correction was buggy + - floating point exceptions in texture coordinate interpolation + - XImage byte swapping didn't always work + - polygon edge flags weren't always used correctly + +1.2.8 May 22, 1996 + New: + - overlay planes on X servers with the SERVER_OVERLAY_VISUALS property + - better monochrome output + - more IRIX 6.x configurations + - more robust RGB mode color allocation + - added MESA_XSYNC environment variable + - GLX_MESA_pixmap_colormap and GLX_EXT_visual_info extensions + - GL_MESA_window_pos extension + - faster glReadPixels/glDrawPixels for GL_DEPTH and GL_UNSIGNED_SHORT + and GL_UNSIGNED_INT + - driver for prototype Cirrus Mondello 3-D board + - updated AmigaDOS driver + - a few small speed optimizations in polygon rendering + Changes: + - internal device driver interface modified to simplify device + driver implementations and to support hardware Z buffers + - several changes to the X/Mesa interface (xmesa.h) + Bug fixes: + - fixed pow(0,0) domain error triggered on some systems + - glStencilClear() in a display list caused an infinite loop + - glRasterPos*() was sometimes off by +/-0.5 in X and Y + - color masking and blending were performed in wrong order + - auxSolidCylinder() sometimes drew a wire-frame cylinder + - fixed file writing bug in osdemo.c + - pixel mapping didn't always work + - the GL_GEQUAL stencil func didn't work + - the GL_INVERT stencil op didn't work + - the stencil write mask didn't work + - glPush/PopAttrib() didn't do enough error checking + - glIsList() didn't always work correctly + +2.0 October 10, 1996 + New: + - Implements OpenGL 1.1 API functions + - all texture filtering modes supported (mipmapping) + - faster texture mapping, see Performance Tip 11 in README + - antialiased RGB points + - X support for line and polygon stippling + - glDrawBuffer( GL_FRONT_AND_BACK ) works + - util/ directory of useful stuff + - demos/texobj demo of texture objects + Changes: + - major internal changes for thread-safeness + - new device driver interface + - MESA_ALPHA env variable removed + - triangle rasterizer replaces polygon rasterizer + Bug fixes: + - glPopAttrib() bug + - glDrawBuffer(GL_NONE) works now + +2.1 December 14, 1996 + New: + - VMS support + - MS-DOS driver + - OpenStep support + - updated, combined Windows 95/NT driver + - implemented glGetLighti() and glGetTexGen*() + - GLX does garbage collection of ancillary buffers + Bug fixes: + - removed unused _EXT constants from gl.h + - fixed polygon offset bugs + - Z coordinates of clipped lines were incorrect + - glEdgeFlag() in display lists didn't always work + - glLight*() in display lists didn't work + - fixed X line stipple bugs (Michael Pichler) + - glXUseXfonts XFreeFont/XFreeFontInfo bug fixed + - fixed a feedback bug + - glTexGen*() now transforms GL_EYE_PLANE by inverse modelview matrix + - polygons were sometimes culled instead of clipped + - triangle rasterizer suffered from float/int overflow exceptions + - fixed FP underflow exception in lighting (specular exponent) + - glEnable/glDisable of GL_EXT_vertex_array enums didn't work + - fixed free(NULL) in GLU tesselator code + - using 24-bit color on some X servers resulted in garbage rendering + - 32-bit per pixel mode for XFree86 now works + - glRotate(a,0,0,0) gave unpredictable results + - GL_LINE_STRIP with > 480 vertices had occasional clipping problems + - 8-bit TrueColor GLXPixmap rendering incorrectly required a colormap + - glMaterial() wasn't ignored when GL_COLOR_MATERIAL was enabled + - glEnable(GL_COLOR_MATERIAL) followed by glColor() didn't work right + - accumulation buffer was limited to positive values + - projective textures didn't work + - selection buffer overflows weren't handled correctly + Changes: + - restored the GL_EXT_polygon_offset extension + - slightly faster RGB dithering + - the SVGA driver works again + - Amiga driver now distributed separately + - NeXT driver updated for Mesa 2.x + +2.2 March 14, 1997 + New: + - better color selection when dithering + - added GL_EXT_texture_object extension + - updated MS-DOS driver for DJGPP + - added openbsd make configuration + - faster dithered flat-shaded triangles + - various compilation problems with Motif widgets fixed + - gl.h, glx.h and glu.h name mangling option + - BeOS driver + - 3D texture mapping extension + - GL_MESA_resize_buffers extension + - morph3d, stex3d and spectex demos + - 3Dfx support + Bug fixes: + - glColorMaterial should finally work right in all respects + - linear interpolation of mipmap levels was incorrectly weighted + - readpix.c didn't compile on Macintosh + - GL_INVERT and related logic ops didn't work right + - glTexImage[12]D() didn't check its parameters consistantly + - fixed a memory leak in glTexImage[12]D() + - kludged around a SunOS 5.x/GCC compiler bug in the feedback code + - glReadPixels aborted instead of normally catching some errors + - a few 1.1 constants were missing or misnamed in gl.h + - glBegin(p); glBegin(q); didn't generate an error + - fixed a memory leak in GLX code + - clipping of concave polygons could cause a core dump + - 1-component alpha texture maps didn't work + - fixed a GLU polygon tesselator bug + - polygons with colinear vertices were sometimes culled + - feedback triangle colors were wrong when using smooth shading + - textures with borders didn't work correctly + - colors returned in feedback mode were wrong when using lighting + - spotlights didn't effect ambient lighting correctly + - gluPartialDisk() had a few bugs + Changes: + - device driver interface expanded to support texture mapping + - faster matrix inversion subroutine + - commented out #include "wmesa_extend.h" from src/wmesa.c + - fixed many compiler warnings in the demo programs + +2.3 June 30, 1997 + New: + - Mesa distribution divided into two pieces: library code and demos + - faster vertex transformation, clip testing, lighting + - faster line drawing + - TrueColor visuals how have dithering (for depths < 24 bits) + - added MESA_NO_DITHER environment variable + - new device driver function: NearFar(), RenderVB(), RasterSetup() + - added LynxOS configuration + - added cygnus Win32 configuration + - added texcyl.c GLUT demo + - added XMesaDitherColor() to X/Mesa interface + - new NURBS code from Bogdan Sikorski + - added demos/shape.c (non-rectangular X window!) + Bug fixes: + - glEnable/DisableClientState() were missing from GL/gl.h + - GL_SPHERE_MAP texcoord generation didn't work correctly + - glXGetConfig() returned wrong number of depth, stencil, accum bits + - glDrawPixels feedback/selection didn't examine RasterPos valid bit + - black and white were reversed on some monochrome displays + - fixed potential image memory leak (wasn't setting reference counter) + - glDrawPixels sometimes didn't recognize some GL state changes + - gluProject/UnProject() didn't check for divide by zero + - stex3d demo called random() and srandom(), not portable + - fixed memory leaks in context.c and drawpix.c + - fixed NULL dereferencing problem in gl_update_texture_state() + - glReadPixels between glBegin/glEnd didn't generate an error. + - fixed memory leak in polygon tesselator (Randy Frank) + - fixed seg fault bug drawing flat-shaded, depth-tested lines + - clipped GL_TRIANGLE_STRIPs sometimes had wrong color when flat-shaded + - glBindTexture sometimes didn't work + - fixed a bug deep in glXReleaseBuffersMESA() + - fog was mistakenly applied to alpha + - glPopMatrix didn't set "dirty matrix" flag + - glPolygonStipple pattern was sometimes wrong + - glClear wasn't disabled during feedback and selection + - fixed memory leak in glTexSubImage[123]D + Changes: + - many library source files reorganized + - faster X color allocation, colors also freed when finished with them + - new texture sampling function pointer in texture objects + - incorporated 3Dfx VooDoo driver v0.16 into main source tree + - many 3Dfx driver updates + - cygnus Makefiles now included + - updated DOS driver + - made a few changes to dosmesa.c and wmesa.c (VB->Unclipped) + - internally, colors now stored in GLubytes, not GLfixed + - optimized changing of GL_SHININESS parameter + +2.4 September 18, 1997 + New: + - updated 3Dfx Glide driver + - hacks for 3Dfx rendering into an X window or fullscreen + - added depth buffer access functions to X/Mesa and OS/Mesa interfaces + Bug fixes: + - pixel buffer could overflow with long, wide lines + - fixed FP underflow problems in lighting + - glTexSubImage1D() had an unitialized variable + - incomplete texture objects could cause a segfault + - glDrawPixels with GL_COMPILE_AND_EXECUTE caused infinite loop + - flat-shaded quads in a strip were miscolored if clipped + - mipmapped triangle lod computation now works correctly + - fixed a few under/overflow bugs in triangle rasterizer + - glArrayElement() assigned bad normal if normal array disabled + - changed argument to glXReleaseBuffersMESA() + - fixed small triangle underflow bugs in tritemp.h (hopefully) + - glBindTexture(target, 0) caused a crash + - glTexImage[123]D() with NULL image pointer caused crash + - glPixelStore parameters are now ignored during display list execution + - fixed a two-sided lighting w/ clipping bug (black vertices) + - textures with width!=height were sometimes mis-rendered + - "weird" projection matrices could cause div by 0, other fp errors + Changes: + - changed precompiled header symbol from PCH to PC_HEADER + - split api.c into api1.c and api2.c + - added hash.c source file (but not used yet) + - a few Sun and HP configuration file changes + - MESA_GLX_FX env var replaces MESA_FX_WINDOW and MESA_FX_FULLSCREEN + - fixed a few cygnus build problems (src/Makefile.cygnus, src/wmesa.c) + +2.5 November 20, 1997 + New: + - updated 3Dfx driver (v20) for GLQuake + - added GL_EXT_paletted_texture extension + - added GL_EXT_shared_texture_palette extension + - added GL_EXT_point_parameters extension + - now including Mark Kilgard's GLUT library v3.6 + - new GLUT-based demos in gdemos/ + - added a few more Unix config targets + - added Intel X86 assembly language vertex transformation code + - 3Dfx/Glide driver for Mesa now recognizes SST_SCREENREFRESH env var + - Windows 95 S3 Virge driver + Bug fixes: + - glCopyTexImage?D would crash due to uninitialized variable + - glColor w/ glColorMaterial in a display list caused a bug + - fixed several glDrawPixels() and ReadPixels() bugs in 3Dfx driver + - glVertex4*() vertices weren't always projected correctly + - trying to use mipmapped textured points or lines caused crash + - glColor[34][fd]() values now clamped to [0,1] before int conversion + Changes: + - new device driver functions for texture mapping + - hash tables used for display list and texture object lookup + - fixed GLX visual handling code to avoid saving redundant visuals + - 3Dfx Glide libraries automatically linked to libMesaGL.so + - dropped the Cirrus Logic Mondello code since it's obsolete + - updated Cygnus Makefiles (Stephane Rehel) + - updated Windows MSVC++ Makefiles (Oleg Letsinsky) + - procedure for making library files has changed: scripts now take + a major and minor version arguments. Make-config changed a lot. + - new implementation of glTexSubImage2D() + - updated widgets-mesa directory to create libMesaGLwM.a (Motif widget) + - separate linux-glide and linux-386-glide configurations + +2.6 February 12, 1998 + New: + - Windows WGL functions + - updated VMS, DOS, Windows, Cygnus, BeOS, Amiga compilation support + - v0.22 of 3Dfx Glide driver + - more X86 assembly language optimizations + - faster blending for some modes + - XMesaSetFXmode() to switch between 3Dfx window and full-screen mode + - added preliminary thread support + - added GLX_MESA_copy_sub_buffer extension + - some clipping optimizations + Bug fixes: + - fixed shading/material bug when drawing long primitive strips + - fixed clipping problem in long primitive strips + - fixed clipping bug when using 3Dfx driver + - fixed a problem when trying to use X fonts w/ 3Dfx driver + - fixed a texture filter bug in 3Dfx/Glide driver + - fixed bug in 3Dfx/Glide driver involving depth mask & clearing + - glLoadMatrix to set projection matrix confused the 3Dfx driver + - non-identity texture matrices didn't work with linux-386 configs + - glGenTextures() didn't reserve the returned texture IDs + - NULL proxy image sent to glTexImageXD() caused crash + - added texture state validation optimization (Henk Kok) + - fixed colormap reuse problem when using both RGB and CI windows + - 32bpp True/DirectColor X visuals weren't recognized + - fixed potential problem in evaluators memory allocation + - fixed assorted demo compilation bugs + Changes: + - replaced old Mesa/windows/ directory with Mesa/WIN32/ directory + - converted a few old glaux/gltk demos to GLUT + - renamed directories: demos -> xdemos, gdemos -> demos + + +3.0 September 17, 1998 + New: + - OpenGL 1.2 API + - GL_EXT_abgr pixel format extension + - GL_SGIS_texture_edge_clamp extension + - GL_SGIS_multitexture extension (to be replaced by GL_ARB_multitex) + - GL_EXT_multitexture extension (to be replaced by GL_ARB_multitex) + - GL_EXT_rescale_normal extension and renormal.c demo + - GLX_SGI_video_sync extension (a no-op) + - antialiased lines + - glGetTexImage() now implemented + - glDraw/Copy/ReadPixels() optimizations + - optimized textured triangle code (Marten Stromberg) + - more optimization of dithered TrueColor triangles in X driver + - Linux GGI driver + - updated MGL driver + Bug fixes: + - lots of assorted compilation fixes + - glInitNames didn't write initial hit record + - glBitmap didn't always check for invalid raster position + - switching between GLX and OSMesa contexts caused a crash + - fixed uninitialized variable in Mesa widget code + - fixed typo in texture code which caused book/texgen to crash + - fixed texture sampling bug when filter=GL_LINEAR and wrap=GL_CLAMP + - gluDisk() in POINT or LINE mode sometimes failed + - fixed texture + fog bug + - GL_COMPILE_AND_EXECUTE mode didn't work reliably + - glMultMatrix in projection matrix mode w/ 3Dfx driver could fail + - glDrawPixels(color index pixels) weren't converted to RGBA + - fixed possible getenv() buffer overflow security bug + - glBitmap in feedback mode was offset by xOrig, yOrig params + - device driver's DrawPixels hook was never used + - glDrawPixels with zoomY!=1 and top/bottom clipping didn't work + - glDrawPixels optimized for GL_LUMINANCE, GL_LUMINANCE_ALPHA, GLubyte + - fixed MakeCurrent bug in GLwRedrawObjects() in MesaWorkstation.c + - glCopyTexSubImage2D() didn't work with 3Dfx driver + - lines with width = 2 could cause crash + - glClear with scissor rect sometimes cleared whole buffer + - glTexSubImage2D( .. GL_COLOR_INDEX .. ) didn't work + - glTexImageXD( .. GL_ABGR_EXT .. ) didn't work + - computation of inverse modelview matrix sometimes failed + - fixed GL_CLAMP mode texture sampling bug + - textured line interpolation was somewhat broken + - textured triangle interpolation was also somewhat broken + - glGet(MODELVIEW/PROJECTION/TEXTURE_MATRIX_STACK_DEPTH) off by one + - evaluator state wasn't fully initialized + - texture coordinate clipping was buggy + - evaluator surfaces could be mis-colored + - glAccum(GL_RETURN, s) didn't obey glColorMask() settings + - zero area polygons shouldn't be culled if polygon mode is point/line + - clipped width and height of glReadPixels was sometimes off by one + - blending with alpha = 0 or 1.0 wasn't always exact + - reading of pixels from clipped region was buggy + - minor tweaking of X visual management in GLX emulator + - glPolygonStipple now obeys pixel unpacking parameters + - glGetPolygonStipple now obeys pixel packing parameters + - interleaved vertex array texture coordinates were broken + - query of proxy texture internal format was broken + - alpha channel wasn't reliably cleared + - fixed divide by zero error in gluScaleImage if dest size = 1 x 1 + Conformance bug fixes: + - GL_SELECTION_BUFFER_POINTER and GL_SELECTION_BUFFER_SIZE were missing + - GL_TEXTURE_INTERNAL_FORMAT was missing + - glGet*(GL_POLYGON_STIPPLE) was broken + - glPush/PopAttrib() didn't save/restore all texture state + - glBitmap in feedback mode didn't work + - feedback of texture coords didn't always work + - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLbyte was broke + - glDrawPixels w/ format=GL_DEPTH_COMPONENT, type=GLubyte was broke + - glDrawPixels w/ format=GL_STENCIL_INDEX, type=GL_BITMAP was broke + Changes: + - upgraded GLUT to version 3.7 + - only GL and GLU library code included in MesaLib.tar.gz + - GLUT and all demos now in MesaDemos.tar.gz + - glaux and gltk libraries removed + - IRIX -n32 and -64 libs go in lib32/ and lib64/ directories + + +3.1 beta 1 November 19, 1998 + New: + - GL_EXT_stencil_wrap extension + - GL_INGR_blend_func_separate extension + - GL_ARB_multitexture extension + - GL_NV_texgen_reflection extension + - newly optimized vertex transformation code + - updated GLUT 3.7 code + - better precision when using 32-bit Z buffer + - Allegro DJGPP driver + Bug fixes: + - glCopyPixels between front/back buffers didn't copy alpha correctly + - fixed out-of-bounds memory access in optimized 2-D texture code + - glPixelStorei didn't accept GL_PACK/UNPACK_IMAGE_HEIGHT parameter + - glGet*() didn't accept GL_MAX_3D_TEXTURE_SIZE parameter + - clipping of texture coordinates sometimes had bad R,Q values + - GL_CLAMP_TO_EDGE texture sampling was off by 0.5 texels + - glEdgeFlagPointer() now takes a GLvoid * instead of GLboolean * + - texture was sometimes applied twice with 3Dfx driver + - glPush/PopAttrib() fouled up texture object reference counts + - glDeleteLists(0, n) caused assertion failure + - bilinear texture sampling wasn't accurate enough + - glClear w/ glDepthMask(GL_FALSE) didn't work right on 3Dfx + - color components were reversed on big endian 32 bpp X visuals + Changes: + - removed GL_EXT_multitexture extension + + +3.1 beta 2 May 24, 1999 + New: + - multi-textured points and lines (mjk@nvidia.com) + - optimized 24bpp X rendering (bernd.paysan@gmx.de) + - added allegro support (bernie-t@geocities.com) + - cleaned-up Windows-related stuff (Ted Jump) + - minor stereo changes (KendallB@scitechsoft.com) + - new BeOS driver which implements BGLView class + - new Direct3D driver (see src/D3D) + - more efficient filled gluCylinder() function + - utilities: util/showbuffer.[ch] and util/glstate.[ch] + - fixed some IRIX compiler warnings + - added support for building Mesa in XFree86 with + SGI's GLX (kevin@precisioninsight.com) + Bug fixes: + - a variety of Windows/Mesa bug fixes (mjk@nvidia.com) + - packed pixel images weren't unpacked correctly + - patches some win32 files in GLUT (mjk@nvidia.com) + - glTexImage[123]D() didn't accept internalFormat == GL_COLOR_INDEX + - fixed lighting bug in Keith's new shading code + - fixed texture segfault seen in Lament screensaver + - fixed miscellaneous low-memory bugs + - glClear(GL_COLOR_BUFFER_BIT) with RGBA or CI masking was broken + - GL_LINEAR sampling of 3D textures was broken + - fixed SVR4 'cc' compiler macro problem (dawes@xfree86.org) + - added GL_TEXTURE_PRIORITY fix (keithh@netcomuk.co.uk) + - fixed wide point and wide line conformance bugs (brianp) + Changes: + - some device driver changes (see src/dd.h) + - new copyright on core Mesa code + + +3.1 beta 3 September 17, 1999 + New: + - optimized glAccum function + - optimized 24bpp rendering in XMesa driver + - GLU 1.2 polygon tessellator + Bug Fixes: + - glGetTexLevelParameter wasn't fully implemented + - glXUseXFont now handles multi-byte fonts + - glIsEnabled(GL_TEXTURE_2D / 3D) returned wrong result + - alpha channel of blending points, lines was sometimes incorrect + Changes: + - New library names: "libGL" instead of "libMesaGL" + - New library numbering: libGL.so.1.2.310 + - New subdirectories: docs/ and bin/ + - New Makefile-system (autoconf,automake,libtool) + + +3.1 final December 14, 1999 + New: + - added demos/gloss.c + - added xdemos/glxdpyinfo.c + - added GLX_ARB_get_proc_address extension + - rewritten glTexImage code paths (faster, less memory, bug fixes) + Bug Fixes: + - several vertex array bug fixes + - overlapping glCopyPixels with pixel zooming now works + - glXUseXFont() bitmaps were vertically shifted by one pixel + - glCopyPixels with pixel zooming now works + + +3.2 final April 24, 2000 + Bug fixes: + - fixed memcpy bugs in span.c + - fixed missing glEnd problem in demos/tessdemo.c + - fixed bug when clearing 24bpp Ximages + - fixed clipping problem found in Unreal Tournament + - fixed Loki's "ice bug" and "crazy triangles" seen in Heretic2 + - fixed Loki's 3dfx RGB vs BGR bug + - fixed Loki's 3dfx smooth/flat shading bug in SoF + Changes: + - updated docs/README file + - use bcopy() optimizations on FreeBSD + - re-enabled the optimized persp_textured_triangle() function + + +3.2.1 July 19, 2000 + Bug fixes: + - gluBuild2DMipmaps() didn't accept GL_BGRA + - Fixed compile/makefile problems on IRIX + - fixed segfault in 3dfx driver when using GL selection/feedback + - no longer cull very, very tiny triangles + - blending w/ drawbuffer==GL_FRONT_BACK caused segfault (sw rendering) + - fixed Motif detection code in widgets-mesa/configure.in + - glColorMaterial and glMaterial updates to emissive and ambient + didn't always work right + - Specular highlights weren't always in the right place + - clipped GL_LINE mode polygons had interior lines appear + - blend term GL_ONE_MINUS_CONSTANT_ALPHA was broken + - GL_NICEST fog didn't always work with flat shading + - glRect commands in display lists were sometimes miscolored + - Line Z offset didn't always work + - fixed texgen normal vector problem (gloss's teapot) + - numerous GL conformance bugs fixed + Changes: + - glColorMask(false, false, false, false) handled better/faster + - reverted to old GLU polygon tessellator, GLU 1.1 + - updated Win32 build files + + +3.3 July 21, 2000 + New: + - antialiased triangles now implemented + - GL_EXT_texture_env_add texture mode extension + - GLX 1.3 API + - support for separate draw/read buffers (ie GL_SGI_make_current_read) + - thread-safe API dispath + - improved glxinfo program + - demos/texdown program to measure texture download performance + - glext.h header file + - demos/geartrain program + - GL_EXT_texture_lod_bias extension + - demos/lodbias program + - further optimized glRead/DrawPixels for 16-bit TrueColor X visuals + - GLX_EXT_visual_rating extension (a no-op, however) + - GL_HP_occlusion_test extension (for X and OS/Mesa drivers) + - demos/occlude program + - GL_SGIS_pixel_texture and GL_SGIX_pixel_texture extensions + - demos/pixeltex program + - GL_SGI_color_matrix extension + - GL_SGI_color_table extension + - GL_EXT_histogram extension + - GL_ARB_texture_cube_map extension + - added xdemos/glxheads and xdemos/manywin + - demos/texenv.c demo + - GL_EXT_texture_env_combine extension (by Holger Waechtler) + - Xlib driver is now thread-safe (see xdemos/glthreads) + Bug Fixes: + - various GL conformance failures fixed since 3.2.1 + Changes: + - gl.h now uses #defines instead of C enums for all tokens + - glu.h now uses #defines instead of C enums for all tokens + - moved programs from 3Dfx/demos/ into demos/ directory + + +3.4 November 3, 2000 + New: + - optimized glDrawPixels for glPixelZoom(1,-1) + Bug Fixes: + - widgets-mesa/src/*.c files were missing from 3.3 distro + - include/GL/mesa_wgl.h file was missing from 3.3 distro + - fixed some Win32 compile problems + - texture object priorities weren't getting initialized to 1.0 + - glAreTexturesResident return value was wrong when using hardware + - glXUseXFont segfaulted when using 3dfx driver (via MESA_GLX_FX) + - glReadPixels with GLushort packed types was broken + - fixed a few bugs in the GL_EXT_texture_env_combine texture code + - glPush/PopAttrib(GL_ENABLE_BIT) mishandled multi-texture enables + - fixed some typos/bugs in the VB code + - glDrawPixels(GL_COLOR_INDEX) to RGB window didn't work + - optimized glDrawPixels paths weren't being used + - per-fragment fog calculation didn't work without a Z buffer + - improved blending accuracy, fixes Glean blendFunc test failures + - glPixelStore(GL_PACK/UNPACK_SKIP_IMAGES) wasn't handled correctly + - glXGetProcAddressARB() didn't always return the right address + - gluBuild[12]DMipmaps() didn't grok the GL_BGR pixel format + - texture matrix changes weren't always detected (GLUT projtex demo) + - fixed random color problem in vertex fog code + - fixed Glide-related bug that let Quake get a 24-bit Z buffer + Changes: + - finished internal support for compressed textures for DRI + diff --git a/xc/extras/Mesa/include/GL/Makefile.am b/xc/extras/Mesa/include/GL/Makefile.am new file mode 100644 index 000000000..58aded1d5 --- /dev/null +++ b/xc/extras/Mesa/include/GL/Makefile.am @@ -0,0 +1,34 @@ +## Process this file with automake to produce Makefile.in + +GLincludedir = $(includedir)/GL + +if HAVE_FX +INC_FX = fxmesa.h +endif + +if HAVE_GGI +INC_GGI = ggimesa.h +endif + +if HAVE_OSMESA +INC_OSMESA = osmesa.h +endif + +if HAVE_SVGA +INC_SVGA = svgamesa.h +endif + +if HAVE_X11 +INC_X11 = glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h +endif + +if NEED_GLUT +INC_GLUT = glut.h +endif + +EXTRA_DIST = fxmesa.h ggimesa.h osmesa.h svgamesa.h \ + glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h + +GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h \ + $(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) + diff --git a/xc/extras/Mesa/include/GL/Makefile.in b/xc/extras/Mesa/include/GL/Makefile.in new file mode 100644 index 000000000..ab9f47408 --- /dev/null +++ b/xc/extras/Mesa/include/GL/Makefile.in @@ -0,0 +1,264 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +GLincludedir = $(includedir)/GL + +@HAVE_FX_TRUE@INC_FX = fxmesa.h + +@HAVE_GGI_TRUE@INC_GGI = ggimesa.h + +@HAVE_OSMESA_TRUE@INC_OSMESA = osmesa.h + +@HAVE_SVGA_TRUE@INC_SVGA = svgamesa.h + +@HAVE_X11_TRUE@INC_X11 = glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h + +@NEED_GLUT_TRUE@INC_GLUT = glut.h + +EXTRA_DIST = fxmesa.h ggimesa.h osmesa.h svgamesa.h glx.h glx_mangle.h xmesa.h xmesa_x.h xmesa_xf86.h + + +GLinclude_HEADERS = gl.h glext.h gl_mangle.h glu.h glu_mangle.h $(INC_FX) $(INC_GGI) $(INC_OSMESA) $(INC_SVGA) $(INC_X11) $(INC_GLUT) + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../conf.h +CONFIG_CLEAN_FILES = +HEADERS = $(GLinclude_HEADERS) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu include/GL/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-GLincludeHEADERS: $(GLinclude_HEADERS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(GLincludedir) + @list='$(GLinclude_HEADERS)'; for p in $$list; do \ + if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ + echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(GLincludedir)/$$p"; \ + $(INSTALL_DATA) $$d$$p $(DESTDIR)$(GLincludedir)/$$p; \ + done + +uninstall-GLincludeHEADERS: + @$(NORMAL_UNINSTALL) + list='$(GLinclude_HEADERS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(GLincludedir)/$$p; \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = include/GL + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu include/GL/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-GLincludeHEADERS +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-GLincludeHEADERS +uninstall: uninstall-am +all-am: Makefile $(HEADERS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(GLincludedir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-tags clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-tags distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: uninstall-GLincludeHEADERS install-GLincludeHEADERS tags \ +mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ +distdir info-am info dvi-am dvi check check-am installcheck-am \ +installcheck install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/include/GL/amesa.h b/xc/extras/Mesa/include/GL/amesa.h new file mode 100644 index 000000000..052f6dca5 --- /dev/null +++ b/xc/extras/Mesa/include/GL/amesa.h @@ -0,0 +1,67 @@ +/* $Id: amesa.h,v 1.1 2000/11/30 17:31:30 dawes Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * + * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * 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. + */ + + +/* Allegro (DJGPP) driver by Bernhard Tschirren (bernie-t@geocities.com) */ + + +#ifndef AMESA_H +#define AMESA_H + + +#define AMESA_MAJOR_VERSION 3 +#define AMESA_MINOR_VERSION 3 + + +typedef struct amesa_visual *AMesaVisual; +typedef struct amesa_buffer *AMesaBuffer; +typedef struct amesa_context *AMesaContext; + + +extern AMesaVisual AMesaCreateVisual(GLboolean dbFlag, GLint depth, + GLint depthSize, + GLint stencilSize, + GLint accumSize); + +extern void AMesaDestroyVisual(AMesaVisual visual); + +extern AMesaBuffer AMesaCreateBuffer(AMesaVisual visual, + GLint width, GLint height); + +extern void AMesaDestroyBuffer(AMesaBuffer buffer); + + +extern AMesaContext AMesaCreateContext(AMesaVisual visual, + AMesaContext sharelist); + +extern void AMesaDestroyContext(AMesaContext context); + +extern GLboolean AMesaMakeCurrent(AMesaContext context, AMesaBuffer buffer); + +extern void AMesaSwapBuffers(AMesaBuffer buffer); + + +#endif /* AMESA_H */ diff --git a/xc/extras/Mesa/include/GL/gl_mangle.h b/xc/extras/Mesa/include/GL/gl_mangle.h new file mode 100644 index 000000000..ec21bd1ce --- /dev/null +++ b/xc/extras/Mesa/include/GL/gl_mangle.h @@ -0,0 +1,539 @@ +/* $Id: gl_mangle.h,v 1.1 2000/11/30 17:31:30 dawes Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.3 + * + * 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. + */ + + +/* + * If you compile Mesa with USE_MGL_NAMESPACE defined then you can link + * your application both with OpenGL and Mesa. The Mesa functions will + * be redefined so they are prefixed with "mgl" instead of "gl". + * Contributed by Randy Frank (rfrank@rsinc.com) + */ + +#ifndef GL_MANGLE_H +#define GL_MANGLE_H + +#define glClearIndex mglClearIndex +#define glClearColor mglClearColor +#define glClear mglClear +#define glIndexMask mglIndexMask +#define glColorMask mglColorMask +#define glAlphaFunc mglAlphaFunc +#define glBlendFunc mglBlendFunc +#define glLogicOp mglLogicOp +#define glCullFace mglCullFace +#define glFrontFace mglFrontFace +#define glPointSize mglPointSize +#define glLineWidth mglLineWidth +#define glLineStipple mglLineStipple +#define glPolygonMode mglPolygonMode +#define glPolygonOffset mglPolygonOffset +#define glPolygonStipple mglPolygonStipple +#define glGetPolygonStipple mglGetPolygonStipple +#define glEdgeFlag mglEdgeFlag +#define glEdgeFlagv mglEdgeFlagv +#define glScissor mglScissor +#define glClipPlane mglClipPlane +#define glGetClipPlane mglGetClipPlane +#define glDrawBuffer mglDrawBuffer +#define glReadBuffer mglReadBuffer +#define glEnable mglEnable +#define glDisable mglDisable +#define glIsEnabled mglIsEnabled +#define glEnableClientState mglEnableClientState +#define glDisableClientState mglDisableClientState +#define glGetBooleanv mglGetBooleanv +#define glGetDoublev mglGetDoublev +#define glGetFloatv mglGetFloatv +#define glGetIntegerv mglGetIntegerv +#define glPushAttrib mglPushAttrib +#define glPopAttrib mglPopAttrib +#define glPushClientAttrib mglPushClientAttrib +#define glPopClientAttrib mglPopClientAttrib +#define glRenderMode mglRenderMode +#define glGetError mglGetError +#define glGetString mglGetString +#define glFinish mglFinish +#define glFlush mglFlush +#define glHint mglHint +#define glClearDepth mglClearDepth +#define glDepthFunc mglDepthFunc +#define glDepthMask mglDepthMask +#define glDepthRange mglDepthRange +#define glClearAccum mglClearAccum +#define glAccum mglAccum +#define glMatrixMode mglMatrixMode +#define glOrtho mglOrtho +#define glFrustum mglFrustum +#define glViewport mglViewport +#define glPushMatrix mglPushMatrix +#define glPopMatrix mglPopMatrix +#define glLoadIdentity mglLoadIdentity +#define glLoadMatrixd mglLoadMatrixd +#define glLoadMatrixf mglLoadMatrixf +#define glMultMatrixd mglMultMatrixd +#define glMultMatrixf mglMultMatrixf +#define glRotated mglRotated +#define glRotatef mglRotatef +#define glScaled mglScaled +#define glScalef mglScalef +#define glTranslated mglTranslated +#define glTranslatef mglTranslatef +#define glIsList mglIsList +#define glDeleteLists mglDeleteLists +#define glGenLists mglGenLists +#define glNewList mglNewList +#define glEndList mglEndList +#define glCallList mglCallList +#define glCallLists mglCallLists +#define glListBase mglListBase +#define glBegin mglBegin +#define glEnd mglEnd +#define glVertex2d mglVertex2d +#define glVertex2f mglVertex2f +#define glVertex2i mglVertex2i +#define glVertex2s mglVertex2s +#define glVertex3d mglVertex3d +#define glVertex3f mglVertex3f +#define glVertex3i mglVertex3i +#define glVertex3s mglVertex3s +#define glVertex4d mglVertex4d +#define glVertex4f mglVertex4f +#define glVertex4i mglVertex4i +#define glVertex4s mglVertex4s +#define glVertex2dv mglVertex2dv +#define glVertex2fv mglVertex2fv +#define glVertex2iv mglVertex2iv +#define glVertex2sv mglVertex2sv +#define glVertex3dv mglVertex3dv +#define glVertex3fv mglVertex3fv +#define glVertex3iv mglVertex3iv +#define glVertex3sv mglVertex3sv +#define glVertex4dv mglVertex4dv +#define glVertex4fv mglVertex4fv +#define glVertex4iv mglVertex4iv +#define glVertex4sv mglVertex4sv +#define glNormal3b mglNormal3b +#define glNormal3d mglNormal3d +#define glNormal3f mglNormal3f +#define glNormal3i mglNormal3i +#define glNormal3s mglNormal3s +#define glNormal3bv mglNormal3bv +#define glNormal3dv mglNormal3dv +#define glNormal3fv mglNormal3fv +#define glNormal3iv mglNormal3iv +#define glNormal3sv mglNormal3sv +#define glIndexd mglIndexd +#define glIndexf mglIndexf +#define glIndexi mglIndexi +#define glIndexs mglIndexs +#define glIndexub mglIndexub +#define glIndexdv mglIndexdv +#define glIndexfv mglIndexfv +#define glIndexiv mglIndexiv +#define glIndexsv mglIndexsv +#define glIndexubv mglIndexubv +#define glColor3b mglColor3b +#define glColor3d mglColor3d +#define glColor3f mglColor3f +#define glColor3i mglColor3i +#define glColor3s mglColor3s +#define glColor3ub mglColor3ub +#define glColor3ui mglColor3ui +#define glColor3us mglColor3us +#define glColor4b mglColor4b +#define glColor4d mglColor4d +#define glColor4f mglColor4f +#define glColor4i mglColor4i +#define glColor4s mglColor4s +#define glColor4ub mglColor4ub +#define glColor4ui mglColor4ui +#define glColor4us mglColor4us +#define glColor3bv mglColor3bv +#define glColor3dv mglColor3dv +#define glColor3fv mglColor3fv +#define glColor3iv mglColor3iv +#define glColor3sv mglColor3sv +#define glColor3ubv mglColor3ubv +#define glColor3uiv mglColor3uiv +#define glColor3usv mglColor3usv +#define glColor4bv mglColor4bv +#define glColor4dv mglColor4dv +#define glColor4fv mglColor4fv +#define glColor4iv mglColor4iv +#define glColor4sv mglColor4sv +#define glColor4ubv mglColor4ubv +#define glColor4uiv mglColor4uiv +#define glColor4usv mglColor4usv +#define glTexCoord1d mglTexCoord1d +#define glTexCoord1f mglTexCoord1f +#define glTexCoord1i mglTexCoord1i +#define glTexCoord1s mglTexCoord1s +#define glTexCoord2d mglTexCoord2d +#define glTexCoord2f mglTexCoord2f +#define glTexCoord2i mglTexCoord2i +#define glTexCoord2s mglTexCoord2s +#define glTexCoord3d mglTexCoord3d +#define glTexCoord3f mglTexCoord3f +#define glTexCoord3i mglTexCoord3i +#define glTexCoord3s mglTexCoord3s +#define glTexCoord4d mglTexCoord4d +#define glTexCoord4f mglTexCoord4f +#define glTexCoord4i mglTexCoord4i +#define glTexCoord4s mglTexCoord4s +#define glTexCoord1dv mglTexCoord1dv +#define glTexCoord1fv mglTexCoord1fv +#define glTexCoord1iv mglTexCoord1iv +#define glTexCoord1sv mglTexCoord1sv +#define glTexCoord2dv mglTexCoord2dv +#define glTexCoord2fv mglTexCoord2fv +#define glTexCoord2iv mglTexCoord2iv +#define glTexCoord2sv mglTexCoord2sv +#define glTexCoord3dv mglTexCoord3dv +#define glTexCoord3fv mglTexCoord3fv +#define glTexCoord3iv mglTexCoord3iv +#define glTexCoord3sv mglTexCoord3sv +#define glTexCoord4dv mglTexCoord4dv +#define glTexCoord4fv mglTexCoord4fv +#define glTexCoord4iv mglTexCoord4iv +#define glTexCoord4sv mglTexCoord4sv +#define glRasterPos2d mglRasterPos2d +#define glRasterPos2f mglRasterPos2f +#define glRasterPos2i mglRasterPos2i +#define glRasterPos2s mglRasterPos2s +#define glRasterPos3d mglRasterPos3d +#define glRasterPos3f mglRasterPos3f +#define glRasterPos3i mglRasterPos3i +#define glRasterPos3s mglRasterPos3s +#define glRasterPos4d mglRasterPos4d +#define glRasterPos4f mglRasterPos4f +#define glRasterPos4i mglRasterPos4i +#define glRasterPos4s mglRasterPos4s +#define glRasterPos2dv mglRasterPos2dv +#define glRasterPos2fv mglRasterPos2fv +#define glRasterPos2iv mglRasterPos2iv +#define glRasterPos2sv mglRasterPos2sv +#define glRasterPos3dv mglRasterPos3dv +#define glRasterPos3fv mglRasterPos3fv +#define glRasterPos3iv mglRasterPos3iv +#define glRasterPos3sv mglRasterPos3sv +#define glRasterPos4dv mglRasterPos4dv +#define glRasterPos4fv mglRasterPos4fv +#define glRasterPos4iv mglRasterPos4iv +#define glRasterPos4sv mglRasterPos4sv +#define glRectd mglRectd +#define glRectf mglRectf +#define glRecti mglRecti +#define glRects mglRects +#define glRectdv mglRectdv +#define glRectfv mglRectfv +#define glRectiv mglRectiv +#define glRectsv mglRectsv +#define glVertexPointer mglVertexPointer +#define glNormalPointer mglNormalPointer +#define glColorPointer mglColorPointer +#define glIndexPointer mglIndexPointer +#define glTexCoordPointer mglTexCoordPointer +#define glEdgeFlagPointer mglEdgeFlagPointer +#define glGetPointerv mglGetPointerv +#define glArrayElement mglArrayElement +#define glDrawArrays mglDrawArrays +#define glDrawElements mglDrawElements +#define glInterleavedArrays mglInterleavedArrays +#define glShadeModel mglShadeModel +#define glLightf mglLightf +#define glLighti mglLighti +#define glLightfv mglLightfv +#define glLightiv mglLightiv +#define glGetLightfv mglGetLightfv +#define glGetLightiv mglGetLightiv +#define glLightModelf mglLightModelf +#define glLightModeli mglLightModeli +#define glLightModelfv mglLightModelfv +#define glLightModeliv mglLightModeliv +#define glMaterialf mglMaterialf +#define glMateriali mglMateriali +#define glMaterialfv mglMaterialfv +#define glMaterialiv mglMaterialiv +#define glGetMaterialfv mglGetMaterialfv +#define glGetMaterialiv mglGetMaterialiv +#define glColorMaterial mglColorMaterial +#define glPixelZoom mglPixelZoom +#define glPixelStoref mglPixelStoref +#define glPixelStorei mglPixelStorei +#define glPixelTransferf mglPixelTransferf +#define glPixelTransferi mglPixelTransferi +#define glPixelMapfv mglPixelMapfv +#define glPixelMapuiv mglPixelMapuiv +#define glPixelMapusv mglPixelMapusv +#define glGetPixelMapfv mglGetPixelMapfv +#define glGetPixelMapuiv mglGetPixelMapuiv +#define glGetPixelMapusv mglGetPixelMapusv +#define glBitmap mglBitmap +#define glReadPixels mglReadPixels +#define glDrawPixels mglDrawPixels +#define glCopyPixels mglCopyPixels +#define glStencilFunc mglStencilFunc +#define glStencilMask mglStencilMask +#define glStencilOp mglStencilOp +#define glClearStencil mglClearStencil +#define glTexGend mglTexGend +#define glTexGenf mglTexGenf +#define glTexGeni mglTexGeni +#define glTexGendv mglTexGendv +#define glTexGenfv mglTexGenfv +#define glTexGeniv mglTexGeniv +#define glGetTexGendv mglGetTexGendv +#define glGetTexGenfv mglGetTexGenfv +#define glGetTexGeniv mglGetTexGeniv +#define glTexEnvf mglTexEnvf +#define glTexEnvi mglTexEnvi +#define glTexEnvfv mglTexEnvfv +#define glTexEnviv mglTexEnviv +#define glGetTexEnvfv mglGetTexEnvfv +#define glGetTexEnviv mglGetTexEnviv +#define glTexParameterf mglTexParameterf +#define glTexParameteri mglTexParameteri +#define glTexParameterfv mglTexParameterfv +#define glTexParameteriv mglTexParameteriv +#define glGetTexParameterfv mglGetTexParameterfv +#define glGetTexParameteriv mglGetTexParameteriv +#define glGetTexLevelParameterfv mglGetTexLevelParameterfv +#define glGetTexLevelParameteriv mglGetTexLevelParameteriv +#define glTexImage1D mglTexImage1D +#define glTexImage2D mglTexImage2D +#define glGetTexImage mglGetTexImage +#define glGenTextures mglGenTextures +#define glDeleteTextures mglDeleteTextures +#define glBindTexture mglBindTexture +#define glPrioritizeTextures mglPrioritizeTextures +#define glAreTexturesResident mglAreTexturesResident +#define glIsTexture mglIsTexture +#define glTexSubImage1D mglTexSubImage1D +#define glTexSubImage2D mglTexSubImage2D +#define glCopyTexImage1D mglCopyTexImage1D +#define glCopyTexImage2D mglCopyTexImage2D +#define glCopyTexSubImage1D mglCopyTexSubImage1D +#define glCopyTexSubImage2D mglCopyTexSubImage2D +#define glMap1d mglMap1d +#define glMap1f mglMap1f +#define glMap2d mglMap2d +#define glMap2f mglMap2f +#define glGetMapdv mglGetMapdv +#define glGetMapfv mglGetMapfv +#define glGetMapiv mglGetMapiv +#define glGetMinmax mglGetMinmax +#define glEvalCoord1d mglEvalCoord1d +#define glEvalCoord1f mglEvalCoord1f +#define glEvalCoord1dv mglEvalCoord1dv +#define glEvalCoord1fv mglEvalCoord1fv +#define glEvalCoord2d mglEvalCoord2d +#define glEvalCoord2f mglEvalCoord2f +#define glEvalCoord2dv mglEvalCoord2dv +#define glEvalCoord2fv mglEvalCoord2fv +#define glMapGrid1d mglMapGrid1d +#define glMapGrid1f mglMapGrid1f +#define glMapGrid2d mglMapGrid2d +#define glMapGrid2f mglMapGrid2f +#define glEvalPoint1 mglEvalPoint1 +#define glEvalPoint2 mglEvalPoint2 +#define glEvalMesh1 mglEvalMesh1 +#define glEvalMesh2 mglEvalMesh2 +#define glFogf mglFogf +#define glFogi mglFogi +#define glFogfv mglFogfv +#define glFogiv mglFogiv +#define glFeedbackBuffer mglFeedbackBuffer +#define glPassThrough mglPassThrough +#define glSelectBuffer mglSelectBuffer +#define glInitNames mglInitNames +#define glLoadName mglLoadName +#define glPushName mglPushName +#define glPopName mglPopName +#define glBlendEquation mglBlendEquation +#define glBlendEquationEXT mglBlendEquationEXT +#define glBlendColor mglBlendColor +#define glBlendColorEXT mglBlendColorEXT +#define glPolygonOffsetEXT mglPolygonOffsetEXT +#define glVertexPointerEXT mglVertexPointerEXT +#define glNormalPointerEXT mglNormalPointerEXT +#define glColorPointerEXT mglColorPointerEXT +#define glIndexPointerEXT mglIndexPointerEXT +#define glTexCoordPointerEXT mglTexCoordPointerEXT +#define glEdgeFlagPointerEXT mglEdgeFlagPointerEXT +#define glGetPointervEXT mglGetPointervEXT +#define glArrayElementEXT mglArrayElementEXT +#define glDrawArraysEXT mglDrawArraysEXT +#define glGenTexturesEXT mglGenTexturesEXT +#define glDeleteTexturesEXT mglDeleteTexturesEXT +#define glBindTextureEXT mglBindTextureEXT +#define glPrioritizeTexturesEXT mglPrioritizeTexturesEXT +#define glAreTexturesResidentEXT mglAreTexturesResidentEXT +#define glIsTextureEXT mglIsTextureEXT +#define glTexImage3DEXT mglTexImage3DEXT +#define glTexSubImage3DEXT mglTexSubImage3DEXT +#define glCopyTexSubImage3DEXT mglCopyTexSubImage3DEXT +#define glColorTable mglColorTable +#define glColorTableParameteriv mglColorTableParameteriv +#define glColorTableParameterfv mglColorTableParameterfv +#define glColorSubTable mglColorSubTable +#define glGetColorTable mglGetColorTable +#define glGetColorTableParameteriv mglGetColorTableParameteriv +#define glGetColorTableParameterfv mglGetColorTableParameterfv +#define glColorTableEXT mglColorTableEXT +#define glColorSubTableEXT mglColorSubTableEXT +#define glGetColorTableEXT mglGetColorTableEXT +#define glGetColorTableParameterfvEXT mglGetColorTableParameterfvEXT +#define glGetColorTableParameterivEXT mglGetColorTableParameterivEXT +#define glMultiTexCoord1dSGIS mglMultiTexCoord1dSGIS +#define glMultiTexCoord1dvSGIS mglMultiTexCoord1dvSGIS +#define glMultiTexCoord1fSGIS mglMultiTexCoord1fSGIS +#define glMultiTexCoord1fvSGIS mglMultiTexCoord1fvSGIS +#define glMultiTexCoord1iSGIS mglMultiTexCoord1iSGIS +#define glMultiTexCoord1ivSGIS mglMultiTexCoord1ivSGIS +#define glMultiTexCoord1sSGIS mglMultiTexCoord1sSGIS +#define glMultiTexCoord1svSGIS mglMultiTexCoord1svSGIS +#define glMultiTexCoord2dSGIS mglMultiTexCoord2dSGIS +#define glMultiTexCoord2dvSGIS mglMultiTexCoord2dvSGIS +#define glMultiTexCoord2fSGIS mglMultiTexCoord2fSGIS +#define glMultiTexCoord2fvSGIS mglMultiTexCoord2fvSGIS +#define glMultiTexCoord2iSGIS mglMultiTexCoord2iSGIS +#define glMultiTexCoord2ivSGIS mglMultiTexCoord2ivSGIS +#define glMultiTexCoord2sSGIS mglMultiTexCoord2sSGIS +#define glMultiTexCoord2svSGIS mglMultiTexCoord2svSGIS +#define glMultiTexCoord3dSGIS mglMultiTexCoord3dSGIS +#define glMultiTexCoord3dvSGIS mglMultiTexCoord3dvSGIS +#define glMultiTexCoord3fSGIS mglMultiTexCoord3fSGIS +#define glMultiTexCoord3fvSGIS mglMultiTexCoord3fvSGIS +#define glMultiTexCoord3iSGIS mglMultiTexCoord3iSGIS +#define glMultiTexCoord3ivSGIS mglMultiTexCoord3ivSGIS +#define glMultiTexCoord3sSGIS mglMultiTexCoord3sSGIS +#define glMultiTexCoord3svSGIS mglMultiTexCoord3svSGIS +#define glMultiTexCoord4dSGIS mglMultiTexCoord4dSGIS +#define glMultiTexCoord4dvSGIS mglMultiTexCoord4dvSGIS +#define glMultiTexCoord4fSGIS mglMultiTexCoord4fSGIS +#define glMultiTexCoord4fvSGIS mglMultiTexCoord4fvSGIS +#define glMultiTexCoord4iSGIS mglMultiTexCoord4iSGIS +#define glMultiTexCoord4ivSGIS mglMultiTexCoord4ivSGIS +#define glMultiTexCoord4sSGIS mglMultiTexCoord4sSGIS +#define glMultiTexCoord4svSGIS mglMultiTexCoord4svSGIS +#define glMultiTexCoordPointerSGIS mglMultiTexCoordPointerSGIS +#define glSelectTextureSGIS mglSelectTextureSGIS +#define glSelectTextureCoordSetSGIS mglSelectTextureCoordSetSGIS +#define glActiveTextureARB mglActiveTextureARB +#define glClientActiveTextureARB mglClientActiveTextureARB +#define glMultiTexCoord1dARB mglMultiTexCoord1dARB +#define glMultiTexCoord1dvARB mglMultiTexCoord1dvARB +#define glMultiTexCoord1fARB mglMultiTexCoord1fARB +#define glMultiTexCoord1fvARB mglMultiTexCoord1fvARB +#define glMultiTexCoord1iARB mglMultiTexCoord1iARB +#define glMultiTexCoord1ivARB mglMultiTexCoord1ivARB +#define glMultiTexCoord1sARB mglMultiTexCoord1sARB +#define glMultiTexCoord1svARB mglMultiTexCoord1svARB +#define glMultiTexCoord2dARB mglMultiTexCoord2dARB +#define glMultiTexCoord2dvARB mglMultiTexCoord2dvARB +#define glMultiTexCoord2fARB mglMultiTexCoord2fARB +#define glMultiTexCoord2fvARB mglMultiTexCoord2fvARB +#define glMultiTexCoord2iARB mglMultiTexCoord2iARB +#define glMultiTexCoord2ivARB mglMultiTexCoord2ivARB +#define glMultiTexCoord2sARB mglMultiTexCoord2sARB +#define glMultiTexCoord2svARB mglMultiTexCoord2svARB +#define glMultiTexCoord3dARB mglMultiTexCoord3dARB +#define glMultiTexCoord3dvARB mglMultiTexCoord3dvARB +#define glMultiTexCoord3fARB mglMultiTexCoord3fARB +#define glMultiTexCoord3fvARB mglMultiTexCoord3fvARB +#define glMultiTexCoord3iARB mglMultiTexCoord3iARB +#define glMultiTexCoord3ivARB mglMultiTexCoord3ivARB +#define glMultiTexCoord3sARB mglMultiTexCoord3sARB +#define glMultiTexCoord3svARB mglMultiTexCoord3svARB +#define glMultiTexCoord4dARB mglMultiTexCoord4dARB +#define glMultiTexCoord4dvARB mglMultiTexCoord4dvARB +#define glMultiTexCoord4fARB mglMultiTexCoord4fARB +#define glMultiTexCoord4fvARB mglMultiTexCoord4fvARB +#define glMultiTexCoord4iARB mglMultiTexCoord4iARB +#define glMultiTexCoord4ivARB mglMultiTexCoord4ivARB +#define glMultiTexCoord4sARB mglMultiTexCoord4sARB +#define glMultiTexCoord4svARB mglMultiTexCoord4svARB +#define glPointParameterfEXT mglPointParameterfEXT +#define glPointParameterfvEXT mglPointParameterfvEXT +#define glBlendFuncSeparateINGR mglBlendFuncSeparateINGR +#define glWindowPos2iMESA mglWindowPos2iMESA +#define glWindowPos2sMESA mglWindowPos2sMESA +#define glWindowPos2fMESA mglWindowPos2fMESA +#define glWindowPos2dMESA mglWindowPos2dMESA +#define glWindowPos2ivMESA mglWindowPos2ivMESA +#define glWindowPos2svMESA mglWindowPos2svMESA +#define glWindowPos2fvMESA mglWindowPos2fvMESA +#define glWindowPos2dvMESA mglWindowPos2dvMESA +#define glWindowPos3iMESA mglWindowPos3iMESA +#define glWindowPos3sMESA mglWindowPos3sMESA +#define glWindowPos3fMESA mglWindowPos3fMESA +#define glWindowPos3dMESA mglWindowPos3dMESA +#define glWindowPos3ivMESA mglWindowPos3ivMESA +#define glWindowPos3svMESA mglWindowPos3svMESA +#define glWindowPos3fvMESA mglWindowPos3fvMESA +#define glWindowPos3dvMESA mglWindowPos3dvMESA +#define glWindowPos4iMESA mglWindowPos4iMESA +#define glWindowPos4sMESA mglWindowPos4sMESA +#define glWindowPos4fMESA mglWindowPos4fMESA +#define glWindowPos4dMESA mglWindowPos4dMESA +#define glWindowPos4ivMESA mglWindowPos4ivMESA +#define glWindowPos4svMESA mglWindowPos4svMESA +#define glWindowPos4fvMESA mglWindowPos4fvMESA +#define glWindowPos4dvMESA mglWindowPos4dvMESA +#define glResizeBuffersMESA mglResizeBuffersMESA +#define glDrawRangeElements mglDrawRangeElements +#define glTexImage3D mglTexImage3D +#define glTexSubImage3D mglTexSubImage3D +#define glCopyTexSubImage3D mglCopyTexSubImage3D +#define glHistogram mglHistogram +#define glResetHistogram mglResetHistogram +#define glGetHistogram mglGetHistogram +#define glGetHistogramParameterfv mglGetHistogramParameterfv +#define glGetHistogramParameteriv mglGetHistogramParameteriv +#define glMinmax mglMinmax +#define glResetMinmax mglResetMinmax +#define glGetMinmax mglGetMinmax +#define glGetMinmaxParameterfv mglGetMinmaxParameterfv +#define glGetMinmaxParameteriv mglGetMinmaxParameteriv +#define glConvolutionFilter1D mglConvolutionFilter1D +#define glConvolutionFilter2D mglConvolutionFilter2D +#define glConvolutionParameterf mglConvolutionParameterf +#define glConvolutionParameterfv mglConvolutionParameterfv +#define glConvolutionParameteri mglConvolutionParameteri +#define glConvolutionParameteriv mglConvolutionParameteriv +#define glCopyConvolutionFilter1D mglCopyConvolutionFilter1D +#define glCopyConvolutionFilter2D mglCopyConvolutionFilter2D +#define glGetConvolutionFilter mglGetConvolutionFilter +#define glGetConvolutionParameterfv mglGetConvolutionParameterfv +#define glGetConvolutionParameteriv mglGetConvolutionParameteriv +#define glSeparableFilter2D mglSeparableFilter2D +#define glGetSeparableFilter mglGetSeparableFilter +#define glCopyColorSubTable mglCopyColorSubTable +#define glCopyColorTable mglCopyColorTable +#define glLockArraysEXT mglLockArraysEXT +#define glUnlockArraysEXT mglUnlockArraysEXT + +#endif diff --git a/xc/extras/Mesa/include/GL/mesa_wgl.h b/xc/extras/Mesa/include/GL/mesa_wgl.h new file mode 100644 index 000000000..93c4f2ff5 --- /dev/null +++ b/xc/extras/Mesa/include/GL/mesa_wgl.h @@ -0,0 +1,123 @@ +/* $Id: mesa_wgl.h,v 1.1 2000/11/30 17:31:30 dawes Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.1
+ *
+ * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/* prototypes for the Mesa WGL functions */
+/* relocated here so that I could make GLUT get them properly */
+
+#ifndef _mesa_wgl_h_
+#define _mesa_wgl_h_
+
+
+#include <gl/gl.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN32__))
+# if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
+# define GLAPI __declspec(dllexport)
+# define WGLAPI __declspec(dllexport)
+# elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
+# define GLAPI __declspec(dllimport)
+# define WGLAPI __declspec(dllimport)
+# else /* for use with static link lib build of Win32 edition only */
+# define GLAPI extern
+# define WGLAPI __declspec(dllimport)
+# endif /* _STATIC_MESA support */
+# define GLAPIENTRY __stdcall
+#else
+/* non-Windows compilation */
+# define GLAPI extern
+# define GLAPIENTRY
+#endif /* WIN32 / CYGWIN32 bracket */
+
+
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
+#ifndef _GNU_H_WINDOWS32_FUNCTIONS
+# ifdef UNICODE
+# define wglUseFontBitmaps wglUseFontBitmapsW
+# define wglUseFontOutlines wglUseFontOutlinesW
+# else
+# define wglUseFontBitmaps wglUseFontBitmapsA
+# define wglUseFontOutlines wglUseFontOutlinesA
+# endif /* !UNICODE */
+#endif /* _GNU_H_WINDOWS32_FUNCTIONS */
+typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
+typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
+typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
+#endif
+
+
+#ifdef _MSC_VER
+# pragma warning( disable : 4615 ) /* pragma warning : unknown user warning type*/
+# pragma warning( push )
+# pragma warning( disable : 4273 ) /* 'function' : inconsistent DLL linkage. dllexport assumed. */
+#endif
+
+WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
+WGLAPI int GLAPIENTRY wglMakeCurrent(HDC,HGLRC);
+WGLAPI int GLAPIENTRY wglSetPixelFormat(HDC, int, const PIXELFORMATDESCRIPTOR *);
+WGLAPI int GLAPIENTRY wglSwapBuffers(HDC hdc);
+WGLAPI HDC GLAPIENTRY wglGetCurrentDC(void);
+WGLAPI HGLRC GLAPIENTRY wglCreateContext(HDC);
+WGLAPI HGLRC GLAPIENTRY wglCreateLayerContext(HDC,int);
+WGLAPI HGLRC GLAPIENTRY wglGetCurrentContext(void);
+WGLAPI PROC GLAPIENTRY wglGetProcAddress(const char*);
+WGLAPI int GLAPIENTRY wglChoosePixelFormat(HDC, const PIXELFORMATDESCRIPTOR *);
+WGLAPI int GLAPIENTRY wglCopyContext(HGLRC, HGLRC, unsigned int);
+WGLAPI int GLAPIENTRY wglDeleteContext(HGLRC);
+WGLAPI int GLAPIENTRY wglDescribeLayerPlane(HDC, int, int, unsigned int,LPLAYERPLANEDESCRIPTOR);
+WGLAPI int GLAPIENTRY wglDescribePixelFormat(HDC,int, unsigned int, LPPIXELFORMATDESCRIPTOR);
+WGLAPI int GLAPIENTRY wglGetLayerPaletteEntries(HDC, int, int, int,COLORREF *);
+WGLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
+WGLAPI int GLAPIENTRY wglMakeCurrent(HDC, HGLRC);
+WGLAPI int GLAPIENTRY wglRealizeLayerPalette(HDC, int, int);
+WGLAPI int GLAPIENTRY wglSetLayerPaletteEntries(HDC, int, int, int,const COLORREF *);
+WGLAPI int GLAPIENTRY wglShareLists(HGLRC, HGLRC);
+WGLAPI int GLAPIENTRY wglSwapLayerBuffers(HDC, unsigned int);
+WGLAPI int GLAPIENTRY wglUseFontBitmapsA(HDC, unsigned long, unsigned long, unsigned long);
+WGLAPI int GLAPIENTRY wglUseFontBitmapsW(HDC, unsigned long, unsigned long, unsigned long);
+WGLAPI int GLAPIENTRY wglUseFontOutlinesA(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
+WGLAPI int GLAPIENTRY wglUseFontOutlinesW(HDC, unsigned long, unsigned long, unsigned long, float,float, int, LPGLYPHMETRICSFLOAT);
+WGLAPI int GLAPIENTRY SwapBuffers(HDC);
+WGLAPI int GLAPIENTRY ChoosePixelFormat(HDC,const PIXELFORMATDESCRIPTOR *);
+WGLAPI int GLAPIENTRY DescribePixelFormat(HDC,int,unsigned int,LPPIXELFORMATDESCRIPTOR);
+WGLAPI int GLAPIENTRY GetPixelFormat(HDC);
+WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
+
+#ifdef _MSC_VER
+# pragma warning( pop )
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _mesa_wgl_h_ */
diff --git a/xc/extras/Mesa/include/GLView.h b/xc/extras/Mesa/include/GLView.h new file mode 100644 index 000000000..71fc6ac3e --- /dev/null +++ b/xc/extras/Mesa/include/GLView.h @@ -0,0 +1,196 @@ +/******************************************************************************* +/ +/ File: GLView.h +/ +/ Copyright 1993-98, Be Incorporated, All Rights Reserved. +/ +*******************************************************************************/ + +#ifndef BGLVIEW_H +#define BGLVIEW_H + +// added by Brian Paul: +#ifndef BGL_RGB +#define BGL_RGB 0 +#define BGL_INDEX 1 +#define BGL_SINGLE 0 +#define BGL_DOUBLE 2 +#define BGL_DIRECT 0 +#define BGL_INDIRECT 4 +#define BGL_ACCUM 8 +#define BGL_ALPHA 16 +#define BGL_DEPTH 32 +#define BGL_OVERLAY 64 +#define BGL_UNDERLAY 128 +#define BGL_STENCIL 512 +#endif + + +#include <GL/gl.h> +#include <AppKit.h> +#include <interface/Window.h> +#include <interface/View.h> +#include <interface/Bitmap.h> +#include <game/WindowScreen.h> +#include <game/DirectWindow.h> + +class BGLView : public BView { +public: + + BGLView(BRect rect, char *name, + ulong resizingMode, ulong mode, + ulong options); + virtual ~BGLView(); + + void LockGL(); + void UnlockGL(); + void SwapBuffers(); + + // Added for Mesa (can't be virtual!) + void CopySubBufferMESA(GLint x, GLint y, GLuint width, GLuint height); + + BView * EmbeddedView(); + status_t CopyPixelsOut(BPoint source, BBitmap *dest); + status_t CopyPixelsIn(BBitmap *source, BPoint dest); + + virtual void ErrorCallback(GLenum errorCode); + + virtual void Draw(BRect updateRect); + + virtual void AttachedToWindow(); + virtual void AllAttached(); + virtual void DetachedFromWindow(); + virtual void AllDetached(); + + virtual void FrameResized(float width, float height); + virtual status_t Perform(perform_code d, void *arg); + + /* The public methods below, for the moment, + are just pass-throughs to BView */ + + virtual status_t Archive(BMessage *data, bool deep = true) const; + + virtual void MessageReceived(BMessage *msg); + virtual void SetResizingMode(uint32 mode); + + virtual void Show(); + virtual void Hide(); + + virtual BHandler *ResolveSpecifier(BMessage *msg, int32 index, + BMessage *specifier, int32 form, + const char *property); + virtual status_t GetSupportedSuites(BMessage *data); + + /* New public functions */ + void DirectConnected( direct_buffer_info *info ); + void EnableDirectMode( bool enabled ); + +private: + + virtual void _ReservedGLView1(); + virtual void _ReservedGLView2(); + virtual void _ReservedGLView3(); + virtual void _ReservedGLView4(); + virtual void _ReservedGLView5(); + virtual void _ReservedGLView6(); + virtual void _ReservedGLView7(); + virtual void _ReservedGLView8(); + + BGLView(const BGLView &); + BGLView &operator=(const BGLView &); + + void dither_front(); + bool confirm_dither(); + void draw(BRect r); + + void * m_gc; + uint32 m_options; + uint32 m_ditherCount; + BLocker m_drawLock; + BLocker m_displayLock; +#if OLD_GLVIEW + BView * m_embeddedFront; + BView * m_embeddedBack; +#else + void * m_clip_info; + void * _reserved1; +#endif + BBitmap * m_ditherMap; + BRect m_bounds; + int16 * m_errorBuffer[2]; + uint64 _reserved[8]; + + /* Direct Window stuff */ +private: + void drawScanline( int x1, int x2, int y, void *data ); + static void scanlineHandler(struct rasStateRec *state, GLint x1, GLint x2); + void lock_draw(); + void unlock_draw(); + bool validateView(); +}; + + + +class BGLScreen : public BWindowScreen { +public: + BGLScreen(char *name, + ulong screenMode, ulong options, + status_t *error, bool debug=false); + ~BGLScreen(); + + void LockGL(); + void UnlockGL(); + void SwapBuffers(); + virtual void ErrorCallback(GLenum errorCode); + + virtual void ScreenConnected(bool connected); + virtual void FrameResized(float width, float height); + virtual status_t Perform(perform_code d, void *arg); + + /* The public methods below, for the moment, + are just pass-throughs to BWindowScreen */ + + virtual status_t Archive(BMessage *data, bool deep = true) const; + virtual void MessageReceived(BMessage *msg); + + virtual void Show(); + virtual void Hide(); + + virtual BHandler *ResolveSpecifier(BMessage *msg, + int32 index, + BMessage *specifier, + int32 form, + const char *property); + virtual status_t GetSupportedSuites(BMessage *data); + +private: + + virtual void _ReservedGLScreen1(); + virtual void _ReservedGLScreen2(); + virtual void _ReservedGLScreen3(); + virtual void _ReservedGLScreen4(); + virtual void _ReservedGLScreen5(); + virtual void _ReservedGLScreen6(); + virtual void _ReservedGLScreen7(); + virtual void _ReservedGLScreen8(); + + BGLScreen(const BGLScreen &); + BGLScreen &operator=(const BGLScreen &); + + void * m_gc; + long m_options; + BLocker m_drawLock; + + int32 m_colorSpace; + uint32 m_screen_mode; + + uint64 _reserved[7]; +}; + + +#endif + + + + + diff --git a/xc/extras/Mesa/include/Makefile.am b/xc/extras/Mesa/include/Makefile.am new file mode 100644 index 000000000..90f2094b8 --- /dev/null +++ b/xc/extras/Mesa/include/Makefile.am @@ -0,0 +1,3 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = GL diff --git a/xc/extras/Mesa/include/Makefile.in b/xc/extras/Mesa/include/Makefile.in new file mode 100644 index 000000000..84ff453ea --- /dev/null +++ b/xc/extras/Mesa/include/Makefile.in @@ -0,0 +1,304 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +SUBDIRS = GL +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../conf.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = include + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu include/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-tags distclean-generic clean-am + -rm -f libtool + +distclean: distclean-recursive + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + +.PHONY: install-data-recursive uninstall-data-recursive \ +install-exec-recursive uninstall-exec-recursive installdirs-recursive \ +uninstalldirs-recursive all-recursive check-recursive \ +installcheck-recursive info-recursive dvi-recursive \ +mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/install-sh b/xc/extras/Mesa/install-sh new file mode 100755 index 000000000..e9de23842 --- /dev/null +++ b/xc/extras/Mesa/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/xc/extras/Mesa/mesaw32.BAT b/xc/extras/Mesa/mesaw32.BAT new file mode 100755 index 000000000..6ee578b39 --- /dev/null +++ b/xc/extras/Mesa/mesaw32.BAT @@ -0,0 +1,20 @@ +@echo off + +set _argc=0 +:loops +if [%1] == [] goto loope +If _argc == 0 set _args=%1 +If Not _argc == 0 set _args=%_args% %1 +set _argc=1 +shift +goto loops +:loope + +if %_argc% == 0 set _args=help + +cd win32 +nmake /f nmake.mak %_args% +cd .. + +set _args= +set _argc= diff --git a/xc/extras/Mesa/mesawin32.mak b/xc/extras/Mesa/mesawin32.mak new file mode 100644 index 000000000..9adb794ab --- /dev/null +++ b/xc/extras/Mesa/mesawin32.mak @@ -0,0 +1,41 @@ +# Be sure to modify the definitions in this file to agree with your +# systems installation. +# +# NOTE: be sure that the install directories use '\' not '/' for paths. +# +# Modified by tjump@spgs.com for better functioning with the win32\ build +# rules. + +# BEGIN USER MODIFICATION ZONE ... +# +# Make sure the following definitions make sense for your system! They +# *should* pluck out reasonable defaults, however it is possible for +# this code to fail in it's setup. +# +# These definitions are used only by build files in the win32\ subdirectory. +# + +# import libraries install directory +# +LIBINSTALL = $(MSDEVDIR)\..\VC\LIB + +# header file installation directory +HDRINSTALL = $(MSDEVDIR)\..\VC\INCLUDE + +# dll file installation directory +# +!IF "$(OS)" == "Windows_NT" +DLLINSTALL = $(WINDIR)\SYSTEM32 +!ELSE # "$(OS)" != "Windows_NT" +DLLINSTALL = $(WINDIR)\SYSTEM +!ENDIF + +# END USER MODIFICATION ZONE ... +# +# you should not need to change anything beyond this line manually. + +!IF "$(DEVDIR)" != "" +LIBINSTALL = $(DEVDIR)\SDK\LIB\WIN32\VC +HDRINSTALL = $(DEVDIR)\SDK\H +DLLINSTALL = $(DEVDIR)\SDK\BIN +!ENDIF diff --git a/xc/extras/Mesa/mkinstalldirs b/xc/extras/Mesa/mkinstalldirs new file mode 100755 index 000000000..034ef0aeb --- /dev/null +++ b/xc/extras/Mesa/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/xc/extras/Mesa/mms-config b/xc/extras/Mesa/mms-config new file mode 100644 index 000000000..f06f4f523 --- /dev/null +++ b/xc/extras/Mesa/mms-config @@ -0,0 +1,23 @@ +# Makefile for VMS +# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl + + +#vms +.ifdef SHARE +GL_LIB = libMesaGL.exe +GLU_LIB = libMesaGLU.exe +GLUT_LIB = libglut.exe +.else +GL_LIB = libMesaGL.olb +GLU_LIB = libMesaGLU.olb +GLUT_LIB = libglut.olb +.endif +CC = cc +CFLAGS1 = +MAKELIB = library/create +RANLIB = true +.ifdef SHARE +XLIBS = [-.vms]xlib_share/opt +.else +XLIBS = [-.vms]xlib/opt +.endif diff --git a/xc/extras/Mesa/src/BeOS/GLView.cpp b/xc/extras/Mesa/src/BeOS/GLView.cpp new file mode 100644 index 000000000..27ddda9d7 --- /dev/null +++ b/xc/extras/Mesa/src/BeOS/GLView.cpp @@ -0,0 +1,1261 @@ +/* $Id: GLView.cpp,v 1.1 2000/11/30 17:31:36 dawes Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.1 + * + * Copyright (C) 1999 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + +/* + * $Log: GLView.cpp,v $ + * Revision 1.1 2000/11/30 17:31:36 dawes + * Initial revision + * + * Revision 1.2 2000/03/19 01:13:13 brianp + * updated for Mesa 3.3 + * + * Revision 1.1.1.1 1999/08/19 00:55:41 jtg + * Imported sources + * + * Revision 1.7 1999/03/28 21:08:17 brianp + * updated SetBuffer driver function + * + * Revision 1.6 1999/02/14 03:44:37 brianp + * new copyright + * + * Revision 1.5 1999/02/11 03:50:57 brianp + * added CopySubBufferMESA() + * + * Revision 1.4 1999/02/06 17:44:59 brianp + * code clean-up and bug fixes + * + * Revision 1.3 1999/02/04 04:13:15 brianp + * implemented double buffering + * + * Revision 1.2 1999/02/03 04:23:28 brianp + * basic device driver functions now work (yeah!) + * + * Revision 1.1 1999/02/02 04:40:46 brianp + * Initial revision + */ + + + +#include <assert.h> +#include <stdio.h> +#include <GLView.h> +#include "../src/context.h" + + +// BeOS component ordering for B_RGBA32 bitmap format +#define BE_RCOMP 2 +#define BE_GCOMP 1 +#define BE_BCOMP 0 +#define BE_ACOMP 3 + + +// +// This object hangs off of the BGLView object. We have to use +// Be's BGLView class as-is to maintain binary compatibility (we +// can't add new members to it). Instead we just put all our data +// in this class and use BGLVIew::m_gc to point to it. +// +class AuxInfo +{ +public: + AuxInfo(); + ~AuxInfo(); + void Init(BGLView *bglView, GLcontext *c, GLvisual *v, GLframebuffer *b); + + void MakeCurrent(); + void SwapBuffers() const; + void CopySubBuffer(GLint x, GLint y, GLuint width, GLuint height) const; + +private: + AuxInfo(const AuxInfo &rhs); // copy constructor illegal + AuxInfo &operator=(const AuxInfo &rhs); // assignment oper. illegal + + GLcontext *mContext; + GLvisual *mVisual; + GLframebuffer *mBuffer; + + BGLView *mBGLView; + BBitmap *mBitmap; + + GLubyte mColor[4]; // current color + GLuint mIndex; // current color index + GLubyte mClearColor[4]; // buffer clear color + GLuint mClearIndex; // buffer clear color index + GLint mBottom; // used for flipping Y coords + GLint mWidth, mHeight; // size of buffer + + // Mesa device driver functions + static void UpdateState(GLcontext *ctx); + static void ClearIndex(GLcontext *ctx, GLuint index); + static void ClearColor(GLcontext *ctx, GLubyte r, GLubyte g, + GLubyte b, GLubyte a); + static GLbitfield Clear(GLcontext *ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, + GLint width, GLint height); + static void ClearFront(GLcontext *ctx, GLboolean all, GLint x, GLint y, + GLint width, GLint height); + static void ClearBack(GLcontext *ctx, GLboolean all, GLint x, GLint y, + GLint width, GLint height); + static void Index(GLcontext *ctx, GLuint index); + static void Color(GLcontext *ctx, GLubyte r, GLubyte g, + GLubyte b, GLubyte a); + static GLboolean SetDrawBuffer(GLcontext *ctx, GLenum mode); + static void SetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLenum mode); + static void GetBufferSize(GLcontext *ctgx, GLuint *width, + GLuint *height); + static const GLubyte *GetString(GLcontext *ctx, GLenum name); + + // Front-buffer functions + static void WriteRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]); + static void WriteRGBSpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][3], + const GLubyte mask[]); + static void WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, const GLubyte mask[]); + static void WriteRGBAPixelsFront(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[]); + static void WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLubyte mask[]); + static void WriteCI32SpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLuint index[], const GLubyte mask[]); + static void WriteCI8SpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLubyte index[], const GLubyte mask[]); + static void WriteMonoCISpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, const GLubyte mask[]); + static void WriteCI32PixelsFront(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + const GLuint index[], const GLubyte mask[]); + static void WriteMonoCIPixelsFront(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLubyte mask[]); + static void ReadCI32SpanFront(const GLcontext *ctx, + GLuint n, GLint x, GLint y, GLuint index[]); + static void ReadRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + GLubyte rgba[][4]); + static void ReadCI32PixelsFront(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint indx[], const GLubyte mask[]); + static void ReadRGBAPixelsFront(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[]); + + // Back buffer functions + static void WriteRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]); + static void WriteRGBSpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][3], + const GLubyte mask[]); + static void WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, const GLubyte mask[]); + static void WriteRGBAPixelsBack(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[]); + static void WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLubyte mask[]); + static void WriteCI32SpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLuint index[], const GLubyte mask[]); + static void WriteCI8SpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLubyte index[], const GLubyte mask[]); + static void WriteMonoCISpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLubyte mask[]); + static void WriteCI32PixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + const GLuint index[], const GLubyte mask[]); + static void WriteMonoCIPixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + const GLubyte mask[]); + static void ReadCI32SpanBack(const GLcontext *ctx, + GLuint n, GLint x, GLint y, GLuint index[]); + static void ReadRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + GLubyte rgba[][4]); + static void ReadCI32PixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint indx[], const GLubyte mask[]); + static void ReadRGBAPixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[]); + +}; + + + +AuxInfo::AuxInfo() +{ + mContext = NULL; + mVisual = NULL; + mBuffer = NULL; + mBGLView = NULL; + mBitmap = NULL; + mClearColor[BE_RCOMP] = 0; + mClearColor[BE_GCOMP] = 0; + mClearColor[BE_BCOMP] = 0; + mClearColor[BE_ACOMP] = 0; + mClearIndex = 0; + mColor[BE_RCOMP] = 255; + mColor[BE_GCOMP] = 255; + mColor[BE_BCOMP] = 255; + mColor[BE_ACOMP] = 255; + mIndex = 1; +} + + +AuxInfo::~AuxInfo() +{ + + gl_destroy_visual(mVisual); + gl_destroy_framebuffer(mBuffer); + gl_destroy_context(mContext); +} + + +void AuxInfo::Init(BGLView *bglView, GLcontext *c, GLvisual *v, GLframebuffer *b) +{ + mBGLView = bglView; + mContext = c; + mVisual = v; + mBuffer = b; +} + + +void AuxInfo::MakeCurrent() +{ + UpdateState(mContext); + gl_make_current(mContext, mBuffer); +} + + +void AuxInfo::SwapBuffers() const +{ + if (mBitmap) { + mBGLView->DrawBitmap(mBitmap, BPoint(0, 0)); + } +} + + +void AuxInfo::CopySubBuffer(GLint x, GLint y, GLuint width, GLuint height) const +{ + if (mBitmap) { + // Source bitmap and view's bitmap are same size. + // Source and dest rectangle are the same. + // Note (x,y) = (0,0) is the lower-left corner, have to flip Y + BRect srcAndDest; + srcAndDest.left = x; + srcAndDest.right = x + width - 1; + srcAndDest.bottom = mBottom - y; + srcAndDest.top = srcAndDest.bottom - height + 1; + mBGLView->DrawBitmap(mBitmap, srcAndDest, srcAndDest); + } +} + + +void AuxInfo::UpdateState( GLcontext *ctx ) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + + assert(aux->mContext == ctx ); + + ctx->Driver.UpdateState = AuxInfo::UpdateState; + ctx->Driver.SetDrawBuffer = AuxInfo::SetDrawBuffer; + ctx->Driver.SetReadBuffer = AuxInfo::SetReadBuffer; + ctx->Driver.Color = AuxInfo::Color; + ctx->Driver.Index = AuxInfo::Index; + ctx->Driver.ClearIndex = AuxInfo::ClearIndex; + ctx->Driver.ClearColor = AuxInfo::ClearColor; + ctx->Driver.GetBufferSize = AuxInfo::GetBufferSize; + ctx->Driver.GetString = AuxInfo::GetString; + ctx->Driver.Clear = AuxInfo::Clear; + + if (ctx->Color.DrawBuffer == GL_FRONT) { + /* read/write front buffer */ + ctx->Driver.WriteRGBASpan = AuxInfo::WriteRGBASpanFront; + ctx->Driver.WriteRGBSpan = AuxInfo::WriteRGBSpanFront; + ctx->Driver.WriteRGBAPixels = AuxInfo::WriteRGBAPixelsFront; + ctx->Driver.WriteMonoRGBASpan = AuxInfo::WriteMonoRGBASpanFront; + ctx->Driver.WriteMonoRGBAPixels = AuxInfo::WriteMonoRGBAPixelsFront; + ctx->Driver.WriteCI32Span = AuxInfo::WriteCI32SpanFront; + ctx->Driver.WriteCI8Span = AuxInfo::WriteCI8SpanFront; + ctx->Driver.WriteMonoCISpan = AuxInfo::WriteMonoCISpanFront; + ctx->Driver.WriteCI32Pixels = AuxInfo::WriteCI32PixelsFront; + ctx->Driver.WriteMonoCIPixels = AuxInfo::WriteMonoCIPixelsFront; + ctx->Driver.ReadRGBASpan = AuxInfo::ReadRGBASpanFront; + ctx->Driver.ReadRGBAPixels = AuxInfo::ReadRGBAPixelsFront; + ctx->Driver.ReadCI32Span = AuxInfo::ReadCI32SpanFront; + ctx->Driver.ReadCI32Pixels = AuxInfo::ReadCI32PixelsFront; + } + else { + /* read/write back buffer */ + ctx->Driver.WriteRGBASpan = AuxInfo::WriteRGBASpanBack; + ctx->Driver.WriteRGBSpan = AuxInfo::WriteRGBSpanBack; + ctx->Driver.WriteRGBAPixels = AuxInfo::WriteRGBAPixelsBack; + ctx->Driver.WriteMonoRGBASpan = AuxInfo::WriteMonoRGBASpanBack; + ctx->Driver.WriteMonoRGBAPixels = AuxInfo::WriteMonoRGBAPixelsBack; + ctx->Driver.WriteCI32Span = AuxInfo::WriteCI32SpanBack; + ctx->Driver.WriteCI8Span = AuxInfo::WriteCI8SpanBack; + ctx->Driver.WriteMonoCISpan = AuxInfo::WriteMonoCISpanBack; + ctx->Driver.WriteCI32Pixels = AuxInfo::WriteCI32PixelsBack; + ctx->Driver.WriteMonoCIPixels = AuxInfo::WriteMonoCIPixelsBack; + ctx->Driver.ReadRGBASpan = AuxInfo::ReadRGBASpanBack; + ctx->Driver.ReadRGBAPixels = AuxInfo::ReadRGBAPixelsBack; + ctx->Driver.ReadCI32Span = AuxInfo::ReadCI32SpanBack; + ctx->Driver.ReadCI32Pixels = AuxInfo::ReadCI32PixelsBack; + } +} + + +void AuxInfo::ClearIndex(GLcontext *ctx, GLuint index) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + aux->mClearIndex = index; +} + + +void AuxInfo::ClearColor(GLcontext *ctx, GLubyte r, GLubyte g, + GLubyte b, GLubyte a) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + aux->mClearColor[BE_RCOMP] = r; + aux->mClearColor[BE_GCOMP] = g; + aux->mClearColor[BE_BCOMP] = b; + aux->mClearColor[BE_ACOMP] = a; + assert(aux->mBGLView); +} + + +GLbitfield AuxInfo::Clear(GLcontext *ctx, GLbitfield mask, + GLboolean all, GLint x, GLint y, + GLint width, GLint height) +{ + if (mask & DD_FRONT_LEFT_BIT) + ClearFront(ctx, all, x, y, width, height); + if (mask & DD_BACK_LEFT_BIT) + ClearBack(ctx, all, x, y, width, height); + return mask & ~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT); +} + + +void AuxInfo::ClearFront(GLcontext *ctx, + GLboolean all, GLint x, GLint y, + GLint width, GLint height) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + + bglview->SetHighColor(aux->mClearColor[BE_RCOMP], + aux->mClearColor[BE_GCOMP], + aux->mClearColor[BE_BCOMP], + aux->mClearColor[BE_ACOMP]); + bglview->SetLowColor(aux->mClearColor[BE_RCOMP], + aux->mClearColor[BE_GCOMP], + aux->mClearColor[BE_BCOMP], + aux->mClearColor[BE_ACOMP]); + if (all) { + BRect b = bglview->Bounds(); + bglview->FillRect(b); + } + else { + // XXX untested + BRect b; + b.left = x; + b.right = x + width; + b.bottom = aux->mHeight - y - 1; + b.top = b.bottom - height; + bglview->FillRect(b); + } + + // restore drawing color + bglview->SetHighColor(aux->mColor[BE_RCOMP], + aux->mColor[BE_GCOMP], + aux->mColor[BE_BCOMP], + aux->mColor[BE_ACOMP]); + bglview->SetLowColor(aux->mColor[BE_RCOMP], + aux->mColor[BE_GCOMP], + aux->mColor[BE_BCOMP], + aux->mColor[BE_ACOMP]); +} + + +void AuxInfo::ClearBack(GLcontext *ctx, + GLboolean all, GLint x, GLint y, + GLint width, GLint height) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + BBitmap *bitmap = aux->mBitmap; + assert(bitmap); + GLuint *start = (GLuint *) bitmap->Bits(); + const GLuint *clearPixelPtr = (const GLuint *) aux->mClearColor; + const GLuint clearPixel = *clearPixelPtr; + + if (all) { + const int numPixels = aux->mWidth * aux->mHeight; + if (clearPixel == 0) { + memset(start, 0, numPixels * 4); + } + else { + for (int i = 0; i < numPixels; i++) { + start[i] = clearPixel; + } + } + } + else { + // XXX untested + start += y * aux->mWidth + x; + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) { + start[j] = clearPixel; + } + start += aux->mWidth; + } + } +} + + +void AuxInfo::Index(GLcontext *ctx, GLuint index) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + aux->mIndex = index; +} + + +void AuxInfo::Color(GLcontext *ctx, GLubyte r, GLubyte g, + GLubyte b, GLubyte a) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + aux->mColor[BE_RCOMP] = r; + aux->mColor[BE_GCOMP] = g; + aux->mColor[BE_BCOMP] = b; + aux->mColor[BE_ACOMP] = a; + bglview->SetHighColor(r, g, b, a); + bglview->SetLowColor(r, g, b, a); +} + +GLboolean AuxInfo::SetDrawBuffer(GLcontext *ctx, GLenum buffer) +{ + if (buffer == GL_FRONT_LEFT) + return GL_TRUE; + else if (buffer == GL_BACK_LEFT) + return GL_TRUE; + else + return GL_FALSE; +} + +void AuxInfo::SetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer, + GLenum buffer) +{ + /* XXX to do */ +} + +void AuxInfo::GetBufferSize(GLcontext *ctx, GLuint *width, + GLuint *height) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + BRect b = bglview->Bounds(); + *width = (GLuint) (b.right - b.left + 1); + *height = (GLuint) (b.bottom - b.top + 1); + aux->mBottom = (GLint) b.bottom; + + if (ctx->Visual->DBflag) { + if (*width != aux->mWidth || *height != aux->mHeight) { + // allocate new size of back buffer bitmap + if (aux->mBitmap) + delete aux->mBitmap; + BRect rect(0.0, 0.0, *width - 1, *height - 1); + aux->mBitmap = new BBitmap(rect, B_RGBA32); + } + } + else + { + aux->mBitmap = NULL; + } + + aux->mWidth = *width; + aux->mHeight = *height; +} + + +const GLubyte *AuxInfo::GetString(GLcontext *ctx, GLenum name) +{ + switch (name) { + case GL_RENDERER: + return (const GLubyte *) "Mesa BeOS"; + default: + // Let core library handle all other cases + return NULL; + } +} + + +// Plot a pixel. (0,0) is upper-left corner +// This is only used when drawing to the front buffer. +static void Plot(BGLView *bglview, int x, int y) +{ + // XXX There's got to be a better way! + BPoint p(x, y), q(x+1, y); + bglview->StrokeLine(p, q); +} + + +void AuxInfo::WriteRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + int flippedY = aux->mBottom - y; + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2], rgba[i][3]); + Plot(bglview, x++, flippedY); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2], rgba[i][3]); + Plot(bglview, x++, flippedY); + } + } +} + +void AuxInfo::WriteRGBSpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][3], + const GLubyte mask[]) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + int flippedY = aux->mBottom - y; + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2]); + Plot(bglview, x++, flippedY); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2]); + Plot(bglview, x++, flippedY); + } + } +} + +void AuxInfo::WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n, + GLint x, GLint y, const GLubyte mask[]) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + int flippedY = aux->mBottom - y; + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + Plot(bglview, x++, flippedY); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + Plot(bglview, x++, flippedY); + } + } +} + +void AuxInfo::WriteRGBAPixelsFront(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[] ) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2]); + Plot(bglview, x[i], aux->mBottom - y[i]); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + bglview->SetHighColor(rgba[i][0], rgba[i][1], rgba[i][2]); + Plot(bglview, x[i], aux->mBottom - y[i]); + } + } +} + + +void AuxInfo::WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLubyte mask[]) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BGLView *bglview = aux->mBGLView; + assert(bglview); + // plot points using current color + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + Plot(bglview, x[i], aux->mBottom - y[i]); + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + Plot(bglview, x[i], aux->mBottom - y[i]); + } + } +} + + +void AuxInfo::WriteCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLuint index[], const GLubyte mask[] ) +{ + // XXX to do +} + +void AuxInfo::WriteCI8SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y, + const GLubyte index[], const GLubyte mask[] ) +{ + // XXX to do +} + +void AuxInfo::WriteMonoCISpanFront( const GLcontext *ctx, GLuint n, + GLint x, GLint y, const GLubyte mask[] ) +{ + // XXX to do +} + + +void AuxInfo::WriteCI32PixelsFront( const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLuint index[], const GLubyte mask[] ) +{ + // XXX to do +} + +void AuxInfo::WriteMonoCIPixelsFront( const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLubyte mask[] ) +{ + // XXX to do +} + + +void AuxInfo::ReadCI32SpanFront( const GLcontext *ctx, + GLuint n, GLint x, GLint y, GLuint index[] ) +{ + // XXX to do +} + + +void AuxInfo::ReadRGBASpanFront( const GLcontext *ctx, GLuint n, + GLint x, GLint y, GLubyte rgba[][4] ) +{ + // XXX to do +} + + +void AuxInfo::ReadCI32PixelsFront( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint indx[], const GLubyte mask[] ) +{ + // XXX to do +} + + +void AuxInfo::ReadRGBAPixelsFront( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[] ) +{ + // XXX to do +} + + + + +void AuxInfo::WriteRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgba[][4], + const GLubyte mask[]) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BBitmap *bitmap = aux->mBitmap; + assert(bitmap); + int row = aux->mBottom - y; + GLubyte *pixel = (GLubyte *) bitmap->Bits() + (row * aux->mWidth + x) * 4; + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + pixel[BE_RCOMP] = rgba[i][RCOMP]; + pixel[BE_GCOMP] = rgba[i][GCOMP]; + pixel[BE_BCOMP] = rgba[i][BCOMP]; + pixel[BE_ACOMP] = rgba[i][ACOMP]; + } + pixel += 4; + } + } + else { + for (GLuint i = 0; i < n; i++) { + pixel[BE_RCOMP] = rgba[i][RCOMP]; + pixel[BE_GCOMP] = rgba[i][GCOMP]; + pixel[BE_BCOMP] = rgba[i][BCOMP]; + pixel[BE_ACOMP] = rgba[i][ACOMP]; + pixel += 4; + } + } +} + + +void AuxInfo::WriteRGBSpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, + CONST GLubyte rgb[][3], + const GLubyte mask[]) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BBitmap *bitmap = aux->mBitmap; + assert(bitmap); + int row = aux->mBottom - y; + GLubyte *pixel = (GLubyte *) bitmap->Bits() + (row * aux->mWidth + x) * 4; + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + pixel[BE_RCOMP] = rgb[i][RCOMP]; + pixel[BE_GCOMP] = rgb[i][GCOMP]; + pixel[BE_BCOMP] = rgb[i][BCOMP]; + pixel[BE_ACOMP] = 255; + } + pixel += 4; + } + } + else { + for (GLuint i = 0; i < n; i++) { + pixel[BE_RCOMP] = rgb[i][RCOMP]; + pixel[BE_GCOMP] = rgb[i][GCOMP]; + pixel[BE_BCOMP] = rgb[i][BCOMP]; + pixel[BE_ACOMP] = 255; + pixel += 4; + } + } +} + + +void AuxInfo::WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n, + GLint x, GLint y, const GLubyte mask[]) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BBitmap *bitmap = aux->mBitmap; + assert(bitmap); + int row = aux->mBottom - y; + GLuint *pixelPtr = (GLuint *) bitmap->Bits() + row * aux->mWidth + x; + const GLuint pixel = *((GLuint *) aux->mColor); + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) + *pixelPtr = pixel; + pixelPtr++; + } + } + else { + for (GLuint i = 0; i < n; i++) { + *pixelPtr++ = pixel; + } + } +} + + +void AuxInfo::WriteRGBAPixelsBack(const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + CONST GLubyte rgba[][4], + const GLubyte mask[] ) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BBitmap *bitmap = aux->mBitmap; + assert(bitmap); + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + (aux->mBottom - y[i]) * bitmap->BytesPerRow() + x[i] * 4; + pixel[BE_RCOMP] = rgba[i][RCOMP]; + pixel[BE_GCOMP] = rgba[i][GCOMP]; + pixel[BE_BCOMP] = rgba[i][BCOMP]; + pixel[BE_ACOMP] = rgba[i][ACOMP]; + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + GLubyte *pixel = (GLubyte *) bitmap->Bits() + + (aux->mBottom - y[i]) * bitmap->BytesPerRow() + x[i] * 4; + pixel[BE_RCOMP] = rgba[i][RCOMP]; + pixel[BE_GCOMP] = rgba[i][GCOMP]; + pixel[BE_BCOMP] = rgba[i][BCOMP]; + pixel[BE_ACOMP] = rgba[i][ACOMP]; + } + } +} + + +void AuxInfo::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLubyte mask[]) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + BBitmap *bitmap = aux->mBitmap; + assert(bitmap); + const GLuint pixel = *((GLuint *) aux->mColor); + if (mask) { + for (GLuint i = 0; i < n; i++) { + if (mask[i]) { + GLuint *pixelPtr = (GLuint *) bitmap->Bits() + + (aux->mBottom - y[i]) * aux->mWidth + x[i]; + *pixelPtr = pixel; + } + } + } + else { + for (GLuint i = 0; i < n; i++) { + GLuint *pixelPtr = (GLuint *) bitmap->Bits() + + (aux->mBottom - y[i]) * aux->mWidth + x[i]; + *pixelPtr = pixel; + } + } +} + + +void AuxInfo::WriteCI32SpanBack( const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLuint index[], const GLubyte mask[] ) +{ + // XXX to do +} + +void AuxInfo::WriteCI8SpanBack( const GLcontext *ctx, GLuint n, + GLint x, GLint y, + const GLubyte index[], const GLubyte mask[] ) +{ + // XXX to do +} + +void AuxInfo::WriteMonoCISpanBack( const GLcontext *ctx, GLuint n, + GLint x, GLint y, const GLubyte mask[] ) +{ + // XXX to do +} + + +void AuxInfo::WriteCI32PixelsBack( const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLuint index[], const GLubyte mask[] ) +{ + // XXX to do +} + +void AuxInfo::WriteMonoCIPixelsBack( const GLcontext *ctx, GLuint n, + const GLint x[], const GLint y[], + const GLubyte mask[] ) +{ + // XXX to do +} + + +void AuxInfo::ReadCI32SpanBack( const GLcontext *ctx, + GLuint n, GLint x, GLint y, GLuint index[] ) +{ + // XXX to do +} + + +void AuxInfo::ReadRGBASpanBack( const GLcontext *ctx, GLuint n, + GLint x, GLint y, GLubyte rgba[][4] ) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + const BBitmap *bitmap = aux->mBitmap; + assert(bitmap); + int row = aux->mBottom - y; + const GLubyte *pixel = (GLubyte *) bitmap->Bits() + + row * bitmap->BytesPerRow() + x * 4; + for (GLuint i = 0; i < n; i++) { + rgba[i][RCOMP] = pixel[BE_RCOMP]; + rgba[i][GCOMP] = pixel[BE_GCOMP]; + rgba[i][BCOMP] = pixel[BE_BCOMP]; + rgba[i][ACOMP] = pixel[BE_ACOMP]; + pixel += 4; + } +} + + +void AuxInfo::ReadCI32PixelsBack( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLuint indx[], const GLubyte mask[] ) +{ + // XXX to do +} + + +void AuxInfo::ReadRGBAPixelsBack( const GLcontext *ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte rgba[][4], const GLubyte mask[] ) +{ + AuxInfo *aux = (AuxInfo *) ctx->DriverCtx; + const BBitmap *bitmap = aux->mBitmap; + assert(bitmap); + for (GLuint i = 0; i < n; i++) { + if (y[i] < aux->mHeight) { + const GLubyte *pixel = (const GLubyte *) bitmap->Bits() + + ((aux->mBottom - y[i]) * aux->mWidth + x[i]) * 4; + rgba[i][RCOMP] = pixel[BE_RCOMP]; + rgba[i][GCOMP] = pixel[BE_GCOMP]; + rgba[i][BCOMP] = pixel[BE_BCOMP]; + rgba[i][ACOMP] = pixel[BE_ACOMP]; + } + } +} + + + + +//------------------------------------------------------------------ +// Public interface methods +//------------------------------------------------------------------ + + +// +// Input: rect - initial rectangle +// name - window name +// resizingMode - example: B_FOLLOW_NONE +// mode - usually 0 ? +// options - Bitwise-OR of BGL_* tokens +// +BGLView::BGLView(BRect rect, char *name, + ulong resizingMode, ulong mode, + ulong options) + :BView(rect, name, resizingMode, mode) +{ + const GLboolean rgbFlag = (options & BGL_RGB) == BGL_RGB; + const GLboolean alphaFlag = (options & BGL_ALPHA) == BGL_ALPHA; + const GLboolean dblFlag = (options & BGL_DOUBLE) == BGL_DOUBLE; + const GLboolean stereoFlag = false; + const GLint depth = (options & BGL_DEPTH) ? 16 : 0; + const GLint stencil = (options & BGL_STENCIL) ? 8 : 0; + const GLint accum = (options & BGL_ACCUM) ? 16 : 0; + const GLint index = (options & BGL_INDEX) ? 32 : 0; + const GLint red = (options & BGL_RGB) ? 8 : 0; + const GLint green = (options & BGL_RGB) ? 8 : 0; + const GLint blue = (options & BGL_RGB) ? 8 : 0; + const GLint alpha = (options & BGL_RGB) ? 8 : 0; + + if (!rgbFlag) { + fprintf(stderr, "Mesa Warning: color index mode not supported\n"); + } + + // Allocate auxiliary data object + AuxInfo *aux = new AuxInfo; + + // examine option flags and create gl_context struct + GLvisual *visual = gl_create_visual( rgbFlag, alphaFlag, + dblFlag, stereoFlag, + depth, stencil, accum, index, + red, green, blue, alpha); + + // create core framebuffer + GLframebuffer *buffer = gl_create_framebuffer(visual, + depth > 0 ? GL_TRUE : GL_FALSE, + stencil > 0 ? GL_TRUE: GL_FALSE, + accum > 0 ? GL_TRUE : GL_FALSE, + alphaFlag + ); + + // create core context + const GLboolean direct = GL_TRUE; + GLcontext *ctx = gl_create_context( visual, NULL, aux, direct ); + + aux->Init(this, ctx, visual, buffer ); + + // Hook aux data into BGLView object + m_gc = aux; +} + + +BGLView::~BGLView() +{ + printf("BGLView destructor\n"); + AuxInfo *aux = (AuxInfo *) m_gc; + assert(aux); + delete aux; +} + +void BGLView::LockGL() +{ + AuxInfo *aux = (AuxInfo *) m_gc; + assert(aux); + aux->MakeCurrent(); +} + +void BGLView::UnlockGL() +{ + AuxInfo *aux = (AuxInfo *) m_gc; + assert(aux); + // Could call gl_make_current(NULL, NULL) but it would just + // hinder performance +} + +void BGLView::SwapBuffers() +{ + AuxInfo *aux = (AuxInfo *) m_gc; + assert(aux); + aux->SwapBuffers(); +} + + +void BGLView::CopySubBufferMESA(GLint x, GLint y, GLuint width, GLuint height) +{ + AuxInfo *aux = (AuxInfo *) m_gc; + assert(aux); + aux->CopySubBuffer(x, y, width, height); +} + + +BView *BGLView::EmbeddedView() +{ + // XXX to do + +} + +status_t BGLView::CopyPixelsOut(BPoint source, BBitmap *dest) +{ + // XXX to do +} + + +status_t BGLView::CopyPixelsIn(BBitmap *source, BPoint dest) +{ + // XXX to do +} + +void BGLView::ErrorCallback(GLenum errorCode) +{ + // XXX to do +} + +void BGLView::Draw(BRect updateRect) +{ +// printf("BGLView draw\n"); + // XXX to do +} + +void BGLView::AttachedToWindow() +{ + BView::AttachedToWindow(); + + // don't paint window background white when resized + SetViewColor(B_TRANSPARENT_32_BIT); +} + +void BGLView::AllAttached() +{ + BView::AllAttached(); +// printf("BGLView AllAttached\n"); +} + +void BGLView::DetachedFromWindow() +{ + BView::DetachedFromWindow(); +} + +void BGLView::AllDetached() +{ + BView::AllDetached(); +// printf("BGLView AllDetached"); +} + +void BGLView::FrameResized(float width, float height) +{ + return BView::FrameResized(width, height); +} + +status_t BGLView::Perform(perform_code d, void *arg) +{ + return BView::Perform(d, arg); +} + + +status_t BGLView::Archive(BMessage *data, bool deep) const +{ + return BView::Archive(data, deep); +} + +void BGLView::MessageReceived(BMessage *msg) +{ + BView::MessageReceived(msg); +} + +void BGLView::SetResizingMode(uint32 mode) +{ + BView::SetResizingMode(mode); +} + +void BGLView::Show() +{ +// printf("BGLView Show\n"); + BView::Show(); +} + +void BGLView::Hide() +{ +// printf("BGLView Hide\n"); + BView::Hide(); +} + +BHandler *BGLView::ResolveSpecifier(BMessage *msg, int32 index, + BMessage *specifier, int32 form, + const char *property) +{ + return BView::ResolveSpecifier(msg, index, specifier, form, property); +} + +status_t BGLView::GetSupportedSuites(BMessage *data) +{ + return BView::GetSupportedSuites(data); +} + +void BGLView::DirectConnected( direct_buffer_info *info ) +{ + // XXX to do +} + +void BGLView::EnableDirectMode( bool enabled ) +{ + // XXX to do +} + + + +//---- private methods ---------- + +void BGLView::_ReservedGLView1() {} +void BGLView::_ReservedGLView2() {} +void BGLView::_ReservedGLView3() {} +void BGLView::_ReservedGLView4() {} +void BGLView::_ReservedGLView5() {} +void BGLView::_ReservedGLView6() {} +void BGLView::_ReservedGLView7() {} +void BGLView::_ReservedGLView8() {} + +#if 0 +BGLView::BGLView(const BGLView &v) + : BView(v) +{ + // XXX not sure how this should work + printf("Warning BGLView::copy constructor not implemented\n"); +} +#endif + + +BGLView &BGLView::operator=(const BGLView &v) +{ + printf("Warning BGLView::operator= not implemented\n"); +} + +void BGLView::dither_front() +{ + // no-op +} + +bool BGLView::confirm_dither() +{ + // no-op + return false; +} + +void BGLView::draw(BRect r) +{ + // XXX no-op ??? +} + +/* Direct Window stuff */ +void BGLView::drawScanline( int x1, int x2, int y, void *data ) +{ + // no-op +} + +void BGLView::scanlineHandler(struct rasStateRec *state, + GLint x1, GLint x2) +{ + // no-op +} + +void BGLView::lock_draw() +{ + // no-op +} + +void BGLView::unlock_draw() +{ + // no-op +} + +bool BGLView::validateView() +{ + // no-op + return true; +} + diff --git a/xc/extras/Mesa/src/D3D/D3DCAPS.CPP b/xc/extras/Mesa/src/D3D/D3DCAPS.CPP new file mode 100644 index 000000000..cd95ef0f1 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DCAPS.CPP @@ -0,0 +1,250 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver Build 5 */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "D3DHAL.h"
+/*===========================================================================*/
+/* Macros. */
+/*===========================================================================*/
+#define SRCBLEND_MAP(gl,d3d,fall) if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwSrcBlendCaps & d3d ) \
+ { \
+ sprintf( buffer, "SRC Blend: %s -> %s", # gl, # d3d ); \
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \
+ pShared->dwSrcBlendCaps[index] = d3d; \
+ } \
+ else \
+ { \
+ sprintf( buffer, "SRC Blend: %s -> %s", # gl, # fall ); \
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \
+ pShared->dwSrcBlendCaps[index] = fall; \
+ }
+#define DSTBLEND_MAP(gl,d3d,fall) if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwDestBlendCaps & d3d ) \
+ { \
+ sprintf( buffer, "DST Blend: %s -> %s", # gl, # d3d ); \
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \
+ pShared->dwDestBlendCaps[index] = d3d; \
+ } \
+ else \
+ { \
+ sprintf( buffer, "DST Blend: %s -> %s", # gl, # fall ); \
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), buffer )); \
+ pShared->dwDestBlendCaps[index] = fall; \
+ }
+
+/*===========================================================================*/
+/* I use this function to handle the fact that the D3D texture blending and */
+/* OpenGL texture blending functions don't map one to one. Also there is the*/
+/* problem with cards not supporting all the D3D functions. So I use the CAPS*/
+/* of the card to make a table of functions that will have defaults for the */
+/* unsupported functions. */
+/* So first I fill the table with the fallback function then I check to see */
+/* if the card supports the requested function. If it does I replace the */
+/* default thats already in the array. Now order does matter as I used an */
+/* enum type in D3DShared.h so that the mapping would be a little easier. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void AlphaBlendTableHAL( PMESAD3DHAL pHAL )
+{
+ PMESAD3DSHARED pShared = &pHAL->shared;
+ int index;
+ char buffer[128];
+
+ DPF(( DBG_FUNC, "AlphaBlendTableHAL();" ));
+
+ /* Make the fallback for the Source blend. */
+ for( index = 0; index < 14; index++ )
+ {
+ switch( index )
+ {
+ case s_zero:
+ SRCBLEND_MAP( GL_ZERO, D3DBLEND_ZERO, D3DBLEND_ONE );
+ break;
+ case s_one:
+ SRCBLEND_MAP( GL_ONE, D3DBLEND_ONE, D3DBLEND_ONE );
+ break;
+ case s_dst_color:
+ SRCBLEND_MAP( GL_DST_COLOR, D3DBLEND_DESTCOLOR, D3DBLEND_ONE );
+ break;
+ case s_one_minus_dst_color:
+ SRCBLEND_MAP( GL_ONE_MINUS_DST_COLOR, D3DBLEND_INVDESTCOLOR, D3DBLEND_ONE );
+ break;
+ case s_src_alpha:
+ SRCBLEND_MAP( GL_SRC_ALPHA, D3DBLEND_SRCALPHA, D3DBLEND_ONE );
+ break;
+ case s_one_minus_src_alpha:
+ SRCBLEND_MAP( GL_ONE_MINUS_SRC_ALPHA, D3DBLEND_INVSRCALPHA, D3DBLEND_ONE );
+ break;
+ case s_dst_alpha:
+ SRCBLEND_MAP( GL_DST_ALPHA, D3DBLEND_DESTALPHA, D3DBLEND_ONE );
+ break;
+ case s_one_minus_dst_alpha:
+ SRCBLEND_MAP( GL_ONE_MINUS_DST_ALPHA, D3DBLEND_INVDESTALPHA, D3DBLEND_ONE );
+ break;
+ case s_src_alpha_saturate:
+ SRCBLEND_MAP( GL_SRC_ALPHA_SATURATE, D3DBLEND_SRCALPHASAT, D3DBLEND_ONE );
+ break;
+ case s_constant_color:
+ SRCBLEND_MAP( GL_CONSTANT_COLOR, D3DBLEND_SRCCOLOR, D3DBLEND_ONE );
+ break;
+ case s_one_minus_constant_color:
+ SRCBLEND_MAP( GL_ONE_MINUS_CONSTANT_COLOR, D3DBLEND_INVSRCCOLOR, D3DBLEND_ONE );
+ break;
+ case s_constant_alpha:
+ SRCBLEND_MAP( GL_CONSTANT_ALPHA, D3DBLEND_BOTHSRCALPHA, D3DBLEND_ONE );
+ break;
+ case s_one_minus_constant_alpha:
+ SRCBLEND_MAP( GL_ONE_MINUS_CONSTANT_ALPHA, D3DBLEND_BOTHINVSRCALPHA, D3DBLEND_ONE );
+ break;
+ }
+ }
+
+ /* Make the fallback for the Destination blend. */
+ for( index = 0; index < 14; index++ )
+ {
+ switch( index )
+ {
+ case d_zero:
+ DSTBLEND_MAP( GL_ZERO, D3DBLEND_ZERO, D3DBLEND_ONE );
+ break;
+ case d_one:
+ DSTBLEND_MAP( GL_ONE, D3DBLEND_ONE, D3DBLEND_ONE );
+ break;
+ case d_src_color:
+ DSTBLEND_MAP( GL_SRC_COLOR, D3DBLEND_SRCCOLOR, D3DBLEND_ONE );
+ break;
+ case d_one_minus_src_color:
+ DSTBLEND_MAP( GL_ONE_MINUS_SRC_COLOR, D3DBLEND_INVSRCCOLOR, D3DBLEND_ONE );
+ break;
+ case d_src_alpha:
+ DSTBLEND_MAP( GL_SRC_ALPHA, D3DBLEND_SRCALPHA, D3DBLEND_ONE );
+ break;
+ case d_one_minus_src_alpha:
+ DSTBLEND_MAP( GL_ONE_MINUS_SRC_ALPHA, D3DBLEND_INVSRCALPHA, D3DBLEND_ONE );
+ break;
+ case d_dst_alpha:
+ DSTBLEND_MAP( GL_DST_ALPHA, D3DBLEND_DESTALPHA, D3DBLEND_ONE );
+ break;
+ case d_one_minus_dst_alpha:
+ DSTBLEND_MAP( GL_ONE_MINUS_DST_ALPHA, D3DBLEND_INVDESTALPHA, D3DBLEND_ONE );
+ break;
+ case d_constant_color:
+ DSTBLEND_MAP( GL_CONSTANT_COLOR, D3DBLEND_DESTCOLOR, D3DBLEND_ONE );
+ break;
+ case d_one_minus_constant_color:
+ DSTBLEND_MAP( GL_ONE_MINUS_CONSTANT_COLOR, D3DBLEND_INVDESTCOLOR, D3DBLEND_ONE );
+ break;
+ case d_constant_alpha:
+ DSTBLEND_MAP( GL_CONSTANT_ALPHAR, D3DBLEND_BOTHSRCALPHA, D3DBLEND_ONE );
+ break;
+ case d_one_minus_constant_alpha:
+ DSTBLEND_MAP( GL_ONE_MINUS_CONSTANT_ALPHA, D3DBLEND_BOTHINVSRCALPHA, D3DBLEND_ONE );
+ break;
+ }
+ }
+
+ /* Make the fallbacks for the texture functions. */
+ for( index = 0; index < 4; index++ )
+ {
+ switch( index )
+ {
+ case d3dtblend_decal:
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_DECAL" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_DECAL;
+ }
+ else
+ {
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_MODULATE" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_MODULATE;
+ }
+ else
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECAL -> D3DTBLEND_ADD" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_ADD;
+ }
+ }
+ break;
+ case d3dtblend_decalalpha:
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECALALPHA )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPHA -> D3DTBLEND_DECALALPHA" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_DECALALPHA;
+ }
+ else
+ {
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPA -> D3DTBLEND_DECAL" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_DECAL;
+ }
+ else
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_DECALALPHA -> D3DTBLEND_ADD" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_ADD;
+ }
+ }
+ break;
+ case d3dtblend_modulate:
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_MODULATE" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_MODULATE;
+ }
+ else
+ {
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATEALPHA )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_MODULATEALPHA" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_MODULATEALPHA;
+ }
+ else if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_DECAL" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_DECAL;
+ }
+ else
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATE -> D3DTBLEND_ADD" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_ADD;
+ }
+ }
+ break;
+ case d3dtblend_modulatealpha:
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATEALPHA )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_MODULATEALPHA" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_MODULATEALPHA;
+ }
+ else
+ {
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_MODULATE )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_MODULATE" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_MODULATE;
+ }
+ else if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureBlendCaps & D3DTBLEND_DECAL )
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_DECALE" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_DECAL;
+ }
+ else
+ {
+ DPF(( (DBG_CNTX_INFO|DBG_TXT_INFO), "D3DTBLEND_MODULATEALPHA -> D3DTBLEND_ADD" ));
+ pShared->dwTexFunc[index] = D3DTBLEND_ADD;
+ }
+ }
+ break;
+ }
+ }
+}
+
diff --git a/xc/extras/Mesa/src/D3D/D3DHAL.H b/xc/extras/Mesa/src/D3D/D3DHAL.H new file mode 100644 index 000000000..5295520d7 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DHAL.H @@ -0,0 +1,68 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#ifndef _D3D_HAL_INC
+#define _D3D_HAL_INC
+
+/*===========================================================================*/
+/* Includes. */
+/*===========================================================================*/
+#include <windows.h>
+#include <ddraw.h>
+#include <d3d.h>
+#include <stdlib.h>
+#include <time.h>
+#include "D3DShared.h"
+#include "D3DTextureMgr.h"
+#include "Debug.h"
+/*===========================================================================*/
+/* Defines. */
+/*===========================================================================*/
+#define DX_RESTORE(ps) if ( (ps) && (ps)->IsLost() ) (ps)->Restore();
+/*===========================================================================*/
+/* Type defines. */
+/*===========================================================================*/
+typedef struct _d3d_hal_struct
+{
+ MESAD3DSHARED shared;
+
+ GUID guid;
+ LPDIRECTDRAW lpDD;
+ LPDIRECTDRAW4 lpDD4;
+ LPDIRECT3D3 lpD3D3;
+ LPDIRECT3DDEVICE3 lpD3DDevice;
+ D3DDEVICEDESC D3DHWDevDesc;
+ LPDIRECTDRAWSURFACE4 lpDDSPrimary,
+ lpDDSRender,
+ lpDDSZbuffer;
+ LPDIRECT3DVIEWPORT3 lpViewport;
+ LPDIRECTDRAWCLIPPER lpClipper;
+ DDPIXELFORMAT ddpf,
+ ddpfZBuffer;
+ PTM_OBJECT pTMList;
+
+} MESAD3DHAL, *PMESAD3DHAL;
+/*===========================================================================*/
+/* External function prototypes. */
+/*===========================================================================*/
+extern BOOL InitTMgrHAL( PMESAD3DHAL pHAL );
+extern void TermTMgrHAL( PMESAD3DHAL pHAL );
+extern void AlphaBlendTableHAL( PMESAD3DHAL pHAL );
+
+extern void Solve8BitChannelPixelFormat( DDPIXELFORMAT *pddpf, PPIXELINFO pPixel );
+extern char *ErrorStringD3D( HRESULT hr );
+extern void FatalShutDown( PMESAD3DHAL pHAL );
+/*===========================================================================*/
+/* Global variables. */
+/*===========================================================================*/
+extern char *errorMsg;
+
+#endif
+
diff --git a/xc/extras/Mesa/src/D3D/D3DInit.cpp b/xc/extras/Mesa/src/D3D/D3DInit.cpp new file mode 100644 index 000000000..ba7891612 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DInit.cpp @@ -0,0 +1,891 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver Build 5 */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "D3DHAL.h"
+/*===========================================================================*/
+/* Local function prototypes. */
+/*===========================================================================*/
+static void DestroyAllSurfaces( PMESAD3DHAL pHAL );
+static void DestroyDevice( PMESAD3DHAL pHAL );
+static void DestroyInterfaces( PMESAD3DHAL pHAL );
+
+HRESULT WINAPI EnumSurfacesHook( LPDIRECTDRAWSURFACE4 lpDDS, LPDDSURFACEDESC2 lpDDSDesc, LPVOID pVoid );
+HRESULT CALLBACK EnumZBufferHook( DDPIXELFORMAT* pddpf, VOID *pVoid );
+HRESULT CALLBACK EnumDeviceHook( GUID FAR* lpGuid, LPSTR lpDesc, LPSTR lpName, LPD3DDEVICEDESC lpD3DHWDesc, LPD3DDEVICEDESC lpD3DHELDesc, void *pVoid );
+/*===========================================================================*/
+/* Globals. */
+/*===========================================================================*/
+//char *errorMsg;
+/*===========================================================================*/
+/* This function is responable for allocating the actual MESAD3DHAL struct. */
+/* Each Mesa context will have its own MESAD3DHAL struct so its like a mini */
+/* context to some extent. All one time allocations/operations get done here.*/
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+extern "C" PMESAD3DSHARED InitHAL( HWND hwnd )
+{
+ PMESAD3DHAL pHAL;
+ ULONG rc;
+
+ DPF(( DBG_FUNC, "InitHAL();" ));
+ DPF(( DBG_CNTX_INFO, "hwnd: %d", hwnd ));
+
+ /* Allocate the structure and zero it out. */
+ pHAL = (PMESAD3DHAL)ALLOC( sizeof(MESAD3DHAL) );
+ if ( pHAL == NULL )
+ {
+ RIP( pHAL, "InitHAL->", "Memory Allocation" );
+ return (PMESAD3DSHARED)NULL;
+ }
+ memset( pHAL, 0, sizeof(MESAD3DHAL) );
+
+ /* Get the texture manager going. */
+ rc = InitTMgrHAL( pHAL );
+ if ( rc == FALSE )
+ {
+ RIP( pHAL, "InitTMgrHAL->", "Failed" );
+ return (PMESAD3DSHARED)NULL;
+ }
+
+ /* Fill in the window parameters if we can. */
+ pHAL->shared.hwnd = hwnd;
+
+ /* Parse the user's enviroment variables to generate a debug mask. */
+ ReadDBGEnv();
+
+ return (PMESAD3DSHARED)pHAL;
+}
+/*===========================================================================*/
+/* This function will unload all the resources that the MESAD3DHAL struct */
+/* has bound to it. The actual structure itself will be freed. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void TermHAL( PMESAD3DSHARED pShared )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+
+ DPF(( DBG_FUNC, "TermHAL();" ));
+
+ /* Check for an empty wrapper structure. */
+ if ( pHAL == NULL )
+ return;
+
+ /* Kill this texture manager. */
+ TermTMgrHAL( pHAL );
+
+ /* Kill any DDraw stuff if exists. */
+ DestroyDevice( pHAL );
+ DestroyAllSurfaces( pHAL );
+ DestroyInterfaces( pHAL );
+
+ FREE( pHAL );
+}
+/*===========================================================================*/
+/* This function is used to init and resize the rendering surface as the two*/
+/* are almost the same. First the device and all the surfaces are destoryed */
+/* if they already exist. Next we create a OffScreen rendering surface and */
+/* save some pixelformat info to do color convertions. Next we start to take */
+/* care of getting the most out of the hardware. I use bHardware to determine*/
+/* the state of the device we found in the device enumeration. The enum proc*/
+/* will try for hardware first. I next use a bForceSW to make the enum proc */
+/* choose a software device. So I will try some combinations with HW first */
+/* until I feel I have to set the bForceSW and call this function again. If */
+/* this function is called with no width or height then use the internals. */
+/* NOTE: The worst case is that all will be in SW (RGBDevice) and really */
+/* I should forget the whole thing and fall back to a DDraw span type*/
+/* rendering but what is the point. This way I always know I have a */
+/* D3DDevice and that makes things easier. I do impliment the span */
+/* rendering function for stuff that I haven't done support for such */
+/* as points and lines. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE */
+/*===========================================================================*/
+extern "C" BOOL CreateHAL( PMESAD3DSHARED pShared )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+ DDSURFACEDESC2 ddsd2;
+ D3DDEVICEDESC D3DSWDevDesc;
+ DDSCAPS2 ddscaps;
+ DWORD dwCoopFlags,
+ dwWidth,
+ dwHeight;
+ ULONG rc;
+
+ DPF(( DBG_FUNC, "CreateHAL();" ));
+
+#define InitDDSD2(f) memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) ); \
+ ddsd2.dwSize = sizeof( DDSURFACEDESC2 ); \
+ ddsd2.dwFlags = f;
+
+ if ( pHAL == NULL )
+ return FALSE;
+
+ /* Use the internal rectangle struct. */
+ dwWidth = pShared->rectW.right - pShared->rectW.left;
+ dwHeight = pShared->rectW.bottom - pShared->rectW.top;
+
+ DPF(( DBG_CNTX_INFO, "Width: %d Height: %d", dwWidth, dwHeight ));
+
+ /* The dimensions might still be the same so just leave. */
+ if ( (dwWidth == pShared->dwWidth) && (dwHeight == pShared->dwHeight) )
+ {
+ DPF(( DBG_CNTX_WARN, "Context size hasn't changed" ));
+ return TRUE;
+ }
+
+ /* If one of the dimensions are zero then leave. WM_SIZE should get us back here. */
+ if ( (dwWidth == 0) || (dwHeight == 0) )
+ return TRUE;
+
+ /* Save the renders dimensions. */
+ pShared->dwWidth = dwWidth;
+ pShared->dwHeight = dwHeight;
+
+ DPF(( DBG_CNTX_INFO, "Creating Context:\n cx:%d cy:%d", pShared->dwWidth, pShared->dwHeight ));
+
+ /*=================================*/
+ /* Create all required interfaces. */
+ /*=================================*/
+
+ /* Kill any DDraw stuff if exists. */
+ DestroyDevice( pHAL );
+ DestroyAllSurfaces( pHAL );
+ DestroyInterfaces( pHAL );
+
+ /* Create a instance of DDraw using the Primary display driver. */
+ rc = DirectDrawCreate( NULL, &pHAL->lpDD, NULL );
+ if( FAILED(rc) )
+ {
+ RIP( pHAL, "DirectDrawCreate->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Get the DDraw4 interface. */
+ rc = pHAL->lpDD->QueryInterface( IID_IDirectDraw4, (void **)&pHAL->lpDD4 );
+ if( FAILED(rc) )
+ {
+ RIP( pHAL, "QueryInterface (IID_IDirectDraw4) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Get the Direct3D3 interface. */
+ rc = pHAL->lpDD4->QueryInterface( IID_IDirect3D3, (void **)&pHAL->lpD3D3 );
+ if( FAILED(rc) )
+ {
+ RIP( pHAL, "QueryInterface (IID_IDirect3D3) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Set the Cooperative level. NOTE: we need to know if we are FS at this point.*/
+ dwCoopFlags = (pShared->bWindow == TRUE) ? DDSCL_NORMAL : (DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
+ rc = pHAL->lpDD4->SetCooperativeLevel( pShared->hwnd, dwCoopFlags );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "SetCooperativeLevel->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /*==================================================================*/
+ /* Get the best device we can and note whether its hardware or not. */
+ /*==================================================================*/
+ pShared->bForceSW = FALSE;
+ pHAL->lpD3D3->EnumDevices( EnumDeviceHook, (void *)pHAL );
+ pShared->bHardware = IsEqualIID( pHAL->guid, IID_IDirect3DHALDevice );
+ DPF(( DBG_CNTX_INFO, "bHardware: %s", (pShared->bHardware) ? "TRUE" : "FALSE" ));
+ DPF(( DBG_CNTX_INFO, "bWindowed: %s", (pShared->bWindow) ? "TRUE" : "FALSE" ));
+
+ /*========================================================================*/
+ /* HARDWARE was found. */
+ /*========================================================================*/
+ if ( pShared->bHardware == TRUE )
+ {
+ /*===================================*/
+ /* HARDWARE -> Z-BUFFER. */
+ /*===================================*/
+
+ /* Get a Z-Buffer pixelformat. */
+ memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
+ ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
+ rc = pHAL->lpD3D3->EnumZBufferFormats( pHAL->guid, EnumZBufferHook, (VOID*)&ddsd2.ddpfPixelFormat );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "EnumZBufferFormatsl->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Setup our request structure for the Z-buffer surface. */
+ ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY;
+ ddsd2.dwWidth = dwWidth;
+ ddsd2.dwHeight = dwHeight;
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSZbuffer, NULL );
+ if ( !FAILED(rc) )
+ {
+ DPF(( DBG_CNTX_INFO, "HW ZBuffer" ));
+
+ /*===================================*/
+ /* HARDWARE -> Z-BUFFER -> FLIPABLE */
+ /*===================================*/
+ if ( pShared->bWindow == FALSE )
+ {
+ InitDDSD2( DDSD_CAPS | DDSD_BACKBUFFERCOUNT );
+ ddsd2.dwBackBufferCount = 1;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL );
+ if ( FAILED(rc) )
+ {
+ /* Make sure we try the next fall back. */
+ DPF(( DBG_CNTX_WARN, "HW Flip/Complex not available" ));
+ pHAL->lpDDSPrimary = NULL;
+ }
+ else
+ {
+ /* Get the back buffer that was created. */
+ ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
+ rc = pHAL->lpDDSPrimary->GetAttachedSurface( &ddscaps, &pHAL->lpDDSRender );
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_CNTX_WARN, "GetAttachedSurface failed -> HW Flip/Complex" ));
+
+ /* Make sure we try the next fall back. */
+ pHAL->lpDDSPrimary->Release();
+ pHAL->lpDDSPrimary = NULL;
+ }
+ else
+ {
+ /* I have had problems when a complex surface comes back */
+ /* with the back buffer being created in SW. Not sure why */
+ /* or how this is possable but I'm checking for it here. */
+ memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
+ ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
+ DX_RESTORE( pHAL->lpDDSRender );
+ rc = pHAL->lpDDSRender->GetSurfaceDesc( &ddsd2 );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "GetSurfaceDesc (RENDER) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* If the surface is in VID then we are happy with are Flipable. */
+ if ( ddsd2.ddsCaps.dwCaps & DDSCAPS_LOCALVIDMEM )
+ {
+ pShared->bFlipable = TRUE;
+ DPF(( DBG_CNTX_INFO, "HW Flip/Complex!" ));
+ }
+ else
+ {
+ /* Kill this setup. */
+ pHAL->lpDDSPrimary->Release();
+ pHAL->lpDDSPrimary = NULL;
+ }
+ }
+ }
+ }
+
+ /*===================================*/
+ /* HARDWARE -> Z-BUFFER -> BLT */
+ /*===================================*/
+ if ( pHAL->lpDDSPrimary == NULL )
+ {
+ pShared->bFlipable = FALSE;
+
+ /* Create the Primary (front buffer). */
+ InitDDSD2( DDSD_CAPS );
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL );
+ if ( FAILED(rc) )
+ {
+ /* This is an error as we should be able to do this at minimum. */
+ RIP( pHAL, "CreateSurface (PRIMARY) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Create the Render (back buffer). */
+ InitDDSD2( DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT );
+ ddsd2.dwWidth = dwWidth;
+ ddsd2.dwHeight = dwHeight;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSRender, NULL );
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_CNTX_WARN, "Failed HW Offscreen surface" ));
+
+ /* Make sure we try the next fall back. */
+ pHAL->lpDDSPrimary->Release();
+ pHAL->lpDDSPrimary = NULL;
+ }
+ else
+ {
+ /* Might as well check here too see if this surface is in */
+ /* hardware. If nothing else just to be consistant. */
+ memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
+ ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
+ DX_RESTORE( pHAL->lpDDSRender );
+ rc = pHAL->lpDDSRender->GetSurfaceDesc( &ddsd2 );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "GetSurfaceDesc (RENDER) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* If the surface is in VID then we are happy. */
+ if ( ddsd2.ddsCaps.dwCaps & DDSCAPS_LOCALVIDMEM )
+ {
+ /* Create a clipper object so that DDraw will be able to blt windows that */
+ /* have been clipped by the screen or other windows. */
+ pHAL->lpDD4->CreateClipper( 0, &pHAL->lpClipper, NULL );
+ pHAL->lpClipper->SetHWnd( 0, pShared->hwnd );
+ pHAL->lpDDSPrimary->SetClipper( pHAL->lpClipper );
+ pHAL->lpClipper->Release();
+ DPF(( DBG_CNTX_INFO, "HW RENDER surface" ));
+ }
+ else
+ {
+ /* Kill this setup. */
+ pHAL->lpDDSRender->Release();
+ pHAL->lpDDSRender = NULL;
+ pHAL->lpDDSPrimary->Release();
+ pHAL->lpDDSPrimary = NULL;
+ }
+ }
+ }
+
+ /*===================================*/
+ /* Create D3DDEVICE -> HARDWARE. */
+ /*===================================*/
+ if ( pHAL->lpDDSZbuffer && pHAL->lpDDSPrimary && pHAL->lpDDSRender )
+ {
+ DX_RESTORE( pHAL->lpDDSRender );
+ DX_RESTORE( pHAL->lpDDSZbuffer );
+
+ rc = pHAL->lpDDSRender->AddAttachedSurface( pHAL->lpDDSZbuffer );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "AddAttachedSurface (ZBUFFER) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ rc = pHAL->lpD3D3->CreateDevice( IID_IDirect3DHALDevice, pHAL->lpDDSRender, &pHAL->lpD3DDevice, NULL );
+ if ( rc != D3D_OK )
+ {
+ DPF(( DBG_CNTX_WARN, "Failed HW Device" ));
+ pHAL->lpD3DDevice = NULL;
+ }
+ else
+ {
+ DPF(( DBG_CNTX_INFO, "HW Device" ));
+ }
+ }
+ }
+ }
+
+ /*========================================================================*/
+ /* SOFTWARE fallback. */
+ /*========================================================================*/
+ if ( pHAL->lpD3DDevice == NULL )
+ {
+ DPF(( DBG_CNTX_INFO, "SW fallback :(" ));
+
+ /* Make sure we have no surfaces allocated. Just incase. */
+ DestroyAllSurfaces( pHAL );
+
+ /* Get a software device. */
+ pShared->bFlipable = FALSE;
+ pShared->bForceSW = TRUE;
+ pHAL->lpD3D3->EnumDevices( EnumDeviceHook, (void *)pHAL );
+ pShared->bHardware = IsEqualIID( pHAL->guid, IID_IDirect3DHALDevice );
+
+ /*===================================*/
+ /* SOFTWARE -> Z-BUFFER. */
+ /*===================================*/
+
+ /*===================================*/
+ /* SOFTWARE -> Z-BUFFER -> FLIPABLE */
+ /*===================================*/
+ if ( pShared->bWindow == FALSE )
+ {
+ InitDDSD2( DDSD_CAPS | DDSD_BACKBUFFERCOUNT );
+ ddsd2.dwBackBufferCount = 1;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
+ ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT );
+ ddsd2.ddpfPixelFormat.dwFlags = (DDPF_RGB | DDPF_ALPHAPIXELS);
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL );
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_CNTX_WARN, "Failed SW Flip/Complex" ));
+
+ /* Make sure we try the next fall back. */
+ pHAL->lpDDSPrimary = NULL;
+ }
+ else
+ {
+ ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
+ rc = pHAL->lpDDSPrimary->GetAttachedSurface( &ddscaps, &pHAL->lpDDSRender );
+ if ( FAILED(rc) )
+ {
+ /* Make sure we try the next fall back. */
+ DPF(( DBG_CNTX_WARN, "GetAttachedSurface failed -> SW Flip/Complex" ));
+ pHAL->lpDDSPrimary->Release();
+ pHAL->lpDDSPrimary = NULL;
+ }
+ else
+ {
+ DPF(( DBG_CNTX_INFO, "SW Flip/Complex" ));
+ pShared->bFlipable = TRUE;
+ }
+ }
+ }
+
+ /*===================================*/
+ /* SOFTWARE -> Z-BUFFER -> BLT */
+ /*===================================*/
+ if ( pHAL->lpDDSPrimary == NULL )
+ {
+ /* Create the Primary (front buffer). */
+ InitDDSD2( DDSD_CAPS );
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSPrimary, NULL );
+ if ( FAILED(rc) )
+ {
+ /* This is an error as we should be able to do this at minimum. */
+ RIP( pHAL, "CreateSurface (PRIMARY) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Create the Render (back buffer). */
+ InitDDSD2( DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT );
+ ddsd2.dwWidth = dwWidth;
+ ddsd2.dwHeight = dwHeight;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE;
+ ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT );
+ ddsd2.ddpfPixelFormat.dwFlags = (DDPF_RGB | DDPF_ALPHAPIXELS);
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pHAL->lpDDSRender, NULL );
+ if ( FAILED(rc) )
+ {
+ /* That was our last hope. */
+ RIP( pHAL, "CreateSurface (RENDER) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+ else
+ {
+ DPF(( DBG_CNTX_INFO, "SW RENDER surface" ));
+
+ /* Create a clipper object so that DDraw will be able to blt windows that */
+ /* have been clipped by the screen or other windows. */
+ pHAL->lpDD4->CreateClipper( 0, &pHAL->lpClipper, NULL );
+ pHAL->lpClipper->SetHWnd( 0, pShared->hwnd );
+ pHAL->lpDDSPrimary->SetClipper( pHAL->lpClipper );
+ pHAL->lpClipper->Release();
+ }
+ }
+
+ /*===================================*/
+ /* Create D3DDEVICE -> SOFTWARE. */
+ /*===================================*/
+ if ( pHAL->lpDDSPrimary && pHAL->lpDDSRender )
+ {
+ DX_RESTORE( pHAL->lpDDSRender );
+ rc = pHAL->lpD3D3->CreateDevice( IID_IDirect3DRGBDevice, pHAL->lpDDSRender, &pHAL->lpD3DDevice, NULL );
+ if ( rc != D3D_OK )
+ {
+ /* That was our last hope. */
+ RIP( pHAL, "CreateDevice (IID_IDirect3DRGBDevice) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ DPF(( DBG_CNTX_INFO, "SW Device" ));
+ }
+ }
+
+ /*==============================================================================*/
+ /* Get a copy of the render pixelformat so that wgl.c can call GetPixelInfoD3D. */
+ /*==============================================================================*/
+ memset( &pHAL->ddpf, 0, sizeof(DDPIXELFORMAT) );
+ pHAL->ddpf.dwSize = sizeof( DDPIXELFORMAT );
+ rc = pHAL->lpDDSRender->GetPixelFormat( &pHAL->ddpf );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "GetPixelFormat ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+ DebugPixelFormat( "Using OFFSCREEN", &pHAL->ddpf );
+ DebugPixelFormat( "Using ZBUFFER", &ddsd2.ddpfPixelFormat );
+
+ /* Get a copy of what the D3DDevice supports for later use. */
+ memset( &D3DSWDevDesc, 0, sizeof(D3DDEVICEDESC) );
+ memset( &pHAL->D3DHWDevDesc, 0, sizeof(D3DDEVICEDESC) );
+ D3DSWDevDesc.dwSize = sizeof( D3DDEVICEDESC );
+ pHAL->D3DHWDevDesc.dwSize = sizeof( D3DDEVICEDESC );
+ rc = pHAL->lpD3DDevice->GetCaps( &pHAL->D3DHWDevDesc, &D3DSWDevDesc );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "GetCaps ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Get a copy of the pixel convertion stuff for direct buffer access. */
+ Solve8BitChannelPixelFormat( &pHAL->ddpf, &pShared->pixel );
+ AlphaBlendTableHAL( pHAL );
+
+ /* We must prime the Begin/End scene for SwapBuffers to work. */
+ rc = pHAL->lpD3DDevice->BeginScene();
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "BeginScene ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+#undef InitDDSD2
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This function will make sure a viewport is created and set for the device*/
+/* in the supplied structure. If a rect is supplied then it will be used for*/
+/* the viewport otherwise the current setting in the strucute will be used. */
+/* Note that the rect is relative to the window. So left/top must be 0,0 to */
+/* use the whole window else there is scissoring going down. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+extern "C" BOOL SetViewportHAL( PMESAD3DSHARED pShared, RECT *pRect, float minZ, float maxZ )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+ D3DVIEWPORT2 vdData;
+ ULONG rc;
+ POINT pt;
+
+ DPF(( DBG_FUNC, "SetViewportHAL();" ));
+
+ /* Make sure we have enough info. */
+ if ( !pHAL || !pHAL->lpDDSPrimary || !pHAL->lpD3DDevice )
+ {
+ DPF(( DBG_CNTX_WARN, "SetViewport() -> NULL Pointer" ));
+ return FALSE;
+ }
+
+ /* TODO: this is just a temp fix to stop redundant changes. */
+ if ( pRect &&
+ (pShared->rectV.left == pRect->left) &&
+ (pShared->rectV.right == pRect->right) &&
+ (pShared->rectV.top == pRect->top) &&
+ (pShared->rectV.bottom == pRect->bottom) )
+ {
+ DPF(( DBG_CNTX_WARN, "Redundant viewport" ));
+ return TRUE;
+ }
+
+ DPF(( DBG_CNTX_INFO, "Current Viewport:" ));
+ DPF(( DBG_CNTX_INFO, "x: %d y: %d", pShared->rectV.left, pShared->rectV.top ));
+ DPF(( DBG_CNTX_INFO, "cx: %d cy: %d", (pShared->rectV.right-pShared->rectV.left), (pShared->rectV.bottom-pShared->rectV.top) ));
+ DPF(( DBG_CNTX_INFO, "New Viewport:" ));
+ DPF(( DBG_CNTX_INFO, "x: %d y: %d", pRect->left, pRect->top ));
+ DPF(( DBG_CNTX_INFO, "cx: %d cy: %d", (pRect->right-pRect->left), (pRect->bottom-pRect->top) ));
+
+ /* Update the current viewport rect if one is supplied. */
+ if ( pRect )
+ memcpy( &pShared->rectV, pRect, sizeof(RECT) );
+
+ /* Build the request structure. */
+ memset( &vdData, 0, sizeof(D3DVIEWPORT2) );
+ vdData.dwSize = sizeof(D3DVIEWPORT2);
+ vdData.dwX = pShared->rectV.left;
+ vdData.dwY = pShared->rectV.top;
+ vdData.dwWidth = (pShared->rectV.right - pShared->rectV.left);
+ vdData.dwHeight = (pShared->rectV.bottom - pShared->rectV.top);
+
+ if ( !vdData.dwWidth || !vdData.dwHeight )
+ {
+ GetClientRect( pShared->hwnd, &pShared->rectW );
+ pt.x = pt.y = 0;
+ ClientToScreen( pShared->hwnd, &pt );
+ OffsetRect( &pShared->rectW, pt.x, pt.y);
+ vdData.dwX = pShared->rectW.left;
+ vdData.dwY = pShared->rectW.top;
+ vdData.dwWidth = (pShared->rectW.right - pShared->rectW.left);
+ vdData.dwHeight = (pShared->rectW.bottom - pShared->rectW.top);
+ memcpy( &pShared->rectV, &pShared->rectW, sizeof(RECT) );
+ }
+
+ // The dvClipX, dvClipY, dvClipWidth, dvClipHeight, dvMinZ,
+ // and dvMaxZ members define the non-normalized post-perspective
+ // 3-D view volume which is visible to the viewer. In most cases,
+ // dvClipX is set to -1.0 and dvClipY is set to the inverse of
+ // the viewport's aspect ratio on the target surface, which can be
+ // calculated by dividing the dwHeight member by dwWidth. Similarly,
+ // the dvClipWidth member is typically 2.0 and dvClipHeight is set
+ // to twice the aspect ratio set in dwClipY. The dvMinZ and dvMaxZ
+ // are usually set to 0.0 and 1.0.
+ vdData.dvClipX = -1.0f;
+ vdData.dvClipWidth = 2.0f;
+ vdData.dvClipY = 1.0f;
+ vdData.dvClipHeight = 2.0f;
+ vdData.dvMaxZ = maxZ;
+ vdData.dvMinZ = minZ;
+
+ DPF(( DBG_CNTX_INFO, "zMin: %f zMax: %f", minZ, maxZ ));
+
+ /* I'm going to destroy the viewport everytime as when we size we will */
+ /* have a new D3DDevice. As this area doesn't need to be fast... */
+ if ( pHAL->lpViewport )
+ {
+ DPF(( DBG_CNTX_INFO, "DeleteViewport" ));
+
+ pHAL->lpD3DDevice->DeleteViewport( pHAL->lpViewport );
+ rc = pHAL->lpViewport->Release();
+ pHAL->lpViewport = NULL;
+ }
+
+ rc = pHAL->lpD3D3->CreateViewport( &pHAL->lpViewport, NULL );
+ if ( rc != D3D_OK )
+ {
+ DPF(( DBG_CNTX_ERROR, "CreateViewport Failed" ));
+ return FALSE;
+ }
+
+ /* Update the device with the new viewport. */
+ pHAL->lpD3DDevice->AddViewport( pHAL->lpViewport );
+ pHAL->lpViewport->SetViewport2( &vdData );
+ pHAL->lpD3DDevice->SetCurrentViewport( pHAL->lpViewport );
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* */
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+HRESULT WINAPI EnumSurfacesHook( LPDIRECTDRAWSURFACE4 lpDDS, LPDDSURFACEDESC2 lpDDSDesc, LPVOID pVoid )
+{
+ DDSURFACEDESC2 *pddsd2 = (DDSURFACEDESC2 *)pVoid;
+
+ DPF(( DBG_FUNC, "EnumSurfacesHook();" ));
+
+ if ( (lpDDSDesc->ddpfPixelFormat.dwFlags == pddsd2->ddpfPixelFormat.dwFlags) && (lpDDSDesc->ddsCaps.dwCaps == pddsd2->ddsCaps.dwCaps) )
+ {
+ /* Save the pixelformat now so that we know we have one. */
+ memcpy( pddsd2, lpDDSDesc, sizeof(DDSURFACEDESC2) );
+
+ return D3DENUMRET_CANCEL;
+ }
+
+ return D3DENUMRET_OK;
+}
+/*===========================================================================*/
+/* This is the callback proc to get a Z-Buffer. Thats it. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+HRESULT CALLBACK EnumZBufferHook( DDPIXELFORMAT* pddpf, VOID *pVoid )
+{
+ DDPIXELFORMAT *pddpfChoice = (DDPIXELFORMAT *)pVoid;
+
+ DPF(( DBG_FUNC, "EnumZBufferHook();" ));
+
+ /* If this is ANY type of depth-buffer, stop. */
+ if( pddpf->dwFlags == DDPF_ZBUFFER )
+ {
+ /* Save the pixelformat now so that we know we have one. */
+ memcpy( pddpfChoice, pddpf, sizeof(DDPIXELFORMAT) );
+
+ /* I feel if the hardware supports this low then lets use it. Could get ugly. */
+ if( pddpf->dwZBufferBitDepth >= 8 )
+ {
+ return D3DENUMRET_CANCEL;
+ }
+ }
+
+ return D3DENUMRET_OK;
+}
+/*===========================================================================*/
+/* This function handles the callback for the D3DDevice enumeration. Good */
+/* god who's idea was this? The D3D wrapper has two variable related to what*/
+/* kind of device we want and have. First we have a Bool that is set if we */
+/* have allocated a HW device. We always look for the HW device first. The */
+/* other variable is used to force SW. If we have run into a case that we */
+/* want to fallback to SW then we set this. We will fallback if we cannot */
+/* texture in video memory (among others). */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+HRESULT CALLBACK EnumDeviceHook( GUID FAR* lpGuid, LPSTR lpDesc, LPSTR lpName, LPD3DDEVICEDESC lpD3DHWDesc, LPD3DDEVICEDESC lpD3DHELDesc, void *pVoid )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pVoid;
+ LPD3DDEVICEDESC pChoice = lpD3DHWDesc;
+
+ DPF(( DBG_FUNC, "EnumDeviceHook();" ));
+
+ /* Determine if which device description is valid. */
+ if ( pChoice->dcmColorModel == 0 )
+ pChoice = lpD3DHELDesc;
+
+ /* Make sure we always have a GUID. */
+ memcpy( &pHAL->guid, lpGuid, sizeof(GUID) );
+
+ /* This controls whether we will except HW or not. */
+ if ( pHAL->shared.bForceSW == TRUE )
+ {
+ return (pChoice == lpD3DHELDesc) ? D3DENUMRET_CANCEL : D3DENUMRET_OK;
+ }
+
+ /* Always try for hardware. */
+ if ( pChoice == lpD3DHWDesc )
+ {
+ return D3DENUMRET_CANCEL;
+ }
+
+ return D3DENUMRET_OK;
+}
+/*===========================================================================*/
+/* This function will destroy any and all surfaces that this context has */
+/* allocated. If there is a clipper object then it will also be destoryed as*/
+/* it is part of the Primary Surface. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void DestroyAllSurfaces( PMESAD3DHAL pHAL )
+{
+ LONG refCount;
+
+ DPF(( DBG_FUNC, "DestroyAllSurfaces();" ));
+
+ DX_RESTORE( pHAL->lpDDSPrimary );
+ DX_RESTORE( pHAL->lpDDSRender );
+ DX_RESTORE( pHAL->lpDDSZbuffer);
+
+ if ( pHAL->lpDDSRender )
+ {
+ pHAL->lpDDSRender->Unlock( NULL );
+
+ /* If this isn't a Flipable surface then we must clean up the render. */
+ if ( pHAL->shared.bFlipable == FALSE)
+ {
+ if ( pHAL->lpDDSZbuffer )
+ {
+ DPF(( DBG_CNTX_INFO, "Remove attached surfaces from RENDER" ));
+ pHAL->lpDDSRender->DeleteAttachedSurface( 0, NULL );
+ }
+
+ DPF(( DBG_CNTX_INFO, "Release RENDER" ));
+ refCount = pHAL->lpDDSRender->Release();
+ pHAL->lpDDSRender = NULL;
+ }
+ }
+
+ if ( pHAL->lpDDSZbuffer )
+ {
+ DPF(( DBG_CNTX_INFO, "Release ZBuffer" ));
+ pHAL->lpDDSZbuffer->Unlock( NULL );
+ refCount = pHAL->lpDDSZbuffer->Release();
+ pHAL->lpDDSZbuffer = NULL;
+ }
+
+ if ( pHAL->lpClipper )
+ {
+ DPF(( DBG_CNTX_INFO, "Release Clipper" ));
+ refCount = pHAL->lpClipper->Release();
+ pHAL->lpClipper = NULL;
+ }
+
+ if ( pHAL->lpDDSPrimary )
+ {
+ pHAL->lpDDSPrimary->Unlock( NULL );
+
+ DPF(( DBG_CNTX_INFO, "Release PRIMARY" ));
+ refCount = pHAL->lpDDSPrimary->Release();
+ pHAL->lpDDSPrimary = NULL;
+ }
+}
+/*===========================================================================*/
+/* This function will destroy the current D3DDevice and any resources that */
+/* belong to it. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void DestroyDevice( PMESAD3DHAL pHAL )
+{
+ LONG refCount;
+
+ DPF(( DBG_FUNC, "DestroyDevice();" ));
+
+ /* Kill the D3D stuff if exists. */
+ if ( pHAL->lpViewport )
+ {
+ DPF(( DBG_CNTX_INFO, "Delete Viewport" ));
+ pHAL->lpD3DDevice->DeleteViewport( pHAL->lpViewport );
+
+ DPF(( DBG_CNTX_INFO, "Release Viewport" ));
+ refCount = pHAL->lpViewport->Release();
+ pHAL->lpViewport = NULL;
+ }
+
+ if ( pHAL->lpD3DDevice != NULL )
+ {
+ DPF(( DBG_CNTX_INFO, "Release D3DDevice" ));
+ refCount = pHAL->lpD3DDevice->EndScene();
+ refCount = pHAL->lpD3DDevice->Release();
+ pHAL->lpD3DDevice = NULL;
+ }
+}
+/*===========================================================================*/
+/* This function will destroy the current D3DDevice and any resources that */
+/* belong to it. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void DestroyInterfaces( PMESAD3DHAL pHAL )
+{
+ LONG refCount;
+
+ DPF(( DBG_FUNC, "DestroyInterfaces();" ));
+
+ if ( pHAL->lpD3D3 != NULL )
+ {
+ DPF(( DBG_CNTX_INFO, "Release Direct3D3" ));
+ refCount = pHAL->lpD3D3->Release();
+ pHAL->lpD3D3 = NULL;
+ }
+
+ if ( pHAL->lpDD4 != NULL )
+ {
+ DPF(( DBG_CNTX_INFO, "Release DDraw4" ));
+ refCount = pHAL->lpDD4->Release();
+ pHAL->lpDD4 = NULL;
+ }
+
+ if ( pHAL->lpDD != NULL )
+ {
+ DPF(( DBG_CNTX_INFO, "Release DDraw" ));
+ refCount = pHAL->lpDD->Release();
+ pHAL->lpDD = NULL;
+ }
+}
+/*===========================================================================*/
+/* This function will first send (not post) a message to the client window */
+/* that this context is using. The client will respond by unbinding itself */
+/* and binding the 'default' context. This allows the API to be supported */
+/* until the window can be destroyed. Finally we post the quit message to */
+/* the client in hopes to end the application. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void FatalShutDown( PMESAD3DHAL pHAL )
+{
+ /* Whip this baby in too try and support the API until we die... */
+ if ( pHAL )
+ SendMessage( pHAL->shared.hwnd, UM_FATALSHUTDOWN, 0L, 0L );
+
+ /* Close the client application down. */
+ PostQuitMessage( 0 );
+}
+
diff --git a/xc/extras/Mesa/src/D3D/D3DMESA.H b/xc/extras/Mesa/src/D3D/D3DMESA.H new file mode 100644 index 000000000..792f34d1f --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DMESA.H @@ -0,0 +1,84 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#ifndef D3D_MESA_H
+#define D3D_MESA_H
+/*===========================================================================*/
+/* Includes. */
+/*===========================================================================*/
+#include <windows.h>
+#include <ddraw.h>
+#include <d3d.h>
+#include "matrix.h"
+#include "context.h"
+#include "types.h"
+#include "vb.h"
+#include "D3DShared.h"
+#include "Debug.h"
+#include "NULLProcs.h"
+/*===========================================================================*/
+/* Macros. */
+/*===========================================================================*/
+#define FLIP(h,y) (h-y)
+/*===========================================================================*/
+/* Magic numbers. */
+/*===========================================================================*/
+/*===========================================================================*/
+/* Type defines. */
+/*===========================================================================*/
+struct __extensions__
+{
+ PROC proc;
+ char *name;
+};
+
+typedef GLbitfield (*ClearPROC)( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
+typedef void (*WSpanRGBPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] );
+typedef void (*WSpanRGBAPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
+typedef void (*WSpanRGBAMonoPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] );
+typedef void (*WPixelsRGBAPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
+typedef void (*WPixelsRGBAMonoPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
+typedef void (*RSpanRGBAPROC)( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
+typedef void (*RPixelsRGBAPROC)( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
+
+typedef struct D3D_mesa_context
+{
+ PMESAD3DSHARED pShared;
+
+ GLcontext *gl_ctx; /* The core GL/Mesa context */
+ GLvisual *gl_visual; /* Describes the buffers */
+ GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers */
+
+ HDC hdc;
+ WNDPROC hOldProc;
+
+ UCHAR rClear, /* Current clear colors. */
+ gClear,
+ bClear,
+ aClear,
+ rCurrent, /* Current rendering colors. */
+ gCurrent,
+ bCurrent,
+ aCurrent;
+
+ struct D3D_mesa_context *next;
+
+} D3DMESACONTEXT, *PD3DMESACONTEXT;
+/*===========================================================================*/
+/* Extern function prototypes. */
+/*===========================================================================*/
+extern void gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height );
+/*===========================================================================*/
+/* Global variables. */
+/*===========================================================================*/
+extern D3DTLVERTEX D3DTLVertices[(VB_MAX*6)];
+
+#endif
+
diff --git a/xc/extras/Mesa/src/D3D/D3DRaster.cpp b/xc/extras/Mesa/src/D3D/D3DRaster.cpp new file mode 100644 index 000000000..004bb7736 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DRaster.cpp @@ -0,0 +1,213 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "D3DHAL.h"
+/*===========================================================================*/
+/* This function clears the context bound to the supplied shared context. */
+/* The function takes the D3D flags D3DCLEAR_TARGET, D3DCLEAR_STENCIL and */
+/* D3DCLEAR_ZBUFFER. Set bAll to TRUE for a full clear else supply the coord*/
+/* of the rect to be cleared relative to the window. The color is always a */
+/* 32bit value (RGBA). Fill in the z-value and stencil if needed. */
+/* */
+/* TODO: this can be redone to be called by Mesa directly. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void ClearHAL( PMESAD3DSHARED pShared, DWORD dwFlags, BOOL bAll, int x, int y, int cx, int cy, DWORD dwColor, float zv, DWORD dwStencil )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+ D3DRECT d3dRect;
+
+#ifdef D3D_DEBUG
+ HRESULT rc;
+
+ DPF(( DBG_FUNC, "CleaHAL();" ));
+
+ /* Make sure we have enough info. */
+ if ( (pHAL == NULL) || (pHAL->lpViewport == NULL) )
+ return;
+#endif
+
+ if ( bAll )
+ {
+ /* I assume my viewport is valid. */
+ d3dRect.lX1 = pShared->rectV.left;
+ d3dRect.lY1 = pShared->rectV.top;
+ d3dRect.lX2 = pShared->rectV.right;
+ d3dRect.lY2 = pShared->rectV.bottom;
+ }
+ else
+ {
+ d3dRect.lX1 = pShared->rectV.left + x;
+ d3dRect.lY1 = pShared->rectV.top + y;
+ d3dRect.lX2 = d3dRect.lX1 + cx;
+ d3dRect.lY2 = d3dRect.lY1 + cy;
+ }
+
+#ifdef D3D_DEBUG
+ rc = pHAL->lpViewport->Clear2( 1, &d3dRect, dwFlags, dwColor, zv, dwStencil );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "Clear2 ->", ErrorStringD3D(rc) );
+ }
+#else
+ pHAL->lpViewport->Clear2( 1, &d3dRect, dwFlags, dwColor, zv, dwStencil );
+#endif
+}
+/*===========================================================================*/
+/* Well this is the guts of it all. Here we rasterize the primitives that */
+/* are in their final form. OpenGL has done all the lighting, transfomations*/
+/* and clipping at this point. */
+/* */
+/* TODO: I'm not sure if I want to bother to check for errors on this call. */
+/* The overhead kills me... */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void DrawPrimitiveHAL( PMESAD3DSHARED pShared, D3DPRIMITIVETYPE dptPrimitiveType, D3DTLVERTEX *pVertices, DWORD dwCount )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+
+#ifdef D3D_DEBUG
+ HRESULT rc;
+
+ DPF(( DBG_FUNC, "DrawPrimitveHAL();" ));
+
+ /* Make sure we have enough info. */
+ if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) )
+ return;
+
+ DPF(( DBG_PRIM_INFO, "DP( %d )", dwCount ));
+
+ rc = pHAL->lpD3DDevice->DrawPrimitive( dptPrimitiveType,
+ D3DFVF_TLVERTEX,
+ (LPVOID)pVertices,
+ dwCount,
+ (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "DrawPrimitive ->", ErrorStringD3D(rc) );
+ }
+#else
+ pHAL->lpD3DDevice->DrawPrimitive( dptPrimitiveType,
+ D3DFVF_TLVERTEX,
+ (LPVOID)pVertices,
+ dwCount,
+ (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) );
+#endif
+}
+/*===========================================================================*/
+/* This call will handle the swapping of the buffers. Now I didn't bother */
+/* to support single buffered so this will be used for glFlush() as its all */
+/* the same. So first we do an EndScene as we are always considered to be in*/
+/* a BeginScene because when we leave we do a BeginScene. Now note that when*/
+/* the context is created in the first place we do a BeginScene also just to */
+/* get things going. The call will use either Flip/blt based on the type of */
+/* surface was created for rendering. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void SwapBuffersHAL( PMESAD3DSHARED pShared )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+
+#ifdef D3D_DEBUG
+ HRESULT rc;
+
+ DPF(( DBG_FUNC, "SwapBuffersHAL();" ));
+ DPF(( DBG_ALL_PROFILE, "=================SWAP===================" ));
+
+ /* Make sure we have enough info. */
+ if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) )
+ return;
+
+ /* Make sure we have enough info. */
+ if ( pHAL->lpDDSPrimary != NULL )
+ {
+ rc = pHAL->lpD3DDevice->EndScene();
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "EndScene ->", ErrorStringD3D(rc) );
+ }
+
+ if ( pShared->bFlipable )
+ {
+ DPF(( DBG_CNTX_PROFILE, "Swap->FLIP" ));
+ rc = pHAL->lpDDSPrimary->Flip( NULL, DDFLIP_WAIT );
+ }
+ else
+ {
+ DPF(( DBG_CNTX_PROFILE, "Swap->Blt" ));
+ rc = pHAL->lpDDSPrimary->Blt( &pShared->rectW, pHAL->lpDDSRender, NULL, DDBLT_WAIT, NULL );
+ }
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "Blt (RENDER/PRIMARY) ->", ErrorStringD3D(rc) );
+ }
+
+ rc = pHAL->lpD3DDevice->BeginScene();
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "BeginScene ->", ErrorStringD3D(rc) );
+ }
+ }
+#else
+ pHAL->lpD3DDevice->EndScene();
+
+ if ( pShared->bFlipable )
+ pHAL->lpDDSPrimary->Flip( NULL, DDFLIP_WAIT );
+ else
+ pHAL->lpDDSPrimary->Blt( &pShared->rectW, pHAL->lpDDSRender, NULL, DDBLT_WAIT, NULL );
+
+ pHAL->lpD3DDevice->BeginScene();
+
+#endif
+}
+/*===========================================================================*/
+/* This function is a very thin wrapper for the D3D call 'SetRenderState'. */
+/* Using this function requires all the types to be defined by including the */
+/* D3D header file. */
+/* */
+/* TODO: would be much better to get ride of all these calls per VBRender. */
+/* I feel I should get this call into SetRenderStates() the RenderVB. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void SetStateHAL( PMESAD3DSHARED pShared, DWORD dwType, DWORD dwState )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+
+#ifdef D3D_DEBUG
+ HRESULT rc;
+
+ DPF(( DBG_FUNC, "SetStateHAL();" ));
+
+ /* Make sure we have enough info. */
+ if ( (pHAL == NULL) || (pHAL->lpD3DDevice == NULL) )
+ return;
+
+ rc = pHAL->lpD3DDevice->SetRenderState( (D3DRENDERSTATETYPE)dwType, dwState );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "SetRenderState ->", ErrorStringD3D(rc) );
+ }
+
+#else
+ pHAL->lpD3DDevice->SetRenderState( (D3DRENDERSTATETYPE)dwType, dwState );
+#endif
+}
+
+
+
+
+
+
+
+
diff --git a/xc/extras/Mesa/src/D3D/D3DShared.h b/xc/extras/Mesa/src/D3D/D3DShared.h new file mode 100644 index 000000000..cc629e211 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DShared.h @@ -0,0 +1,154 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef D3D_MESA_ALL_H +#define D3D_MESA_ALL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include <stdio.h> +#include <string.h> +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +#define TM_ACTION_LOAD 0x01 +#define TM_ACTION_BIND 0x02 +#define TM_ACTION_UPDATE 0x04 + +#define UM_FATALSHUTDOWN (WM_USER+42) +/*===========================================================================*/ +/* Macros defines. */ +/*===========================================================================*/ +#define ALLOC(cb) malloc( (cb) ) +#define FREE(p) { free( (p) ); (p) = NULL; } +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +typedef struct _pixel_convert +{ + int cb, /* Count in bytes of one pixel. */ + rShift, /* Shift count that postions each componet. */ + gShift, + bShift, + aShift; + float rScale, /* Value that scales a color that ranges 0.0 -> 1.0 */ + gScale, /* to this pixel format. */ + bScale, + aScale; + DWORD dwRMask, /* Color mask per component. */ + dwGMask, + dwBMask, + dwAMask; + +} PIXELINFO, *PPIXELINFO; + + +typedef struct _d3d_shared_info +{ + HWND hwnd; + BOOL bWindow, + bFlipable, + bForceSW, + bHardware; + RECT rectW, /* Window size and postion in screen space. */ + rectV; /* Viewport size and postion. */ + DWORD dwWidth, /* Current render size for quick checks. */ + dwHeight; + + PIXELINFO pixel; + DWORD dwSrcBlendCaps[14], /* See D3DCAPS.CPP */ + dwDestBlendCaps[14], + dwTexFunc[4]; + +} MESAD3DSHARED, *PMESAD3DSHARED; + +typedef struct _render_options +{ + BOOL bForceSoftware, /* TODO: Add user switches. */ + bStretchtoPrimary; + +} USER_CTRL, *PUSER_CRTL; + +enum { s_zero = 0, + s_one, + s_dst_color, + s_one_minus_dst_color, + s_src_alpha, + s_one_minus_src_alpha, + s_dst_alpha, + s_one_minus_dst_alpha, + s_src_alpha_saturate, + s_constant_color, + s_one_minus_constant_color, + s_constant_alpha, + s_one_minus_constant_alpha }; + +enum { d_zero = 0, + d_one, + d_src_color, + d_one_minus_src_color, + d_src_alpha, + d_one_minus_src_alpha, + d_dst_alpha, + d_one_minus_dst_alpha, + d_constant_color, + d_one_minus_constant_color, + d_constant_alpha, + d_one_minus_constant_alpha }; + +enum { d3dtblend_decal = 0, + d3dtblend_decalalpha, + d3dtblend_modulate, + d3dtblend_modulatealpha }; + +/*===========================================================================*/ +/* Function prototypes. */ +/*===========================================================================*/ +PMESAD3DSHARED InitHAL( HWND hwnd ); +void TermHAL( PMESAD3DSHARED pShared ); +BOOL CreateHAL( PMESAD3DSHARED pShared ); +BOOL SetViewportHAL( PMESAD3DSHARED pShared, RECT *pRect, float minZ, float maxZ ); + +void ClearHAL( PMESAD3DSHARED pShared, DWORD dwFlags, BOOL bAll, int x, int y, int cx, int cy, DWORD dwColor, float zv, DWORD dwStencil ); +void SetStateHAL( PMESAD3DSHARED pShared, DWORD dwType, DWORD dwState ); +void DrawPrimitiveHAL( PMESAD3DSHARED pShared, D3DPRIMITIVETYPE dptPrimitiveType, D3DTLVERTEX *pVertices, DWORD dwCount ); + +void SwapBuffersHAL( PMESAD3DSHARED pShared ); +DDSURFACEDESC2 *LockHAL( PMESAD3DSHARED pShared, BOOL bBack ); +void UnlockHAL( PMESAD3DSHARED pShared, BOOL bBack ); +void UpdateScreenPosHAL( PMESAD3DSHARED pShared ); +void GetPixelInfoHAL( PMESAD3DSHARED pShared, PPIXELINFO pPixel ); +BOOL CreateTMgrHAL( PMESAD3DSHARED pShared, DWORD dwName, int level, DWORD dwRequestFlags, RECT *rectDirty, DWORD dwWidth, DWORD dwHeight, DWORD dwAction, void *pPixels ); +void DisableTMgrHAL( PMESAD3DSHARED pShared ); + + +int SaveDIBitmap( char *filename, BITMAPINFO *info, void *bits ); +int ARGB_SaveBitmap( char *filename, int width, int height, unsigned char *pARGB ); +int BGRA_SaveBitmap( char *filename, int width, int height, unsigned char *pBGRA ); +int BGR_SaveBitmap( char *filename, int width, int height, unsigned char *pBGR ); +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ +extern float g_DepthScale, /* Mesa needs to scale Z in SW. The HAL */ + g_MaxDepth; /* doesn't but I wanted SW still to work.*/ + +#ifdef __cplusplus +} +#endif + +#endif + + + diff --git a/xc/extras/Mesa/src/D3D/D3DTEXT.CPP b/xc/extras/Mesa/src/D3D/D3DTEXT.CPP new file mode 100644 index 000000000..e6ff86456 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DTEXT.CPP @@ -0,0 +1,576 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "d3dText.h"
+
+/*=============================================================================
+
+ 1
+ ------
+ | |
+ 6 | | 2
+ | 7 |
+ ------
+ | |
+ 5 | | 3
+ | |
+ ------
+ 4
+
+ TL_0 TR_0
+TLL TL_1 TR_1 TRR
+
+MLL_0 ML_0 MR_0 MRR_0
+MLL_1 ML_1 MR_1 MRR_1
+
+BLL BL_0 BR_0 BRR
+ BL_1 BR_1
+
+=============================================================================*/
+
+#define TLL 0
+#define TRR 1
+#define TL_0 2
+#define TL_1 3
+#define TR_0 4
+#define TR_1 5
+
+#define MLL_0 6
+#define MLL_1 7
+#define MRR_0 8
+#define MRR_1 9
+
+#define ML_0 10
+#define ML_1 11
+#define MR_0 12
+#define MR_1 13
+
+#define BL_0 14
+#define BL_1 15
+#define BR_0 16
+#define BR_1 17
+#define BLL 18
+#define BRR 19
+
+#define BIT1 0x00000001
+#define BIT2 0x00000002
+#define BIT3 0x00000004
+#define BIT4 0x00000008
+#define BIT5 0x00000010
+#define BIT6 0x00000020
+#define BIT7 0x00000040
+
+#define TOP BIT4
+#define MIDDLE BIT7
+#define BOTTOM BIT1
+#define TLEFT BIT5
+#define BLEFT BIT6
+#define LEFT (TLEFT|BLEFT)
+#define TRIGHT BIT3
+#define BRIGHT BIT2
+#define RIGHT (TRIGHT|BRIGHT)
+#define ALL 0xFFFFFFFF
+
+/*===========================================================================*/
+/* This is the static array that will map the ASCII value of the character */
+/* being draw to the bit mask that will be scan converted to the LED display.*/
+/*===========================================================================*/
+DWORD textBitMasks[] =
+{
+ 0xFFFFFFFF, // 000
+ 0xFFFFFFFF, // 001
+ 0xFFFFFFFF, // 002
+ 0xFFFFFFFF, // 003
+ 0xFFFFFFFF, // 004
+ 0xFFFFFFFF, // 005
+ 0xFFFFFFFF, // 006
+ 0xFFFFFFFF, // 007
+ 0xFFFFFFFF, // 008
+ 0xFFFFFFFF, // 009
+ 0xFFFFFFFF, // 010
+ 0xFFFFFFFF, // 011
+ 0xFFFFFFFF, // 012
+ 0xFFFFFFFF, // 013
+ 0xFFFFFFFF, // 014
+ 0xFFFFFFFF, // 015
+ 0xFFFFFFFF, // 016
+ 0xFFFFFFFF, // 017
+ 0xFFFFFFFF, // 018
+ 0xFFFFFFFF, // 019
+ 0xFFFFFFFF, // 020
+ 0xFFFFFFFF, // 021
+ 0xFFFFFFFF, // 022
+ 0xFFFFFFFF, // 023
+ 0xFFFFFFFF, // 024
+ 0xFFFFFFFF, // 025
+ 0xFFFFFFFF, // 026
+ 0xFFFFFFFF, // 027
+ 0xFFFFFFFF, // 028
+ 0xFFFFFFFF, // 029
+ 0xFFFFFFFF, // 030
+ 0XFFFFFFFF, // 031
+ 0x00000000, // 032 'SPC'
+ 0xFFFFFFFF, // 033
+ 0xFFFFFFFF, // 034
+ 0xFFFFFFFF, // 035
+ 0xFFFFFFFF, // 036
+ 0xFFFFFFFF, // 037
+ 0xFFFFFFFF, // 038
+ 0xFFFFFFFF, // 039
+ 0xFFFFFFFF, // 040
+ 0xFFFFFFFF, // 041
+ 0xFFFFFFFF, // 042
+ 0xFFFFFFFF, // 043
+ 0xFFFFFFFF, // 044
+ 0xFFFFFFFF, // 045
+ 0xFFFFFFFF, // 046
+ 0xFFFFFFFF, // 047
+ (ALL &~ MIDDLE), // 048 '0'
+ (RIGHT), // 049 '1'
+ (ALL &~ TLEFT &~ BRIGHT), // 050 '2'
+ (ALL &~ LEFT), // 051 '3'
+ (TLEFT | MIDDLE | RIGHT), // 052 '4'
+ (ALL &~ TRIGHT &~ BLEFT), // 053 '5'
+ (ALL &~ TRIGHT), // 054 '6'
+ (TOP | RIGHT), // 055 '7'
+ (ALL), // 056 '8'
+ (ALL &~ BOTTOM &~ BLEFT), // 057 '9'
+ 0xFFFFFFFF, // 058
+ 0xFFFFFFFF, // 059
+ 0xFFFFFFFF, // 060
+ 0XFFFFFFFF, // 061
+ 0xFFFFFFFF, // 062
+ 0xFFFFFFFF, // 063
+ 0xFFFFFFFF, // 064
+ (ALL &~ BOTTOM), // 065 'A'
+ (ALL), // 066 'B'
+ (TOP | LEFT | BOTTOM), // 067 'C'
+ (ALL &~ MIDDLE), // 068 'D'
+ (ALL &~ RIGHT), // 069 'E'
+ (LEFT | TOP | MIDDLE), // 070 'F'
+ 0x00000000, // 071 'G'
+ (ALL &~ TOP &~ BOTTOM), // 072 'H'
+ (RIGHT), // 073 'I'
+ (RIGHT | BOTTOM), // 074 'J'
+ 0x00000000, // 075 'K'
+ (LEFT | BOTTOM), // 076 'L'
+ 0x00000000, // 088 'M'
+ 0x00000000, // 089 'N'
+ (ALL &~ MIDDLE), // 090 'O'
+ (ALL &~ BRIGHT &~ BOTTOM),// 091 'P'
+ 0x00000000, // 092 'Q'
+ 0x00000000, // 093 'R'
+ (ALL &~ TRIGHT &~ BLEFT), // 094 'S'
+ 0X00000000, // 095 'T'
+ (LEFT | RIGHT | BOTTOM), // 096 'U'
+ 0x00000000, // 097 'V'
+ 0x00000000, // 098 'W'
+ 0x00000000, // 099 'X'
+ 0x00000000, // 1000 'Z'
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 100
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 104
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 108
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 112
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 116
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, // 120
+ 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF // 124
+};
+
+#define CT 1.0f
+#define CX 7.0f
+#define CY 13.0f
+#define CM ((CY-(CT*3.0f))/2.0f)
+
+float lCoords[][2] =
+{
+ /* Top outsides. */
+ { 0, (CY-CT) },
+ { CX, (CY-CT) },
+
+ /* Top Line. */
+ { CT, CY },
+ { CT, (CY-CT) },
+ { (CX-CT), CY },
+ { (CX-CT), (CY-CT) },
+
+ /* Middle outsides. */
+ { 0.0f, (CT+CM+CT) },
+ { 0.0f, (CT+CM) },
+ { CX, (CT+CM+CT) },
+ { CX, (CT+CM) },
+
+ /* Middle Line. */
+ { CT, (CT+CM+CT) },
+ { CT, (CT+CM) },
+ { (CX-CT), (CT+CM+CT) },
+ { (CX-CT), (CT+CM) },
+
+ /* Bottom line. */
+ { CT, CT },
+ { CT, 0.0f },
+ { (CX-CT), CT },
+ { (CX-CT), 0.0f },
+
+ /* Bottom outsides. */
+ { 0.0f, CT},
+ { CX, CT }
+};
+
+static int ConvertCharacter( char *c, int cIndex, PD3DFONTMETRICS pfntMetrics );
+
+D3DTLVERTEX TextVertices[MAX_VERTICES];
+/*===========================================================================*/
+/* When we attach I will zero out the whole D3D vertex buffer I'm using for */
+/* the text. This way I don't need to set all the redundant values. I also */
+/* set all the oow values to 1 as I will be doing direct rendering. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+extern "C" BOOL InitD3DText( void )
+{
+ int index;
+
+ /* Set the D3D Vertex Buffer up once so we don't do redundant changes. */
+ memset( &TextVertices[0], 0, sizeof(TextVertices) );
+ for( index = 0; index < MAX_VERTICES; index++ )
+ TextVertices[index].rhw = D3DVAL( 1.0 );
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This function takes a single character and draw it using the supplied */
+/* fontmetrics structure. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void d3dTextDrawString( char *pszString, int x, int y, PD3DFONTMETRICS pfntMetrics )
+{
+ int cIndex,
+ nIndex,
+ index;
+ float cWidth = CX,
+ cHeight = CY;
+
+ /* Find the max width/height of a character and add the spacing so */
+ /* that we can use this value to calculate the x,y of the character.*/
+ cWidth = (cWidth * pfntMetrics->fntXScale) + pfntMetrics->fntXSpacing;
+ cHeight = (cHeight * pfntMetrics->fntYScale) + pfntMetrics->fntYSpacing;
+
+ /* Walk the string. This must be NULL terminated. */
+ for( cIndex = 0, nIndex = 0; *pszString; pszString++, cIndex = nIndex, x++ )
+ {
+ /* Convert the character and get the index into the text vertex buffer. */
+ nIndex = ConvertCharacter( &pszString[0], cIndex, pfntMetrics );
+ if ( (nIndex - cIndex) > 2 )
+ {
+ /* Modify the text vertex buffer based on the fntMetrics structure. */
+ for( index = cIndex; index < nIndex; index++ )
+ {
+ /* Scale the character. */
+ TextVertices[index].sx *= pfntMetrics->fntXScale;
+ TextVertices[index].sy *= pfntMetrics->fntYScale;
+
+ /* Move the character. */
+ TextVertices[index].sx += (cWidth*x);
+ TextVertices[index].sy += (cHeight*y);
+
+ /* Set the color. */
+ TextVertices[index].color = pfntMetrics->dwColor;
+ }
+ }
+ }
+
+ if ( nIndex < 3 )
+ return;
+
+ /* Set the states that slim things down. */
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_CULLMODE, D3DCULL_NONE );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZENABLE, FALSE );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZWRITEENABLE , FALSE );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHATESTENABLE, FALSE );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHABLENDENABLE, FALSE );
+
+ /* Blast them baby... */
+ pfntMetrics->lpD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST,
+ D3DFVF_TLVERTEX,
+ (LPVOID)&TextVertices[0],
+ nIndex,
+ (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) );
+}
+/*===========================================================================*/
+/* This function takes a single character and draw it directly to the screen*/
+/* unsing the supplied fntMetrics structure. The character will be drawn at */
+/* the supplied x,y. The x,y position is relative to the top left and uses */
+/* the spacing in the fntMetrics structure. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void d3dTextDrawCharacter( char *c, int x, int y, PD3DFONTMETRICS pfntMetrics )
+{
+ int cIndex = 0,
+ index;
+ float cWidth = CX,
+ cHeight = CY;
+
+ /* Convert the character and get the index into the text vertex buffer. */
+ cIndex = ConvertCharacter( c, 0, pfntMetrics );
+ if ( cIndex < 3 )
+ return;
+
+ /* Find the max width/height of a character and add the spacing so */
+ /* that we can use this value to calculate the x,y of the character.*/
+ cWidth = (cWidth * pfntMetrics->fntXScale) + pfntMetrics->fntXSpacing;
+ cHeight = (cHeight * pfntMetrics->fntYScale) + pfntMetrics->fntYSpacing;
+
+ /* Modify the text vertex buffer based on the fntMetrics structure. */
+ for( index = 0; index < cIndex; index++ )
+ {
+ /* Scale the character. */
+ TextVertices[index].sx *= pfntMetrics->fntXScale;
+ TextVertices[index].sy *= pfntMetrics->fntYScale;
+
+ /* Move the character. */
+ TextVertices[index].sx += (cWidth*x);
+ TextVertices[index].sy += (cHeight*y);
+
+ /* Set the color. */
+ TextVertices[index].color = pfntMetrics->dwColor;
+ }
+
+
+ /* Set the states that slim things down. */
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_CULLMODE, D3DCULL_NONE );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZENABLE, FALSE );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ZWRITEENABLE , FALSE );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHATESTENABLE, FALSE );
+ pfntMetrics->lpD3DDevice->SetRenderState( D3DRENDERSTATE_ALPHABLENDENABLE, FALSE );
+
+ /* Blast them baby... */
+ pfntMetrics->lpD3DDevice->DrawPrimitive( D3DPT_TRIANGLELIST,
+ D3DFVF_TLVERTEX,
+ (LPVOID)&TextVertices[0],
+ cIndex,
+ (D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT) );
+}
+/*===========================================================================*/
+/* This function takes a single character and draw it using the supplied */
+/* fontmetrics structure. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static int ConvertCharacter( char *c, int cIndex, PD3DFONTMETRICS pfntMetrics )
+{
+ DWORD asciiChar = (int)(*c);
+
+ /* Handle the TOP line. */
+ if ( textBitMasks[asciiChar] & BIT1 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TL_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TR_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TL_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_0][1] );
+ }
+
+ /* Handle the TOP/BOTTOM RIGHT lines. */
+ // if ( textBitMasks[index] & (BIT2|BIT3) )
+ if ( 1 == 0 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TRR][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TRR][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BRR][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BRR][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TR_1][1] );
+ }
+ else
+ {
+ if ( textBitMasks[asciiChar] & BIT2 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[TR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TRR][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[TRR][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MR_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TR_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[TR_1][1] );
+ }
+ if ( textBitMasks[asciiChar] & BIT3 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MRR_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MRR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[BRR][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BRR][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[BRR][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[BR_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MR_1][1] );
+ }
+ }
+
+ /* Handle the TOP/BOTTOM LEFT lines. */
+ // if ( textBitMasks[asciiChar] & (BIT5|BIT6) )
+ if ( 1 == 0 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TLL][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TL_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BLL][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BLL][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[TLL][1] );
+ }
+ else
+ {
+ if ( textBitMasks[asciiChar] & BIT5 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[ML_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[BL_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[BL_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BLL][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[BLL][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_1][1] );
+ }
+ if ( textBitMasks[asciiChar] & BIT6 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[TLL][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TL_1][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[TL_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[ML_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MLL_0][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[MLL_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[TLL][0] );
+ TextVertices[cIndex++].sy = D3DVAL( lCoords[TLL][1] );
+ }
+ }
+
+ /* Handle the MIDDLE line. */
+ if ( textBitMasks[asciiChar] & BIT7 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MR_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[MR_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[MR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[ML_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[ML_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[ML_0][1] );
+ }
+
+ /* Handle the BOTTOM line. */
+ if ( textBitMasks[asciiChar] & BIT4 )
+ {
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BR_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_0][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BR_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BR_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BR_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BL_1][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_1][1] );
+ TextVertices[cIndex].sx = D3DVAL( lCoords[BL_0][0] );
+ TextVertices[cIndex++].sy= D3DVAL( lCoords[BL_0][1] );
+ }
+
+ return cIndex;
+}
+
+#undef CM
+#undef CY
+#undef CX
+#undef CT
+
+#undef TLL
+#undef TRR
+#undef TL_0
+#undef TL_1
+#undef TR_0
+#undef TR_1
+
+#undef MLL_0
+#undef MLL_1
+#undef MRR_0
+#undef MRR_1
+
+#undef ML_0
+#undef ML_1
+#undef MR_0
+#undef MR_1
+
+#undef BL_0
+#undef BL_1
+#undef BR_0
+#undef BR_1
+#undef BLL
+#undef BRR
+
+#undef BIT1
+#undef BIT2
+#undef BIT3
+#undef BIT4
+#undef BIT5
+#undef BIT6
+#undef BIT7
+
+#undef TOP
+#undef MIDDLE
+#undef BOTTOM
+#undef TLEFT
+#undef BLEFT
+#undef LEFT
+#undef TRIGHT
+#undef BRIGHT
+#undef RIGHT
+#undef ALL
diff --git a/xc/extras/Mesa/src/D3D/D3DTextureMgr.cpp b/xc/extras/Mesa/src/D3D/D3DTextureMgr.cpp new file mode 100644 index 000000000..ac9d2621f --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DTextureMgr.cpp @@ -0,0 +1,947 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "D3DHAL.h"
+/*===========================================================================*/
+/* Local function prototypes. */
+/*===========================================================================*/
+static void UpdateTexture( PTM_OBJECT pTMObj, BOOL bVideo, RECT *pRect, UCHAR *pixels );
+static BOOL LoadTextureInVideo( PMESAD3DHAL pHAL, PTM_OBJECT pTMObj );
+static BOOL FreeTextureMemory( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject );
+static BOOL DestroyTextureObject( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject );
+HRESULT CALLBACK EnumPFHook( LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext );
+/*===========================================================================*/
+/* This function will simply set the top of stack to NULL. I only used it */
+/* just incase I want to add something later. */
+/*===========================================================================*/
+/* RETURN: TRUE. */
+/*===========================================================================*/
+BOOL InitTMgrHAL( PMESAD3DHAL pHAL )
+{
+ DPF(( DBG_FUNC, "InitTMgrHAL();" ));
+
+ /* Be clean my friend. */
+ pHAL->pTMList = NULL;
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This function will walk the Texture Managers linked list and destroy all */
+/* surfaces (SYSTEM/VIDEO). The texture objects themselves also will be */
+/* freed. */
+/* NOTE: this is per/context. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void TermTMgrHAL( PMESAD3DHAL pHAL )
+{
+ DPF(( DBG_FUNC, "TermTMgrHAL();" ));
+
+ if ( pHAL && pHAL->pTMList )
+ {
+ /* Destroy the surface and remove the TMO from the stack. */
+ while( DestroyTextureObject(pHAL,NULL) );
+
+ /* Be clean my friend. */
+ pHAL->pTMList = NULL;
+ }
+}
+/*===========================================================================*/
+/* This function is a HACK as I don't know how I can disable a texture with-*/
+/* out booting it out. Is there know state change? */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void DisableTMgrHAL( PMESAD3DSHARED pShared )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+
+ DPF(( DBG_FUNC, "DisableTMgrHAL();" ));
+
+ /* Check too see that we have a valid context. */
+ if ( (pHAL == NULL) && (pHAL->lpD3DDevice != NULL) )
+ {
+ DPF(( DBG_TXT_WARN, "Null HAL/Direct3D Device!" ));
+ return;
+ }
+
+ // TODO: This is a hack to shut off textures.
+ pHAL->lpD3DDevice->SetTexture( 0, NULL );
+}
+/*===========================================================================*/
+/* This function is the only entry into the TextureManager that Mesa/wgl */
+/* will see. It uses a dwAction to specify what we are doing. I did this as*/
+/* depending on the cards resources the action taken can change. */
+/* When this function is called we will always search the Texture Managers */
+/* linked list (per context remember) and try and find a structure that has */
+/* the same dwName. If we have a match we pull it out of the list and put it*/
+/* at the top of the list (TOL). If we don't find one then we create a struc*/
+/* and put it a TOL. This TOL idea makes for some caching as we will always */
+/* destroy Texture Surfaces from the bottom up... */
+/* All texture objects at this point will create a texture surface in System*/
+/* memory (SMEM). Then we will copy the Mesa texture into the surface using */
+/* the 'pixel' struc to get the translation info. So now this means that all*/
+/* textures that Mesa gives me I will have a Surface with a copy. If Mesa */
+/* changes the texture the I update the surface in (SMEM). */
+/* Now we have a texture struc and a Texture Surface in SMEM. At this point*/
+/* we create another surface on the card (VMEM). Finally we blt from the */
+/* SMEM to the VMEM and set the texture as current. Why do I need two? First*/
+/* this solves square textures. If the cards CAPS is square textures only */
+/* then I change the dimensions of the VMEM surface and the blt solves it for*/
+/* me. Second it saves me from filling D3D textures over and over if the */
+/* card needs to be creating and destroying surfaces because of low memory. */
+/* The surface in SMEM is expected to work always. When a surface has to be*/
+/* created in VMEM then we put it in a loop that tries to create the surface.*/
+/* If we create the surface ok then we brake from the loop. If we fail then */
+/* we will call 'FreeTextureMemory' that will return TRUE/FALSE as to whether*/
+/* memory was freed. If memory was freed then we can try again. If no memory*/
+/* was freed then it just can't fit. */
+/* 'FreeTextureMemory' will find the end of the list and start freeing VMEM */
+/* (never SMEM) surfaces that are not locked. */
+/* BIND - when we bind and there is a texture struct with a texture surface */
+/* in VMEM then we just make it current. If we have a struct and a surface */
+/* in SMEM but no VMEM surface then we create the surface in VMEM and blt */
+/* from the SMEM surface. If we have nothing its just like a creation... */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+extern "C" BOOL CreateTMgrHAL( PMESAD3DSHARED pShared, DWORD dwName, int level, DWORD dwRequestFlags,
+ RECT *rectDirty, DWORD dwWidth, DWORD dwHeight, DWORD dwAction, void *pPixels )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+ PTM_OBJECT pTMObj,
+ pTemp;
+ DDSURFACEDESC2 ddsd2;
+ HRESULT rc;
+
+
+ DPF(( DBG_FUNC, "CreateTMgrHAL();" ));
+
+ DPF(( DBG_TXT_INFO, "Texture:" ));
+ DPF(( DBG_TXT_INFO, "cx: %d cy: %d", dwWidth, dwHeight ));
+ DPF(( DBG_TXT_INFO, "Rect:" ));
+ if ( rectDirty )
+ {
+ DPF(( DBG_TXT_INFO, "x0: %d y0: %d", rectDirty->left, rectDirty->top ));
+ DPF(( DBG_TXT_INFO, "x1: %d y1: %d", rectDirty->right, rectDirty->bottom ));
+ }
+
+ /* Check too see that we have a valid context. */
+ if ( (pHAL == NULL) && (pHAL->lpD3DDevice != NULL) )
+ {
+ DPF(( DBG_TXT_WARN, "Null HAL/Direct3D Device!" ));
+ return FALSE;
+ }
+
+ /*=================================================*/
+ /* See if we can find this texture object by name. */
+ /*=================================================*/
+ for( pTMObj = pHAL->pTMList; pTMObj && (pTMObj->dwName != dwName); pTMObj = pTMObj->next );
+
+ /*=========================================================*/
+ /* Allocate a new object if we didn't get a matching name. */
+ /*=========================================================*/
+ if ( pTMObj == NULL )
+ {
+ pTMObj = (PTM_OBJECT)ALLOC( sizeof(TM_OBJECT) );
+ if ( pTMObj == NULL )
+ return FALSE;
+ memset( pTMObj, 0, sizeof(TM_OBJECT) );
+
+ /* Put the object at the beginning of the list. */
+ pTMObj->next = pHAL->pTMList;
+ if ( pTMObj->next )
+ {
+ pTemp = pTMObj->next;
+ pTemp->prev = pTMObj;
+ }
+ pHAL->pTMList = pTMObj;
+ }
+ else
+ {
+ /*===============================================================*/
+ /* Make some caching happen by pulling this object to the front. */
+ /*===============================================================*/
+ if ( pHAL->pTMList != pTMObj )
+ {
+ /* Pull the object out of the list. */
+ if ( pTMObj->prev )
+ {
+ pTemp = pTMObj->prev;
+ pTemp->next = pTMObj->next;
+ }
+ if ( pTMObj->next )
+ {
+ pTemp = pTMObj->next;
+ pTemp->prev = pTMObj->prev;
+ }
+
+ pTMObj->prev = NULL;
+ pTMObj->next = NULL;
+
+ /* Put the object at the front of the list. */
+ pTMObj->next = pHAL->pTMList;
+ if ( pTMObj->next )
+ {
+ pTemp = pTMObj->next;
+ pTemp->prev = pTMObj;
+ }
+ pHAL->pTMList = pTMObj;
+ }
+ }
+
+ /*========================================================*/
+ /* If we are doing BIND and the texture is in VID memory. */
+ /*========================================================*/
+ if ( (dwAction == TM_ACTION_BIND) && pTMObj->lpDDS_Video )
+ {
+ DPF(( DBG_TXT_PROFILE, "Cache HIT (%d)", dwName ));
+
+ /* Make this the current texture. */
+ rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
+ pHAL->lpD3DDevice->SetTexture( 0, NULL );
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ /*=================================================================*/
+ /* If we are doing BIND and the texture is at least in SYS memory. */
+ /*=================================================================*/
+ if ( (dwAction == TM_ACTION_BIND) && pTMObj->lpDDS_System )
+ {
+ DPF(( DBG_TXT_PROFILE, "Cache MISS (%d)", dwName ));
+
+ /* Create the texture on the card. */
+ rc = LoadTextureInVideo( pHAL, pTMObj );
+ if ( rc == FALSE )
+ return FALSE;
+
+ /* Make this the current texture. */
+ rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
+ pHAL->lpD3DDevice->SetTexture( 0, NULL );
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ /*=========================================================*/
+ /* If we are doing UPDATE then try in VID first for speed. */
+ /*=========================================================*/
+ if ( (dwAction == TM_ACTION_UPDATE) && pTMObj->lpDDS_Video &&
+ !(pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY) )
+ {
+ DPF(( DBG_TXT_INFO, "Fix the SubTexture update Leigh!" ));
+
+ /* Update the texture on the card. */
+ UpdateTexture( pTMObj, TRUE, rectDirty, (UCHAR *)pPixels );
+
+ /* We updated the texture in VID so kill the SYS so we know its dirty. */
+ if ( pTMObj->lpDDS_System )
+ {
+ DPF(( DBG_TXT_INFO, "Release texture (SYS)" ));
+ DX_RESTORE( pTMObj->lpDDS_System );
+ pTMObj->lpDDS_System->Release();
+ pTMObj->lpDDS_System = NULL;
+ }
+
+ /* Make this the current texture. */
+ rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
+ pHAL->lpD3DDevice->SetTexture( 0, NULL );
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ /*===========================================================*/
+ /* If we are doing UPDATE then try in SYS still gives speed. */
+ /*===========================================================*/
+ if ( (dwAction == TM_ACTION_UPDATE) && pTMObj->lpDDS_System )
+ {
+ DPF(( DBG_TXT_INFO, "Fix the SubTexture update Leigh!" ));
+
+ /* Update the texture in SYS. */
+ UpdateTexture( pTMObj, FALSE, NULL, (UCHAR *)pPixels );
+
+ /* We updated the SYS texture only so now blt to the VID. */
+ rc = LoadTextureInVideo( pHAL, pTMObj );
+ if ( rc == FALSE )
+ return FALSE;
+
+ /* Make this the current texture. */
+ rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
+ pHAL->lpD3DDevice->SetTexture( 0, NULL );
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ /* At this point we have a valid Texture Manager Object with updated */
+ /* links. We now need to create or update a texture surface that is */
+ /* in system memory. Every texture has a copy in system so we can use*/
+ /* blt to solve problems with textures allocated on the card (square */
+ /* only textures, pixelformats...). */
+
+ // TODO: make support for update also. Dirty rectangle basicly...
+
+ /* Kill the interface if we have one no matter what. */
+ if ( pTMObj->lpD3DTexture2 )
+ {
+ DPF(( DBG_TXT_INFO, "Release Texture2" ));
+ pTMObj->lpD3DTexture2->Release();
+ pTMObj->lpD3DTexture2 = NULL;
+ }
+
+ /* Kill the system surface. TODO: should try to get the SubIMage going again */
+ if ( pTMObj->lpDDS_System )
+ {
+ DPF(( DBG_TXT_INFO, "Release texture (SYS)" ));
+ DX_RESTORE( pTMObj->lpDDS_System );
+ pTMObj->lpDDS_System->Release();
+ pTMObj->lpDDS_System = NULL;
+ }
+
+ /* Kill the Video surface. TODO: need some reuse system... */
+ if ( pTMObj->lpDDS_Video )
+ {
+ DPF(( DBG_TXT_INFO, "Release texture (VID)" ));
+ DX_RESTORE( pTMObj->lpDDS_Video );
+ pTMObj->lpDDS_Video->Release();
+ pTMObj->lpDDS_Video = NULL;
+ }
+
+ /*================================================================*/
+ /* Translate the the Mesa/OpenGL pixel channels to the D3D flags. */
+ /*================================================================*/
+ switch( dwRequestFlags )
+ {
+ case GL_ALPHA:
+ dwRequestFlags = DDPF_ALPHA;
+ DPF(( DBG_TXT_WARN, "GL_ALPHA not supported!)" ));
+ return FALSE;
+
+ case GL_INTENSITY:
+ case GL_LUMINANCE:
+ DPF(( DBG_TXT_WARN, "GL_INTENSITY/GL_LUMINANCE not supported!)" ));
+ dwRequestFlags = DDPF_LUMINANCE;
+ return FALSE;
+
+ case GL_LUMINANCE_ALPHA:
+ DPF(( DBG_TXT_WARN, "GL_LUMINANCE_ALPHA not supported!)" ));
+ dwRequestFlags = DDPF_LUMINANCE | DDPF_ALPHAPIXELS;
+ return FALSE;
+
+ case GL_RGB:
+ DPF(( DBG_TXT_INFO, "Texture -> GL_RGB" ));
+ dwRequestFlags = DDPF_RGB;
+ break;
+
+ case GL_RGBA:
+ DPF(( DBG_TXT_INFO, "Texture -> GL_RGBA" ));
+ dwRequestFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
+ break;
+ }
+
+ /*==============================*/
+ /* Populate the texture object. */
+ /*==============================*/
+ pTMObj->dwName = dwName;
+ pTMObj->lpD3DDevice = pHAL->lpD3DDevice;
+ pTMObj->dwFlags = dwRequestFlags;
+ if ( pHAL->D3DHWDevDesc.dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_SQUAREONLY )
+ {
+ DPF(( DBG_TXT_INFO, "Convert to Square..." ));
+ pTMObj->dwSHeight = dwHeight;
+ pTMObj->dwSWidth = dwWidth;
+
+ /* Shrink non-square textures. */
+ pTMObj->dwVHeight = (dwHeight > dwWidth) ? dwWidth : dwHeight;
+ pTMObj->dwVWidth = (dwHeight > dwWidth) ? dwWidth : dwHeight;
+ }
+ else
+ {
+ pTMObj->dwSHeight = dwHeight;
+ pTMObj->dwSWidth = dwWidth;
+ pTMObj->dwVHeight = dwHeight;
+ pTMObj->dwVWidth = dwWidth;
+ }
+
+ /*========================*/
+ /* Create SYSTEM surface. */
+ /*========================*/
+
+ /* Request a surface in system memory. */
+ memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
+ ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
+ ddsd2.dwWidth = pTMObj->dwSWidth;
+ ddsd2.dwHeight = pTMObj->dwSHeight;
+ ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY;
+ ddsd2.ddsCaps.dwCaps2 = 0L;
+ memset( &ddsd2.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT) );
+ ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT );
+ ddsd2.ddpfPixelFormat.dwFlags = dwRequestFlags;
+ rc = pHAL->lpD3DDevice->EnumTextureFormats( EnumPFHook, &ddsd2.ddpfPixelFormat );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "EnumerTextureFormats (SYSTEM)->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Create the surface using the enumerated pixelformat. */
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pTMObj->lpDDS_System, NULL );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "CreateSurface (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Solve the pixel mapping info using the surface pixelformat. */
+ Solve8BitChannelPixelFormat( &ddsd2.ddpfPixelFormat, &pTMObj->pixel );
+
+ /*===================================================================*/
+ /* Fill the texture using the PixelInfo structure to do the mapping. */
+ /*===================================================================*/
+ UpdateTexture( pTMObj, FALSE, NULL, (UCHAR *)pPixels );
+
+ /*=======================*/
+ /* Create VIDEO surface. */
+ /*=======================*/
+ rc = LoadTextureInVideo( pHAL, pTMObj );
+ if ( rc == FALSE )
+ return FALSE;
+
+ /* Make this the current texture. */
+ rc = pHAL->lpD3DDevice->SetTexture( 0, pTMObj->lpD3DTexture2 );
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_TXT_WARN, "Failed SetTexture() (%s)", ErrorStringD3D(rc) ));
+ pHAL->lpD3DDevice->SetTexture( 0, NULL );
+ return FALSE;
+ }
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This function will handle the creation and destruction of the texture */
+/* surfaces on the card. Using the dw'V'Width/Height dimensions the call */
+/* try and create the texture on the card and keep using FreeTextureMemory */
+/* until the surace can be created. Once the surface is created we get the */
+/* interface that we will use to make it the current texture. I didn't put */
+/* the code to make the texture current in this function as BIND needs to */
+/* use the same code and this function doesn't always get called when we do a*/
+/* bind. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+static BOOL LoadTextureInVideo( PMESAD3DHAL pHAL, PTM_OBJECT pTMObj )
+{
+ DDSURFACEDESC2 ddsd2;
+ HRESULT rc;
+
+ DPF(( DBG_FUNC, "LoadTextureInVideo();" ));
+
+ /* Kill the interface if we have one no matter what. */
+ if ( pTMObj->lpD3DTexture2 )
+ {
+ DPF(( DBG_TXT_INFO, "Release Texture2" ));
+ pTMObj->lpD3DTexture2->Release();
+ pTMObj->lpD3DTexture2 = NULL;
+ }
+
+ /* Kill the Video surface. TODO: need some reuse system... */
+ if ( pTMObj->lpDDS_Video )
+ {
+ DPF(( DBG_TXT_INFO, "Release texture (VID)" ));
+ DX_RESTORE( pTMObj->lpDDS_Video );
+ pTMObj->lpDDS_Video->Release();
+ pTMObj->lpDDS_Video = NULL;
+ }
+
+ /* Request a surface in Video memory. */
+ memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
+ ddsd2.dwSize = sizeof( DDSURFACEDESC2 );
+ ddsd2.dwWidth = pTMObj->dwVWidth;
+ ddsd2.dwHeight = pTMObj->dwVHeight;
+ ddsd2.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
+ ddsd2.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY;
+ ddsd2.ddsCaps.dwCaps2 = 0L;
+ memset( &ddsd2.ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT) );
+ ddsd2.ddpfPixelFormat.dwSize = sizeof( DDPIXELFORMAT );
+ ddsd2.ddpfPixelFormat.dwFlags = pTMObj->dwFlags;
+ rc = pHAL->lpD3DDevice->EnumTextureFormats( EnumPFHook, &ddsd2.ddpfPixelFormat );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "EnumerTextureFormats ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Make sure we lock so we don't nuke this texture trying to free memory for it. */
+ pTMObj->bLock = TRUE;
+
+ /* Start a loop that will free all textures until we have created the texture */
+ /* surface or we can't free up more memory. */
+ do
+ {
+ /* Try to create the texture surface. */
+ rc = pHAL->lpDD4->CreateSurface( &ddsd2, &pTMObj->lpDDS_Video, NULL );
+ if ( !FAILED(rc) )
+ break;
+
+ DPF(( DBG_TXT_INFO, "Free Texture Memory" ));
+
+ /* DestroyTexture will return TRUE if a surface was freed. */
+ } while( FreeTextureMemory(pHAL,NULL) );
+
+ /* Make sure we unlock or we won't be able to nuke the TMO later. */
+ pTMObj->bLock = FALSE;
+
+ /* Did we create a valid texture surface? */
+ if ( FAILED(rc) )
+ {
+ DPF(( DBG_TXT_WARN, "Failed to load texture" ));
+ pHAL->lpD3DDevice->SetTexture( 0, NULL );
+ return FALSE;
+ }
+
+ DX_RESTORE( pTMObj->lpDDS_System );
+ DX_RESTORE( pTMObj->lpDDS_Video );
+
+ DPF(( DBG_TXT_INFO, "Texture Blt SYSTEM -> VID" ));
+
+ /* Now blt the texture in system memory to the card. */
+ rc = pTMObj->lpDDS_Video->Blt( NULL, pTMObj->lpDDS_System, NULL, DDBLT_WAIT, NULL );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "Blt (TEXTURE) ->", ErrorStringD3D(rc) );
+ return FALSE;
+ }
+
+ /* Get the Texture interface that is used to render with. */
+ pTMObj->lpDDS_Video->QueryInterface( IID_IDirect3DTexture2, (void **)&pTMObj->lpD3DTexture2 );
+ if ( pTMObj->lpD3DTexture2 == NULL )
+ {
+ DPF(( DBG_TXT_WARN, "Failed QueryTextureInterface" ));
+ pHAL->lpD3DDevice->SetTexture( 0, NULL );
+ return FALSE;
+ }
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* If this function gets a texture object struc then we will try and free */
+/* it. If we get a NULL then we will search from the bottom up and free one */
+/* VMEM surface. I can only free when the surface isn't locked and of course*/
+/* there must be a VMEM surface. We never free SMEM surfaces as that isn't */
+/* the point. */
+/* TODO: should have a pointer to the bottom of the stack really. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static BOOL FreeTextureMemory( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject )
+{
+ PTM_OBJECT pCurrent;
+ BOOL bFreed = FALSE;
+
+ DPF(( DBG_FUNC, "FreeTextureMemory();" ));
+ DPF(( DBG_TXT_WARN, "FREE TEXTURE!" ));
+
+ /* Just to be safe. */
+ if ( !pHAL || !pHAL->pTMList )
+ {
+ DPF(( DBG_TXT_WARN, "FreeTextureMemory() -> NULL pHAL/pHAL->pTMList" ));
+ return FALSE;
+ }
+
+ /* Free the last texture in the list. */
+ if ( pTMObject == NULL )
+ {
+ DPF(( DBG_TXT_INFO, "Free Last texture in cache" ));
+
+ /* Find the last texture object. */
+ for( pCurrent = pHAL->pTMList; pCurrent->next; pCurrent = pCurrent->next );
+
+ /* Now backup until we find a texture on the card. */
+ while( pCurrent && (pCurrent->lpDDS_Video == NULL) && (pCurrent->bLock == FALSE) )
+ pCurrent = pCurrent->prev;
+
+ /* Didn't find anything. */
+ if ( pCurrent == NULL )
+ {
+ DPF(( DBG_TXT_INFO, "No texture memory freed" ));
+ return FALSE;
+ }
+ }
+ else
+ {
+ /* See if we can find this texture object. */
+ for( pCurrent = pHAL->pTMList; pCurrent && (pCurrent != pTMObject); pCurrent = pCurrent->next );
+
+ /* Didn't find anything. */
+ if ( pCurrent == NULL )
+ {
+ DPF(( DBG_TXT_INFO, "Requested texture to be freed NOT FOUND" ));
+ return FALSE;
+ }
+ }
+
+ /* Can't free this baby. */
+ if ( pCurrent->bLock == TRUE )
+ {
+ DPF(( DBG_TXT_WARN, "Requested texture LOCKED" ));
+ return FALSE;
+ }
+
+ /* Free the texture memory. */
+ if ( pCurrent->lpD3DTexture2 )
+ {
+ DPF(( DBG_TXT_INFO, "Release Texture2" ));
+ pCurrent->lpD3DTexture2->Release();
+ pCurrent->lpD3DTexture2 = NULL;
+ bFreed = TRUE;
+ }
+ if ( pCurrent->lpDDS_Video )
+ {
+ DPF(( DBG_TXT_INFO, "Release texture (VID):" ));
+ DPF(( DBG_TXT_INFO, "dwName: %d", pCurrent->dwName ));
+ DPF(( DBG_TXT_INFO, "cx: %d, cy: %d", pCurrent->dwVWidth, pCurrent->dwVHeight ));
+ pCurrent->lpDDS_Video->Release();
+ pCurrent->lpDDS_Video = NULL;
+ bFreed = TRUE;
+ }
+
+ return bFreed;
+}
+/*===========================================================================*/
+/* This function searches the linked list of texture objects in the supplied*/
+/* D3Dwrapper structure. If it finds a match it will free it and pull it out*/
+/* of the linked list. The function works on the bases of a matching pointer*/
+/* to the object (not matching content). */
+/* If the function gets passed a NULL then we want to free the last texture */
+/* object in the list. Used in a loop to destory all. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+static BOOL DestroyTextureObject( PMESAD3DHAL pHAL, PTM_OBJECT pTMObject )
+{
+ PTM_OBJECT pCurrent;
+
+ DPF(( DBG_FUNC, "DestoryTextureObject();" ));
+
+ /* Just to be safe. */
+ if ( !pHAL || !pHAL->pTMList )
+ {
+ DPF(( DBG_TXT_WARN, "DestroyTextureObject() -> NULL pHAL/pHAL->pTMList" ));
+ return FALSE;
+ }
+
+ /* Free the last texture in the list. */
+ if ( pTMObject == NULL )
+ {
+ /* Find the last texture object. */
+ for( pCurrent = pHAL->pTMList; pCurrent->next; pCurrent = pCurrent->next );
+ }
+ else
+ {
+ /* See if we can find this texture object. */
+ for( pCurrent = pHAL->pTMList; pCurrent && (pCurrent != pTMObject); pCurrent = pCurrent->next );
+
+ /* Didn't find anything. */
+ if ( pCurrent == NULL )
+ {
+ DPF(( DBG_TXT_WARN, "No textures to be freed" ));
+ return FALSE;
+ }
+ }
+
+ /* Can't free this baby. */
+ if ( pCurrent->bLock == TRUE )
+ {
+ DPF(( DBG_TXT_WARN, "Requested texture to be freed LOCKED" ));
+ return FALSE;
+ }
+
+ /* Free the texture memory. */
+ if ( pCurrent->lpD3DTexture2 )
+ {
+ DPF(( DBG_TXT_INFO, "Release Texture2" ));
+ pCurrent->lpD3DTexture2->Release();
+ pCurrent->lpD3DTexture2 = NULL;
+ }
+ if ( pCurrent->lpDDS_Video )
+ {
+ DPF(( DBG_TXT_INFO, "Release texture (VID):" ));
+ pCurrent->lpDDS_Video->Release();
+ pCurrent->lpDDS_Video = NULL;
+ }
+ if ( pCurrent->lpDDS_System )
+ {
+ DPF(( DBG_TXT_INFO, "Release texture (SYS):" ));
+ pCurrent->lpDDS_System->Release();
+ pCurrent->lpDDS_System = NULL;
+ }
+
+ /* Pull this texture out of the list. */
+ if ( pCurrent == pHAL->pTMList )
+ pHAL->pTMList = NULL;
+ if ( pCurrent->prev )
+ (pCurrent->prev)->next = pCurrent->next;
+ if ( pCurrent->next )
+ (pCurrent->next)->prev = pCurrent->prev;
+ FREE( pCurrent );
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This function is the callback function that gets called when we are doing*/
+/* an enumeration of the texture formats supported by this device. The choice*/
+/* is made by checking to see if we have a match with the supplied D3D pixel-*/
+/* format. So the enumeration has to pass a desired D3D PF as the user var. */
+/*===========================================================================*/
+/* RETURN: D3DENUMRET_OK, D3DENUMRET_CANCEL. */
+/*===========================================================================*/
+static void UpdateTexture( PTM_OBJECT pTMObj, BOOL bVideo, RECT *pRect, UCHAR *pixels )
+{
+ LPDIRECTDRAWSURFACE4 lpDDS;
+ DDSURFACEDESC2 ddsd2;
+ DWORD srcPitch,
+ dwHeight,
+ dwWidth,
+ dwCol,
+ dwColor;
+ UCHAR *pSrc,
+ *pSrcRow,
+ *pDest,
+ *pDestRow;
+ int rc;
+
+ // TODO: Do I need to pass the h/w when its in the object!
+ DPF(( DBG_FUNC, "UpdateTexture();" ));
+
+ /* Get the surface pointer we are looking for. */
+ lpDDS = (bVideo) ? pTMObj->lpDDS_Video : pTMObj->lpDDS_System;
+
+ /*===================================================================*/
+ /* Fill the texture using the PixelInfo structure to do the mapping. */
+ /*===================================================================*/
+
+ /* Get the surface pointer. */
+ memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
+ ddsd2.dwSize = sizeof(DDSURFACEDESC2);
+ rc = lpDDS->Lock( NULL, &ddsd2, DDLOCK_WAIT, NULL );
+ if ( FAILED(rc) )
+ {
+ RIP( NULL, "Lock (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) );
+ return;
+ }
+
+ /* For now we are only updating the system surface so use its dimensions. */
+ dwWidth = (bVideo) ? pTMObj->dwVWidth : pTMObj->dwSWidth;
+ dwHeight = (bVideo) ? pTMObj->dwVHeight : pTMObj->dwSHeight;
+
+ /* If we are updating the whole surface then the pDest/pSrc will */
+ /* always be the same. */
+ if ( pRect == NULL )
+ {
+ pDest = (UCHAR *)ddsd2.lpSurface;
+ pSrc = pixels;
+ }
+
+ /* Fill the texture surface based on the pixelformat flags. */
+ if ( pTMObj->dwFlags == (DDPF_RGB | DDPF_ALPHAPIXELS) )
+ {
+ srcPitch = dwWidth * 4;
+ if ( pRect )
+ {
+ pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
+ pSrc = pixels + (pRect->top * dwWidth * 4) + (pRect->left * 4);
+ dwHeight = (pRect->bottom - pRect->top);
+ dwWidth = (pRect->right - pRect->left);
+ }
+
+ for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
+ {
+ for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
+ {
+ dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift );
+ dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.gScale)) << pTMObj->pixel.gShift );
+ dwColor |= ( ((DWORD)(*(pSrc+2) * pTMObj->pixel.bScale)) << pTMObj->pixel.bShift );
+ if ( pTMObj->pixel.aScale == -1.0 )
+ dwColor |= ( (*(pSrc+3) & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 );
+ else
+ dwColor |= ( ((DWORD)(*(pSrc+3) * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift );
+ memcpy( pDest, &dwColor, pTMObj->pixel.cb );
+ pDest += pTMObj->pixel.cb;
+ pSrc += 4;
+ }
+ }
+ }
+ else if ( pTMObj->dwFlags == DDPF_RGB )
+ {
+ srcPitch = dwWidth * 3;
+ if ( pRect )
+ {
+ pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
+ pSrc = pixels + (pRect->top * dwWidth * 3) + (pRect->left * 3);
+ dwHeight = (pRect->bottom - pRect->top);
+ dwWidth = (pRect->right - pRect->left);
+ }
+
+ for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
+ {
+ for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
+ {
+ dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift );
+ dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.gScale)) << pTMObj->pixel.gShift );
+ dwColor |= ( ((DWORD)(*(pSrc+2) * pTMObj->pixel.bScale)) << pTMObj->pixel.bShift );
+ memcpy( pDest, &dwColor, pTMObj->pixel.cb );
+ pDest += pTMObj->pixel.cb;
+ pSrc += 3;
+ }
+ }
+ }
+ else if ( pTMObj->dwFlags == (DDPF_LUMINANCE | DDPF_ALPHAPIXELS) )
+ {
+ srcPitch = dwWidth * 2;
+ if ( pRect )
+ {
+ pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
+ pSrc = pixels + (pRect->top * dwWidth * 2) + (pRect->left * 2);
+ dwHeight = (pRect->bottom - pRect->top);
+ dwWidth = (pRect->right - pRect->left);
+ }
+
+ for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
+ {
+ for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
+ {
+ dwColor = ( ((DWORD)(*(pSrc ) * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift );
+ if ( pTMObj->pixel.aScale == -1.0 )
+ dwColor |= ( (*(pSrc+1) & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 );
+ else
+ dwColor |= ( ((DWORD)(*(pSrc+1) * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift );
+ memcpy( pDest, &dwColor, pTMObj->pixel.cb );
+ pDest += pTMObj->pixel.cb;
+ pSrc += 2;
+ }
+ }
+ }
+ else if ( pTMObj->dwFlags == DDPF_LUMINANCE )
+ {
+ srcPitch = dwWidth;
+ if ( pRect )
+ {
+ pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
+ pSrc = pixels + (pRect->top * dwWidth) + (pRect->left);
+ dwHeight = (pRect->bottom - pRect->top);
+ dwWidth = (pRect->right - pRect->left);
+ }
+
+ for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
+ {
+ for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
+ {
+ dwColor = ( ((DWORD)(*pSrc * pTMObj->pixel.rScale)) << pTMObj->pixel.rShift );
+ memcpy( pDest, &dwColor, pTMObj->pixel.cb );
+ pDest += pTMObj->pixel.cb;
+ pSrc++;
+ }
+ }
+ }
+ else if ( pTMObj->dwFlags == DDPF_ALPHAPIXELS )
+ {
+ srcPitch = dwWidth;
+ if ( pRect )
+ {
+ pDest = ((UCHAR *)ddsd2.lpSurface) + (pRect->top * ddsd2.lPitch) + (pRect->left * pTMObj->pixel.cb);
+ pSrc = pixels + (pRect->top * dwWidth) + (pRect->left);
+ dwHeight = (pRect->bottom - pRect->top);
+ dwWidth = (pRect->right - pRect->left);
+ }
+
+ for( pDestRow = pDest, pSrcRow = pSrc; dwHeight > 0; dwHeight--, pDestRow += ddsd2.lPitch, pSrcRow += srcPitch )
+ {
+ for( dwCol = 0, pDest = pDestRow, pSrc = pSrcRow; dwCol < dwWidth; dwCol++ )
+ {
+ if ( pTMObj->pixel.aScale == -1.0 )
+ dwColor = ( (*pSrc & 0x80) ? (1 << pTMObj->pixel.aShift) : 0 );
+ else
+ dwColor = ( ((DWORD)(*pSrc * pTMObj->pixel.aScale)) << pTMObj->pixel.aShift );
+ memcpy( pDest, &dwColor, pTMObj->pixel.cb );
+ pDest += pTMObj->pixel.cb;
+ pSrc++;
+ }
+ }
+ }
+
+ /* Unlock the surface. */
+ rc = lpDDS->Unlock( NULL );
+ if ( FAILED(rc) )
+ {
+ RIP( NULL, "Unlock (TEXTURE/SYSTEM)->", ErrorStringD3D(rc) );
+ }
+}
+/*===========================================================================*/
+/* This function is the callback function that gets called when we are doing*/
+/* an enumeration of the texture formats supported by this device. The choice*/
+/* is made by checking to see if we have a match with the supplied D3D pixel-*/
+/* format. So the enumeration has to pass a desired D3D PF as the user var. */
+/*===========================================================================*/
+/* RETURN: D3DENUMRET_OK, D3DENUMRET_CANCEL. */
+/*===========================================================================*/
+HRESULT CALLBACK EnumPFHook( LPDDPIXELFORMAT lpDDPixFmt, LPVOID lpContext )
+{
+ LPDDPIXELFORMAT lpDDPixFmtRequest = (LPDDPIXELFORMAT)lpContext;
+ PIXELINFO pixel;
+
+ DPF(( DBG_FUNC, "EnumPFHook();" ));
+
+ if ( lpDDPixFmt->dwFlags == lpDDPixFmtRequest->dwFlags )
+ {
+ /* Are we looking for an alpha channel? */
+ if ( lpDDPixFmtRequest->dwFlags & DDPF_ALPHAPIXELS )
+ {
+ /* Try for something that has more then 1bits of Alpha. */
+ Solve8BitChannelPixelFormat( lpDDPixFmt, &pixel );
+ if ( pixel.aScale == -1.0 )
+ {
+ /* Save this format no matter what as its a match of sorts. */
+ memcpy( lpDDPixFmtRequest, lpDDPixFmt, sizeof(DDPIXELFORMAT) );
+ return D3DENUMRET_OK;
+ }
+ }
+
+ /* Save this format as its a good match. */
+ memcpy( lpDDPixFmtRequest, lpDDPixFmt, sizeof(DDPIXELFORMAT) );
+
+ /* We are happy at this point so lets leave. */
+ return D3DENUMRET_CANCEL;
+ }
+
+ return D3DENUMRET_OK;
+}
+
+
diff --git a/xc/extras/Mesa/src/D3D/D3DTextureMgr.h b/xc/extras/Mesa/src/D3D/D3DTextureMgr.h new file mode 100644 index 000000000..f4a415491 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DTextureMgr.h @@ -0,0 +1,62 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#ifndef _TEXTURE_MGR_INC
+#define _TEXTURE_MGR_INC
+
+/*===========================================================================*/
+/* Includes. */
+/*===========================================================================*/
+#include <windows.h>
+#include <ddraw.h>
+#include <d3d.h>
+#include <stdlib.h>
+#include <stdlib.h>
+#include "GL/gl.h"
+/*========================================================================*/
+/* Defines. */
+/*========================================================================*/
+/*========================================================================*/
+/* Type defines. */
+/*========================================================================*/
+typedef struct _local_texture_object
+{
+ DWORD dwName,
+ dwPriority,
+ dwFlags,
+ dwSWidth,
+ dwSHeight,
+ dwVWidth,
+ dwVHeight;
+ BOOL bLock,
+ bDirty; /* I only update VID on SubImage calls so the system */
+ /* texture can get invalid. */
+
+ LPDIRECT3DDEVICE3 lpD3DDevice; /* If the device changes we must get new handles... */
+ LPDIRECTDRAWSURFACE4 lpDDS_System,
+ lpDDS_Video;
+ LPDIRECT3DTEXTURE2 lpD3DTexture2;
+
+ PIXELINFO pixel;
+
+ struct _local_texture_object *next;
+ struct _local_texture_object *prev;
+
+} TM_OBJECT, *PTM_OBJECT;
+/*========================================================================*/
+/* Function prototypes. */
+/*========================================================================*/
+void APIENTRY InitTMD3D( void *pVoid );
+void APIENTRY TermTMD3D( void *pVoid );
+/*========================================================================*/
+/* Global variables declaration. */
+/*========================================================================*/
+
+#endif
diff --git a/xc/extras/Mesa/src/D3D/D3DUTILS.CPP b/xc/extras/Mesa/src/D3D/D3DUTILS.CPP new file mode 100644 index 000000000..c13d89cd7 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3DUTILS.CPP @@ -0,0 +1,638 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "D3DHAL.h"
+/*===========================================================================*/
+/* Local only functions. */
+/*===========================================================================*/
+static int CountTrailingZeros( DWORD dwMask );
+/*===========================================================================*/
+/* This function is used to get the pointer to the surface and the pitch for*/
+/* the scanline rendering functions. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" DDSURFACEDESC2 *LockHAL( PMESAD3DSHARED pShared, BOOL bBack )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+ static DDSURFACEDESC2 ddsd2;
+ HRESULT rc;
+
+ DPF(( DBG_FUNC, "LockHAL();" ));
+
+ /* Set the request structure up first. */
+ memset( &ddsd2, 0, sizeof(DDSURFACEDESC2) );
+ ddsd2.dwSize = sizeof(DDSURFACEDESC2);
+
+ /* Make sure we have enough info. */
+ if ( pHAL )
+ {
+ rc = pHAL->lpDDSRender->Lock( NULL, &ddsd2, DDLOCK_WAIT, NULL );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "Lock (RENDER) ->", ErrorStringD3D(rc) );
+ }
+ }
+
+ return &ddsd2;
+}
+/*===========================================================================*/
+/* This is just a simple wrapper. I probably don't need to do any error */
+/* checking as the Lock must have worked inorder to get here... */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void UnlockHAL( PMESAD3DSHARED pShared, BOOL bBack )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+ HRESULT rc;
+
+ DPF(( DBG_FUNC, "UnlockHAL();" ));
+
+ /* Make sure we have enough info. */
+ if ( pHAL )
+ {
+ rc = pHAL->lpDDSRender->Unlock( NULL );
+ if ( FAILED(rc) )
+ {
+ RIP( pHAL, "Unlock (RENDER) ->", ErrorStringD3D(rc) );
+ }
+ }
+}
+/*===========================================================================*/
+/* This function will track the main/Primary window that will be used as the*/
+/* target for the Blt in SwapBuffers. As a side effect the call will check */
+/* to see if the primary surface is the same size and position as the screen.*/
+/* If they are the same size we will call it fullscreen... */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+extern "C" void UpdateScreenPosHAL( PMESAD3DSHARED pShared )
+{
+ PMESAD3DHAL pHAL = (PMESAD3DHAL)pShared;
+ POINT pt;
+ DWORD dwWidth, dwHeight;
+
+ DPF(( DBG_FUNC, "UpdateScreenPosHAL();" ));
+
+ /* Make sure we have enough info. */
+ if ( pHAL != NULL )
+ {
+ /* Update the windows screen position. */
+ GetClientRect( pShared->hwnd, &pShared->rectW );
+ pt.x = pt.y = 0;
+ ClientToScreen( pShared->hwnd, &pt );
+ OffsetRect( &pShared->rectW, pt.x, pt.y);
+
+ /* Compare the primary to the screen. */
+ dwWidth = GetSystemMetrics( SM_CXSCREEN );
+ dwHeight = GetSystemMetrics( SM_CYSCREEN );
+ if ( (pShared->rectW.left > 0) || (pShared->rectW.top > 0) ||
+ (pShared->rectW.right > dwWidth) || (pShared->rectW.bottom > dwHeight) )
+ pShared->bWindow = TRUE;
+ else
+ pShared->bWindow = FALSE;
+ }
+}
+/*===========================================================================*/
+/* This function will fill in the pixel info structure defined in D3Dshared.*/
+/* Basicly it will take a DirectDraw pixelformat structure and make scaling */
+/* values that will convert from 8bit channels to whatever the supplied ddpf */
+/* uses. Also we will generate shift values that will be used to get move */
+/* each component of the pixel into place. */
+/* I have now added a special case for a 1bit alpha channel. If I find a 1b*/
+/* alpha then I will set the scale to -1.0 which should be unique. Later I */
+/* can check the alpha scale value too see if its -1.0 and thus handle it. I*/
+/* was finding that the case was not working tom my advantage so this is my */
+/* HACK for the day. As a TODO I should work on this... */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void Solve8BitChannelPixelFormat( DDPIXELFORMAT *pddpf, PPIXELINFO pPixel )
+{
+ DPF(( DBG_FUNC, "Solve8BitChannelPixelFromat();" ));
+
+ memset( pPixel, 0, sizeof(PPIXELINFO) );
+
+ /* Check too see if the color space is valid in the PF. */
+ if ( pddpf->dwFlags & DDPF_RGB )
+ {
+ /* Solve the red stuff. */
+ pPixel->dwRMask = pddpf->dwRBitMask;
+ pPixel->rShift = CountTrailingZeros( pPixel->dwRMask );
+ pPixel->rScale = (float)0.00392156 * (float)(pPixel->dwRMask >> pPixel->rShift);
+
+ /* Solve the green thingy's. */
+ pPixel->dwGMask = pddpf->dwGBitMask;
+ pPixel->gShift = CountTrailingZeros( pPixel->dwGMask );
+ pPixel->gScale = (float)0.00392156 * (float)(pPixel->dwGMask >> pPixel->gShift);
+
+ /* Solve the blues. */
+ pPixel->dwBMask = pddpf->dwBBitMask;
+ pPixel->bShift = CountTrailingZeros( pddpf->dwBBitMask );
+ pPixel->bScale = (float)0.00392156 * (float)(pddpf->dwBBitMask >> pPixel->bShift);
+ }
+
+ /* Do the alpha channel if there is one. */
+ if ( pddpf->dwFlags & DDPF_ALPHAPIXELS )
+ {
+ pPixel->dwAMask = pddpf->dwRGBAlphaBitMask;
+ pPixel->aShift = CountTrailingZeros( pPixel->dwAMask );
+
+ /* Special case a 1bit alpha. */
+ if ( (pPixel->dwAMask >> pPixel->aShift) == 1 )
+ pPixel->aScale = -1.0;
+ else
+ pPixel->aScale = (float)0.00392156 * (float)(pPixel->dwAMask >> pPixel->aShift);
+ }
+
+ /* Get the size of the pixel in bytes. Should work as dwRGBBitCount is in a union. */
+ pPixel->cb = pddpf->dwRGBBitCount / 8;
+}
+/*===========================================================================*/
+/* See RETURN :) */
+/*===========================================================================*/
+/* RETURN: number of contiguous zeros starting from the right. */
+/*===========================================================================*/
+static int CountTrailingZeros( DWORD dwMask )
+{
+ DWORD Mask;
+
+ if ( dwMask == 0 )
+ return 32;
+
+ /* Can't take credit for this one! */
+ Mask = dwMask & -(int)dwMask;
+ return ((Mask & 0xFFFF0000)!=0) << 4
+ | ((Mask & 0xFF00FF00)!=0) << 3
+ | ((Mask & 0xF0F0F0F0)!=0) << 2
+ | ((Mask & 0xCCCCCCCC)!=0) << 1
+ | ((Mask & 0xAAAAAAAA)!=0);
+}
+/*===========================================================================*/
+/* This function will convert the DDraw error code to its macro string. The*/
+/* returned pointer is static so you need not worry about memory managemnet */
+/* but the error message gets written over from call to call... */
+/*===========================================================================*/
+/* RETURN: pointer to the single static buffer that hold the error message. */
+/*===========================================================================*/
+char *ErrorStringD3D( HRESULT hr )
+{
+ static char errorString[128];
+
+ switch( hr )
+ {
+ case DDERR_ALREADYINITIALIZED:
+ strcpy( errorString, "DDERR_ALREADYINITIALIZED" );
+ break;
+
+ case DDERR_CANNOTATTACHSURFACE:
+ strcpy( errorString, "DDERR_CANNOTATTACHSURFACE" );
+ break;
+
+ case DDERR_CANNOTDETACHSURFACE:
+ strcpy( errorString, "DDERR_CANNOTDETACHSURFACE" );
+ break;
+
+ case DDERR_CURRENTLYNOTAVAIL:
+ strcpy( errorString, "DDERR_CURRENTLYNOTAVAIL" );
+ break;
+
+ case DDERR_EXCEPTION:
+ strcpy( errorString, "DDERR_EXCEPTION" );
+ break;
+
+ case DDERR_GENERIC:
+ strcpy( errorString, "DDERR_GENERIC" );
+ break;
+
+ case DDERR_HEIGHTALIGN:
+ strcpy( errorString, "DDERR_HEIGHTALIGN" );
+ break;
+
+ case DDERR_INCOMPATIBLEPRIMARY:
+ strcpy( errorString, "DDERR_INCOMPATIBLEPRIMARY" );
+ break;
+
+ case DDERR_INVALIDCAPS:
+ strcpy( errorString, "DDERR_INVALIDCAPS" );
+ break;
+
+ case DDERR_INVALIDCLIPLIST:
+ strcpy( errorString, "DDERR_INVALIDCLIPLIST" );
+ break;
+
+ case DDERR_INVALIDMODE:
+ strcpy( errorString, "DDERR_INVALIDMODE" );
+ break;
+
+ case DDERR_INVALIDOBJECT:
+ strcpy( errorString, "DDERR_INVALIDOBJECT" );
+ break;
+
+ case DDERR_INVALIDPARAMS:
+ strcpy( errorString, "DDERR_INVALIDPARAMS" );
+ break;
+
+ case DDERR_INVALIDPIXELFORMAT:
+ strcpy( errorString, "DDERR_INVALIDPIXELFORMAT" );
+ break;
+
+ case DDERR_INVALIDRECT:
+ strcpy( errorString, "DDERR_INVALIDRECT" );
+ break;
+
+ case DDERR_LOCKEDSURFACES:
+ strcpy( errorString, "DDERR_LOCKEDSURFACES" );
+ break;
+
+ case DDERR_NO3D:
+ strcpy( errorString, "DDERR_NO3D" );
+ break;
+
+ case DDERR_NOALPHAHW:
+ strcpy( errorString, "DDERR_NOALPHAHW" );
+ break;
+
+ case DDERR_NOCLIPLIST:
+ strcpy( errorString, "DDERR_NOCLIPLIST" );
+ break;
+
+ case DDERR_NOCOLORCONVHW:
+ strcpy( errorString, "DDERR_NOCOLORCONVHW" );
+ break;
+
+ case DDERR_NOCOOPERATIVELEVELSET:
+ strcpy( errorString, "DDERR_NOCOOPERATIVELEVELSET" );
+ break;
+
+ case DDERR_NOCOLORKEY:
+ strcpy( errorString, "DDERR_NOCOLORKEY" );
+ break;
+
+ case DDERR_NOCOLORKEYHW:
+ strcpy( errorString, "DDERR_NOCOLORKEYHW" );
+ break;
+
+ case DDERR_NODIRECTDRAWSUPPORT:
+ strcpy( errorString, "DDERR_NODIRECTDRAWSUPPORT" );
+ break;
+
+ case DDERR_NOEXCLUSIVEMODE:
+ strcpy( errorString, "DDERR_NOEXCLUSIVEMODE" );
+ break;
+
+ case DDERR_NOFLIPHW:
+ strcpy( errorString, "DDERR_NOFLIPHW" );
+ break;
+
+ case DDERR_NOGDI:
+ strcpy( errorString, "DDERR_NOGDI" );
+ break;
+
+ case DDERR_NOMIRRORHW:
+ strcpy( errorString, "DDERR_NOMIRRORHW" );
+ break;
+
+ case DDERR_NOTFOUND:
+ strcpy( errorString, "DDERR_NOTFOUND" );
+ break;
+
+ case DDERR_NOOVERLAYHW:
+ strcpy( errorString, "DDERR_NOOVERLAYHW" );
+ break;
+
+ case DDERR_OVERLAPPINGRECTS:
+ strcpy( errorString, "DDERR_OVERLAPPINGRECTS" );
+ break;
+
+ case DDERR_NORASTEROPHW:
+ strcpy( errorString, "DDERR_NORASTEROPHW" );
+ break;
+
+ case DDERR_NOROTATIONHW:
+ strcpy( errorString, "DDERR_NOROTATIONHW" );
+ break;
+
+ case DDERR_NOSTRETCHHW:
+ strcpy( errorString, "DDERR_NOSTRETCHHW" );
+ break;
+
+ case DDERR_NOT4BITCOLOR:
+ strcpy( errorString, "DDERR_NOT4BITCOLOR" );
+ break;
+
+ case DDERR_NOT4BITCOLORINDEX:
+ strcpy( errorString, "DDERR_NOT4BITCOLORINDEX" );
+ break;
+
+ case DDERR_NOT8BITCOLOR:
+ strcpy( errorString, "DDERR_NOT8BITCOLOR" );
+ break;
+
+ case DDERR_NOTEXTUREHW:
+ strcpy( errorString, "DDERR_NOTEXTUREHW" );
+ break;
+
+ case DDERR_NOVSYNCHW:
+ strcpy( errorString, "DDERR_NOVSYNCHW" );
+ break;
+
+ case DDERR_NOZBUFFERHW:
+ strcpy( errorString, "DDERR_NOZBUFFERHW" );
+ break;
+
+ case DDERR_NOZOVERLAYHW:
+ strcpy( errorString, "DDERR_NOZOVERLAYHW" );
+ break;
+
+ case DDERR_OUTOFCAPS:
+ strcpy( errorString, "DDERR_OUTOFCAPS" );
+ break;
+
+ case DDERR_OUTOFMEMORY:
+ strcpy( errorString, "DDERR_OUTOFMEMORY" );
+ break;
+
+ case DDERR_OUTOFVIDEOMEMORY:
+ strcpy( errorString, "DDERR_OUTOFVIDEOMEMORY" );
+ break;
+
+ case DDERR_OVERLAYCANTCLIP:
+ strcpy( errorString, "DDERR_OVERLAYCANTCLIP" );
+ break;
+
+ case DDERR_OVERLAYCOLORKEYONLYONEACTIVE:
+ strcpy( errorString, "DDERR_OVERLAYCOLORKEYONLYONEACTIVE" );
+ break;
+
+ case DDERR_PALETTEBUSY:
+ strcpy( errorString, "DDERR_PALETTEBUSY" );
+ break;
+
+ case DDERR_COLORKEYNOTSET:
+ strcpy( errorString, "DDERR_COLORKEYNOTSET" );
+ break;
+
+ case DDERR_SURFACEALREADYATTACHED:
+ strcpy( errorString, "DDERR_SURFACEALREADYATTACHED" );
+ break;
+
+ case DDERR_SURFACEALREADYDEPENDENT:
+ strcpy( errorString, "DDERR_SURFACEALREADYDEPENDENT" );
+ break;
+
+ case DDERR_SURFACEBUSY:
+ strcpy( errorString, "DDERR_SURFACEBUSY" );
+ break;
+
+ case DDERR_CANTLOCKSURFACE:
+ strcpy( errorString, "DDERR_CANTLOCKSURFACE" );
+ break;
+
+ case DDERR_SURFACEISOBSCURED:
+ strcpy( errorString, "DDERR_SURFACEISOBSCURED" );
+ break;
+
+ case DDERR_SURFACELOST:
+ strcpy( errorString, "DDERR_SURFACELOST" );
+ break;
+
+ case DDERR_SURFACENOTATTACHED:
+ strcpy( errorString, "DDERR_SURFACENOTATTACHED" );
+ break;
+
+ case DDERR_TOOBIGHEIGHT:
+ strcpy( errorString, "DDERR_TOOBIGHEIGHT" );
+ break;
+
+ case DDERR_TOOBIGSIZE:
+ strcpy( errorString, "DDERR_TOOBIGSIZE" );
+ break;
+
+ case DDERR_TOOBIGWIDTH:
+ strcpy( errorString, "DDERR_TOOBIGWIDTH" );
+ break;
+
+ case DDERR_UNSUPPORTED:
+ strcpy( errorString, "DDERR_UNSUPPORTED" );
+ break;
+
+ case DDERR_UNSUPPORTEDFORMAT:
+ strcpy( errorString, "DDERR_UNSUPPORTEDFORMAT" );
+ break;
+
+ case DDERR_UNSUPPORTEDMASK:
+ strcpy( errorString, "DDERR_UNSUPPORTEDMASK" );
+ break;
+
+ case DDERR_INVALIDSTREAM:
+ strcpy( errorString, "DDERR_INVALIDSTREAM" );
+ break;
+
+ case DDERR_VERTICALBLANKINPROGRESS:
+ strcpy( errorString, "DDERR_VERTICALBLANKINPROGRESS" );
+ break;
+
+ case DDERR_WASSTILLDRAWING:
+ strcpy( errorString, "DDERR_WASSTILLDRAWING" );
+ break;
+
+ case DDERR_XALIGN:
+ strcpy( errorString, "DDERR_XALIGN" );
+ break;
+
+ case DDERR_INVALIDDIRECTDRAWGUID:
+ strcpy( errorString, "DDERR_INVALIDDIRECTDRAWGUID" );
+ break;
+
+ case DDERR_DIRECTDRAWALREADYCREATED:
+ strcpy( errorString, "DDERR_DIRECTDRAWALREADYCREATED" );
+ break;
+
+ case DDERR_NODIRECTDRAWHW:
+ strcpy( errorString, "DDERR_NODIRECTDRAWHW" );
+ break;
+
+ case DDERR_PRIMARYSURFACEALREADYEXISTS:
+ strcpy( errorString, "DDERR_PRIMARYSURFACEALREADYEXISTS" );
+ break;
+
+ case DDERR_NOEMULATION:
+ strcpy( errorString, "DDERR_NOEMULATION" );
+ break;
+
+ case DDERR_REGIONTOOSMALL:
+ strcpy( errorString, "DDERR_REGIONTOOSMALL" );
+ break;
+
+ case DDERR_CLIPPERISUSINGHWND:
+ strcpy( errorString, "DDERR_CLIPPERISUSINGHWND" );
+ break;
+
+ case DDERR_NOCLIPPERATTACHED:
+ strcpy( errorString, "DDERR_NOCLIPPERATTACHED" );
+ break;
+
+ case DDERR_NOHWND:
+ strcpy( errorString, "DDERR_NOHWND" );
+ break;
+
+ case DDERR_HWNDSUBCLASSED:
+ strcpy( errorString, "DDERR_HWNDSUBCLASSED" );
+ break;
+
+ case DDERR_HWNDALREADYSET:
+ strcpy( errorString, "DDERR_HWNDALREADYSET" );
+ break;
+
+ case DDERR_NOPALETTEATTACHED:
+ strcpy( errorString, "DDERR_NOPALETTEATTACHED" );
+ break;
+
+ case DDERR_NOPALETTEHW:
+ strcpy( errorString, "DDERR_NOPALETTEHW" );
+ break;
+
+ case DDERR_BLTFASTCANTCLIP:
+ strcpy( errorString, "DDERR_BLTFASTCANTCLIP" );
+ break;
+
+ case DDERR_NOBLTHW:
+ strcpy( errorString, "DDERR_NOBLTHW" );
+ break;
+
+ case DDERR_NODDROPSHW:
+ strcpy( errorString, "DDERR_NODDROPSHW" );
+ break;
+
+ case DDERR_OVERLAYNOTVISIBLE:
+ strcpy( errorString, "DDERR_OVERLAYNOTVISIBLE" );
+ break;
+
+ case DDERR_NOOVERLAYDEST:
+ strcpy( errorString, "DDERR_NOOVERLAYDEST" );
+ break;
+
+ case DDERR_INVALIDPOSITION:
+ strcpy( errorString, "DDERR_INVALIDPOSITION" );
+ break;
+
+ case DDERR_NOTAOVERLAYSURFACE:
+ strcpy( errorString, "DDERR_NOTAOVERLAYSURFACE" );
+ break;
+
+ case DDERR_EXCLUSIVEMODEALREADYSET:
+ strcpy( errorString, "DDERR_EXCLUSIVEMODEALREADYSET" );
+ break;
+
+ case DDERR_NOTFLIPPABLE:
+ strcpy( errorString, "DDERR_NOTFLIPPABLE" );
+ break;
+
+ case DDERR_CANTDUPLICATE:
+ strcpy( errorString, "DDERR_CANTDUPLICATE" );
+ break;
+
+ case DDERR_NOTLOCKED:
+ strcpy( errorString, "DDERR_NOTLOCKED" );
+ break;
+
+ case DDERR_CANTCREATEDC:
+ strcpy( errorString, "DDERR_CANTCREATEDC" );
+ break;
+
+ case DDERR_NODC:
+ strcpy( errorString, "DDERR_NODC" );
+ break;
+
+ case DDERR_WRONGMODE:
+ strcpy( errorString, "DDERR_WRONGMODE" );
+ break;
+
+ case DDERR_IMPLICITLYCREATED:
+ strcpy( errorString, "DDERR_IMPLICITLYCREATED" );
+ break;
+
+ case DDERR_NOTPALETTIZED:
+ strcpy( errorString, "DDERR_NOTPALETTIZED" );
+ break;
+
+ case DDERR_UNSUPPORTEDMODE:
+ strcpy( errorString, "DDERR_UNSUPPORTEDMODE" );
+ break;
+
+ case DDERR_NOMIPMAPHW:
+ strcpy( errorString, "DDERR_NOMIPMAPHW" );
+ break;
+
+ case DDERR_INVALIDSURFACETYPE:
+ strcpy( errorString, "DDERR_INVALIDSURFACETYPE" );
+ break;
+
+ case DDERR_NOOPTIMIZEHW:
+ strcpy( errorString, "DDERR_NOOPTIMIZEHW" );
+ break;
+
+ case DDERR_NOTLOADED:
+ strcpy( errorString, "DDERR_NOTLOADED" );
+ break;
+
+ case DDERR_NOFOCUSWINDOW:
+ strcpy( errorString, "DDERR_NOFOCUSWINDOW" );
+ break;
+
+ case DDERR_DCALREADYCREATED:
+ strcpy( errorString, "DDERR_DCALREADYCREATED" );
+ break;
+
+ case DDERR_NONONLOCALVIDMEM:
+ strcpy( errorString, "DDERR_NONONLOCALVIDMEM" );
+ break;
+
+ case DDERR_CANTPAGELOCK:
+ strcpy( errorString, "DDERR_CANTPAGELOCK" );
+ break;
+
+ case DDERR_CANTPAGEUNLOCK:
+ strcpy( errorString, "DDERR_CANTPAGEUNLOCK" );
+ break;
+
+ case DDERR_NOTPAGELOCKED:
+ strcpy( errorString, "DDERR_NOTPAGELOCKED" );
+ break;
+
+ case DDERR_MOREDATA:
+ strcpy( errorString, "DDERR_MOREDATA" );
+ break;
+
+ case DDERR_EXPIRED:
+ strcpy( errorString, "DDERR_EXPIRED" );
+ break;
+
+ case DDERR_VIDEONOTACTIVE:
+ strcpy( errorString, "DDERR_VIDEONOTACTIVE" );
+ break;
+
+ case DDERR_DEVICEDOESNTOWNSURFACE:
+ strcpy( errorString, "DDERR_DEVICEDOESNTOWNSURFACE" );
+ break;
+
+ case DDERR_NOTINITIALIZED:
+ strcpy( errorString, "DDERR_NOTINITIALIZED" );
+ break;
+
+ default:
+ strcpy( errorString, "<unknown error code>" );
+ break;
+ }
+
+ return &errorString[0];
+}
diff --git a/xc/extras/Mesa/src/D3D/D3Dvbrender.c b/xc/extras/Mesa/src/D3D/D3Dvbrender.c new file mode 100644 index 000000000..0ef32e26c --- /dev/null +++ b/xc/extras/Mesa/src/D3D/D3Dvbrender.c @@ -0,0 +1,2149 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#include <stdio.h> +#include "clip.h" +#include "context.h" +#include "light.h" +#include "lines.h" +#include "macros.h" +#include "matrix.h" +#include "pb.h" +#include "points.h" +#include "types.h" +#include "vb.h" +#include "vbrender.h" +#include "xform.h" +#include "D3DMesa.h" + +static void SetRenderStates( GLcontext *ctx ); +static void DebugRenderStates( GLcontext *ctx, BOOL bForce ); + +static void RenderPointsVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderTriangleVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderTriangleFanVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderTriangleStripVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderQuadVB( GLcontext *ctx, GLuint start, GLuint end ); +static void RenderQuad( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint pv ); +void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv ); +void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); + +/* I went with a D3D vertex buffer that is 6 times that of the Mesa one */ +/* instead of having the D3D one flush when its full. This way Mesa will*/ +/* handle all the flushing. I need x6 as points can use 4 vertex each. */ +D3DTLVERTEX D3DTLVertices[ (VB_MAX*6) ]; +GLuint VList[VB_SIZE]; +/*===========================================================================*/ +/* Compute Z offsets for a polygon with plane defined by (A,B,C,D) */ +/* D is not needed. TODO: Currently we are calculating this but not using it.*/ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void OffsetPolygon( GLcontext *ctx, GLfloat a, GLfloat b, GLfloat c ) +{ + GLfloat ac, + bc, + m, + offset; + + DPF(( DBG_FUNC, "OffsetPolygon();" )); + + if ( (c < 0.001F) && (c > - 0.001F) ) + { + /* Prevents underflow problems. */ + ctx->PointZoffset = 0.0F; + ctx->LineZoffset = 0.0F; + ctx->PolygonZoffset = 0.0F; + } + else + { + ac = a / c; + bc = b / c; + if ( ac < 0.0F ) + ac = -ac; + if ( bc<0.0F ) + bc = -bc; + m = MAX2( ac, bc ); /* m = sqrt( ac*ac + bc*bc ); */ + + offset = (m * ctx->Polygon.OffsetFactor + ctx->Polygon.OffsetUnits); + ctx->PointZoffset = ctx->Polygon.OffsetPoint ? offset : 0.0F; + ctx->LineZoffset = ctx->Polygon.OffsetLine ? offset : 0.0F; + ctx->PolygonZoffset = ctx->Polygon.OffsetFill ? offset : 0.0F; + } + + DPF(( DBG_PRIM_INFO, "OffsetPolygon: %f", offset )); +} +/*===========================================================================*/ +/* Compute signed area of the n-sided polgyon specified by vertices */ +/* vb->Win[] and vertex list vlist[]. */ +/* A clockwise polygon will return a negative area. A counter-clockwise */ +/* polygon will return a positive area. I have changed this function to */ +/* actually calculate twice the area as its faster and still gives the sign. */ +/*===========================================================================*/ +/* RETURN: signed area of the polgon. */ +/*===========================================================================*/ +static GLfloat PolygonArea( const struct vertex_buffer *vb, GLuint n, const GLuint vlist[] ) +{ + GLfloat area; + GLuint i; + + DPF(( DBG_FUNC, "PolygonArea();" )); + +#define j0 vlist[i] +#define j1 vlist[(i+1)%n] +#define x0 vb->Win[j0][0] +#define y0 vb->Win[j0][1] +#define x1 vb->Win[j1][0] +#define y1 vb->Win[j1][1] + + /* area = sum of trapezoids */ + for( i = 0, area = 0.0; i < n; i++ ) + area += ((x0 - x1) * (y0 + y1)); /* Note: no divide by two here! */ + +#undef x0 +#undef y0 +#undef x1 +#undef y1 +#undef j1 +#undef j0 + + // TODO: I don't see the point or * 0.5 as we just want the sign... + return area; +} +/*===========================================================================*/ +/* Render a polygon that needs clipping on at least one vertex. The function*/ +/* will first clip the polygon to any user clipping planes then clip to the */ +/* viewing volume. The final polygon will be draw as single triangles that */ +/* first need minor proccessing (culling, offset, etc) before we draw the */ +/* polygon as a fan. NOTE: the fan is draw as single triangles as its not */ +/* formed sequentaly in the VB but is in the vlist[]. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderClippedPolygon( GLcontext *ctx, GLuint n, GLuint vlist[] ) +{ + struct vertex_buffer *VB = ctx->VB; + GLfloat (*win)[3] = VB->Win, + *proj = ctx->ProjectionMatrix, + ex, ey, + fx, fy, c, + wInv; + GLuint index, + pv, + facing; + + DPF(( DBG_FUNC, "RenderClippedPolygon();" )); + + DPF(( DBG_PRIM_INFO, "RenderClippedtPolygon( %d )", n )); + + /* Which vertex dictates the color when flat shading. */ + pv = (ctx->Primitive==GL_POLYGON) ? vlist[0] : vlist[n-1]; + + /* Clipping may introduce new vertices. New vertices will be stored in */ + /* the vertex buffer arrays starting with location VB->Free. After we've*/ + /* rendered the polygon, these extra vertices can be overwritten. */ + VB->Free = VB_MAX; + + /* Clip against user clipping planes in eye coord space. */ + if ( ctx->Transform.AnyClip ) + { + n = gl_userclip_polygon( ctx, n, vlist ); + if ( n < 3 ) + return; + + /* Transform vertices from eye to clip coordinates: clip = Proj * eye */ + for( index = 0; index < n; index++ ) + { + TRANSFORM_POINT( VB->Clip[vlist[index]], proj, VB->Eye[vlist[index]] ); + } + } + + /* Clip against view volume in clip coord space */ + n = gl_viewclip_polygon( ctx, n, vlist ); + if ( n < 3 ) + return; + + /* Transform new vertices from clip to ndc to window coords. */ + /* ndc = clip / W window = viewport_mapping(ndc) */ + /* Note that window Z values are scaled to the range of integer */ + /* depth buffer values. */ + + /* Only need to compute window coords for new vertices */ + for( index = VB_MAX; index < VB->Free; index++ ) + { + if ( VB->Clip[index][3] != 0.0F ) + { + wInv = 1.0F / VB->Clip[index][3]; + + win[index][0] = VB->Clip[index][0] * wInv * ctx->Viewport.Sx + ctx->Viewport.Tx; + win[index][1] = VB->Clip[index][1] * wInv * ctx->Viewport.Sy + ctx->Viewport.Ty; + win[index][2] = VB->Clip[index][2] * wInv * ctx->Viewport.Sz + ctx->Viewport.Tz; + } + else + { + /* Can't divide by zero, so... */ + win[index][0] = win[index][1] = win[index][2] = 0.0F; + } + } + + /* Draw filled polygon as a triangle fan */ + for( index = 2; index < n; index++ ) + { + /* Compute orientation of triangle */ + ex = win[vlist[index-1]][0] - win[vlist[0]][0]; + ey = win[vlist[index-1]][1] - win[vlist[0]][1]; + fx = win[vlist[index]][0] - win[vlist[0]][0]; + fy = win[vlist[index]][1] - win[vlist[0]][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* finish computing plane equation of polygon, compute offset */ + GLfloat fz = win[vlist[index]][2] - win[vlist[0]][2]; + GLfloat ez = win[vlist[index-1]][2] - win[vlist[0]][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + RenderOneTriangle( ctx, vlist[0], vlist[index-1], vlist[index], pv ); + } +} +/*===========================================================================*/ +/* This function gets called when either the vertex buffer is full or glEnd */ +/* has been called. If the we aren't in rendering mode (FEEDBACK) then I */ +/* pass the vertex buffer back to Mesa to deal with by returning FALSE. */ +/* If I can render the primitive types in the buffer directly then I will */ +/* return TRUE after I render the vertex buffer and reset the vertex buffer. */ +/* */ +/* TODO: I don't handle the special case of when the vertex buffer is full */ +/* and we have a primitive that bounds this buffer and the next one to */ +/* come. I'm not sure right now if Mesa handles this for me... */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +GLboolean RenderVertexBuffer( GLcontext *ctx, GLboolean allDone ) +{ + struct vertex_buffer *VB = ctx->VB; + GLuint index, + vlist[VB_SIZE]; + + DPF(( DBG_FUNC, "RenderVertexBuffer();" )); + + /* We only need to hook actual tri's that need rendering. */ + if ( ctx->RenderMode != GL_RENDER ) + { + // (ctx->Visual->AccumBits > 0) ) + // (ctx->Visual->StencilBits > 0) ) + DPF(( DBG_PRIM_INFO, "Passing VB back to Mesa" )); + return FALSE; + } + + /* I'm going to set the states here so that all functions will */ + /* be assured to have the right states. If Mesa's vertex bufefr */ + /* function calls one of my primitive functions (TRI,POINT,LINE) */ + /* it will need the right states. So instead of doing it in the */ + /* primitive function I will always do it here at risk of some */ + /* slow down to some cases... */ + SetRenderStates( ctx ); + + switch( ctx->Primitive ) + { + case GL_POINTS: + DPF(( DBG_PRIM_INFO, "GL_POINTS( %d )", VB->Count )); + RenderPointsVB( ctx, 0, VB->Count ); + break; + + case GL_LINES: + case GL_LINE_STRIP: + case GL_LINE_LOOP: + /* Not supported functions yet so pass back that we failed to */ + /* render the vertex buffer and Mesa will have to do it. */ + DPF(( DBG_PRIM_INFO, "GL_LINE_?( %d )", VB->Count )); + return FALSE; + + case GL_TRIANGLES: + if ( VB->Count < 3 ) + { + DPF(( DBG_PRIM_WARN, "GL_TRIANGLES( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_TRIANGLES( %d )", VB->Count )); + RenderTriangleVB( ctx, 0, VB->Count ); + break; + + case GL_TRIANGLE_STRIP: + if ( VB->Count < 3 ) + { + DPF(( DBG_PRIM_WARN, "GL_TRIANGLE_STRIP( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_TRIANGLE_STRIP( %d )", VB->Count )); + RenderTriangleStripVB( ctx, 0, VB->Count ); + break; + + case GL_TRIANGLE_FAN: + if ( VB->Count < 3 ) + { + DPF(( DBG_PRIM_WARN, "GL_TRIANGLE_FAN( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_TRIANGLE_FAN( %d )", VB->Count )); + RenderTriangleFanVB( ctx, 0, VB->Count ); + break; + + case GL_QUADS: + if ( VB->Count < 4 ) + { + DPF(( DBG_PRIM_WARN, "GL_QUADS( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_QUADS( %d )", VB->Count )); + RenderQuadVB( ctx, 0, VB->Count ); + break; + + case GL_QUAD_STRIP: + if ( VB->Count < 4 ) + { + DPF(( DBG_PRIM_WARN, "GL_QUAD_STRIP( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_QUAD_STRIP( %d )", VB->Count )); + + if ( VB->ClipOrMask ) + { + for( index = 3; index < VB->Count; index += 2 ) + { + if ( VB->ClipMask[index-3] & VB->ClipMask[index-2] & VB->ClipMask[index-1] & VB->ClipMask[index] & CLIP_ALL_BITS ) + { + /* All points clipped by common plane */ + DPF(( DBG_PRIM_WARN, "GL_QUAD_STRIP( %d )", VB->Count )); + continue; + } + else if ( VB->ClipMask[index-3] | VB->ClipMask[index-2] | VB->ClipMask[index-1] | VB->ClipMask[index] ) + { + vlist[0] = index - 3; + vlist[1] = index - 2; + vlist[2] = index; + vlist[3] = index - 1; + RenderClippedPolygon( ctx, 4, vlist ); + } + else + { + RenderQuad( ctx, (index-3), (index-2), index, (index-1), index ); + } + } + } + else + { + /* No clipping needed */ + for( index = 3; index < VB->Count; index += 2 ) + RenderQuad( ctx, (index-3), (index-2), index, (index-1), index ); + } + break; + + case GL_POLYGON: + if ( VB->Count < 3 ) + { + DPF(( DBG_PRIM_WARN, "GL_POLYGON( %d )", VB->Count )); + return FALSE; + } + + DPF(( DBG_PRIM_INFO, "GL_POLYGON( %d )", VB->Count )); + + /* All points clipped by common plane, draw nothing */ + if ( !(VB->ClipAndMask & CLIP_ALL_BITS) ) + RenderTriangleFanVB( ctx, 0, VB->Count ); + break; + + default: + /* should never get here */ + gl_problem( ctx, "invalid mode in gl_render_vb" ); + } + + DPF(( DBG_PRIM_INFO, "ResetVB" )); + + /* We return TRUE to indicate we rendered the VB. */ + gl_reset_vb( ctx, allDone ); + return TRUE; +} +/*===========================================================================*/ +/* This function will render the current vertex buffer as triangles. The */ +/* buffer has to be able to be rendered directly. This means that we are */ +/* filled, no offsets, no culling and one sided rendering. Also we must be */ +/* in render mode of course. */ +/* First I will fill the global D3D vertice buffer. Next I will set all the*/ +/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ +/* to the wrapper that call DrawPrimitives. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderTriangleVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int index, + cVertex, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + GLfloat ex, ey, + fx, fy, c; + GLuint facing; + + DPF(( DBG_FUNC, "RenderTriangleVB" )); + + if ( (!(ctx->IndirectTriangles & DD_SW_SETUP)) && !VB->ClipOrMask ) + { + DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) )); + for( index = start, cVertex = 0; index < end; ) + { + dwPVColor = (VB->Color[(index+2)][3]<<24) | (VB->Color[(index+2)][0]<<16) | (VB->Color[(index+2)][1]<<8) | VB->Color[(index+2)][2]; + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; + index++; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; + index++; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color= dwPVColor; + index++; + } + } + else + { +#define v1 index +#define v2 (index+1) +#define v3 (index+2) + + for( index = start, cVertex = 0; index < end; index += 3 ) + { + if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) + { + continue; + } + else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) + { + VList[0] = v1; + VList[1] = v2; + VList[2] = v3; + RenderClippedPolygon( ctx, 3, VList ); + continue; + } + + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + /* Solve the prevoking vertex color as we need it for the 3rd triangle and flat shading. */ + dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= dwPVColor; + } +#undef v1 +#undef v2 +#undef v3 + } + + /* Render the converted vertex buffer. */ + if ( cVertex > 2 ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); +} +/*===========================================================================*/ +/* This function will render the current vertex buffer as a triangle fan. */ +/* The buffer has to be able to be rendered directly. This means that we are*/ +/* filled, no offsets, no culling and one sided rendering. Also we must be */ +/* in render mode of course. */ +/* First I will fill the global D3D vertice buffer. Next I will set all the*/ +/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ +/* to the wrapper that call DrawPrimitives. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderTriangleFanVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int index, + cVertex, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + GLfloat ex, ey, + fx, fy, c; + GLuint facing; + DWORD dwPVColor; + + DPF(( DBG_FUNC, "RenderTriangleFanVB();" )); + + /* Special case that we can blast the fan without culling, offset, etc... */ + if ( (!(ctx->IndirectTriangles & DD_SW_SETUP)) && !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) ) + { + DPF(( DBG_PRIM_INFO, "DirectTriangles( %d )", (end-start) )); + + /* Seed the the fan. */ + D3DTLVertices[0].sx = D3DVAL( VB->Win[start][0] ); + D3DTLVertices[0].sy = D3DVAL( (height - VB->Win[start][1]) ); + D3DTLVertices[0].sz = D3DVAL( VB->Win[start][2] ); + D3DTLVertices[0].tu = D3DVAL( VB->TexCoord[start][0] ); + D3DTLVertices[0].tv = D3DVAL( VB->TexCoord[start][1] ); + D3DTLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[start][3]) ); + D3DTLVertices[0].color= (VB->Color[start][3]<<24) | (VB->Color[start][0]<<16) | (VB->Color[start][1]<<8) | VB->Color[start][2]; + + /* Seed the the fan. */ + D3DTLVertices[1].sx = D3DVAL( VB->Win[(start+1)][0] ); + D3DTLVertices[1].sy = D3DVAL( (height - VB->Win[(start+1)][1]) ); + D3DTLVertices[1].sz = D3DVAL( VB->Win[(start+1)][2] ); + D3DTLVertices[1].tu = D3DVAL( VB->TexCoord[(start+1)][0] ); + D3DTLVertices[1].tv = D3DVAL( VB->TexCoord[(start+1)][1] ); + D3DTLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[(start+1)][3]) ); + D3DTLVertices[1].color= (VB->Color[(start+1)][3]<<24) | (VB->Color[(start+1)][0]<<16) | (VB->Color[(start+1)][1]<<8) | VB->Color[(start+1)][2]; + + for( index = (start+2), cVertex = 2; index < end; index++, cVertex++ ) + { + /*=================================*/ + /* Add the next vertex to the fan. */ + /*=================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex].color = (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLEFAN, &D3DTLVertices[0], cVertex ); + } + else + { +#define v1 start +#define v2 (index-1) +#define v3 index + + for( index = (start+2), cVertex = 0; index < end; index++ ) + { + if ( VB->ClipOrMask ) + { + /* All points clipped by common plane */ + if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) + { + continue; + } + else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) + { + VList[0] = v1; + VList[1] = v2; + VList[2] = v3; + RenderClippedPolygon( ctx, 3, VList ); + continue; + } + } + + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= dwPVColor; + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); +#undef v1 +#undef v2 +#undef v3 + } +} +/*===========================================================================*/ +/* This function will render the current vertex buffer as a triangle strip. */ +/* The buffer has to be able to be rendered directly. This means that we are*/ +/* filled, no offsets, no culling and one sided rendering. Also we must be */ +/* in render mode of course. */ +/* First I will fill the global D3D vertice buffer. Next I will set all the*/ +/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ +/* to the wrapper that call DrawPrimitives. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderTriangleStripVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int index, + cVertex = 0, + v1, v2, v3, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + GLfloat ex, ey, + fx, fy, c; + GLuint facing; + DWORD dwPVColor; + + DPF(( DBG_FUNC, "RenderTriangleStripVB();" )); + + /* Special case that we can blast the fan without culling, offset, etc... */ + if ( (!(ctx->IndirectTriangles & DD_SW_SETUP)) && !VB->ClipOrMask && (ctx->Light.ShadeModel != GL_FLAT) ) + { + DPF(( DBG_PRIM_PROFILE, "DirectTriangles" )); + + /* Seed the the strip. */ + D3DTLVertices[0].sx = D3DVAL( VB->Win[start][0] ); + D3DTLVertices[0].sy = D3DVAL( (height - VB->Win[start][1]) ); + D3DTLVertices[0].sz = D3DVAL( VB->Win[start][2] ); + D3DTLVertices[0].tu = D3DVAL( VB->TexCoord[start][0] ); + D3DTLVertices[0].tv = D3DVAL( VB->TexCoord[start][1] ); + D3DTLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[start][3]) ); + D3DTLVertices[0].color= (VB->Color[start][3]<<24) | (VB->Color[start][0]<<16) | (VB->Color[start][1]<<8) | VB->Color[start][2]; + + /* Seed the the strip. */ + D3DTLVertices[1].sx = D3DVAL( VB->Win[(start+1)][0] ); + D3DTLVertices[1].sy = D3DVAL( (height - VB->Win[(start+1)][1]) ); + D3DTLVertices[1].sz = D3DVAL( VB->Win[(start+1)][2] ); + D3DTLVertices[1].tu = D3DVAL( VB->TexCoord[(start+1)][0] ); + D3DTLVertices[1].tv = D3DVAL( VB->TexCoord[(start+1)][1] ); + D3DTLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[(start+1)][3]) ); + D3DTLVertices[1].color= (VB->Color[(start+1)][3]<<24) | (VB->Color[(start+1)][0]<<16) | (VB->Color[(start+1)][1]<<8) | VB->Color[(start+1)][2]; + + for( index = (start+2), cVertex = 2; index < end; index++, cVertex++ ) + { + /*===================================*/ + /* Add the next vertex to the strip. */ + /*===================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[index][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[index][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[index][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[index][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[index][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex].color = (VB->Color[index][3]<<24) | (VB->Color[index][0]<<16) | (VB->Color[index][1]<<8) | VB->Color[index][2]; + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLESTRIP, &D3DTLVertices[0], cVertex ); + } + else + { + for( index = (start+2); index < end; index++ ) + { + /* We need to switch order so that winding won't be a problem. */ + if ( index & 1 ) + { + v1 = index - 1; + v2 = index - 2; + v3 = index - 0; + } + else + { + v1 = index - 2; + v2 = index - 1; + v3 = index - 0; + } + + /* All vertices clipped by common plane */ + if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & CLIP_ALL_BITS ) + continue; + + /* Check if any vertices need clipping. */ + if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] ) + { + VList[0] = v1; + VList[1] = v2; + VList[2] = v3; + RenderClippedPolygon( ctx, 3, VList ); + } + else + { + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* Polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + /* Need right color if we have two sided lighting. */ + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + + /* Solve the prevoking vertex color as we need it for the 3rd triangle and flat shading. */ + dwPVColor = (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= dwPVColor; + } + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); + } +} +/*===========================================================================*/ +/* This function will render the current vertex buffer as Quads. The buffer*/ +/* has to be able to be rendered directly. This means that we are filled, no*/ +/* offsets, no culling and one sided rendering. Also we must be in render */ +/* mode of cource. */ +/* First I will fill the global D3D vertice buffer. Next I will set all the*/ +/* states for D3D based on the current OGL state. Finally I pass the D3D VB */ +/* to the wrapper that call DrawPrimitives. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderQuadVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int index, + cVertex, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + GLfloat ex, ey, + fx, fy, c; + GLuint facing; /* 0=front, 1=back */ + + DPF(( DBG_FUNC, "RenderQuadVB();" )); + +#define v1 (index) +#define v2 (index+1) +#define v3 (index+2) +#define v4 (index+3) + + if ( (!(ctx->IndirectTriangles & DD_SW_SETUP)) && !VB->ClipOrMask ) + { + DPF(( DBG_PRIM_PROFILE, "DirectTriangles" )); + + for( cVertex = 0, index = start; index < end; index += 4 ) + { + if ( ctx->Light.ShadeModel == GL_FLAT ) + dwPVColor = (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v1][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v2][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v3][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v1][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v3][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v4][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v4][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( VB->Win[v4][2] ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v4][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v4][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + } + } + else + { + for( cVertex = 0, index = start; index < end; index += 4 ) + { + if ( VB->ClipMask[v1] & VB->ClipMask[v2] & VB->ClipMask[v3] & VB->ClipMask[v4] & CLIP_ALL_BITS ) + { + continue; + } + else if ( VB->ClipMask[v1] | VB->ClipMask[v2] | VB->ClipMask[v3] | VB->ClipMask[v4] ) + { + VList[0] = v1; + VList[1] = v2; + VList[2] = v3; + VList[3] = v4; + RenderClippedPolygon( ctx, 4, VList ); + continue; + } + + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + continue; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + continue; + + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + + if ( ctx->Light.ShadeModel == GL_FLAT ) + dwPVColor = (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v2][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v2][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v2][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v2][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v1][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v1][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v1][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v1][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v3][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v3][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v3][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v3][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + D3DTLVertices[cVertex].sx = D3DVAL( VB->Win[v4][0] ); + D3DTLVertices[cVertex].sy = D3DVAL( (height - VB->Win[v4][1]) ); + D3DTLVertices[cVertex].sz = D3DVAL( (VB->Win[v4][2] + ctx->PolygonZoffset) ); + D3DTLVertices[cVertex].tu = D3DVAL( VB->TexCoord[v4][0] ); + D3DTLVertices[cVertex].tv = D3DVAL( VB->TexCoord[v4][1] ); + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); + D3DTLVertices[cVertex++].color= (ctx->Light.ShadeModel == GL_FLAT) ? + dwPVColor : + (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + } + } + +#undef v4 +#undef v3 +#undef v2 +#undef v1 + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); +} +/*===========================================================================*/ +/* */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +static void RenderQuad( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint v4, GLuint pv ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + GLfloat ex, ey, + fx, fy, c; + GLuint facing; /* 0=front, 1=back */ + static D3DTLVERTEX TLVertices[6]; + + DPF(( DBG_FUNC, "RenderQuad" )); + DPF(( DBG_PRIM_INFO, "RenderQuad( 1 )" )); + + /* Compute orientation of triangle */ + ex = VB->Win[v2][0] - VB->Win[v1][0]; + ey = VB->Win[v2][1] - VB->Win[v1][1]; + fx = VB->Win[v3][0] - VB->Win[v1][0]; + fy = VB->Win[v3][1] - VB->Win[v1][1]; + c = (ex * fy) - (ey * fx); + + /* polygon is perpindicular to view plane, don't draw it */ + if ( (c == 0.0F) && !ctx->Polygon.Unfilled ) + return; + + /* Backface culling. */ + facing = (c < 0.0F) ^ ctx->Polygon.FrontBit; + if ( (facing + 1) & ctx->Polygon.CullBits ) + return; + + if ( ctx->IndirectTriangles & DD_TRI_LIGHT_TWOSIDE ) + { + if ( facing == 1 ) + { + /* use back color */ + VB->Color = VB->Bcolor; + VB->Specular= VB->Bspec; + } + else + { + /* use front color */ + VB->Color = VB->Fcolor; + VB->Specular= VB->Fspec; + } + } + + if ( ctx->IndirectTriangles & DD_TRI_OFFSET ) + { + /* Finish computing plane equation of polygon, compute offset */ + GLfloat fz = VB->Win[v3][2] - VB->Win[v1][2]; + GLfloat ez = VB->Win[v2][2] - VB->Win[v1][2]; + GLfloat a = (ey * fz) - (ez * fy); + GLfloat b = (ez * fx) - (ex * fz); + OffsetPolygon( ctx, a, b, c ); + } + + if ( ctx->Light.ShadeModel == GL_FLAT ) + dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); + TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); + TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); + TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); + TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); + TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); + TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); + TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); + TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + TLVertices[2].sx = D3DVAL( VB->Win[v3][0] ); + TLVertices[2].sy = D3DVAL( (height - VB->Win[v3][1]) ); + TLVertices[2].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + TLVertices[2].tu = D3DVAL( VB->TexCoord[v3][0] ); + TLVertices[2].tv = D3DVAL( VB->TexCoord[v3][1] ); + TLVertices[2].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + TLVertices[2].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + TLVertices[3].sx = D3DVAL( VB->Win[v3][0] ); + TLVertices[3].sy = D3DVAL( (height - VB->Win[v3][1]) ); + TLVertices[3].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + TLVertices[3].tu = D3DVAL( VB->TexCoord[v3][0] ); + TLVertices[3].tv = D3DVAL( VB->TexCoord[v3][1] ); + TLVertices[3].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + TLVertices[3].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + + TLVertices[4].sx = D3DVAL( VB->Win[v4][0] ); + TLVertices[4].sy = D3DVAL( (height - VB->Win[v4][1]) ); + TLVertices[4].sz = D3DVAL( (VB->Win[v4][2] + ctx->PolygonZoffset) ); + TLVertices[4].tu = D3DVAL( VB->TexCoord[v4][0] ); + TLVertices[4].tv = D3DVAL( VB->TexCoord[v4][1] ); + TLVertices[4].rhw = D3DVAL( (1.0 / VB->Clip[v4][3]) ); + TLVertices[4].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v4][3]<<24) | (VB->Color[v4][0]<<16) | (VB->Color[v4][1]<<8) | VB->Color[v4][2]; + + TLVertices[5].sx = D3DVAL( VB->Win[v1][0] ); + TLVertices[5].sy = D3DVAL( (height - VB->Win[v1][1]) ); + TLVertices[5].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + TLVertices[5].tu = D3DVAL( VB->TexCoord[v1][0] ); + TLVertices[5].tv = D3DVAL( VB->TexCoord[v1][1] ); + TLVertices[5].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + TLVertices[5].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + /* Draw the two triangles. */ + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &TLVertices[0], 6 ); +} +/*===========================================================================*/ +/* */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + static D3DTLVERTEX TLVertices[3]; + + DPF(( DBG_FUNC, "RenderOneTriangle" )); + DPF(( DBG_PRIM_INFO, "RenderTriangle( 1 )" )); + + /*=====================================*/ + /* Populate the the triangle vertices. */ + /*=====================================*/ + if ( ctx->Light.ShadeModel == GL_FLAT ) + dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; + + TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); + TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); + TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->PolygonZoffset) ); + TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); + TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); + TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + DPF(( DBG_PRIM_INFO, "V1 -> x:%f y:%f z:%f c:%x", + TLVertices[0].sx, + TLVertices[0].sy, + TLVertices[0].sz, + TLVertices[0].color )); + + TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); + TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); + TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->PolygonZoffset) ); + TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); + TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); + TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + DPF(( DBG_PRIM_INFO, "V2 -> x:%f y:%f z:%f c:%x", + TLVertices[1].sx, + TLVertices[1].sy, + TLVertices[1].sz, + TLVertices[1].color )); + + TLVertices[2].sx = D3DVAL( VB->Win[v3][0] ); + TLVertices[2].sy = D3DVAL( (height - VB->Win[v3][1]) ); + TLVertices[2].sz = D3DVAL( (VB->Win[v3][2] + ctx->PolygonZoffset) ); + TLVertices[2].tu = D3DVAL( VB->TexCoord[v3][0] ); + TLVertices[2].tv = D3DVAL( VB->TexCoord[v3][1] ); + TLVertices[2].rhw = D3DVAL( (1.0 / VB->Clip[v3][3]) ); + TLVertices[2].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v3][3]<<24) | (VB->Color[v3][0]<<16) | (VB->Color[v3][1]<<8) | VB->Color[v3][2]; + DPF(( DBG_PRIM_INFO, "V3 -> x:%f y:%f z:%f c:%x", + TLVertices[2].sx, + TLVertices[2].sy, + TLVertices[2].sz, + TLVertices[2].color )); + + /* Draw the triangle. */ + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &TLVertices[0], 3 ); +} +/*===========================================================================*/ +/* */ +/*===========================================================================*/ +/* RETURN: TRUE, FALSE. */ +/*===========================================================================*/ +void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + int height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + static D3DTLVERTEX TLVertices[2]; + + DPF(( DBG_FUNC, "RenderOneLine" )); + DPF(( DBG_PRIM_INFO, "RenderLine( 1 )" )); + + if ( VB->MonoColor ) + dwPVColor = (pContext->aCurrent<<24) | (pContext->rCurrent<<16) | (pContext->gCurrent<<8) | pContext->bCurrent; + else + dwPVColor = (VB->Color[pv][3]<<24) | (VB->Color[pv][0]<<16) | (VB->Color[pv][1]<<8) | VB->Color[pv][2]; + + TLVertices[0].sx = D3DVAL( VB->Win[v1][0] ); + TLVertices[0].sy = D3DVAL( (height - VB->Win[v1][1]) ); + TLVertices[0].sz = D3DVAL( (VB->Win[v1][2] + ctx->LineZoffset) ); + TLVertices[0].tu = D3DVAL( VB->TexCoord[v1][0] ); + TLVertices[0].tv = D3DVAL( VB->TexCoord[v1][1] ); + TLVertices[0].rhw = D3DVAL( (1.0 / VB->Clip[v1][3]) ); + TLVertices[0].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v1][3]<<24) | (VB->Color[v1][0]<<16) | (VB->Color[v1][1]<<8) | VB->Color[v1][2]; + + TLVertices[1].sx = D3DVAL( VB->Win[v2][0] ); + TLVertices[1].sy = D3DVAL( (height - VB->Win[v2][1]) ); + TLVertices[1].sz = D3DVAL( (VB->Win[v2][2] + ctx->LineZoffset) ); + TLVertices[1].tu = D3DVAL( VB->TexCoord[v2][0] ); + TLVertices[1].tv = D3DVAL( VB->TexCoord[v2][1] ); + TLVertices[1].rhw = D3DVAL( (1.0 / VB->Clip[v2][3]) ); + TLVertices[1].color = (ctx->Light.ShadeModel == GL_FLAT) ? dwPVColor : + (VB->Color[v2][3]<<24) | (VB->Color[v2][0]<<16) | (VB->Color[v2][1]<<8) | VB->Color[v2][2]; + + /* Draw line from (x0,y0) to (x1,y1) with current pixel color/index */ + DrawPrimitiveHAL( pContext->pShared, D3DPT_LINELIST, &TLVertices[0], 2 ); +} +/*===========================================================================*/ +/* This function was written to convert points into triangles. I did this */ +/* as all card accelerate triangles and most drivers do this anyway. In hind*/ +/* thought this might be a bad idea as some cards do better. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void RenderPointsVB( GLcontext *ctx, GLuint start, GLuint end ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + struct vertex_buffer *VB = ctx->VB; + struct pixel_buffer *PB = ctx->PB; + GLuint index; + GLfloat radius, z, + xmin, ymin, + xmax, ymax; + GLint cVertex, + height = (pContext->pShared->rectW.bottom - pContext->pShared->rectW.top); + DWORD dwPVColor; + + DPF(( DBG_FUNC, "RenderPointsVB();" )); + + radius = CLAMP( ctx->Point.Size, MIN_POINT_SIZE, MAX_POINT_SIZE ) * 0.5F; + + for( index = start, cVertex = 0; index <= end; index++ ) + { + if ( VB->ClipMask[index] == 0 ) + { + xmin = D3DVAL( VB->Win[index][0] - radius ); + xmax = D3DVAL( VB->Win[index][0] + radius ); + ymin = D3DVAL( height - VB->Win[index][1] - radius ); + ymax = D3DVAL( height - VB->Win[index][1] + radius ); + z = D3DVAL( (VB->Win[index][2] + ctx->PointZoffset) ); + + dwPVColor = (VB->Color[index][3]<<24) | + (VB->Color[index][0]<<16) | + (VB->Color[index][1]<<8) | + VB->Color[index][2]; + + D3DTLVertices[cVertex].sx = xmin; + D3DTLVertices[cVertex].sy = ymax; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmin; + D3DTLVertices[cVertex].sy = ymin; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmax; + D3DTLVertices[cVertex].sy = ymin; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmax; + D3DTLVertices[cVertex].sy = ymin; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmax; + D3DTLVertices[cVertex].sy = ymax; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + + D3DTLVertices[cVertex].sx = xmin; + D3DTLVertices[cVertex].sy = ymax; + D3DTLVertices[cVertex].sz = z; + D3DTLVertices[cVertex].tu = 0.0; + D3DTLVertices[cVertex].tv = 0.0; + D3DTLVertices[cVertex].rhw = D3DVAL( (1.0 / VB->Clip[index][3]) ); + D3DTLVertices[cVertex++].color = dwPVColor; + } + } + + /* Render the converted vertex buffer. */ + if ( cVertex ) + DrawPrimitiveHAL( pContext->pShared, D3DPT_TRIANGLELIST, &D3DTLVertices[0], cVertex ); +} +/*===========================================================================*/ +/* This gets call before we render any primitives so that the current OGL */ +/* states will be mapped the D3D context. I'm still not sure how D3D works */ +/* but I'm finding that it doesn't act like a state machine as OGL is. It */ +/* looks like the state gets set back to the defaults after a DrawPrimitives */ +/* or an EndScene. Also I set states that are the default even though this */ +/* is redundant as the defaults seem screwed up. */ +/* TODO: make a batch call. */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void SetRenderStates( GLcontext *ctx ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DWORD dwFunc; + static BOOL bTexture = FALSE; + static int texName = -1; + + DPF(( DBG_FUNC, "SetRenderStates();" )); + + if ( g_DBGMask & DBG_STATES ) + DebugRenderStates( ctx, FALSE ); + + SetStateHAL( pContext->pShared, D3DRENDERSTATE_CULLMODE, D3DCULL_NONE ); + SetStateHAL( pContext->pShared, D3DRENDERSTATE_DITHERENABLE, (ctx->Color.DitherFlag) ? TRUE : FALSE ); + + /*================================================*/ + /* Check too see if there are new TEXTURE states. */ + /*================================================*/ + if ( ctx->Texture.ReallyEnabled ) + { + switch( ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode ) + { + case GL_MODULATE: + if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format == GL_RGBA ) + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulatealpha]; + else + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_modulate]; + break; + + case GL_BLEND: + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha]; + break; + + case GL_REPLACE: + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal]; + break; + + case GL_DECAL: + if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format == GL_RGBA ) + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decalalpha]; + else + dwFunc = pContext->pShared->dwTexFunc[d3dtblend_decal]; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMAPBLEND, dwFunc ); + + switch( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter ) + { + case GL_NEAREST: + dwFunc = D3DFILTER_NEAREST; + break; + case GL_LINEAR: + dwFunc = D3DFILTER_LINEAR; + break; + case GL_NEAREST_MIPMAP_NEAREST: + dwFunc = D3DFILTER_MIPNEAREST; + break; + case GL_LINEAR_MIPMAP_NEAREST: + dwFunc = D3DFILTER_LINEARMIPNEAREST; + break; + case GL_NEAREST_MIPMAP_LINEAR: + dwFunc = D3DFILTER_MIPLINEAR; + break; + case GL_LINEAR_MIPMAP_LINEAR: + dwFunc = D3DFILTER_LINEARMIPLINEAR; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMAG, dwFunc ); + + switch( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter ) + { + case GL_NEAREST: + dwFunc = D3DFILTER_NEAREST; + break; + case GL_LINEAR: + dwFunc = D3DFILTER_LINEAR; + break; + case GL_NEAREST_MIPMAP_NEAREST: + dwFunc = D3DFILTER_MIPNEAREST; + break; + case GL_LINEAR_MIPMAP_NEAREST: + dwFunc = D3DFILTER_LINEARMIPNEAREST; + break; + case GL_NEAREST_MIPMAP_LINEAR: + dwFunc = D3DFILTER_MIPLINEAR; + break; + case GL_LINEAR_MIPMAP_LINEAR: + dwFunc = D3DFILTER_LINEARMIPLINEAR; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_TEXTUREMIN, dwFunc ); + + /* Another hack to cut down on redundant texture binding. */ + // if ( texName != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name ) + // { + texName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name; + CreateTMgrHAL( pContext->pShared, + texName, + 0, + ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format, + (RECT *)NULL, + ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Width, + ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Height, + TM_ACTION_BIND, + (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Data ); + // } + bTexture = TRUE; + } + else + { + /* This is nasty but should cut down on the number of redundant calls. */ + if ( bTexture == TRUE ) + { + DisableTMgrHAL( pContext->pShared ); + bTexture = FALSE; + } + } + + /*===============================================*/ + /* Check too see if there are new RASTER states. */ + /*===============================================*/ + + // TODO: no concept of front & back. + switch( ctx->Polygon.FrontMode ) + { + case GL_POINT: + SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_POINT ); + break; + case GL_LINE: + SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_WIREFRAME ); + break; + case GL_FILL: + SetStateHAL( pContext->pShared, D3DRENDERSTATE_FILLMODE, D3DFILL_SOLID ); + break; + } + + /*************/ + /* Z-Buffer. */ + /*************/ + if ( ctx->Depth.Test == GL_TRUE ) + { + switch( ctx->Depth.Func ) + { + case GL_NEVER: + dwFunc = D3DCMP_NEVER; + break; + case GL_LESS: + dwFunc = D3DCMP_LESS; + break; + case GL_GEQUAL: + dwFunc = D3DCMP_GREATEREQUAL; + break; + case GL_LEQUAL: + dwFunc = D3DCMP_LESSEQUAL; + break; + case GL_GREATER: + dwFunc = D3DCMP_GREATER; + break; + case GL_NOTEQUAL: + dwFunc = D3DCMP_NOTEQUAL; + break; + case GL_EQUAL: + dwFunc = D3DCMP_EQUAL; + break; + case GL_ALWAYS: + dwFunc = D3DCMP_ALWAYS; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZFUNC, dwFunc ); + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZENABLE, TRUE ); + } + else + { + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZENABLE, FALSE ); + } + + /*******************/ + /* Z-Write Enable. */ + /*******************/ + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ZWRITEENABLE , (ctx->Depth.Mask == GL_TRUE) ? TRUE : FALSE ); + + /***************/ + /* Alpha test. */ + /***************/ + if ( ctx->Color.AlphaEnabled == GL_TRUE ) + { + switch( ctx->Color.AlphaFunc ) + { + case GL_NEVER: + dwFunc = D3DCMP_NEVER; + break; + case GL_LESS: + dwFunc = D3DCMP_LESS; + break; + case GL_GEQUAL: + dwFunc = D3DCMP_GREATEREQUAL; + break; + case GL_LEQUAL: + dwFunc = D3DCMP_LESSEQUAL; + break; + case GL_GREATER: + dwFunc = D3DCMP_GREATER; + break; + case GL_NOTEQUAL: + dwFunc = D3DCMP_NOTEQUAL; + break; + case GL_EQUAL: + dwFunc = D3DCMP_EQUAL; + break; + case GL_ALWAYS: + dwFunc = D3DCMP_ALWAYS; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHAFUNC , dwFunc ); + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHATESTENABLE, TRUE ); + } + else + { + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHATESTENABLE, FALSE ); + } + + /****************/ + /* Alpha blend. */ + /****************/ + if ( ctx->Color.BlendEnabled == GL_TRUE ) + { + switch( ctx->Color.BlendSrc ) + { + case GL_ZERO: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_zero]; + break; + case GL_ONE: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one]; + break; + case GL_DST_COLOR: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_dst_color]; + break; + case GL_ONE_MINUS_DST_COLOR: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_dst_color]; + break; + case GL_SRC_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_src_alpha]; + break; + case GL_ONE_MINUS_SRC_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_src_alpha]; + break; + case GL_DST_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_dst_alpha]; + break; + case GL_ONE_MINUS_DST_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_dst_alpha]; + break; + case GL_SRC_ALPHA_SATURATE: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_src_alpha_saturate]; + break; + case GL_CONSTANT_COLOR: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_constant_color]; + break; + case GL_ONE_MINUS_CONSTANT_COLOR: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_constant_color]; + break; + case GL_CONSTANT_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_constant_alpha]; + break; + case GL_ONE_MINUS_CONSTANT_ALPHA: + dwFunc = pContext->pShared->dwSrcBlendCaps[s_one_minus_constant_alpha]; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_SRCBLEND, dwFunc ); + + switch( ctx->Color.BlendDst ) + { + case GL_ZERO: + dwFunc = pContext->pShared->dwDestBlendCaps[d_zero]; + break; + case GL_ONE: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one]; + break; + case GL_SRC_COLOR: + dwFunc = pContext->pShared->dwDestBlendCaps[d_src_color]; + break; + case GL_ONE_MINUS_SRC_COLOR: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_src_color]; + break; + case GL_SRC_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_src_alpha]; + break; + case GL_ONE_MINUS_SRC_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_src_alpha]; + break; + case GL_DST_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_dst_alpha]; + break; + case GL_ONE_MINUS_DST_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_dst_alpha]; + break; + case GL_CONSTANT_COLOR: + dwFunc = pContext->pShared->dwDestBlendCaps[d_constant_color]; + break; + case GL_ONE_MINUS_CONSTANT_COLOR: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_constant_color]; + break; + case GL_CONSTANT_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_constant_alpha]; + break; + case GL_ONE_MINUS_CONSTANT_ALPHA: + dwFunc = pContext->pShared->dwDestBlendCaps[d_one_minus_constant_alpha]; + break; + } + SetStateHAL( pContext->pShared, D3DRENDERSTATE_DESTBLEND, dwFunc ); + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHABLENDENABLE, TRUE ); + } + else + { + SetStateHAL( pContext->pShared, D3DRENDERSTATE_ALPHABLENDENABLE, FALSE ); + } +} +/*===========================================================================*/ +/* If this function is called it will track the changes to the current */ +/* states that I'm setting in Direct3D. I did this so that the DPF's would */ +/* be under control! */ +/*===========================================================================*/ +/* RETURN: */ +/*===========================================================================*/ +static void DebugRenderStates( GLcontext *ctx, BOOL bForce ) +{ + D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx; + DWORD dwFunc; + static int dither = -1, + texture = -1, + textName = -1, + textEnv = -1, + textMin = -1, + textMag = -1, + polyMode = -1, + depthTest = -1, + depthFunc = -1, + depthMask = -1, + alphaTest = -1, + alphaFunc = -1, + blend = -1, + blendSrc = -1, + blendDest = -1; + + /* Force a displayed update of all current states. */ + if ( bForce ) + { + dither = texture = textName = textEnv = textMin = textMag = -1; + polyMode = depthTest = depthFunc = depthMask = -1; + alphaTest = alphaFunc = blend = blendSrc = blendDest = -1; + } + + if ( dither != ctx->Color.DitherFlag ) + { + dither = ctx->Color.DitherFlag; + DPF(( 0, "\tDither\t\t%s", (dither) ? "ENABLED" : "--------" )); + } + if ( depthTest != ctx->Depth.Test ) + { + depthTest = ctx->Depth.Test; + DPF(( 0, "\tDepth Test\t%s", (depthTest) ? "ENABLED" : "--------" )); + } + if ( alphaTest != ctx->Color.AlphaEnabled ) + { + alphaTest = ctx->Color.AlphaEnabled; + + DPF(( 0, "\tAlpha Test\t%s", (alphaTest) ? "ENABLED" : "--------" )); + } + if ( blend != ctx->Color.BlendEnabled ) + { + blend = ctx->Color.BlendEnabled; + + DPF(( 0, "\tBlending\t%s", (blend) ? "ENABLED" : "--------" )); + } + + /*================================================*/ + /* Check too see if there are new TEXTURE states. */ + /*================================================*/ + if ( texture != ctx->Texture.ReallyEnabled ) + { + texture = ctx->Texture.ReallyEnabled; + DPF(( 0, "\tTexture\t\t%s", (texture) ? "ENABLED" : "--------" )); + } + + if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current ) + { + if ( ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name != textName ) + { + textName = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name; + DPF(( 0, "\tTexture Name:\t%d", textName )); + DPF(( 0, "\tTexture Format:\t%s", + (ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format == GL_RGBA) ? + "GL_RGBA" : "GLRGB" )); + } + + if ( textEnv != ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode ) + { + textEnv = ctx->Texture.Set[ctx->Texture.CurrentSet].EnvMode; + + switch( textEnv ) + { + case GL_MODULATE: + DPF(( 0, "\tTexture\tMode\tGL_MODULATE" )); + break; + case GL_BLEND: + DPF(( 0, "\tTexture\tMode\tGL_BLEND" )); + break; + case GL_REPLACE: + DPF(( 0, "\tTexture\tMode\tGL_REPLACE" )); + break; + case GL_DECAL: + DPF(( 0, "\tTexture\tMode\tGL_DECAL" )); + break; + } + } + + if ( textMag != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter ) + { + textMag = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MagFilter; + + switch( textMag ) + { + case GL_NEAREST: + DPF(( 0, "\tTexture MAG\tGL_NEAREST" )); + break; + case GL_LINEAR: + DPF(( 0, "\tTexture MAG\tGL_LINEAR" )); + break; + case GL_NEAREST_MIPMAP_NEAREST: + DPF(( 0, "\tTexture MAG\tGL_NEAREST_MIPMAP_NEAREST" )); + break; + case GL_LINEAR_MIPMAP_NEAREST: + DPF(( 0, "\tTexture MAG\tGL_LINEAR_MIPMAP_NEAREST" )); + break; + case GL_NEAREST_MIPMAP_LINEAR: + DPF(( 0, "\tTexture MAG\tGL_NEAREST_MIPMAP_LINEAR" )); + break; + case GL_LINEAR_MIPMAP_LINEAR: + DPF(( 0, "\tTexture MAG\tGL_LINEAR_MIPMAP_LINEAR" )); + break; + } + } + + if ( textMin != ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter ) + { + textMin = ctx->Texture.Set[ctx->Texture.CurrentSet].Current->MinFilter; + + switch( textMin ) + { + case GL_NEAREST: + DPF(( 0, "\tTexture MIN\tGL_NEAREST" )); + break; + case GL_LINEAR: + DPF(( 0, "\tTexture MIN\tGL_LINEAR" )); + break; + case GL_NEAREST_MIPMAP_NEAREST: + DPF(( 0, "\tTexture MIN\tGL_NEAREST_MIPMAP_NEAREST" )); + break; + case GL_LINEAR_MIPMAP_NEAREST: + DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_NEAREST" )); + break; + case GL_NEAREST_MIPMAP_LINEAR: + DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_LINEAR" )); + break; + case GL_LINEAR_MIPMAP_LINEAR: + DPF(( 0, "\tTexture MIN\tGL_LINEAR_MIPMAP_LINEAR" )); + break; + } + } + } + + if ( ctx->Polygon.FrontMode != polyMode ) + { + polyMode = ctx->Polygon.FrontMode; + + switch( polyMode ) + { + case GL_POINT: + DPF(( 0, "\tMode\t\tGL_POINT" )); + break; + case GL_LINE: + DPF(( 0, "\tMode\t\tGL_LINE" )); + break; + case GL_FILL: + DPF(( 0, "\tMode\t\tGL_FILL" )); + break; + } + } + + if ( depthFunc != ctx->Depth.Func ) + { + depthFunc = ctx->Depth.Func; + + switch( depthFunc ) + { + case GL_NEVER: + DPF(( 0, "\tDepth Func\tGL_NEVER" )); + break; + case GL_LESS: + DPF(( 0, "\tDepth Func\tGL_LESS" )); + break; + case GL_GEQUAL: + DPF(( 0, "\tDepth Func\tGL_GEQUAL" )); + break; + case GL_LEQUAL: + DPF(( 0, "\tDepth Func\tGL_LEQUAL" )); + break; + case GL_GREATER: + DPF(( 0, "\tDepth Func\tGL_GREATER" )); + break; + case GL_NOTEQUAL: + DPF(( 0, "\tDepth Func\tGL_NOTEQUAL" )); + break; + case GL_EQUAL: + DPF(( 0, "\tDepth Func\tGL_EQUAL" )); + break; + case GL_ALWAYS: + DPF(( 0, "\tDepth Func\tGL_ALWAYS" )); + break; + } + } + + if ( depthMask != ctx->Depth.Mask ) + { + depthMask = ctx->Depth.Mask; + DPF(( 0, "\tZWrite\t\t%s", (depthMask) ? "ENABLED" : "--------" )); + } + + if ( alphaFunc != ctx->Color.AlphaFunc ) + { + alphaFunc = ctx->Color.AlphaFunc; + + switch( alphaFunc ) + { + case GL_NEVER: + DPF(( 0, "\tAlpha Func\tGL_NEVER" )); + break; + case GL_LESS: + DPF(( 0, "\tAlpha Func\tGL_LESS" )); + break; + case GL_GEQUAL: + DPF(( 0, "\tAlpha Func\tGL_GEQUAL" )); + break; + case GL_LEQUAL: + DPF(( 0, "\tAlpha Func\tGL_LEQUAL" )); + break; + case GL_GREATER: + DPF(( 0, "\tAlpha Func\tGL_GREATER" )); + break; + case GL_NOTEQUAL: + DPF(( 0, "\tAlpha Func\tGL_NOTEQUAL" )); + break; + case GL_EQUAL: + DPF(( 0, "\tAlpha Func\tGL_EQUAL" )); + break; + case GL_ALWAYS: + DPF(( 0, "\tAlpha Func\tGL_ALWAYS" )); + break; + } + } + + if ( blendSrc != ctx->Color.BlendSrc ) + { + blendSrc = ctx->Color.BlendSrc; + + switch( blendSrc ) + { + case GL_ZERO: + DPF(( 0, "\tSRC Blend\tGL_ZERO" )); + break; + case GL_ONE: + DPF(( 0, "\tSRC Blend\tGL_ONE" )); + break; + case GL_DST_COLOR: + DPF(( 0, "\tSRC Blend\tGL_DST_COLOR" )); + break; + case GL_ONE_MINUS_DST_COLOR: + DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_DST_COLOR" )); + break; + case GL_SRC_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_SRC_ALPHA" )); + break; + case GL_ONE_MINUS_SRC_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_MINUS_SRC_ALPHA" )); + break; + case GL_DST_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_DST_ALPHA" )); + break; + case GL_ONE_MINUS_DST_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_DST_ALPHA" )); + break; + case GL_SRC_ALPHA_SATURATE: + DPF(( 0, "\tSRC Blend\tGL_SRC_ALPHA_SATURATE" )); + break; + case GL_CONSTANT_COLOR: + DPF(( 0, "\tSRC Blend\tGL_CONSTANT_COLOR" )); + break; + case GL_ONE_MINUS_CONSTANT_COLOR: + DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_CONSTANT_COLOR" )); + break; + case GL_CONSTANT_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_CONSTANT_ALPHA" )); + break; + case GL_ONE_MINUS_CONSTANT_ALPHA: + DPF(( 0, "\tSRC Blend\tGL_ONE_MINUS_CONSTANT_ALPHA" )); + break; + } + } + + if ( blendDest != ctx->Color.BlendDst ) + { + blendDest = ctx->Color.BlendDst; + + switch( blendDest ) + { + case GL_ZERO: + DPF(( 0, "\tDST Blend\tGL_ZERO" )); + break; + case GL_ONE: + DPF(( 0, "\tDST Blend\tGL_ONE" )); + break; + case GL_SRC_COLOR: + DPF(( 0, "\tDST Blend\tGL_SRC_COLOR" )); + break; + case GL_ONE_MINUS_SRC_COLOR: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_SRC_COLOR" )); + break; + case GL_SRC_ALPHA: + DPF(( 0, "\tDST Blend\tGL_SRC_ALPHA" )); + break; + case GL_ONE_MINUS_SRC_ALPHA: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_SRC_ALPHA" )); + break; + case GL_DST_ALPHA: + DPF(( 0, "\tDST Blend\tGL_DST_ALPHA" )); + break; + case GL_ONE_MINUS_DST_ALPHA: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_DST_ALPHA" )); + break; + case GL_CONSTANT_COLOR: + DPF(( 0, "\tDST Blend\tGL_CONSTANT_COLOR" )); + break; + case GL_ONE_MINUS_CONSTANT_COLOR: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_CONSTANT_COLOR" )); + break; + case GL_CONSTANT_ALPHA: + DPF(( 0, "\tDST Blend\tGL_CONSTANT_ALPHA" )); + break; + case GL_ONE_MINUS_CONSTANT_ALPHA: + DPF(( 0, "\tDST Blend\tGL_ONE_MINUS_CONSTANT_ALPHA" )); + break; + } + } +} diff --git a/xc/extras/Mesa/src/D3D/DDrawPROCS.c b/xc/extras/Mesa/src/D3D/DDrawPROCS.c new file mode 100644 index 000000000..a02a89deb --- /dev/null +++ b/xc/extras/Mesa/src/D3D/DDrawPROCS.c @@ -0,0 +1,399 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "D3DMesa.h"
+/*===========================================================================*/
+/* This call will clear the render surface using the pixel info built from */
+/* the surface at creation time. The call uses Lock/Unlock to access the */
+/* surface. The call also special cases a full clear or a dirty rectangle. */
+/* Finally the call returns the new clear mask that reflects that the color */
+/* buffer was cleared. */
+/*===========================================================================*/
+/* RETURN: the original mask with the bits cleared that represents the buffer*/
+/* or buffers we just cleared. */
+/*===========================================================================*/
+GLbitfield ClearBuffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DDSURFACEDESC2 *pddsd2;
+ UCHAR *pBuffer,
+ *pScanLine;
+ int index,
+ index2;
+ DWORD dwColor;
+
+ if ( mask & GL_COLOR_BUFFER_BIT )
+ {
+ /* Lock the surface to get the surface pointer. */
+ pddsd2 = LockHAL( pContext->pShared, TRUE );
+
+ /* Solve the color once only. */
+ dwColor = ( ((DWORD)((float)pContext->rClear * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)pContext->gClear * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)pContext->bClear * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+
+ if ( all )
+ {
+ for( index = 0, pScanLine = (UCHAR *)pddsd2->lpSurface; index < pContext->pShared->dwHeight; index++, pScanLine += pddsd2->lPitch )
+ for( pBuffer = pScanLine, index2 = 0; index2 < pContext->pShared->dwWidth; index2++, pBuffer += pContext->pShared->pixel.cb )
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ else
+ {
+ pScanLine = ((UCHAR *)pddsd2->lpSurface) +
+ ( (FLIP( pContext->pShared->dwHeight, (y+height)) * pddsd2->lPitch) + (x * pContext->pShared->pixel.cb) );
+
+ for( index = 0; index < height; index++, pScanLine += pddsd2->lPitch )
+ {
+ for( index2 = 0, pBuffer = pScanLine; index2 < width; index2++, pBuffer += pContext->pShared->pixel.cb )
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+
+ UnlockHAL( pContext->pShared, TRUE );
+ }
+
+ return (mask & ~GL_COLOR_BUFFER_BIT);
+}
+/*===========================================================================*/
+/* This proc (as all others) has been written for the general case. I use */
+/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
+/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void WSpanRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DDSURFACEDESC2 *pddsd2;
+ UCHAR *pBuffer;
+ int index;
+ DWORD dwColor;
+
+ /* Get the surface pointer and the pitch. */
+ pddsd2 = LockHAL( pContext->pShared, TRUE );
+
+ /* Find the start of the span. Invert y for Windows. */
+ pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb);
+
+ if ( mask )
+ {
+ for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
+ {
+ if ( mask[index] )
+ {
+ /* Pack the color components. */
+ dwColor = ( ((DWORD)((float)rgb[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)rgb[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)rgb[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+ }
+ else
+ {
+ for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
+ {
+ /* Pack the color components. */
+ dwColor = ( ((DWORD)((float)rgb[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)rgb[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)rgb[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+
+ /* Giver back. */
+ UnlockHAL( pContext->pShared, TRUE );
+}
+/*===========================================================================*/
+/* This proc (as all others) has been written for the general case. I use */
+/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
+/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void WSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DDSURFACEDESC2 *pddsd2;
+ UCHAR *pBuffer;
+ int index;
+ DWORD dwColor;
+
+ /* Get the surface pointer and the pitch. */
+ pddsd2 = LockHAL( pContext->pShared, TRUE );
+
+ /* Find the start of the span. Invert y for Windows. */
+ pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb);
+
+ if ( mask )
+ {
+ for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
+ {
+ if ( mask[index] )
+ {
+ /* Pack the color components. */
+ dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+ }
+ else
+ {
+ for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
+ {
+ /* Pack the color components. */
+ dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+
+ /* Giver back. */
+ UnlockHAL( pContext->pShared, TRUE );
+}
+/*===========================================================================*/
+/* This proc (as all others) has been written for the general case. I use */
+/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
+/* Screen render surface uses. The color is solved once from the current */
+/* color components. The alpha is ignored as Mesa is doing it in SW. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void WSpanRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DDSURFACEDESC2 *pddsd2;
+ UCHAR *pBuffer;
+ int index;
+ DWORD dwColor;
+
+ /* Lock the surface to get the surface pointer and the pitch. */
+ pddsd2 = LockHAL( pContext->pShared, TRUE );
+
+ /* Solve the color once only. (no alpha) */
+ dwColor = ( ((DWORD)((float)pContext->rCurrent * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)pContext->gCurrent * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)pContext->bCurrent * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+
+ /* Find the start of the span. Invert y for Windows. */
+ pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) + (x*pContext->pShared->pixel.cb);
+
+ if ( mask )
+ {
+ for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
+ if ( mask[index] )
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ else
+ {
+ for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+
+ /* Giver back. */
+ UnlockHAL( pContext->pShared, TRUE );
+}
+/*===========================================================================*/
+/* This proc (as all others) has been written for the general case. I use */
+/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
+/* Screen render surface uses. The alpha is ignored as Mesa does it in SW. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void WPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DDSURFACEDESC2 *pddsd2;
+ UCHAR *pBuffer;
+ int index;
+ DWORD dwColor;
+
+ /* Get the surface pointer and the pitch. */
+ pddsd2 = LockHAL( pContext->pShared, TRUE );
+
+ if ( mask )
+ {
+ for( index = 0; index < n; index++ )
+ {
+ if ( mask[index] )
+ {
+ /* Pack the color components. */
+ dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+
+ /* Find the pixel. Invert y for Windows. */
+ pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb);
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+ }
+ else
+ {
+ for( index = 0; index < n; index++ )
+ {
+ /* Pack the color components. */
+ dwColor = ( ((DWORD)((float)rgba[index][RCOMP] * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)rgba[index][GCOMP] * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)rgba[index][BCOMP] * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+
+ /* Find the pixel. Invert y for Windows. */
+ pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb);
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+
+ /* Giver back. */
+ UnlockHAL( pContext->pShared, TRUE );
+}
+/*===========================================================================*/
+/* This proc (as all others) has been written for the general case. I use */
+/* the PIXELINFO structure to pack the pixel from RGB24 to whatever the Off- */
+/* Screen render surface uses. The color is solved once from the current */
+/* color components. The alpha is ignored as Mesa is doing it in SW. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void WPixelsRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DDSURFACEDESC2 *pddsd2;
+ UCHAR *pBuffer;
+ int index;
+ DWORD dwColor;
+
+ /* Get the surface pointer and the pitch. */
+ pddsd2 = LockHAL( pContext->pShared, TRUE );
+
+ /* Solve the color once only. I don't uses the alpha. */
+ dwColor = ( ((DWORD)((float)pContext->rCurrent * pContext->pShared->pixel.rScale)) << pContext->pShared->pixel.rShift );
+ dwColor |= ( ((DWORD)((float)pContext->gCurrent * pContext->pShared->pixel.gScale)) << pContext->pShared->pixel.gShift );
+ dwColor |= ( ((DWORD)((float)pContext->bCurrent * pContext->pShared->pixel.bScale)) << pContext->pShared->pixel.bShift );
+
+ if ( mask )
+ {
+ /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
+ for( index = 0; index < n; index++ )
+ {
+ if ( mask[index] )
+ {
+ /* Find the pixel. Invert y for Windows. */
+ pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb);
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+ }
+ else
+ {
+ /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
+ for( index = 0; index < n; index++ )
+ {
+ /* Find the pixel. Invert y for Windows. */
+ pBuffer = (UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb);
+ memcpy( pBuffer, &dwColor, pContext->pShared->pixel.cb );
+ }
+ }
+
+ /* Giver back. */
+ UnlockHAL( pContext->pShared, TRUE );
+}
+/*===========================================================================*/
+/* This proc isn't written for speed rather its to handle the general case. */
+/* I grab each pixel from the surface and unpack the info using the PIXELINFO*/
+/* structure that was generated from the OffScreen surface pixelformat. The */
+/* function will not fill in the alpha value as Mesa I have Mesa allocate its*/
+/* own alpha channel when the context was created. I did this as I didn't */
+/* feel that it was worth the effort to try and get HW to work (bus bound). */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void RSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DDSURFACEDESC2 *pddsd2;
+ UCHAR *pBuffer;
+ int index;
+ DWORD *pdwColor;
+
+ /* Get the surface pointer and the pitch. */
+ pddsd2 = LockHAL( pContext->pShared, TRUE );
+
+ /* Find the start of the span. Invert y for Windows. */
+ pBuffer = (UCHAR *)pddsd2->lpSurface +
+ (FLIP(pContext->pShared->dwHeight,y) * pddsd2->lPitch) +
+ (x*pContext->pShared->pixel.cb);
+
+ /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
+ for( index = 0; index < n; index++, pBuffer += pContext->pShared->pixel.cb )
+ {
+ pdwColor = (DWORD *)pBuffer;
+ rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale);
+ rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale);
+ rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale);
+ }
+
+ /* Giver back. */
+ UnlockHAL( pContext->pShared, TRUE );
+}
+/*===========================================================================*/
+/* This proc isn't written for speed rather its to handle the general case. */
+/* I grab each pixel from the surface and unpack the info using the PIXELINFO*/
+/* structure that was generated from the OffScreen surface pixelformat. The */
+/* function will not fill in the alpha value as Mesa I have Mesa allocate its*/
+/* own alpha channel when the context was created. I did this as I didn't */
+/* feel that it was worth the effort to try and get HW to work (bus bound). */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void RPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DDSURFACEDESC2 *pddsd2;
+ int index;
+ DWORD *pdwColor;
+
+ /* Get the surface pointer and the pitch. */
+ pddsd2 = LockHAL( pContext->pShared, TRUE );
+
+ if ( mask )
+ {
+ /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
+ for( index = 0; index < n; index++ )
+ {
+ if ( mask[index] )
+ {
+ /* Find the start of the pixel. Invert y for Windows. */
+ pdwColor = (DWORD *)((UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb));
+ rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale);
+ rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale);
+ rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale);
+ }
+ }
+ }
+ else
+ {
+ /* We store the surface pointer as a UCHAR so that pixel.cb (count in btyles) will work for all. */
+ for( index = 0; index < n; index++ )
+ {
+ /* Find the start of the pixel. Invert y for Windows. */
+ pdwColor = (DWORD *)((UCHAR *)pddsd2->lpSurface + (FLIP(pContext->pShared->dwHeight,y[index]) * pddsd2->lPitch) + (x[index]*pContext->pShared->pixel.cb));
+ rgba[index][RCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwRMask) >> pContext->pShared->pixel.rShift) / pContext->pShared->pixel.rScale);
+ rgba[index][GCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwGMask) >> pContext->pShared->pixel.gShift) / pContext->pShared->pixel.gScale);
+ rgba[index][BCOMP] = (GLubyte)((float)((*pdwColor & pContext->pShared->pixel.dwBMask) >> pContext->pShared->pixel.bShift) / pContext->pShared->pixel.bScale);
+ }
+ }
+
+ /* Giver back. */
+ UnlockHAL( pContext->pShared, TRUE );
+}
diff --git a/xc/extras/Mesa/src/D3D/DEBUG.C b/xc/extras/Mesa/src/D3D/DEBUG.C new file mode 100644 index 000000000..dfa524bf3 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/DEBUG.C @@ -0,0 +1,143 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "Debug.h"
+/*===========================================================================*/
+/* Global variables. */
+/*===========================================================================*/
+DWORD g_DBGMask = DBG_ALL_ERROR;
+/*===========================================================================*/
+/* This is your basic DPF function with printf like support. The function */
+/* also works with a global debug mask variable. I have written support that*/
+/* allows for the user's enviroment variable space to be read and set the */
+/* masks. This is done when the dll starts and is only in the debug version.*/
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void _cdecl DebugPrint( int mask, char *pszFormat, ... )
+{
+ char buffer[512];
+ va_list args;
+
+ /* A mask of 0 will always pass. Easy to remeber. */
+ if ( (mask == 0) || (mask & g_DBGMask) )
+ {
+ va_start( args, pszFormat );
+
+ if ( mask & DBG_ALL_ERROR )
+ OutputDebugString( "MesaD3D: (ERROR)" );
+ else
+ OutputDebugString( "MesaD3D: " );
+
+ vsprintf( buffer, pszFormat, args );
+ strcat( buffer, "\n" );
+ OutputDebugString( buffer );
+
+ va_end( args );
+ }
+}
+/*===========================================================================*/
+/* This call reads the users enviroment variables and sets any debug mask */
+/* that they have set to TRUE. Now the value must be "TRUE". */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void ReadDBGEnv( void )
+{
+ g_DBGMask = DBG_ALL_ERROR;
+
+#define IS_VAR_SET(v) if ( getenv( # v ) && !strcmp(getenv( # v ),"TRUE") ) g_DBGMask |= v;
+
+ IS_VAR_SET( DBG_FUNC );
+ IS_VAR_SET( DBG_STATES );
+
+ IS_VAR_SET( DBG_CNTX_INFO );
+ IS_VAR_SET( DBG_CNTX_WARN );
+ IS_VAR_SET( DBG_CNTX_PROFILE );
+ IS_VAR_SET( DBG_CNTX_ERROR );
+ IS_VAR_SET( DBG_CNTX_ALL );
+
+ IS_VAR_SET( DBG_PRIM_INFO );
+ IS_VAR_SET( DBG_PRIM_WARN );
+ IS_VAR_SET( DBG_PRIM_PROFILE );
+ IS_VAR_SET( DBG_PRIM_ERROR );
+ IS_VAR_SET( DBG_PRIM_ALL );
+
+ IS_VAR_SET( DBG_TXT_INFO );
+ IS_VAR_SET( DBG_TXT_WARN );
+ IS_VAR_SET( DBG_TXT_PROFILE );
+ IS_VAR_SET( DBG_TXT_ERROR );
+ IS_VAR_SET( DBG_TXT_ALL );
+
+ IS_VAR_SET( DBG_ALL_INFO );
+ IS_VAR_SET( DBG_ALL_WARN );
+ IS_VAR_SET( DBG_ALL_PROFILE );
+ IS_VAR_SET( DBG_ALL_ERROR );
+ IS_VAR_SET( DBG_ALL );
+
+#undef IS_VAR_SET
+}
+/*===========================================================================*/
+/* This function will take a pointer to a DDSURFACEDESC2 structure & display*/
+/* the parsed information using a DPF call. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf )
+{
+ char buffer[256];
+
+ /* Parse the flag type and write the string equivalent. */
+ if ( pddpf->dwFlags & DDPF_ALPHA )
+ strcat( buffer, "DDPF_ALPHA " );
+ if ( pddpf->dwFlags & DDPF_ALPHAPIXELS )
+ strcat( buffer, "DDPF_ALPHAPIXELS " );
+ if ( pddpf->dwFlags & DDPF_ALPHAPREMULT )
+ strcat( buffer, "DDPF_ALPHAPREMULT " );
+ if ( pddpf->dwFlags & DDPF_BUMPLUMINANCE )
+ strcat( buffer, "DDPF_BUMPLUMINANCE " );
+ if ( pddpf->dwFlags & DDPF_BUMPDUDV )
+ strcat( buffer, "DDPF_BUMPDUDV " );
+ if ( pddpf->dwFlags & DDPF_COMPRESSED )
+ strcat( buffer, "DDPF_COMPRESSED " );
+ if ( pddpf->dwFlags & DDPF_FOURCC )
+ strcat( buffer, "DDPF_FOURCC " );
+ if ( pddpf->dwFlags & DDPF_LUMINANCE )
+ strcat( buffer, "DDPF_LUMINANCE " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXED1 )
+ strcat( buffer, "DDPF_PALETTEINDEXED1 " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXED2 )
+ strcat( buffer, "DDPF_PALETTEINDEXED2 " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXED4 )
+ strcat( buffer, "DDPF_PALETTEINDEXED4 " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXED8 )
+ strcat( buffer, "DDPF_PALETTEINDEXED8 " );
+ if ( pddpf->dwFlags & DDPF_PALETTEINDEXEDTO8 )
+ strcat( buffer, "DDPF_PALETTEINDEXEDTO8 " );
+ if ( pddpf->dwFlags & DDPF_RGB )
+ strcat( buffer, "DDPF_RGB " );
+ if ( pddpf->dwFlags & DDPF_RGBTOYUV )
+ strcat( buffer, "DDPF_RGBTOYUV " );
+ if ( pddpf->dwFlags & DDPF_STENCILBUFFER )
+ strcat( buffer, "DDPF_STENCILBUFFER " );
+ if ( pddpf->dwFlags & DDPF_YUV )
+ strcat( buffer, "DDPF_YUV " );
+ if ( pddpf->dwFlags & DDPF_ZBUFFER )
+ strcat( buffer, "DDPF_ZBUFFER " );
+ if ( pddpf->dwFlags & DDPF_ZPIXELS )
+ strcat( buffer, "DDPF_ZPIXELS " );
+
+ DPF(( (DBG_TXT_INFO|DBG_CNTX_INFO),"%s", buffer ));
+}
+
+
+
+
+
diff --git a/xc/extras/Mesa/src/D3D/DEBUG.H b/xc/extras/Mesa/src/D3D/DEBUG.H new file mode 100644 index 000000000..76122b912 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/DEBUG.H @@ -0,0 +1,90 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#ifndef _DEBUG_H
+#define _DEBUG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*===========================================================================*/
+/* Includes. */
+/*===========================================================================*/
+#include <stdio.h>
+#include <string.h>
+#include <ddraw.h>
+#include <d3d.h>
+#include "D3DShared.h"
+/*===========================================================================*/
+/* Magic numbers. */
+/*===========================================================================*/
+/*===========================================================================*/
+/* Macros defines. */
+/*===========================================================================*/
+#define DBG_FUNC 0x00000001
+#define DBG_STATES 0x00000002
+
+#define DBG_CNTX_INFO 0x00000010
+#define DBG_CNTX_WARN 0x00000020
+#define DBG_CNTX_PROFILE 0x00000040
+#define DBG_CNTX_ERROR 0x00000080
+#define DBG_CNTX_ALL 0x000000F0
+
+#define DBG_PRIM_INFO 0x00000100
+#define DBG_PRIM_WARN 0x00000200
+#define DBG_PRIM_PROFILE 0x00000400
+#define DBG_PRIM_ERROR 0x00000800
+#define DBG_PRIM_ALL 0x00000F00
+
+#define DBG_TXT_INFO 0x00001000
+#define DBG_TXT_WARN 0x00002000
+#define DBG_TXT_PROFILE 0x00004000
+#define DBG_TXT_ERROR 0x00008000
+#define DBG_TXT_ALL 0x0000F000
+
+#define DBG_ALL_INFO 0x11111110
+#define DBG_ALL_WARN 0x22222220
+#define DBG_ALL_PROFILE 0x44444440
+#define DBG_ALL_ERROR 0x88888880
+#define DBG_ALL 0xFFFFFFFF
+
+#ifdef D3D_DEBUG
+# define DPF(arg) DebugPrint arg
+# define RIP(pH,msg,err) OutputDebugString(msg); \
+ OutputDebugString(err); \
+ OutputDebugString("\n"); \
+ FatalShutDown(pH)
+#else
+# define DPF(arg)
+# define RIP(pH,msg,err) FatalShutDown(pH)
+#endif
+/*===========================================================================*/
+/* Type defines. */
+/*===========================================================================*/
+/*===========================================================================*/
+/* Function prototypes. */
+/*===========================================================================*/
+extern void ReadDBGEnv( void );
+extern void _cdecl DebugPrint( int mask, char *pszFormat, ... );
+extern void DebugPixelFormat( char *pszSurfaceName, DDPIXELFORMAT *pddpf );
+/*===========================================================================*/
+/* Global variables. */
+/*===========================================================================*/
+extern DWORD g_DBGMask;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
+
diff --git a/xc/extras/Mesa/src/D3D/DbgEnv.bat b/xc/extras/Mesa/src/D3D/DbgEnv.bat new file mode 100644 index 000000000..40858e668 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/DbgEnv.bat @@ -0,0 +1,25 @@ +SET DBG_FUNC=FALSE
+
+SET DBG_CNTX_INFO=TRUE
+SET DBG_CNTX_WARN=TRUE
+SET DBG_CNTX_PROFILE=FALSE
+SET DBG_CNTX_ERROR=TRUE
+SET DBG_CNTX_ALL=TRUE
+
+SET DBG_PRIM_INFO=FALSE
+SET DBG_PRIM_WARN=FALSE
+SET DBG_PRIM_PROFILE=FALSE
+SET DBG_PRIM_ERROR=TRUE
+SET DBG_PRIM_ALL=FALSE
+
+SET DBG_TXT_INFO=FALSE
+SET DBG_TXT_WARN=TRUE
+SET DBG_TXT_PROFILE=FALSE
+SET DBG_TXT_ERROR=TRUE
+SET DBG_TXT_ALL=FALSE
+
+SET DBG_ALL_INFO=FALSE
+SET DBG_ALL_WARN=TRUE
+SET DBG_ALL_PROFILE=FALSE
+SET DBG_ALL_ERROR=TRUE
+SET DBG_ALL=FALSE
diff --git a/xc/extras/Mesa/src/D3D/MAKEFILE b/xc/extras/Mesa/src/D3D/MAKEFILE new file mode 100644 index 000000000..ad1d40dc2 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/MAKEFILE @@ -0,0 +1,101 @@ +##############################################################################
+#
+# Mesa-3.0 Makefile for DirectX 6 Driver
+#
+# By Leigh McRae
+#
+# http://www.altsoftware.com/
+#
+# Copyright (c) 1999-1998 alt.software inc. All Rights Reserved
+##############################################################################
+NAME=
+TARGET= WGL Driver (D3DHAL)
+
+D3D_DIR=$(MAKEDIR)\D3D
+TARGET_DIR=e:\WinNT\System32
+TEMP_DIR=c:\Temp
+
+SPACE=-
+LINKER=link.exe
+
+INCLUDE=$(SDKROOT)\include;$(INCLUDE)
+LIB=$(SDKROOT)\lib;$(LIB)
+##############################################################################
+CFLAGS = /c /nologo /W1 /G5 /I..\ /I..\..\Include \
+ /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D"
+CPPFLAGS= /c /nologo /W1 /G5 /I..\ /I..\..\Include \
+ /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D"
+
+!IF "$(DEBUG)" == "1"
+
+CFLAGS = /MTd /Od /Z7 /Yd /D "_DEBUG" /D "D3D_DEBUG" $(CFLAGS)
+CPPFLAGS = /MTd /Od /Z7 /Yd /D "_DEBUG" /D "D3D_DEBUG" $(CPPFLAGS)
+BUILD_TYPE=debug
+
+!ELSE
+
+CFLAGS = /MT /Ox /D "NDEBUG" $(CFLAGS)
+CPPFLAGS = /MT /Ox /D "NDEBUG" $(CPPFLAGS)
+BUILD_TYPE=release
+
+!ENDIF
+##############################################################################
+SRCS_WGL = wgl.c D3Dvbrender.c DDrawPROCS.c NULLProcs.c Debug.c
+SRCS_HAL = D3DInit.cpp D3DRaster.cpp D3DTextureMgr.cpp D3DUtils.cpp D3DCaps.cpp
+OBJS_WGL = $(SRCS_WGL:.c=.obj)
+OBJS_HAL = $(SRCS_HAL:.cpp=.obj)
+
+WINLIBS = kernel32.lib user32.lib gdi32.lib oldnames.lib
+DXLIBS =
+LIBS = $(WINLIBS) $(DXLIBS)
+###############################################################################
+# Primary Targets #
+###############################################################################
+
+default: header WGL HAL footer
+
+all: default
+
+WGL : $(OBJS_WGL)
+
+HAL : $(OBJS_HAL)
+
+install : forceit
+ @echo $(SPACE)
+ @echo ========================================
+ @echo Install files created.
+ @echo ========================================
+
+
+###############################################################################
+# Secondary Targets #
+###############################################################################
+
+clean:
+ @echo ========================================
+ @echo Cleaning $(TARGET)
+ @del *.obj
+ @del *.dep
+ @del *.exp
+ @del *.ncb
+ @del *.plg
+ @del *.lib
+ @echo ========================================
+
+header:
+ @echo ============================================================
+ @echo Building $(TARGET) ($(BUILD_TYPE) version)
+ @echo ============================================================
+ @echo $(SPACE)
+
+footer:
+ @echo $(SPACE)
+ @echo ============================================================
+ @echo DONE building $(TARGET) ($(BUILD_TYPE) version)
+ @echo ============================================================
+
+forceit:
+
+
+
+
diff --git a/xc/extras/Mesa/src/D3D/NULLProcs.h b/xc/extras/Mesa/src/D3D/NULLProcs.h new file mode 100644 index 000000000..f0bbd2162 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/NULLProcs.h @@ -0,0 +1,49 @@ +/*===========================================================================*/ +/* */ +/* Mesa-3.0 DirectX 6 Driver */ +/* */ +/* By Leigh McRae */ +/* */ +/* http://www.altsoftware.com/ */ +/* */ +/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */ +/*===========================================================================*/ +#ifndef NULL_MESA_PROCS_INC +#define NULL_MESA_PROCS_INC +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include "matrix.h" +#include "context.h" +#include "types.h" +#include "vb.h" +/*===========================================================================*/ +/* Macros. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +void NULLSetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); +void NULLClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a ); +GLboolean NULLSetBuffer( GLcontext *ctx, GLenum mode ); +void NULLGetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height ); +GLbitfield NULLClearBuffers( GLcontext *ctx, GLbitfield m, GLboolean a, GLint x, GLint y, GLint w, GLint h ); +void NULLWrSpRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][3], const GLubyte m[] ); +void NULLWrSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][4], const GLubyte m[] ); +void NULLWrSpRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte m[] ); +void NULLWrPiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte r[][4], const GLubyte m[] ); +void NULLWrPiRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte m[] ); +void NULLReSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte r[][4] ); +void NULLRePiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte r[][4], const GLubyte m[] ); +/*===========================================================================*/ +/* Extern function prototypes. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ + +#endif + diff --git a/xc/extras/Mesa/src/D3D/NullProcs.c b/xc/extras/Mesa/src/D3D/NullProcs.c new file mode 100644 index 000000000..60e4010f9 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/NullProcs.c @@ -0,0 +1,129 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 DirectX 6 Driver */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1999-1998 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "NULLProcs.h"
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLSetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+GLboolean NULLSetBuffer( GLcontext *ctx, GLenum mode )
+{
+ return TRUE;
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLGetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height )
+{
+ *width = 1;
+ *height = 1;
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+GLbitfield NULLClearBuffers( GLcontext *ctx, GLbitfield m, GLboolean a, GLint x, GLint y, GLint w, GLint h )
+{
+ return m;
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLWrSpRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][3], const GLubyte m[] )
+{
+
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLWrSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte r[][4], const GLubyte m[] )
+{
+
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLWrSpRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte m[] )
+{
+
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLWrPiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte r[][4], const GLubyte m[] )
+{
+
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLWrPiRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte m[] )
+{
+
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLReSpRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte r[][4] )
+{
+
+}
+/*===========================================================================*/
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+void NULLRePiRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte r[][4], const GLubyte m[] )
+{
+
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/xc/extras/Mesa/src/D3D/OPENGL32.DEF b/xc/extras/Mesa/src/D3D/OPENGL32.DEF new file mode 100644 index 000000000..b32bd1fef --- /dev/null +++ b/xc/extras/Mesa/src/D3D/OPENGL32.DEF @@ -0,0 +1,442 @@ +;===========================================================================
+;
+; Mesa-3.0 DirectX 6 Driver
+;
+; By Leigh McRae
+;
+; http://www.altsoftware.com/
+;
+; Copyright (c) 1999-1998 alt.software inc. All Rights Reserved
+;===========================================================================
+NAME OpenGL32.DLL
+DESCRIPTION "Mesa-3.0 DX6 Driver Version 0.5"
+
+EXPORTS
+ DllMain
+ glAccum
+ glAlphaFunc
+ glAreTexturesResident
+ glAreTexturesResidentEXT
+ glArrayElement
+ glArrayElementEXT
+ glBegin
+ glBindTexture
+ glBindTextureEXT
+ glBitmap
+ glBlendColorEXT
+ glBlendEquationEXT
+ glBlendFunc
+ glCallList
+ glCallLists
+ glClear
+ glClearAccum
+ glClearColor
+ glClearDepth
+ glClearIndex
+ glClearStencil
+ glClipPlane
+ glColor3b
+ glColor3bv
+ glColor3d
+ glColor3dv
+ glColor3f
+ glColor3fv
+ glColor3i
+ glColor3iv
+ glColor3s
+ glColor3sv
+ glColor3ub
+ glColor3ubv
+ glColor3ui
+ glColor3uiv
+ glColor3us
+ glColor3usv
+ glColor4b
+ glColor4bv
+ glColor4d
+ glColor4dv
+ glColor4f
+ glColor4fv
+ glColor4i
+ glColor4iv
+ glColor4s
+ glColor4sv
+ glColor4ub
+ glColor4ubv
+ glColor4ui
+ glColor4uiv
+ glColor4us
+ glColor4usv
+ glColorMask
+ glColorMaterial
+ glColorPointer
+ glColorPointerEXT
+ glColorSubTableEXT
+ glColorTableEXT
+ glCopyPixels
+ glCopyTexImage1D
+ glCopyTexImage2D
+ glCopyTexSubImage1D
+ glCopyTexSubImage2D
+ glCopyTexSubImage3DEXT
+ glCullFace
+ glDeleteLists
+ glDeleteTextures
+ glDeleteTexturesEXT
+ glDepthFunc
+ glDepthMask
+ glDepthRange
+ glDisable
+ glDisableClientState
+ glDrawArrays
+ glDrawArraysEXT
+ glDrawBuffer
+ glDrawElements
+ glDrawPixels
+ glEdgeFlag
+ glEdgeFlagPointer
+ glEdgeFlagPointerEXT
+ glEdgeFlagv
+ glEnable
+ glEnableClientState
+ glEnd
+ glEndList
+ glEvalCoord1d
+ glEvalCoord1dv
+ glEvalCoord1f
+ glEvalCoord1fv
+ glEvalCoord2d
+ glEvalCoord2dv
+ glEvalCoord2f
+ glEvalCoord2fv
+ glEvalMesh1
+ glEvalMesh2
+ glEvalPoint1
+ glEvalPoint2
+ glFeedbackBuffer
+ glFinish
+ glFlush
+ glFogf
+ glFogfv
+ glFogi
+ glFogiv
+ glFrontFace
+ glFrustum
+ glGenLists
+ glGenTextures
+ glGenTexturesEXT
+ glGetBooleanv
+ glGetClipPlane
+ glGetColorTableEXT
+ glGetColorTableParameterfvEXT
+ glGetColorTableParameterivEXT
+ glGetDoublev
+ glGetError
+ glGetFloatv
+ glGetIntegerv
+ glGetLightfv
+ glGetLightiv
+ glGetMapdv
+ glGetMapfv
+ glGetMapiv
+ glGetMaterialfv
+ glGetMaterialiv
+ glGetPixelMapfv
+ glGetPixelMapuiv
+ glGetPixelMapusv
+ glGetPointerv
+ glGetPointervEXT
+ glGetPolygonStipple
+ glGetString
+ glGetTexEnvfv
+ glGetTexEnviv
+ glGetTexGendv
+ glGetTexGenfv
+ glGetTexGeniv
+ glGetTexImage
+ glGetTexLevelParameterfv
+ glGetTexLevelParameteriv
+ glGetTexParameterfv
+ glGetTexParameteriv
+ glHint
+ glIndexd
+ glIndexdv
+ glIndexf
+ glIndexfv
+ glIndexi
+ glIndexiv
+ glIndexMask
+ glIndexPointer
+ glIndexPointerEXT
+ glIndexs
+ glIndexsv
+ glIndexub
+ glIndexubv
+ glInitNames
+ glInterleavedArrays
+ glIsEnabled
+ glIsList
+ glIsTexture
+ glIsTextureEXT
+ glLightf
+ glLightfv
+ glLighti
+ glLightiv
+ glLightModelf
+ glLightModelfv
+ glLightModeli
+ glLightModeliv
+ glLineStipple
+ glLineWidth
+ glListBase
+ glLoadIdentity
+ glLoadMatrixd
+ glLoadMatrixf
+ glLoadName
+ glLogicOp
+ glMap1d
+ glMap1f
+ glMap2d
+ glMap2f
+ glMapGrid1d
+ glMapGrid1f
+ glMapGrid2d
+ glMapGrid2f
+ glMaterialf
+ glMaterialfv
+ glMateriali
+ glMaterialiv
+ glMatrixMode
+ glMultMatrixd
+ glMultMatrixf
+ glNewList
+ glNormal3b
+ glNormal3bv
+ glNormal3d
+ glNormal3dv
+ glNormal3f
+ glNormal3fv
+ glNormal3i
+ glNormal3iv
+ glNormal3s
+ glNormal3sv
+ glNormalPointer
+ glNormalPointerEXT
+ glOrtho
+ glPassThrough
+ glPixelMapfv
+ glPixelMapuiv
+ glPixelMapusv
+ glPixelStoref
+ glPixelStorei
+ glPixelTransferf
+ glPixelTransferi
+ glPixelZoom
+ glPointParameterfEXT
+ glPointParameterfvEXT
+ glPointSize
+ glPolygonMode
+ glPolygonOffset
+ glPolygonOffsetEXT
+ glPolygonStipple
+ glPopAttrib
+ glPopClientAttrib
+ glPopMatrix
+ glPopName
+ glPrioritizeTextures
+ glPrioritizeTexturesEXT
+ glPushAttrib
+ glPushClientAttrib
+ glPushMatrix
+ glPushName
+ glRasterPos2d
+ glRasterPos2dv
+ glRasterPos2f
+ glRasterPos2fv
+ glRasterPos2i
+ glRasterPos2iv
+ glRasterPos2s
+ glRasterPos2sv
+ glRasterPos3d
+ glRasterPos3dv
+ glRasterPos3f
+ glRasterPos3fv
+ glRasterPos3i
+ glRasterPos3iv
+ glRasterPos3s
+ glRasterPos3sv
+ glRasterPos4d
+ glRasterPos4dv
+ glRasterPos4f
+ glRasterPos4fv
+ glRasterPos4i
+ glRasterPos4iv
+ glRasterPos4s
+ glRasterPos4sv
+ glReadBuffer
+ glReadPixels
+ glRectd
+ glRectdv
+ glRectf
+ glRectfv
+ glRecti
+ glRectiv
+ glRects
+ glRectsv
+ glRenderMode
+ glResizeBuffersMESA
+ glRotated
+ glRotatef
+ glScaled
+ glScalef
+ glScissor
+ glSelectBuffer
+ glShadeModel
+ glStencilFunc
+ glStencilMask
+ glStencilOp
+ glTexCoord1d
+ glTexCoord1dv
+ glTexCoord1f
+ glTexCoord1fv
+ glTexCoord1i
+ glTexCoord1iv
+ glTexCoord1s
+ glTexCoord1sv
+ glTexCoord2d
+ glTexCoord2dv
+ glTexCoord2f
+ glTexCoord2fv
+ glTexCoord2i
+ glTexCoord2iv
+ glTexCoord2s
+ glTexCoord2sv
+ glTexCoord3d
+ glTexCoord3dv
+ glTexCoord3f
+ glTexCoord3fv
+ glTexCoord3i
+ glTexCoord3iv
+ glTexCoord3s
+ glTexCoord3sv
+ glTexCoord4d
+ glTexCoord4dv
+ glTexCoord4f
+ glTexCoord4fv
+ glTexCoord4i
+ glTexCoord4iv
+ glTexCoord4s
+ glTexCoord4sv
+ glTexCoordPointer
+ glTexCoordPointerEXT
+ glTexEnvf
+ glTexEnvfv
+ glTexEnvi
+ glTexEnviv
+ glTexGend
+ glTexGendv
+ glTexGenf
+ glTexGenfv
+ glTexGeni
+ glTexGeniv
+ glTexImage1D
+ glTexImage2D
+ glTexImage3DEXT
+ glTexParameterf
+ glTexParameterfv
+ glTexParameteri
+ glTexParameteriv
+ glTexSubImage1D
+ glTexSubImage2D
+ glTexSubImage3DEXT
+ glTranslated
+ glTranslatef
+ glVertex2d
+ glVertex2dv
+ glVertex2f
+ glVertex2fv
+ glVertex2i
+ glVertex2iv
+ glVertex2s
+ glVertex2sv
+ glVertex3d
+ glVertex3dv
+ glVertex3f
+ glVertex3fv
+ glVertex3i
+ glVertex3iv
+ glVertex3s
+ glVertex3sv
+ glVertex4d
+ glVertex4dv
+ glVertex4f
+ glVertex4fv
+ glVertex4i
+ glVertex4iv
+ glVertex4s
+ glVertex4sv
+ glVertexPointer
+ glVertexPointerEXT
+ glViewport
+ glWindowPos2dMESA
+ glWindowPos2dvMESA
+ glWindowPos2fMESA
+ glWindowPos2fvMESA
+ glWindowPos2iMESA
+ glWindowPos2ivMESA
+ glWindowPos2sMESA
+ glWindowPos2svMESA
+ glWindowPos3dMESA
+ glWindowPos3dvMESA
+ glWindowPos3fMESA
+ glWindowPos3fvMESA
+ glWindowPos3iMESA
+ glWindowPos3ivMESA
+ glWindowPos3sMESA
+ glWindowPos3svMESA
+ glWindowPos4dMESA
+ glWindowPos4dvMESA
+ glWindowPos4fMESA
+ glWindowPos4fvMESA
+ glWindowPos4iMESA
+ glWindowPos4ivMESA
+ glWindowPos4sMESA
+ glWindowPos4svMESA
+; WMesaCreateContext
+; WMesaDestroyContext
+; WMesaMakeCurrent
+; WMesaPaletteChange
+; WMesaSwapBuffers
+; OSMesaCreateContext
+; OSMesaDestroyContext
+; OSMesaMakeCurrent
+; OSMesaGetCurrentContext
+; OSMesaPixelStore
+; OSMesaGetIntegerv
+; OSMesaGetDepthBuffer
+ wglCopyContext
+ wglCreateContext
+ wglCreateLayerContext
+ wglDeleteContext
+; wglDescribeLayerPlane
+ wglGetCurrentContext
+ wglGetCurrentDC
+; wglGetLayerPaletteEntries
+ wglGetProcAddress
+ wglMakeCurrent
+; wglRealizeLayerPalette
+; wglSetLayerPaletteEntries
+ wglShareLists
+ wglSwapLayerBuffers
+ wglUseFontBitmapsA
+ wglUseFontBitmapsW
+ wglUseFontOutlinesA
+ wglUseFontOutlinesW
+ wglChoosePixelFormat
+ wglDescribePixelFormat
+ wglGetPixelFormat
+ wglSetPixelFormat
+ wglSwapBuffers
+
+
+
diff --git a/xc/extras/Mesa/src/D3D/WGL.C b/xc/extras/Mesa/src/D3D/WGL.C new file mode 100644 index 000000000..2d1a6a0c4 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/WGL.C @@ -0,0 +1,1262 @@ +/*===========================================================================*/
+/* */
+/* Mesa-3.0 Makefile for DirectX 6 */
+/* */
+/* By Leigh McRae */
+/* */
+/* http://www.altsoftware.com/ */
+/* */
+/* Copyright (c) 1998-1997 alt.software inc. All Rights Reserved */
+/*===========================================================================*/
+#include "D3DMesa.h"
+/*===========================================================================*/
+/* Window managment. */
+/*===========================================================================*/
+static BOOL InitOpenGL( HINSTANCE hInst );
+static BOOL TermOpenGL( HINSTANCE hInst );
+static BOOL ResizeContext( GLcontext *ctx );
+static BOOL MakeCurrent( D3DMESACONTEXT *pContext );
+static void DestroyContext( D3DMESACONTEXT *pContext );
+static BOOL UnBindWindow( D3DMESACONTEXT *pContext );
+LONG APIENTRY wglMonitorProc( HWND hwnd, UINT message, UINT wParam, LONG lParam );
+/*===========================================================================*/
+/* Mesa hooks. */
+/*===========================================================================*/
+static void SetupDDPointers( GLcontext *ctx );
+static void SetupSWDDPointers( GLcontext *ctx );
+static void SetupHWDDPointers( GLcontext *ctx );
+static void SetupNULLDDPointers( GLcontext *ctx );
+static const char *RendererString( void );
+
+/* State Management hooks. */
+static void SetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a );
+static void ClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a );
+static GLboolean SetBuffer( GLcontext *ctx, GLenum buffer );
+
+/* Window Management hooks. */
+static void GetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height );
+static void SetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h );
+static void Flush( GLcontext *ctx );
+
+/* Span rendering hooks. */
+void WSpanRGB( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgb[][3], const GLubyte mask[] );
+void WSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte rgba[][4], const GLubyte mask[] );
+void WSpanRGBAMono( const GLcontext* ctx, GLuint n, GLint x, GLint y, const GLubyte mask[] );
+void WPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte rgba[][4], const GLubyte mask[] );
+void WPixelsRGBAMono( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], const GLubyte mask[] );
+void RSpanRGBA( const GLcontext* ctx, GLuint n, GLint x, GLint y, GLubyte rgba[][4] );
+void RPixelsRGBA( const GLcontext* ctx, GLuint n, const GLint x[], const GLint y[], GLubyte rgba[][4], const GLubyte mask[] );
+GLbitfield ClearBuffers( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
+
+/* Primitve rendering hooks. */
+GLboolean RenderVertexBuffer( GLcontext *ctx, GLboolean allDone );
+void RenderOneTriangle( GLcontext *ctx, GLuint v1, GLuint v2, GLuint v3, GLuint pv );
+void RenderOneLine( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv );
+GLbitfield ClearBuffersD3D( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height );
+
+/* Texture Management hooks. */
+static void TextureBind( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj );
+static void TextureLoad( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint internalFormat, const struct gl_texture_image *image );
+static void TextureSubImage( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint internalFormat, const struct gl_texture_image *image );
+/*===========================================================================*/
+/* Global variables. */
+/*===========================================================================*/
+D3DMESACONTEXT *pD3DCurrent,
+ *pD3DDefault; /* Thin support context. */
+
+struct __extensions__ ext[] = {
+
+ { (PROC)glPolygonOffsetEXT, "glPolygonOffsetEXT" },
+ { (PROC)glBlendEquationEXT, "glBlendEquationEXT" },
+ { (PROC)glBlendColorEXT, "glBlendColorExt" },
+ { (PROC)glVertexPointerEXT, "glVertexPointerEXT" },
+ { (PROC)glNormalPointerEXT, "glNormalPointerEXT" },
+ { (PROC)glColorPointerEXT, "glColorPointerEXT" },
+ { (PROC)glIndexPointerEXT, "glIndexPointerEXT" },
+ { (PROC)glTexCoordPointerEXT, "glTexCoordPointer" },
+ { (PROC)glEdgeFlagPointerEXT, "glEdgeFlagPointerEXT" },
+ { (PROC)glGetPointervEXT, "glGetPointervEXT" },
+ { (PROC)glArrayElementEXT, "glArrayElementEXT" },
+ { (PROC)glDrawArraysEXT, "glDrawArrayEXT" },
+ { (PROC)glAreTexturesResidentEXT, "glAreTexturesResidentEXT" },
+ { (PROC)glBindTextureEXT, "glBindTextureEXT" },
+ { (PROC)glDeleteTexturesEXT, "glDeleteTexturesEXT" },
+ { (PROC)glGenTexturesEXT, "glGenTexturesEXT" },
+ { (PROC)glIsTextureEXT, "glIsTextureEXT" },
+ { (PROC)glPrioritizeTexturesEXT, "glPrioritizeTexturesEXT" },
+ { (PROC)glCopyTexSubImage3DEXT, "glCopyTexSubImage3DEXT" },
+ { (PROC)glTexImage3DEXT, "glTexImage3DEXT" },
+ { (PROC)glTexSubImage3DEXT, "glTexSubImage3DEXT" },
+};
+
+int qt_ext = sizeof(ext) / sizeof(ext[0]);
+float g_DepthScale,
+ g_MaxDepth;
+/*===========================================================================*/
+/* When a process loads this DLL we will setup the linked list for context */
+/* management and create a default context that will support the API until */
+/* the user creates and binds thier own. This THIN default context is useful*/
+/* to have around. */
+/* When the process terminates we will clean up all resources here. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY DllMain( HINSTANCE hInst, DWORD reason, LPVOID reserved )
+{
+ switch( reason )
+ {
+ case DLL_PROCESS_ATTACH:
+ return InitOpenGL( hInst );
+
+ case DLL_PROCESS_DETACH:
+ return TermOpenGL( hInst );
+ }
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* The first thing we do when this dll is hit is connect to the dll that has*/
+/* handles all the DirectX 6 rendering. I decided to use another dll as DX6 */
+/* is all C++ and Mesa-3.0 is C (thats a good thing). This way I can write */
+/* the DX6 in C++ and Mesa-3.0 in C without having to worry about linkage. */
+/* I feel this is easy and better then using static wrappers as it is likely */
+/* faster and it allows me to just develope the one without compiling the */
+/* other. */
+/* NOTE that at this point we don't have much other than a very thin context*/
+/* that will support the API calls only to the point of not causing the app */
+/* to crash from the API table being empty. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+static BOOL InitOpenGL( HINSTANCE hInst )
+{
+ /* Allocate and clear the default context. */
+ pD3DDefault = (PD3DMESACONTEXT)ALLOC( sizeof(D3DMESACONTEXT) );
+ if ( pD3DDefault == NULL )
+ return FALSE;
+ memset( pD3DDefault, 0, sizeof(D3DMESACONTEXT) );
+
+ /* Clear the D3D vertex buffer so that values not used will be zero. This */
+ /* save me from some redundant work. */
+ memset( &D3DTLVertices, 0, sizeof(D3DTLVertices) );
+
+ /* Update the link. We uses a circular list so that it is easy to */
+ /* add and search. This context will also be used for head and tail.*/
+ pD3DDefault->next = pD3DDefault;
+
+ /*========================================================================*/
+ /* Do all core Mesa stuff. */
+ /*========================================================================*/
+ pD3DDefault->gl_visual = gl_create_visual( TRUE,
+ GL_FALSE, /* software alpha */
+ FALSE, /* db_flag */
+ GL_FALSE, /* stereo */
+ 16, /* depth_bits */
+ 8, /* stencil_bits */
+ 8, /* accum_bits */
+ 0, /* index bits */
+ 8,8,8,8 ); /* r, g, b, a bits */
+
+ if ( pD3DDefault->gl_visual == NULL)
+ {
+ FREE( pD3DDefault );
+ return FALSE;
+ }
+
+ /* Allocate a new Mesa context */
+ pD3DDefault->gl_ctx = gl_create_context( pD3DDefault->gl_visual, NULL, pD3DDefault, GL_TRUE );
+ if ( pD3DDefault->gl_ctx == NULL )
+ {
+ gl_destroy_visual( pD3DDefault->gl_visual );
+ FREE( pD3DDefault );
+ return FALSE;
+ }
+
+ /* Allocate a new Mesa frame buffer */
+ pD3DDefault->gl_buffer = gl_create_framebuffer( pD3DDefault->gl_visual );
+ if ( pD3DDefault->gl_buffer == NULL )
+ {
+ gl_destroy_visual( pD3DDefault->gl_visual );
+ gl_destroy_context( pD3DDefault->gl_ctx );
+ FREE( pD3DDefault );
+ return FALSE;
+ }
+ SetupDDPointers( pD3DDefault->gl_ctx );
+ gl_make_current( pD3DDefault->gl_ctx, pD3DDefault->gl_buffer );
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This function will create a new D3D context but will not create the D3D */
+/* surfaces or even an instance of D3D (see at GetBufferSize). The only stuff*/
+/* done here is the internal Mesa stuff and some Win32 handles. */
+/*===========================================================================*/
+/* RETURN: casted pointer to the context, NULL. */
+/*===========================================================================*/
+HGLRC APIENTRY wglCreateContext( HDC hdc )
+{
+ D3DMESACONTEXT *pNewContext;
+ DWORD dwCoopFlags = DDSCL_NORMAL;
+ RECT rectClient;
+ POINT pt;
+
+ /* ALLOC and clear the new context. */
+ pNewContext = (PD3DMESACONTEXT)ALLOC( sizeof(D3DMESACONTEXT) );
+ if ( pNewContext == NULL )
+ {
+ SetLastError( 0 );
+ return (HGLRC)NULL;
+ }
+ memset( pNewContext, 0, sizeof(D3DMESACONTEXT) );
+
+ /*========================================================================*/
+ /* Do all core Mesa stuff. */
+ /*========================================================================*/
+
+ /* TODO: support more then one visual. */
+ pNewContext->gl_visual = gl_create_visual( TRUE,
+ GL_TRUE, /* software alpha */
+ TRUE, /* db_flag */
+ GL_FALSE, /* stereo */
+ 16, /* depth_bits */
+ 8, /* stencil_bits */
+ 8, /* accum_bits */
+ 0, /* index bits */
+ 8,8,8,8 ); /* r, g, b, a bits */
+ if ( pNewContext->gl_visual == NULL)
+ {
+ FREE( pNewContext );
+ SetLastError( 0 );
+ return (HGLRC)NULL;
+ }
+
+ /* Allocate a new Mesa context */
+ pNewContext->gl_ctx = gl_create_context( pNewContext->gl_visual, NULL, pNewContext, GL_TRUE );
+ if ( pNewContext->gl_ctx == NULL )
+ {
+ gl_destroy_visual( pNewContext->gl_visual );
+ FREE( pNewContext );
+ SetLastError( 0 );
+ return (HGLRC)NULL;
+ }
+
+ /* Allocate a new Mesa frame buffer */
+ pNewContext->gl_buffer = gl_create_framebuffer( pNewContext->gl_visual );
+ if ( pNewContext->gl_buffer == NULL )
+ {
+ gl_destroy_visual( pNewContext->gl_visual );
+ gl_destroy_context( pNewContext->gl_ctx );
+ FREE( pNewContext );
+ SetLastError( 0 );
+ return (HGLRC)NULL;
+ }
+
+ /*========================================================================*/
+ /* Do all the driver stuff. */
+ /*========================================================================*/
+ pNewContext->hdc = hdc;
+ pNewContext->next = pD3DDefault->next;
+ pD3DDefault->next = pNewContext; /* Add to circular list. */
+
+ /* Create the HAL for the new context. */
+ pNewContext->pShared = InitHAL( WindowFromDC(hdc) );
+
+ return (HGLRC)pNewContext;
+}
+/*===========================================================================*/
+/* This is a wrapper function that is supported by MakeCurrent. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglMakeCurrent( HDC hdc, HGLRC hglrc )
+{
+ return MakeCurrent((D3DMESACONTEXT *)hglrc);
+}
+/*===========================================================================*/
+/* MakeCurrent will unbind whatever context is current (if any) & then bind */
+/* the supplied context. A context that is bound has it's window proc hooked*/
+/* with the wglMonitorProc and the context pointer is saved in pD3DCurrent. */
+/* Once the context is bound we update the Mesa-3.0 hooks (SetDDPointers) and*/
+/* the viewport (Mesa-.30 and DX6). */
+/* */
+/* TODO: this function can't fail. */
+/*===========================================================================*/
+/* RETURN: TRUE */
+/*===========================================================================*/
+static BOOL MakeCurrent( D3DMESACONTEXT *pContext )
+{
+ D3DMESACONTEXT *pNext;
+
+ /*====================================================================*/
+ /* This is a special case that is a request to have no context bound. */
+ /*====================================================================*/
+ if ( pContext == NULL )
+ {
+ /* Walk the whole list. We start and end at the Default context. */
+ for( pNext = pD3DDefault->next; pNext != pD3DDefault; pNext = pNext->next )
+ UnBindWindow( pNext );
+
+ return TRUE;
+ }
+
+ /*=================================================*/
+ /* Make for a fast redundant use of this function. */
+ /*=================================================*/
+ if ( pD3DCurrent == pContext )
+ return TRUE;
+
+ /*=============================*/
+ /* Unbind the current context. */
+ /*=============================*/
+ UnBindWindow( pD3DCurrent );
+
+ /*=====================================*/
+ /* Let Mesa-3.0 we have a new context. */
+ /*=====================================*/
+ SetupDDPointers( pContext->gl_ctx );
+ gl_make_current( pContext->gl_ctx, pContext->gl_buffer );
+
+ /* We are done so set the internal current context. */
+ if ( pContext != pD3DDefault )
+ {
+ ResizeContext( pContext->gl_ctx );
+ pContext->hOldProc = (WNDPROC)GetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC );
+ SetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC, (LONG)wglMonitorProc );
+ }
+ pD3DCurrent = pContext;
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This function will only return the current window size. I have re-done */
+/* this function so that it doesn't check the current size and react to it as*/
+/* I should be able to have all the react code in the WM_SIZE message. The */
+/* old version would check the current window size and create/resize the HAL */
+/* surfaces if they have changed. I needed to delay the creation if the */
+/* surfaces because sometimes I wouldn't have a window size so this is where */
+/* I delayed it. If you are reading this then all went ok! */
+/* The default context will return a zero sized window and I'm not sure if */
+/* this is ok at this point (TODO). */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void GetBufferSize( GLcontext *ctx, GLuint *width, GLuint *height )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ /* Fall through for the default because that is one of the uses for it. */
+ if ( pContext == pD3DDefault )
+ {
+ *width = 0;
+ *height = 0;
+ }
+ else
+ {
+ *width = pContext->pShared->dwWidth;
+ *height = pContext->pShared->dwHeight;
+ }
+}
+/*===========================================================================*/
+/* */
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static BOOL ResizeContext( GLcontext *ctx )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx,
+ *pCurrentTemp;
+ RECT rectClient;
+ POINT pt;
+ DWORD dwWidth,
+ dwHeight;
+ static BOOL bDDrawLock = FALSE;
+
+ /* Make sure we have some values. */
+ if ( (pContext->hdc == NULL ) ||
+ (pContext->pShared->hwnd != WindowFromDC(pContext->hdc)) ||
+ (pContext == pD3DDefault) )
+ return FALSE;
+
+ /* Having problems with DDraw sending resize messages before I was done. */
+ if( bDDrawLock == TRUE )
+ return FALSE;
+
+ // TODO: don't think I need this anymore.
+ pCurrentTemp = pD3DCurrent;
+ pD3DCurrent = pD3DDefault;
+ bDDrawLock = TRUE;
+
+ /* Get the current window dimentions. */
+ UpdateScreenPosHAL( pContext->pShared );
+ dwWidth = pContext->pShared->rectW.right - pContext->pShared->rectW.left;
+ dwHeight = pContext->pShared->rectW.bottom - pContext->pShared->rectW.top;
+
+ /* Is the size of the OffScreen Render different? */
+ if ( (dwWidth != pContext->pShared->dwWidth) || (dwHeight != pContext->pShared->dwHeight) )
+ {
+ /* Create all the D3D surfaces and device. */
+ CreateHAL( pContext->pShared );
+
+ /* I did this so that software rendering would still work as */
+ /* I don't need to scale the z values twice. */
+ g_DepthScale = (pContext->pShared->bHardware) ? 1.0 : ((float)0x00FFFFFF);
+ g_MaxDepth = (pContext->pShared->bHardware) ? 1.0 : ((float)0x00FFFFFF);
+ gl_DepthRange( pContext->gl_ctx, ctx->Viewport.Near, ctx->Viewport.Far );
+
+ /* Make sure we have a viewport. */
+ gl_Viewport( pContext->gl_ctx, 0, 0, dwWidth, dwHeight );
+
+ /* Update Mesa as we might have changed from SW <-> HW. */
+ SetupDDPointers( pContext->gl_ctx );
+ gl_make_current( pContext->gl_ctx, pContext->gl_buffer );
+
+ /* If we are in HW we need to load the current texture if there is one already. */
+ // if ( (ctx->Texture.Set[ctx->Texture.CurrentSet].Current != NULL) &&
+ // (pContext->pShared->bHardware == TRUE) )
+ // {
+ // CreateTMgrHAL( pContext->pShared,
+ // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Name,
+ // 0,
+ // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Format,
+ // (RECT *)NULL,
+ // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Width,
+ // ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Height,
+ // TM_ACTION_BIND,
+ // (void *)ctx->Texture.Set[ctx->Texture.CurrentSet].Current->Image[0]->Data );
+ // }
+ }
+
+ // TODO: don't think I need this anymore.
+ pD3DCurrent = pCurrentTemp;
+ bDDrawLock = FALSE;
+
+ return TRUE;
+}
+
+/*===========================================================================*
+/* This function will Blt the render buffer to the PRIMARY surface. I repeat*/
+/* this code for the other SwapBuffer like functions and the flush (didn't */
+/* want the function calling overhead). Thsi could have been a macro... */
+/* */
+/* TODO: there are some problems with viewport/scissoring. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglSwapBuffers( HDC hdc )
+{
+ /* Fall through for the default because that is one of the uses for it. */
+ if ( pD3DCurrent == pD3DDefault )
+ return FALSE;
+
+ SwapBuffersHAL( pD3DCurrent->pShared );
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* Same as wglSwapBuffers. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY SwapBuffers( HDC hdc )
+{
+ /* Fall through for the default because that is one of the uses for it. */
+ if ( pD3DCurrent == pD3DDefault )
+ return FALSE;
+
+ SwapBuffersHAL( pD3DCurrent->pShared );
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This should be ok as none of the SwapBuffers will cause a redundant Blt */
+/* as none of my Swap functions will call flush. This should also allow */
+/* sinlge buffered applications to work (not really worried though). Some */
+/* applications may flush then swap but then this is there fault IMHO. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void Flush( GLcontext *ctx )
+{
+ /* Fall through for the default because that is one of the uses for it. */
+ if ( pD3DCurrent == pD3DDefault )
+ return;
+
+ SwapBuffersHAL( pD3DCurrent->pShared );
+}
+/*===========================================================================*/
+/* For now this function will ignore the supplied PF. If I'm going to allow */
+/* the user to choice the mode and device at startup I'm going to have to do */
+/* something different. */
+/* */
+/* TODO: use the linked list of modes to build a pixel format to be returned */
+/* to the caller. */
+/*===========================================================================*/
+/* RETURN: 1. */
+/*===========================================================================*/
+int APIENTRY wglChoosePixelFormat( HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd )
+{
+ return 1;
+}
+/*===========================================================================*/
+/* See wglChoosePixelFormat. */
+/*===========================================================================*/
+/* RETURN: 1. */
+/*===========================================================================*/
+int APIENTRY ChoosePixelFormat( HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd )
+{
+ return wglChoosePixelFormat(hdc,ppfd);
+}
+/*===========================================================================*/
+/* This function (for now) returns a static PF everytime. This is just to */
+/* allow things to continue. */
+/*===========================================================================*/
+/* RETURN: 1. */
+/*===========================================================================*/
+int APIENTRY wglDescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd )
+{
+ static PIXELFORMATDESCRIPTOR pfd =
+ {
+ sizeof(PIXELFORMATDESCRIPTOR), /* size */
+ 1, /* version */
+ PFD_SUPPORT_OPENGL |
+ PFD_DRAW_TO_WINDOW |
+ PFD_DOUBLEBUFFER, /* support double-buffering */
+ PFD_TYPE_RGBA, /* color type */
+ 16, /* prefered color depth */
+ 0, 0, 0, 0, 0, 0, /* color bits (ignored) */
+ 0, /* no alpha buffer */
+ 0, /* alpha bits (ignored) */
+ 0, /* no accumulation buffer */
+ 0, 0, 0, 0, /* accum bits (ignored) */
+ 16, /* depth buffer */
+ 0, /* no stencil buffer */
+ 0, /* no auxiliary buffers */
+ PFD_MAIN_PLANE, /* main layer */
+ 0, /* reserved */
+ 0, 0, 0, /* no layer, visible, damage masks */
+ };
+
+ /* Return the address of this static PF if one was requested. */
+ if ( ppfd != NULL )
+ memcpy( ppfd, &pfd, sizeof(PIXELFORMATDESCRIPTOR) );
+
+ return 1;
+}
+/*===========================================================================*/
+/* See wglDescribePixelFormat. */
+/*===========================================================================*/
+/* RETURN: 1. */
+/*===========================================================================*/
+int APIENTRY DescribePixelFormat( HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd )
+{
+ return wglDescribePixelFormat(hdc,iPixelFormat,nBytes,ppfd);
+}
+/*===========================================================================*/
+/* This function will always return 1 for now. Just to allow for support. */
+/*===========================================================================*/
+/* RETURN: 1. */
+/*===========================================================================*/
+int APIENTRY wglGetPixelFormat( HDC hdc )
+{
+ return 1;
+}
+/*===========================================================================*/
+/* See wglGetPixelFormat. */
+/*===========================================================================*/
+/* RETURN: 1. */
+/*===========================================================================*/
+int APIENTRY GetPixelFormat( HDC hdc )
+{
+ return wglGetPixelFormat(hdc);
+}
+/*===========================================================================*/
+/* This will aways work for now. */
+/*===========================================================================*/
+/* RETURN: TRUE. */
+/*===========================================================================*/
+BOOL APIENTRY wglSetPixelFormat( HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd )
+{
+ return TRUE;
+}
+/*===========================================================================*/
+/* See wglSetPixelFormat. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY SetPixelFormat( HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd )
+{
+ return wglSetPixelFormat(hdc,iPixelFormat,ppfd);
+}
+/*===========================================================================*/
+/* This is a wrapper function that is supported by my own internal function.*/
+/* that takes my own D3D Mesa context structure. This so I can reuse the */
+/* function (no need for speed). */
+/*===========================================================================*/
+/* RETURN: TRUE. */
+/*===========================================================================*/
+BOOL APIENTRY wglDeleteContext( HGLRC hglrc )
+{
+ DestroyContext( (D3DMESACONTEXT *)hglrc );
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* Simple getter function that uses a cast. */
+/*===========================================================================*/
+/* RETURN: casted pointer to the context, NULL. */
+/*===========================================================================*/
+HGLRC APIENTRY wglGetCurrentContext( VOID )
+{
+ return (pD3DCurrent) ? (HGLRC)pD3DCurrent : (HGLRC)NULL;
+}
+/*===========================================================================*/
+/* No support. */
+/*===========================================================================*/
+/* RETURN: FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask )
+{
+ SetLastError( 0 );
+ return FALSE;
+}
+/*===========================================================================*/
+/* No support. */
+/*===========================================================================*/
+/* RETURN: NULL. */
+/*===========================================================================*/
+HGLRC APIENTRY wglCreateLayerContext( HDC hdc,int iLayerPlane )
+{
+ SetLastError( 0 );
+ return (HGLRC)NULL;
+}
+/*===========================================================================*/
+/* Simple getter function. */
+/*===========================================================================*/
+/* RETURN: FALSE. */
+/*===========================================================================*/
+HDC APIENTRY wglGetCurrentDC( VOID )
+{
+ return (pD3DCurrent) ? pD3DCurrent->hdc : (HDC)NULL;
+}
+/*===========================================================================*/
+/* Simply call that searches the supported extensions for a match & returns */
+/* the pointer to the function that lends support. */
+/*===========================================================================*/
+/* RETURN: pointer to API call, NULL. */
+/*===========================================================================*/
+PROC APIENTRY wglGetProcAddress( LPCSTR lpszProc )
+{
+ int index;
+
+ for( index = 0; index < qt_ext; index++ )
+ if( !strcmp(lpszProc,ext[index].name) )
+ return ext[index].proc;
+
+ SetLastError( 0 );
+ return NULL;
+}
+/*===========================================================================*/
+/* No support. */
+/*===========================================================================*/
+/* RETURN: FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglShareLists( HGLRC hglrc1, HGLRC hglrc2 )
+{
+ SetLastError( 0 );
+ return FALSE;
+}
+/*===========================================================================*/
+/* No support. */
+/*===========================================================================*/
+/* RETURN: FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglUseFontBitmaps( HDC fontDevice, DWORD firstChar, DWORD numChars, DWORD listBase )
+{
+ SetLastError( 0 );
+ return FALSE;
+}
+/*===========================================================================*/
+/* No support. */
+/*===========================================================================*/
+/* RETURN: FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglUseFontBitmapsW( HDC hdc,DWORD first,DWORD count,DWORD listBase )
+{
+ SetLastError( 0 );
+ return FALSE;
+}
+/*===========================================================================*/
+/* No support. */
+/*===========================================================================*/
+/* RETURN: FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglUseFontOutlinesA( HDC hdc, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf )
+{
+ SetLastError( 0 );
+ return FALSE;
+}
+/*===========================================================================*/
+/* No support. */
+/*===========================================================================*/
+/* RETURN: FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglUseFontOutlinesW( HDC hdc,DWORD first,DWORD count, DWORD listBase,FLOAT deviation, FLOAT extrusion,int format, LPGLYPHMETRICSFLOAT lpgmf )
+{
+ SetLastError( 0 );
+ return FALSE ;
+}
+/*===========================================================================*/
+/* No support. */
+/*===========================================================================*/
+/* RETURN: FALSE. */
+/*===========================================================================*/
+BOOL APIENTRY wglSwapLayerBuffers( HDC hdc, UINT fuPlanes )
+{
+ SetLastError( 0 );
+ return FALSE;
+}
+/*===========================================================================*/
+/* This function will be hooked into the window that has been bound. Right */
+/* now it is used to track the window size and position. Also the we clean */
+/* up the currrent context when the window is close/destroyed. */
+/* */
+/* TODO: there might be something wrong here as some games (Heretic II) don't*/
+/* track the window quit right. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+LONG APIENTRY wglMonitorProc( HWND hwnd, UINT message, UINT wParam, LONG lParam )
+{
+ WNDPROC hOldProc;
+ GLint width,
+ height;
+
+ switch( message )
+ {
+// case WM_PAINT:
+// break;
+// case WM_ACTIVATE:
+// break;
+// case WM_SHOWWINDOW:
+// break;
+
+ case UM_FATALSHUTDOWN:
+ /* Support the API until we die... */
+ MakeCurrent( pD3DDefault );
+ break;
+
+ case WM_MOVE:
+ case WM_DISPLAYCHANGE:
+ case WM_SIZE:
+ ResizeContext( pD3DCurrent->gl_ctx );
+ break;
+
+ case WM_CLOSE:
+ case WM_DESTROY:
+ /* Support the API until we die... */
+ hOldProc = pD3DCurrent->hOldProc;
+ DestroyContext( pD3DCurrent );
+ return (hOldProc)(hwnd,message,wParam,lParam);
+ }
+
+ return (pD3DCurrent->hOldProc)(hwnd,message,wParam,lParam);
+}
+
+/**********************************************************************/
+/***** Miscellaneous device driver funcs *****/
+/**********************************************************************/
+
+/*===========================================================================*/
+/* Not reacting to this as I'm only supporting drawing to the back buffer */
+/* right now. */
+/*===========================================================================*/
+/* RETURN: TRUE. */
+/*===========================================================================*/
+static GLboolean SetBuffer( GLcontext *ctx, GLenum buffer )
+{
+ if (buffer == GL_BACK_LEFT)
+ return GL_TRUE;
+ else
+ return GL_FALSE;
+}
+/*===========================================================================*/
+/* This proc will be called by Mesa when the viewport has been set. So if */
+/* we have a context and it isn't the default then we should let D3D know of */
+/* the change. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void SetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ RECT rect;
+
+ /* Make sure we can set a viewport. */
+ if ( pContext->pShared && (pContext != pD3DDefault) )
+ {
+ // TODO: might be needed.
+ UpdateScreenPosHAL( pContext->pShared );
+ rect.left = x;
+ rect.right = x + w;
+ rect.top = y;
+ rect.bottom = y + h;
+
+ // TODO: shared struct should make this call smaller
+ SetViewportHAL( pContext->pShared, &rect, 0.0F, 1.0F );
+ }
+}
+/*===========================================================================*/
+/* This function could be better I guess but I decided just to grab the four*/
+/* components and store then seperately. Makes it easier to use IMHO. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void ClearColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ pContext->aClear = a;
+ pContext->bClear = b;
+ pContext->gClear = g;
+ pContext->rClear = r;
+}
+/*===========================================================================*/
+/* This function could be better I guess but I decided just to grab the four*/
+/* components and store then seperately. Makes it easier to use IMHO. */
+/* (is there an echo in here?) */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void SetColor( GLcontext *ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ pContext->aCurrent = a;
+ pContext->bCurrent = b;
+ pContext->gCurrent = g;
+ pContext->rCurrent = r;
+}
+/*===========================================================================*/
+/* */
+/* */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static const char *RendererString( void )
+{
+ static char pszRender[64];
+
+ strcpy( pszRender, "altD3D " );
+
+ if ( pD3DCurrent->pShared->bHardware )
+ strcat( pszRender, "(HW)");
+ else
+ strcat( pszRender, "(SW)");
+
+ return (const char *)pszRender;
+}
+/*===========================================================================*/
+/* This function will choose which set of pointers Mesa will use based on */
+/* whether we hard using hardware or software. I have added another set of */
+/* pointers that will do nothing but stop the API from crashing. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void SetupDDPointers( GLcontext *ctx )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ // TODO: write a generic NULL support for the span render.
+ if ( pContext->pShared && pContext->pShared->bHardware )
+ {
+ ctx->Driver.UpdateState = SetupHWDDPointers;
+ }
+ else if ( pContext == pD3DDefault )
+ {
+ ctx->Driver.UpdateState = SetupNULLDDPointers;
+ }
+ else
+ {
+ ctx->Driver.UpdateState = SetupSWDDPointers;
+ }
+}
+/*===========================================================================*/
+/* This function will populate all the Mesa driver hooks. This version of */
+/* hooks will do nothing but support the API when we don't have a valid */
+/* context bound. This is mostly for applications that don't behave right */
+/* and also to help exit as clean as possable when we have a FatalError. */
+/*===========================================================================*/
+/* RETURN: pointer to the specific function. */
+/*===========================================================================*/
+static void SetupNULLDDPointers( GLcontext *ctx )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ /* Initialize all the pointers in the DD struct. Do this whenever */
+ /* a new context is made current or we change buffers via set_buffer! */
+ ctx->Driver.UpdateState = SetupNULLDDPointers;
+
+ /* State management hooks. */
+ ctx->Driver.Color = NULLSetColor;
+ ctx->Driver.ClearColor = NULLClearColor;
+ ctx->Driver.Clear = NULLClearBuffers;
+ ctx->Driver.SetBuffer = NULLSetBuffer;
+
+ /* Window management hooks. */
+ ctx->Driver.GetBufferSize = NULLGetBufferSize;
+
+ /* Primitive rendering hooks. */
+ ctx->Driver.TriangleFunc = NULL;
+ ctx->Driver.RenderVB = NULL;
+
+ /* Pixel/span writing functions: */
+ ctx->Driver.WriteRGBASpan = NULLWrSpRGBA;
+ ctx->Driver.WriteRGBSpan = NULLWrSpRGB;
+ ctx->Driver.WriteMonoRGBASpan = NULLWrSpRGBAMono;
+ ctx->Driver.WriteRGBAPixels = NULLWrPiRGBA;
+ ctx->Driver.WriteMonoRGBAPixels = NULLWrPiRGBAMono;
+
+ /* Pixel/span reading functions: */
+ ctx->Driver.ReadRGBASpan = NULLReSpRGBA;
+ ctx->Driver.ReadRGBAPixels = NULLRePiRGBA;
+
+ /* Misc. hooks. */
+ ctx->Driver.RendererString = RendererString;
+}
+/*===========================================================================*/
+/* This function will populate all the Mesa driver hooks. There are two of */
+/* these functions. One if we have hardware support and one is there is only*/
+/* software. These functions will be called by Mesa and by the wgl.c when we*/
+/* have resized (or created) the buffers. The thing is that if a window gets*/
+/* resized we may loose hardware support or gain it... */
+/*===========================================================================*/
+/* RETURN: pointer to the specific function. */
+/*===========================================================================*/
+static void SetupSWDDPointers( GLcontext *ctx )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ /* Initialize all the pointers in the DD struct. Do this whenever */
+ /* a new context is made current or we change buffers via set_buffer! */
+ ctx->Driver.UpdateState = SetupSWDDPointers;
+
+ /* State management hooks. */
+ ctx->Driver.Color = SetColor;
+ ctx->Driver.ClearColor = ClearColor;
+ ctx->Driver.Clear = ClearBuffers;
+ ctx->Driver.SetBuffer = SetBuffer;
+
+ /* Window management hooks. */
+ ctx->Driver.GetBufferSize = GetBufferSize;
+ ctx->Driver.Viewport = SetViewport;
+
+ /* Primitive rendering hooks. */
+ ctx->Driver.TriangleFunc = NULL;
+ ctx->Driver.RenderVB = NULL;
+
+ /* Texture management hooks. */
+
+ /* Pixel/span writing functions: */
+ ctx->Driver.WriteRGBASpan = WSpanRGBA;
+ ctx->Driver.WriteRGBSpan = WSpanRGB;
+ ctx->Driver.WriteMonoRGBASpan = WSpanRGBAMono;
+ ctx->Driver.WriteRGBAPixels = WPixelsRGBA;
+ ctx->Driver.WriteMonoRGBAPixels = WPixelsRGBAMono;
+
+ /* Pixel/span reading functions: */
+ ctx->Driver.ReadRGBASpan = RSpanRGBA;
+ ctx->Driver.ReadRGBAPixels = RPixelsRGBA;
+
+ /* Misc. hooks. */
+ ctx->Driver.Flush = Flush;
+ ctx->Driver.RendererString = RendererString;
+}
+/*===========================================================================*/
+/* This function will populate all the Mesa driver hooks. There are two of */
+/* these functions. One if we have hardware support and one is there is only*/
+/* software. These functions will be called by Mesa and by the wgl.c when we*/
+/* have resized (or created) the buffers. The thing is that if a window gets*/
+/* resized we may loose hardware support or gain it... */
+/*===========================================================================*/
+/* RETURN: pointer to the specific function. */
+/*===========================================================================*/
+static void SetupHWDDPointers( GLcontext *ctx )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ /* Initialize all the pointers in the DD struct. Do this whenever */
+ /* a new context is made current or we change buffers via set_buffer! */
+ ctx->Driver.UpdateState = SetupHWDDPointers;
+
+ /* State management hooks. */
+ ctx->Driver.Color = SetColor;
+ ctx->Driver.ClearColor = ClearColor;
+ ctx->Driver.Clear = ClearBuffersD3D;
+ ctx->Driver.SetBuffer = SetBuffer;
+
+ /* Window management hooks. */
+ ctx->Driver.GetBufferSize = GetBufferSize;
+ ctx->Driver.Viewport = SetViewport;
+
+ /* Primitive rendering hooks. */
+ ctx->Driver.TriangleFunc = RenderOneTriangle;
+ ctx->Driver.LineFunc = RenderOneLine;
+ ctx->Driver.RenderVB = RenderVertexBuffer;
+
+ /* Pixel/span writing functions: */
+ ctx->Driver.WriteRGBASpan = WSpanRGBA;
+ ctx->Driver.WriteRGBSpan = WSpanRGB;
+ ctx->Driver.WriteMonoRGBASpan = WSpanRGBAMono;
+ ctx->Driver.WriteRGBAPixels = WPixelsRGBA;
+ ctx->Driver.WriteMonoRGBAPixels = WPixelsRGBAMono;
+
+ /* Pixel/span reading functions: */
+ ctx->Driver.ReadRGBASpan = RSpanRGBA;
+ ctx->Driver.ReadRGBAPixels = RPixelsRGBA;
+
+ /* Texture management hooks. */
+ // ctx->Driver.BindTexture = TextureBind;
+ ctx->Driver.TexImage = TextureLoad;
+ ctx->Driver.TexSubImage = TextureSubImage;
+
+ /* Misc. hooks. */
+ ctx->Driver.Flush = Flush;
+ ctx->Driver.RendererString = RendererString;
+}
+/*===========================================================================*/
+/* This function will release all resources used by the DLL. Every context */
+/* will be clobbered by releaseing all driver desources and then freeing the */
+/* context memory. Most all the work is done in DestroyContext. */
+/*===========================================================================*/
+/* RETURN: TRUE. */
+/*===========================================================================*/
+static BOOL TermOpenGL( HINSTANCE hInst )
+{
+ D3DMESACONTEXT *pTmp,
+ *pNext;
+
+ /* Just incase we are still getting paint msg. */
+ MakeCurrent( pD3DDefault );
+
+ /* Walk the list until we get back to the default context. */
+ for( pTmp = pD3DDefault->next; pTmp != pD3DDefault; pTmp = pNext )
+ {
+ pNext = pTmp->next;
+ DestroyContext( pTmp );
+ }
+ DestroyContext( pD3DDefault );
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* This function is an internal function that will clean up all the Mesa */
+/* context bound to this D3D context. Also any D3D stuff that this context */
+/* uses will be unloaded. */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+static void DestroyContext( D3DMESACONTEXT *pContext )
+{
+ D3DMESACONTEXT *pTmp;
+
+ /* Walk the list until we find the context before this one. */
+ for( pTmp = pD3DDefault; pTmp && (pTmp->next != pContext); pTmp = pTmp->next )
+ if ( pTmp == pTmp->next )
+ break;
+
+ /* If we never found it it must already be deleted. */
+ if ( pTmp->next != pContext )
+ return;
+
+ /* Make sure we are not using this context. */
+ if ( pContext == pD3DCurrent )
+ MakeCurrent( pD3DDefault );
+
+ /* Free the Mesa stuff. */
+ if ( pContext->gl_visual )
+ {
+ gl_destroy_visual( pContext->gl_visual );
+ pContext->gl_visual = NULL;
+ }
+ if ( pContext->gl_buffer )
+ {
+ gl_destroy_framebuffer( pContext->gl_buffer );
+ pContext->gl_buffer = NULL;
+ }
+ if ( pContext->gl_ctx )
+ {
+ gl_destroy_context( pContext->gl_ctx );
+ pContext->gl_ctx = NULL;
+ }
+
+ /* Now dump the D3D. */
+ if ( pContext->pShared )
+ TermHAL( pContext->pShared );
+
+ /* Update the previous context's link. */
+ pTmp->next = pContext->next;
+
+ /* Gonzo. */
+ FREE( pContext );
+}
+/*===========================================================================*/
+/* This function will pull the supplied context away from Win32. Basicly it*/
+/* will remove the hook from the window Proc. */
+/* */
+/* TODO: might want to serialize this stuff... */
+/*===========================================================================*/
+/* RETURN: TRUE, FALSE. */
+/*===========================================================================*/
+static BOOL UnBindWindow( D3DMESACONTEXT *pContext )
+{
+ if ( pContext == NULL )
+ return FALSE;
+
+ if ( pContext == pD3DDefault )
+ return TRUE;
+
+ /* Make sure we always have a context bound. */
+ if ( pContext == pD3DCurrent )
+ pD3DCurrent = pD3DDefault;
+
+ SetWindowLong( pContext->pShared->hwnd, GWL_WNDPROC, (LONG)pContext->hOldProc );
+ pContext->hOldProc = NULL;
+
+ return TRUE;
+}
+/*===========================================================================*/
+/* There are two cases that allow for a faster clear when we know that the */
+/* whole buffer is cleared and that there is no clipping. */
+/*===========================================================================*/
+/* RETURN: the original mask with the bits cleared that represents the buffer*
+/* or buffers we just cleared. */
+/*===========================================================================*/
+GLbitfield ClearBuffersD3D( GLcontext *ctx, GLbitfield mask, GLboolean all, GLint x, GLint y, GLint width, GLint height )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ DWORD dwFlags = 0;
+
+ if ( mask & GL_COLOR_BUFFER_BIT )
+ {
+ dwFlags |= D3DCLEAR_TARGET;
+ mask &= ~GL_COLOR_BUFFER_BIT;
+ }
+ if ( mask & GL_DEPTH_BUFFER_BIT )
+ {
+ dwFlags |= D3DCLEAR_ZBUFFER;
+ mask &= ~GL_DEPTH_BUFFER_BIT;
+ }
+ if ( dwFlags == 0 )
+ return mask;
+
+ ClearHAL( pContext->pShared,
+ dwFlags,
+ all,
+ x, y,
+ width, height,
+ ((pContext->aClear<<24) | (pContext->rClear<<16) | (pContext->gClear<<8) | (pContext->bClear)),
+ ctx->Depth.Clear,
+ 0 );
+
+ return mask;
+}
+
+
+
+/*===========================================================================*/
+/* TEXTURE MANAGER: ok here is how I did textures. Mesa-3.0 will keep track*/
+/* of all the textures for us. So this means that at anytime we can go to */
+/* the Mesa context and get the current texture. With this in mind this is */
+/* what I did. I really don't care about what textures get or are loaded */
+/* until I actually have to draw a tri that is textured. At this point I */
+/* must have the texture so I demand the texture by destorying all other */
+/* texture surfaces if need be and load the current one. This allows for the*/
+/* best preformance on low memory cards as time is not wasted loading and */
+/* unload textures. */
+/*===========================================================================*/
+
+
+
+
+
+/*===========================================================================*/
+/* TextureLoad will try and create a D3D surface from the supplied texture */
+/* object if its level 0 (first). The surface will be fully filled with the */
+/* texture. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void TextureLoad( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint internalFormat, const struct gl_texture_image *image )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ /* TODO: only doing first LOD. */
+ if ( (ctx->DriverCtx == NULL) || (level != 0) )
+ return;
+
+ CreateTMgrHAL( pContext->pShared,
+ tObj->Name,
+ level,
+ tObj->Image[level]->Format,
+ (RECT *)NULL,
+ tObj->Image[level]->Width,
+ tObj->Image[level]->Height,
+ TM_ACTION_LOAD,
+ (void *)tObj->Image[level]->Data );
+}
+/*===========================================================================*/
+/* TextureBind make sure that the texture is on the card. Thats it. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void TextureBind( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+
+ /* TODO: only doing first LOD. */
+ if ( (tObj->Image[0] == NULL) || (ctx->DriverCtx == NULL) )
+ return;
+
+ CreateTMgrHAL( pContext->pShared,
+ tObj->Name,
+ 0,
+ tObj->Image[0]->Format,
+ (RECT *)NULL,
+ tObj->Image[0]->Width,
+ tObj->Image[0]->Height,
+ TM_ACTION_BIND,
+ (void *)tObj->Image[0]->Data );
+}
+/*===========================================================================*/
+/* TextureSubImage will make sure that the texture being updated is updated */
+/* if its on the card. */
+/*===========================================================================*/
+/* RETURN: */
+/*===========================================================================*/
+static void TextureSubImage( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLint internalFormat, const struct gl_texture_image *image )
+{
+ D3DMESACONTEXT *pContext = (D3DMESACONTEXT *)ctx->DriverCtx;
+ RECT rect;
+
+ /* TODO: only doing first LOD. */
+ if ( (ctx->DriverCtx == NULL) || (level > 0) )
+ return;
+
+ /* Create a dirty rectangle structure. */
+ rect.left = xoffset;
+ rect.right = xoffset + width;
+ rect.top = yoffset;
+ rect.bottom = yoffset + height;
+
+ CreateTMgrHAL( pContext->pShared,
+ tObj->Name,
+ 0,
+ tObj->Image[0]->Format,
+ &rect,
+ tObj->Image[0]->Width,
+ tObj->Image[0]->Height,
+ TM_ACTION_UPDATE,
+ (void *)tObj->Image[0]->Data );
+}
+
diff --git a/xc/extras/Mesa/src/D3D/d3dText.h b/xc/extras/Mesa/src/D3D/d3dText.h new file mode 100644 index 000000000..9ff065051 --- /dev/null +++ b/xc/extras/Mesa/src/D3D/d3dText.h @@ -0,0 +1,53 @@ +#ifndef D3D_TEXT_H +#define D3D_TEXT_H + + +#ifdef __cplusplus +extern "C" { +#endif + +/*===========================================================================*/ +/* Includes. */ +/*===========================================================================*/ +#include <windows.h> +#include <ddraw.h> +#include <d3d.h> +/*===========================================================================*/ +/* Magic numbers. */ +/*===========================================================================*/ +#define D3DLTEXT_BITSUSED 0xFFFFFFFF +#define MAX_VERTICES 700 // (14*40) 14 per character, 40 characters +/*===========================================================================*/ +/* Macros defines. */ +/*===========================================================================*/ +/*===========================================================================*/ +/* Type defines. */ +/*===========================================================================*/ +typedef struct _d3dText_metrics +{ + float fntYScale, + fntXScale; + + int fntXSpacing, + fntYSpacing; + + DWORD dwColor; + LPDIRECT3DDEVICE3 lpD3DDevice; + +} D3DFONTMETRICS, *PD3DFONTMETRICS; +/*===========================================================================*/ +/* Function prototypes. */ +/*===========================================================================*/ +extern BOOL InitD3DText( void ); +extern void d3dTextDrawCharacter( char *c, int x, int y, PD3DFONTMETRICS pfntMetrics ); +extern void d3dTextDrawString( char *pszString, int x, int y, PD3DFONTMETRICS pfntMetrics ); +/*===========================================================================*/ +/* Global variables. */ +/*===========================================================================*/ + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/xc/extras/Mesa/src/FX/Makefile.am b/xc/extras/Mesa/src/FX/Makefile.am new file mode 100644 index 000000000..c852d92ec --- /dev/null +++ b/xc/extras/Mesa/src/FX/Makefile.am @@ -0,0 +1,47 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src $(FX_CFLAGS) + +if HAVE_FX +# Build a libtool convenience library. +noinst_LTLIBRARIES = libMesaFX.la +if HAVE_X86 +SUBDIRS = X86 +endif +endif + +libMesaFX_la_SOURCES = \ + fxapi.c \ + fxcva.c \ + fxcva.h \ + fxcvatmp.h \ + fxclip.c \ + fxcliptmp.h \ + fxdd.c \ + fxddspan.c \ + fxddtex.c \ + fxdrv.h \ + fxglidew.c \ + fxglidew.h \ + fxfastpath.c \ + fxfasttmp.h \ + fxpipeline.c \ + fxrender.c \ + fxrender.h \ + fxsanity.c \ + fxsetup.c \ + fxtexman.c \ + fxtrifuncs.c \ + fxtritmp.h \ + fxvs_tmp.h \ + fxvsetup.c \ + fxvsetup.h \ + fxwgl.c + + +libMesaFX_la_LIBADD = $(FX_LIBS) + +EXTRA_DIST = fxwgl.c + diff --git a/xc/extras/Mesa/src/FX/Makefile.in b/xc/extras/Mesa/src/FX/Makefile.in new file mode 100644 index 000000000..2eec49306 --- /dev/null +++ b/xc/extras/Mesa/src/FX/Makefile.in @@ -0,0 +1,405 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src $(FX_CFLAGS) + +# Build a libtool convenience library. +@HAVE_FX_TRUE@noinst_LTLIBRARIES = libMesaFX.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@SUBDIRS = X86 + +libMesaFX_la_SOURCES = fxapi.c fxcva.c fxcva.h fxcvatmp.h fxclip.c fxcliptmp.h fxdd.c fxddspan.c fxddtex.c fxdrv.h fxglidew.c fxglidew.h fxfastpath.c fxfasttmp.h fxpipeline.c fxrender.c fxrender.h fxsanity.c fxsetup.c fxtexman.c fxtrifuncs.c fxtritmp.h fxvs_tmp.h fxvsetup.c fxvsetup.h fxwgl.c + + +libMesaFX_la_LIBADD = $(FX_LIBS) + +EXTRA_DIST = fxwgl.c +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../conf.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I../.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +libMesaFX_la_LDFLAGS = +libMesaFX_la_DEPENDENCIES = +libMesaFX_la_OBJECTS = fxapi.lo fxcva.lo fxclip.lo fxdd.lo fxddspan.lo \ +fxddtex.lo fxglidew.lo fxfastpath.lo fxpipeline.lo fxrender.lo \ +fxsanity.lo fxsetup.lo fxtexman.lo fxtrifuncs.lo fxvsetup.lo fxwgl.lo +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +DIST_SUBDIRS = X86 +SOURCES = $(libMesaFX_la_SOURCES) +OBJECTS = $(libMesaFX_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/FX/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLTLIBRARIES: + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + +distclean-noinstLTLIBRARIES: + +maintainer-clean-noinstLTLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libMesaFX.la: $(libMesaFX_la_OBJECTS) $(libMesaFX_la_DEPENDENCIES) + $(LINK) $(libMesaFX_la_LDFLAGS) $(libMesaFX_la_OBJECTS) $(libMesaFX_la_LIBADD) $(LIBS) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src/FX + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(DIST_SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile $(LTLIBRARIES) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ + clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-recursive + +maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + +.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ +clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/src/FX/X86/Makefile.am b/xc/extras/Mesa/src/FX/X86/Makefile.am new file mode 100644 index 000000000..cb28ae9d5 --- /dev/null +++ b/xc/extras/Mesa/src/FX/X86/Makefile.am @@ -0,0 +1,22 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src $(FX_CFLAGS) + +x3dnow_files = \ + fx_3dnow_fasttmp.h \ + fx_3dnow_fastpath.S + + +if HAVE_3DNOW +x3dnow_sources = $(x3dnow_files) +endif + +if HAVE_X86 +fx_3dnow_fastpath.lo: fx_3dnow_fastpath.S fx_3dnow_fasttmp.h + +noinst_LTLIBRARIES = libMesaFX_X86.la +endif + +libMesaFX_X86_la_SOURCES = $(x3dnow_sources) diff --git a/xc/extras/Mesa/src/FX/X86/Makefile.in b/xc/extras/Mesa/src/FX/X86/Makefile.in new file mode 100644 index 000000000..867ef41b5 --- /dev/null +++ b/xc/extras/Mesa/src/FX/X86/Makefile.in @@ -0,0 +1,327 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src $(FX_CFLAGS) + +x3dnow_files = fx_3dnow_fasttmp.h fx_3dnow_fastpath.S + + +@HAVE_3DNOW_TRUE@x3dnow_sources = $(x3dnow_files) + +@HAVE_X86_TRUE@noinst_LTLIBRARIES = libMesaFX_X86.la + +libMesaFX_X86_la_SOURCES = $(x3dnow_sources) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../../conf.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I../../.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +libMesaFX_X86_la_LDFLAGS = +libMesaFX_X86_la_LIBADD = +@HAVE_3DNOW_FALSE@libMesaFX_X86_la_OBJECTS = +@HAVE_3DNOW_TRUE@libMesaFX_X86_la_OBJECTS = fx_3dnow_fastpath.lo +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = $(libMesaFX_X86_la_SOURCES) +OBJECTS = $(libMesaFX_X86_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/FX/X86/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLTLIBRARIES: + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + +distclean-noinstLTLIBRARIES: + +maintainer-clean-noinstLTLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libMesaFX_X86.la: $(libMesaFX_X86_la_OBJECTS) $(libMesaFX_X86_la_DEPENDENCIES) + $(LINK) $(libMesaFX_X86_la_LDFLAGS) $(libMesaFX_X86_la_OBJECTS) $(libMesaFX_X86_la_LIBADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src/FX/X86 + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LTLIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ + clean-tags clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ +clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +@HAVE_X86_TRUE@fx_3dnow_fastpath.lo: fx_3dnow_fastpath.S fx_3dnow_fasttmp.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/src/FX/fxopengl.def b/xc/extras/Mesa/src/FX/fxopengl.def new file mode 100644 index 000000000..af76f4c1b --- /dev/null +++ b/xc/extras/Mesa/src/FX/fxopengl.def @@ -0,0 +1,467 @@ +EXPORTS
+ glAccum
+ glAlphaFunc
+ glAreTexturesResident
+ glArrayElement
+ glBegin
+ glBindTexture
+ glBitmap
+ glBlendFunc
+ glCallList
+ glCallLists
+ glClear
+ glClearAccum
+ glClearIndex
+ glClearColor
+ glClearDepth
+ glClearStencil
+ glClipPlane
+ glColor3b
+ glColor3d
+ glColor3f
+ glColor3i
+ glColor3s
+ glColor3ub
+ glColor3ui
+ glColor3us
+ glColor4b
+ glColor4d
+ glColor4f
+ glColor4i
+ glColor4s
+ glColor4ub
+ glColor4ui
+ glColor4us
+ glColor3bv
+ glColor3dv
+ glColor3fv
+ glColor3iv
+ glColor3sv
+ glColor3ubv
+ glColor3uiv
+ glColor3usv
+ glColor4bv
+ glColor4dv
+ glColor4fv
+ glColor4iv
+ glColor4sv
+ glColor4ubv
+ glColor4uiv
+ glColor4usv
+ glColorMask
+ glColorMaterial
+ glColorPointer
+ glColorTableEXT
+ glColorSubTableEXT
+ glCopyPixels
+ glCopyTexImage1D
+ glCopyTexImage2D
+ glCopyTexSubImage1D
+ glCopyTexSubImage2D
+ glCullFace
+ glDepthFunc
+ glDepthMask
+ glDepthRange
+ glDeleteLists
+ glDeleteTextures
+ glDisable
+ glDisableClientState
+ glDrawArrays
+ glDrawBuffer
+ glDrawElements
+ glDrawPixels
+ glEnable
+ glEnableClientState
+ glEnd
+ glEndList
+ glEvalCoord1d
+ glEvalCoord1f
+ glEvalCoord1dv
+ glEvalCoord1fv
+ glEvalCoord2d
+ glEvalCoord2f
+ glEvalCoord2dv
+ glEvalCoord2fv
+ glEvalPoint1
+ glEvalPoint2
+ glEvalMesh1
+ glEdgeFlag
+ glEdgeFlagv
+ glEdgeFlagPointer
+ glEvalMesh2
+ glFeedbackBuffer
+ glFinish
+ glFlush
+ glFogf
+ glFogi
+ glFogfv
+ glFogiv
+ glFrontFace
+ glFrustum
+ glGenLists
+ glGenTextures
+ glGetBooleanv
+ glGetClipPlane
+ glGetColorTableEXT
+ glGetColorTableParameterivEXT
+ glGetColorTableParameterfvEXT
+ glGetDoublev
+ glGetError
+ glGetFloatv
+ glGetIntegerv
+ glGetLightfv
+ glGetLightiv
+ glGetMapdv
+ glGetMapfv
+ glGetMapiv
+ glGetMaterialfv
+ glGetMaterialiv
+ glGetPixelMapfv
+ glGetPixelMapuiv
+ glGetPixelMapusv
+ glGetPointerv
+ glGetPolygonStipple
+ glGetString
+ glGetTexEnvfv
+ glGetTexEnviv
+ glGetTexGeniv
+ glGetTexGendv
+ glGetTexGenfv
+ glGetTexImage
+ glGetTexLevelParameterfv
+ glGetTexLevelParameteriv
+ glGetTexParameterfv
+ glGetTexParameteriv
+ glHint
+ glIndexd
+ glIndexf
+ glIndexi
+ glIndexs
+ glIndexub
+ glIndexdv
+ glIndexfv
+ glIndexiv
+ glIndexsv
+ glIndexubv
+ glIndexMask
+ glIndexPointer
+ glInterleavedArrays
+ glInitNames
+ glIsList
+ glIsTexture
+ glLightf
+ glLighti
+ glLightfv
+ glLightiv
+ glLightModelf
+ glLightModeli
+ glLightModelfv
+ glLightModeliv
+ glLineWidth
+ glLineStipple
+ glListBase
+ glLoadIdentity
+ glLoadMatrixd
+ glLoadMatrixf
+ glLoadName
+ glLogicOp
+ glMap1d
+ glMap1f
+ glMap2d
+ glMap2f
+ glMapGrid1d
+ glMapGrid1f
+ glMapGrid2d
+ glMapGrid2f
+ glMaterialf
+ glMateriali
+ glMaterialfv
+ glMaterialiv
+ glMatrixMode
+ glMultMatrixd
+ glMultMatrixf
+ glNewList
+ glNormal3b
+ glNormal3d
+ glNormal3f
+ glNormal3i
+ glNormal3s
+ glNormal3bv
+ glNormal3dv
+ glNormal3fv
+ glNormal3iv
+ glNormal3sv
+ glNormalPointer
+ glOrtho
+ glPassThrough
+ glPixelMapfv
+ glPixelMapuiv
+ glPixelMapusv
+ glPixelStoref
+ glPixelStorei
+ glPixelTransferf
+ glPixelTransferi
+ glPixelZoom
+ glPointSize
+ glPolygonMode
+ glPolygonOffset
+ glPolygonOffsetEXT
+ glPolygonStipple
+ glPopAttrib
+ glPopClientAttrib
+ glPopMatrix
+ glPopName
+ glPrioritizeTextures
+ glPushMatrix
+ glRasterPos2d
+ glRasterPos2f
+ glRasterPos2i
+ glRasterPos2s
+ glRasterPos3d
+ glRasterPos3f
+ glRasterPos3i
+ glRasterPos3s
+ glRasterPos4d
+ glRasterPos4f
+ glRasterPos4i
+ glRasterPos4s
+ glRasterPos2dv
+ glRasterPos2fv
+ glRasterPos2iv
+ glRasterPos2sv
+ glRasterPos3dv
+ glRasterPos3fv
+ glRasterPos3iv
+ glRasterPos3sv
+ glRasterPos4dv
+ glRasterPos4fv
+ glRasterPos4iv
+ glRasterPos4sv
+ glReadBuffer
+ glReadPixels
+ glRectd
+ glRectf
+ glRecti
+ glRects
+ glRectdv
+ glRectfv
+ glRectiv
+ glRectsv
+ glScissor
+ glIsEnabled
+ glPushAttrib
+ glPushClientAttrib
+ glPushName
+ glRenderMode
+ glRotated
+ glRotatef
+ glSelectBuffer
+ glScaled
+ glScalef
+ glShadeModel
+ glStencilFunc
+ glStencilMask
+ glStencilOp
+ glTexCoord1d
+ glTexCoord1f
+ glTexCoord1i
+ glTexCoord1s
+ glTexCoord2d
+ glTexCoord2f
+ glTexCoord2i
+ glTexCoord2s
+ glTexCoord3d
+ glTexCoord3f
+ glTexCoord3i
+ glTexCoord3s
+ glTexCoord4d
+ glTexCoord4f
+ glTexCoord4i
+ glTexCoord4s
+ glTexCoord1dv
+ glTexCoord1fv
+ glTexCoord1iv
+ glTexCoord1sv
+ glTexCoord2dv
+ glTexCoord2fv
+ glTexCoord2iv
+ glTexCoord2sv
+ glTexCoord3dv
+ glTexCoord3fv
+ glTexCoord3iv
+ glTexCoord3sv
+ glTexCoord4dv
+ glTexCoord4fv
+ glTexCoord4iv
+ glTexCoord4sv
+ glTexCoordPointer
+ glTexGend
+ glTexGenf
+ glTexGeni
+ glTexGendv
+ glTexGeniv
+ glTexGenfv
+ glTexEnvf
+ glTexEnvi
+ glTexEnvfv
+ glTexEnviv
+ glTexImage1D
+ glTexImage2D
+ glTexParameterf
+ glTexParameteri
+ glTexParameterfv
+ glTexParameteriv
+ glTexSubImage1D
+ glTexSubImage2D
+ glTranslated
+ glTranslatef
+ glVertex2d
+ glVertex2f
+ glVertex2i
+ glVertex2s
+ glVertex3d
+ glVertex3f
+ glVertex3i
+ glVertex3s
+ glVertex4d
+ glVertex4f
+ glVertex4i
+ glVertex4s
+ glVertex2dv
+ glVertex2fv
+ glVertex2iv
+ glVertex2sv
+ glVertex3dv
+ glVertex3fv
+ glVertex3iv
+ glVertex3sv
+ glVertex4dv
+ glVertex4fv
+ glVertex4iv
+ glVertex4sv
+ glVertexPointer
+ glViewport
+ glBlendEquationEXT
+ glBlendColorEXT
+ glVertexPointerEXT
+ glNormalPointerEXT
+ glColorPointerEXT
+ glIndexPointerEXT
+ glTexCoordPointerEXT
+ glEdgeFlagPointerEXT
+ glGetPointervEXT
+ glArrayElementEXT
+ glDrawArraysEXT
+ glBindTextureEXT
+ glDeleteTexturesEXT
+ glGenTexturesEXT
+ glPrioritizeTexturesEXT
+ glCopyTexSubImage3DEXT
+ glTexImage3DEXT
+ glTexSubImage3DEXT
+ glWindowPos4fMESA
+ glWindowPos2iMESA
+ glWindowPos2sMESA
+ glWindowPos2fMESA
+ glWindowPos2dMESA
+ glWindowPos2ivMESA
+ glWindowPos2svMESA
+ glWindowPos2fvMESA
+ glWindowPos2dvMESA
+ glWindowPos3iMESA
+ glWindowPos3sMESA
+ glWindowPos3fMESA
+ glWindowPos3dMESA
+ glWindowPos3ivMESA
+ glWindowPos3svMESA
+ glWindowPos3fvMESA
+ glWindowPos3dvMESA
+ glWindowPos4iMESA
+ glWindowPos4sMESA
+ glWindowPos4dMESA
+ glWindowPos4ivMESA
+ glWindowPos4svMESA
+ glWindowPos4fvMESA
+ glWindowPos4dvMESA
+ glResizeBuffersMESA
+ wglCopyContext
+ wglCreateContext
+ wglCreateLayerContext
+ wglDeleteContext
+;wglDescribeLayerPlane
+ wglGetCurrentContext
+ wglGetCurrentDC
+;wglGetLayerPaletteEntries
+ wglGetProcAddress
+ wglMakeCurrent
+;wglRealizeLayerPalette
+;wglSetLayerPaletteEntries
+ wglShareLists
+ wglSwapLayerBuffers
+ wglUseFontBitmapsA
+ wglUseFontBitmapsW
+ wglUseFontOutlinesA
+ wglUseFontOutlinesW
+ wglChoosePixelFormat
+ ChoosePixelFormat
+ wglDescribePixelFormat
+ DescribePixelFormat
+ wglGetPixelFormat
+ GetPixelFormat
+ wglSetPixelFormat
+ SetPixelFormat
+ wglSwapBuffers
+ SwapBuffers
+ gl3DfxSetPaletteEXT
+ glActiveTextureARB
+ glClientActiveTextureARB
+ glMultiTexCoord1dARB
+ glMultiTexCoord1dvARB
+ glMultiTexCoord1fARB
+ glMultiTexCoord1fvARB
+ glMultiTexCoord1iARB
+ glMultiTexCoord1ivARB
+ glMultiTexCoord1sARB
+ glMultiTexCoord1svARB
+ glMultiTexCoord2dARB
+ glMultiTexCoord2dvARB
+ glMultiTexCoord2fARB
+ glMultiTexCoord2fvARB
+ glMultiTexCoord2iARB
+ glMultiTexCoord2ivARB
+ glMultiTexCoord2sARB
+ glMultiTexCoord2svARB
+ glMultiTexCoord3dARB
+ glMultiTexCoord3dvARB
+ glMultiTexCoord3fARB
+ glMultiTexCoord3fvARB
+ glMultiTexCoord3iARB
+ glMultiTexCoord3ivARB
+ glMultiTexCoord3sARB
+ glMultiTexCoord3svARB
+ glMultiTexCoord4dARB
+ glMultiTexCoord4dvARB
+ glMultiTexCoord4fARB
+ glMultiTexCoord4fvARB
+ glMultiTexCoord4iARB
+ glMultiTexCoord4ivARB
+ glMultiTexCoord4sARB
+ glMultiTexCoord4svARB
+ fxMesaCreateContext
+ fxMesaCreateBestContext
+ fxMesaDestroyContext
+ fxMesaSelectCurrentBoard
+ fxMesaMakeCurrent
+ fxMesaGetCurrentContext
+ fxMesaSwapBuffers
+ fxMesaSetNearFar
+ fxMesaUpdateScreenSize
+ fxQueryHardware
+ fxCloseHardware
+ OSMesaCreateContext
+ OSMesaDestroyContext
+ OSMesaGetCurrentContext
+ OSMesaGetDepthBuffer
+ OSMesaGetIntegerv
+ OSMesaMakeCurrent
+ OSMesaPixelStore
diff --git a/xc/extras/Mesa/src/KNOWN_BUGS b/xc/extras/Mesa/src/KNOWN_BUGS new file mode 100644 index 000000000..f0a649d0f --- /dev/null +++ b/xc/extras/Mesa/src/KNOWN_BUGS @@ -0,0 +1,22 @@ +$Id: KNOWN_BUGS,v 1.1 2000/11/30 17:31:32 dawes Exp $ + + +Performance issues with EXT_point_parameters & quake2 + + + +Using glPolygonMode() where the front and back modes aren't the +same causes poor performance on 3Dfx. + + + +Broken drivers: some of the Mesa device drivers (such as BeOS, D3D, +etc) haven't been updated for Mesa 3.3's device driver changes. + + + +glDrawRangeElements() should use vertex array locking to improve performance +but trying to do so causes a rendering error. Reported by Scott McMillan. +Fixed by disabling locking in glDrawRangeElements (varray.c) but that's +really just hiding a bug in array locking. + diff --git a/xc/extras/Mesa/src/Makefile b/xc/extras/Mesa/src/Makefile new file mode 100644 index 000000000..107781860 --- /dev/null +++ b/xc/extras/Mesa/src/Makefile @@ -0,0 +1,805 @@ +# Generated automatically from Makefile.in by configure. +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +#AUTOMAKE_OPTIONS = no-dependencies + + +SHELL = /bin/sh + +srcdir = . +top_srcdir = .. +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man +includedir = ${prefix}/include +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/Mesa +pkglibdir = $(libdir)/Mesa +pkgincludedir = $(includedir)/Mesa + +top_builddir = .. + +ACLOCAL = aclocal +AUTOCONF = autoconf +AUTOMAKE = automake +AUTOHEADER = autoheader + +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_SCRIPT = ${INSTALL_PROGRAM} +transform = s,x,x, + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = i686-pc-linux-gnu +host_triplet = i686-pc-linux-gnu +AS = @AS@ +CC = gcc +CPP = gcc -E +DLLTOOL = @DLLTOOL@ +EXEEXT = +FX_CFLAGS = -I/usr/include/glide3 -I/usr/local/include/glide3 +FX_LIBS = -lglide3x +GGI_CFLAGS = +GGI_LIBS = +GLUT_CFLAGS = +GLUT_LIBS = -lglut +LIBGLUT_VERSION = 3:7:0 +LIBGLU_VERSION = 1:1:030300 +LIBGL_VERSION = 1:2:030300 +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LN_S = ln -s +MAKEINFO = makeinfo +OBJDUMP = @OBJDUMP@ +OBJEXT = o +PACKAGE = Mesa +RANLIB = ranlib +STRIP = strip +SVGA_CFLAGS = +SVGA_LIBS = -lvga +THREAD_LIBS = -lpthread +VERSION = 3.3b1 +X_LIBADD = -lXmu -lXext -lXi -lX11 +ggi_confdir = /usr/local/etc +ggi_libdir = /usr/local/lib + +INCLUDES = -I$(top_srcdir)/include + +# Build a libtool library for installation in libdir. +lib_LTLIBRARIES = libGL.la + +sysconf_DATA = mesa.conf + +EXTRA_DIST = ddsample.c mesa.conf + +libGL_la_LDFLAGS = -version-info $(LIBGL_VERSION) +libGL_la_SOURCES = aatriangle.c aatriangle.h accum.c accum.h all.h alpha.c alpha.h alphabuf.c alphabuf.h attrib.c attrib.h bbox.c bbox.h bitmap.c bitmap.h blend.c blend.h buffers.c buffers.h clip.c clip.h clip_funcs.h clip_tmp.h colortab.c colortab.h config.c config.h context.c context.h copy_tmp.h copypix.c copypix.h cull_tmp.h cva.c cva.h dd.h debug_xform.c debug_xform.h depth.c depth.h dispatch.c dlist.c dlist.h dotprod_tmp.h drawpix.c drawpix.h enable.c enable.h enums.c enums.h eval.c eval.h extensions.c extensions.h feedback.c feedback.h fixed.h glapi.c glapi.h glapinoop.c glapinoop.h glapioffsets.h glapitable.h glapitemp.h glthread.c glthread.h fog.c fog.h fog_tmp.h general_clip.h get.c get.h glheader.h hash.c hash.h hint.c hint.h imaging.c imaging.h image.c image.h indirect_tmp.h interp_tmp.h light.c light.h lines.c lines.h linetemp.h lnaatemp.h logic.c logic.h macros.h masking.c masking.h matrix.c matrix.h mem.c mem.h mmath.c mmath.h norm_tmp.h pb.c pb.h pipeline.c pipeline.h pixel.c pixel.h pixeltex.c pixeltex.h points.c points.h polygon.c polygon.h quads.c quads.h rastpos.c rastpos.h readpix.c readpix.h rect.c rect.h render_tmp.h scissor.c scissor.h shade.c shade.h shade_tmp.h simple_list.h span.c span.h stages.c stages.h state.c state.h stencil.c stencil.h texgen_tmp.h teximage.c teximage.h texobj.c texobj.h texstate.c texstate.h texture.c texture.h texutil.c texutil.h trans_tmp.h translate.c translate.h triangle.c triangle.h tritemp.h types.h varray.c varray.h vb.c vb.h vbcull.c vbcull.h vbfill.c vbfill.h vbindirect.c vbindirect.h vbrender.c vbrender.h vbxform.c vbxform.h vector.c vector.h vertices.c vertices.h winpos.c winpos.h xform.c xform.h xform_tmp.h zoom.c zoom.h + + +DRV_X86 = X86/libMesaX86.la +SUB_X86 = X86 + +DRV_FX = FX/libMesaFX.la +SUB_FX = FX +DRV_FX_X86 = FX/X86/libMesaFX_X86.la + +#DRV_GGI = GGI/libMesaGGI.la +#SUB_GGI = GGI + +DRV_OSMESA = OSmesa/libMesaOS.la +SUB_OSMESA = OSmesa + +DRV_SVGA = SVGA/libMesaSVGA.la +SUB_SVGA = SVGA + +DRV_X11 = X/libMesaX11.la +SUB_X11 = X + +SUBDIRS = $(SUB_X86) $(SUB_FX) $(SUB_GGI) $(SUB_OSMESA) $(SUB_SVGA) $(SUB_X11) + +libGL_la_LIBADD = $(DRV_X86) $(DRV_FX) $(DRV_FX_X86) $(DRV_GGI) $(DRV_OSMESA) $(DRV_SVGA) $(DRV_X11) $(THREAD_LIBS) + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../conf.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + + +DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I.. +CPPFLAGS = +LDFLAGS = +LIBS = +X_CFLAGS = -I/usr/X11R6/include +X_LIBS = -L/usr/X11R6/lib +X_EXTRA_LIBS = +X_PRE_LIBS = -lSM -lICE +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##FX/libMesaFX.la \ +##FX/X86/libMesaFX_X86.la \ +##GGI/libMesaGGI.la \ +##OSmesa/libMesaOS.la \ +##X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###FX/libMesaFX.la \ +###FX/X86/libMesaFX_X86.la +#####libGL_la_DEPENDENCIES = \ +#####FX/libMesaFX.la \ +#####GGI/libMesaGGI.la +###libGL_la_DEPENDENCIES = \ +###FX/libMesaFX.la \ +###OSmesa/libMesaOS.la +###libGL_la_DEPENDENCIES = \ +###SVGA/libMesaSVGA.la \ +###X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###GGI/libMesaGGI.la \ +###OSmesa/libMesaOS.la \ +###SVGA/libMesaSVGA.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###FX/libMesaFX.la \ +###FX/X86/libMesaFX_X86.la \ +###GGI/libMesaGGI.la \ +###X/libMesaX11.la +#libGL_la_DEPENDENCIES = \ +#X86/libMesaX86.la \ +#FX/libMesaFX.la \ +#FX/X86/libMesaFX_X86.la \ +#OSmesa/libMesaOS.la \ +#X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###FX/libMesaFX.la \ +###GGI/libMesaGGI.la \ +###OSmesa/libMesaOS.la \ +###X/libMesaX11.la +####libGL_la_DEPENDENCIES = \ +####X/libMesaX11.la +####libGL_la_DEPENDENCIES = \ +####X86/libMesaX86.la \ +####GGI/libMesaGGI.la \ +####X/libMesaX11.la +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##OSmesa/libMesaOS.la \ +##X/libMesaX11.la +####libGL_la_DEPENDENCIES = \ +####GGI/libMesaGGI.la \ +####OSmesa/libMesaOS.la \ +####X/libMesaX11.la +##libGL_la_DEPENDENCIES = \ +##FX/libMesaFX.la \ +##SVGA/libMesaSVGA.la \ +##X/libMesaX11.la +##libGL_la_DEPENDENCIES = \ +##FX/libMesaFX.la \ +##GGI/libMesaGGI.la \ +##OSmesa/libMesaOS.la \ +##SVGA/libMesaSVGA.la \ +##X/libMesaX11.la +libGL_la_DEPENDENCIES = \ +X86/libMesaX86.la \ +FX/libMesaFX.la \ +FX/X86/libMesaFX_X86.la \ +OSmesa/libMesaOS.la \ +SVGA/libMesaSVGA.la \ +X/libMesaX11.la +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##FX/libMesaFX.la \ +##FX/X86/libMesaFX_X86.la \ +##GGI/libMesaGGI.la \ +##SVGA/libMesaSVGA.la \ +##X/libMesaX11.la +#####libGL_la_DEPENDENCIES = \ +#####X86/libMesaX86.la \ +#####GGI/libMesaGGI.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###OSmesa/libMesaOS.la +#####libGL_la_DEPENDENCIES = \ +#####GGI/libMesaGGI.la \ +#####OSmesa/libMesaOS.la +###libGL_la_DEPENDENCIES = \ +###FX/libMesaFX.la \ +###SVGA/libMesaSVGA.la +#libGL_la_DEPENDENCIES = \ +#X86/libMesaX86.la \ +#FX/libMesaFX.la \ +#FX/X86/libMesaFX_X86.la \ +#SVGA/libMesaSVGA.la \ +#X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###FX/libMesaFX.la \ +###GGI/libMesaGGI.la \ +###SVGA/libMesaSVGA.la \ +###X/libMesaX11.la +#libGL_la_DEPENDENCIES = \ +#FX/libMesaFX.la \ +#OSmesa/libMesaOS.la \ +#SVGA/libMesaSVGA.la \ +#X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###GGI/libMesaGGI.la \ +###OSmesa/libMesaOS.la \ +###X/libMesaX11.la +####libGL_la_DEPENDENCIES = \ +####FX/libMesaFX.la +####libGL_la_DEPENDENCIES = \ +####X86/libMesaX86.la \ +####FX/libMesaFX.la \ +####FX/X86/libMesaFX_X86.la \ +####GGI/libMesaGGI.la +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##FX/libMesaFX.la \ +##FX/X86/libMesaFX_X86.la \ +##OSmesa/libMesaOS.la +####libGL_la_DEPENDENCIES = \ +####FX/libMesaFX.la \ +####GGI/libMesaGGI.la \ +####OSmesa/libMesaOS.la +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##SVGA/libMesaSVGA.la \ +##X/libMesaX11.la +####libGL_la_DEPENDENCIES = \ +####GGI/libMesaGGI.la \ +####SVGA/libMesaSVGA.la \ +####X/libMesaX11.la +##libGL_la_DEPENDENCIES = \ +##OSmesa/libMesaOS.la \ +##SVGA/libMesaSVGA.la \ +##X/libMesaX11.la +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##GGI/libMesaGGI.la \ +##OSmesa/libMesaOS.la \ +##SVGA/libMesaSVGA.la \ +##X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###FX/libMesaFX.la \ +###X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###OSmesa/libMesaOS.la \ +###SVGA/libMesaSVGA.la +#####libGL_la_DEPENDENCIES = \ +#####GGI/libMesaGGI.la \ +#####SVGA/libMesaSVGA.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###SVGA/libMesaSVGA.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###GGI/libMesaGGI.la \ +###SVGA/libMesaSVGA.la \ +###X/libMesaX11.la +#libGL_la_DEPENDENCIES = \ +#X86/libMesaX86.la \ +#OSmesa/libMesaOS.la \ +#SVGA/libMesaSVGA.la \ +#X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###GGI/libMesaGGI.la \ +###OSmesa/libMesaOS.la \ +###SVGA/libMesaSVGA.la \ +###X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###FX/libMesaFX.la \ +###FX/X86/libMesaFX_X86.la \ +###GGI/libMesaGGI.la \ +###OSmesa/libMesaOS.la +####libGL_la_DEPENDENCIES = \ +####OSmesa/libMesaOS.la +######libGL_la_DEPENDENCIES = \ +######GGI/libMesaGGI.la +####libGL_la_DEPENDENCIES = \ +####X86/libMesaX86.la +##libGL_la_DEPENDENCIES = \ +##FX/libMesaFX.la \ +##OSmesa/libMesaOS.la \ +##SVGA/libMesaSVGA.la +####libGL_la_DEPENDENCIES = \ +####FX/libMesaFX.la \ +####GGI/libMesaGGI.la \ +####SVGA/libMesaSVGA.la +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##FX/libMesaFX.la \ +##FX/X86/libMesaFX_X86.la \ +##SVGA/libMesaSVGA.la +####libGL_la_DEPENDENCIES = \ +####X86/libMesaX86.la \ +####GGI/libMesaGGI.la \ +####OSmesa/libMesaOS.la +#####libGL_la_DEPENDENCIES = +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##FX/libMesaFX.la \ +##FX/X86/libMesaFX_X86.la \ +##GGI/libMesaGGI.la \ +##OSmesa/libMesaOS.la \ +##SVGA/libMesaSVGA.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###X/libMesaX11.la +#####libGL_la_DEPENDENCIES = \ +#####GGI/libMesaGGI.la \ +#####X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###OSmesa/libMesaOS.la \ +###X/libMesaX11.la +###libGL_la_DEPENDENCIES = \ +###FX/libMesaFX.la \ +###GGI/libMesaGGI.la \ +###OSmesa/libMesaOS.la \ +###SVGA/libMesaSVGA.la +#libGL_la_DEPENDENCIES = \ +#X86/libMesaX86.la \ +#FX/libMesaFX.la \ +#FX/X86/libMesaFX_X86.la \ +#OSmesa/libMesaOS.la \ +#SVGA/libMesaSVGA.la +###libGL_la_DEPENDENCIES = \ +###X86/libMesaX86.la \ +###FX/libMesaFX.la \ +###FX/X86/libMesaFX_X86.la \ +###GGI/libMesaGGI.la \ +###SVGA/libMesaSVGA.la +####libGL_la_DEPENDENCIES = \ +####SVGA/libMesaSVGA.la +#libGL_la_DEPENDENCIES = \ +#X86/libMesaX86.la \ +#FX/libMesaFX.la \ +#FX/X86/libMesaFX_X86.la \ +#GGI/libMesaGGI.la \ +#OSmesa/libMesaOS.la \ +#SVGA/libMesaSVGA.la \ +#X/libMesaX11.la +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##FX/libMesaFX.la \ +##FX/X86/libMesaFX_X86.la \ +##X/libMesaX11.la +####libGL_la_DEPENDENCIES = \ +####FX/libMesaFX.la \ +####GGI/libMesaGGI.la \ +####X/libMesaX11.la +##libGL_la_DEPENDENCIES = \ +##FX/libMesaFX.la \ +##OSmesa/libMesaOS.la \ +##X/libMesaX11.la +####libGL_la_DEPENDENCIES = \ +####GGI/libMesaGGI.la \ +####OSmesa/libMesaOS.la \ +####SVGA/libMesaSVGA.la +##libGL_la_DEPENDENCIES = \ +##X86/libMesaX86.la \ +##OSmesa/libMesaOS.la \ +##SVGA/libMesaSVGA.la +####libGL_la_DEPENDENCIES = \ +####X86/libMesaX86.la \ +####GGI/libMesaGGI.la \ +####SVGA/libMesaSVGA.la +libGL_la_OBJECTS = aatriangle.lo accum.lo alpha.lo alphabuf.lo \ +attrib.lo bbox.lo bitmap.lo blend.lo buffers.lo clip.lo colortab.lo \ +config.lo context.lo copypix.lo cva.lo debug_xform.lo depth.lo \ +dispatch.lo dlist.lo drawpix.lo enable.lo enums.lo eval.lo \ +extensions.lo feedback.lo glapi.lo glapinoop.lo glthread.lo fog.lo \ +get.lo hash.lo hint.lo imaging.lo image.lo light.lo lines.lo logic.lo \ +masking.lo matrix.lo mem.lo mmath.lo pb.lo pipeline.lo pixel.lo \ +pixeltex.lo points.lo polygon.lo quads.lo rastpos.lo readpix.lo rect.lo \ +scissor.lo shade.lo span.lo stages.lo state.lo stencil.lo teximage.lo \ +texobj.lo texstate.lo texture.lo texutil.lo translate.lo triangle.lo \ +varray.lo vb.lo vbcull.lo vbfill.lo vbindirect.lo vbrender.lo \ +vbxform.lo vector.lo vertices.lo winpos.lo xform.lo zoom.lo +CFLAGS = -g -O2 -Wall -fomit-frame-pointer -ffast-math -fexpensive-optimizations -fstrict-aliasing -malign-loops=2 -malign-jumps=2 -malign-functions=2 -D_REENTRANT +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DATA = $(sysconf_DATA) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +DIST_SUBDIRS = X86 FX GGI OSmesa SVGA X +DEP_FILES = .deps/aatriangle.P .deps/accum.P .deps/alpha.P \ +.deps/alphabuf.P .deps/attrib.P .deps/bbox.P .deps/bitmap.P \ +.deps/blend.P .deps/buffers.P .deps/clip.P .deps/colortab.P \ +.deps/config.P .deps/context.P .deps/copypix.P .deps/cva.P \ +.deps/debug_xform.P .deps/depth.P .deps/dispatch.P .deps/dlist.P \ +.deps/drawpix.P .deps/enable.P .deps/enums.P .deps/eval.P \ +.deps/extensions.P .deps/feedback.P .deps/fog.P .deps/get.P \ +.deps/glapi.P .deps/glapinoop.P .deps/glthread.P .deps/hash.P \ +.deps/hint.P .deps/image.P .deps/imaging.P .deps/light.P .deps/lines.P \ +.deps/logic.P .deps/masking.P .deps/matrix.P .deps/mem.P .deps/mmath.P \ +.deps/pb.P .deps/pipeline.P .deps/pixel.P .deps/pixeltex.P \ +.deps/points.P .deps/polygon.P .deps/quads.P .deps/rastpos.P \ +.deps/readpix.P .deps/rect.P .deps/scissor.P .deps/shade.P .deps/span.P \ +.deps/stages.P .deps/state.P .deps/stencil.P .deps/teximage.P \ +.deps/texobj.P .deps/texstate.P .deps/texture.P .deps/texutil.P \ +.deps/translate.P .deps/triangle.P .deps/varray.P .deps/vb.P \ +.deps/vbcull.P .deps/vbfill.P .deps/vbindirect.P .deps/vbrender.P \ +.deps/vbxform.P .deps/vector.P .deps/vertices.P .deps/winpos.P \ +.deps/xform.P .deps/zoom.P +SOURCES = $(libGL_la_SOURCES) +OBJECTS = $(libGL_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-libLTLIBRARIES: + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + +distclean-libLTLIBRARIES: + +maintainer-clean-libLTLIBRARIES: + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libGL.la: $(libGL_la_OBJECTS) $(libGL_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libGL_la_LDFLAGS) $(libGL_la_OBJECTS) $(libGL_la_LIBADD) $(LIBS) + +install-sysconfDATA: $(sysconf_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(sysconfdir) + @list='$(sysconf_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$p; \ + fi; fi; \ + done + +uninstall-sysconfDATA: + @$(NORMAL_UNINSTALL) + list='$(sysconf_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(sysconfdir)/$$p; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + + + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(DIST_SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: install-libLTLIBRARIES install-sysconfDATA +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-libLTLIBRARIES uninstall-sysconfDATA +uninstall: uninstall-recursive +all-am: Makefile $(LTLIBRARIES) $(DATA) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(sysconfdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags mostlyclean-depend \ + mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ + clean-depend clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-libLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-depend \ + distclean-generic clean-am + -rm -f libtool + +distclean: distclean-recursive + +maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-depend \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + +.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ +clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ +uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile \ +mostlyclean-libtool distclean-libtool clean-libtool \ +maintainer-clean-libtool uninstall-sysconfDATA install-sysconfDATA \ +install-data-recursive uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs-am installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +strip: + -if strip -V 2>&1 | grep "GNU" > /dev/null; then \ + strip --strip-unneeded .libs/*.so; \ + strip --strip-debug .libs/*.a; \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/src/Makefile.BeOS-R4 b/xc/extras/Mesa/src/Makefile.BeOS-R4 new file mode 100755 index 000000000..db5c675b0 --- /dev/null +++ b/xc/extras/Mesa/src/Makefile.BeOS-R4 @@ -0,0 +1,172 @@ +# $Id: Makefile.BeOS-R4,v 1.1 2000/11/30 17:31:31 dawes Exp $ + +# Mesa 3-D graphics library +# Version: 3.3 +# +# 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. + + +# Makefile for Mese for BeOS R4 + + +##### MACROS ##### + +GL_MAJOR = 1 +GL_MINOR = 2 +GL_TINY = $(MESA_MAJOR)$(MESA_MINOR)$(MESA_TINY) + +VPATH = RCS + +INCDIR = ../include +LIBDIR = ../lib + +CORE_SOURCES = \ + aatriangle.c \ + accum.c \ + alpha.c \ + alphabuf.c \ + attrib.c \ + bbox.c \ + bitmap.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + copypix.c \ + cva.c \ + debug_xform.c \ + depth.c \ + dispatch.c \ + dlist.c \ + drawpix.c \ + enable.c \ + enums.c \ + eval.c \ + extensions.c \ + feedback.c \ + fog.c \ + get.c \ + glapi.c \ + glapinoop.c \ + glthread.c \ + hash.c \ + hint.c \ + image.c \ + imaging.c \ + light.c \ + lines.c \ + logic.c \ + masking.c \ + matrix.c \ + mem.c \ + mmath.c \ + pb.c \ + pixel.c \ + pixeltex.c \ + pipeline.c \ + points.c \ + polygon.c \ + quads.c \ + rastpos.c \ + readpix.c \ + rect.c \ + scissor.c \ + shade.c \ + span.c \ + stages.c \ + state.c \ + stencil.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texutil.c \ + translate.c \ + triangle.c \ + varray.c \ + vb.c \ + vbcull.c \ + vbfill.c \ + vbindirect.c \ + vbrender.c \ + vbxform.c \ + vector.c \ + vertices.c \ + winpos.c \ + xform.c \ + zoom.c + +DRIVER_SOURCES = OSmesa/osmesa.c BeOS/GLView.cpp + +OBJECTS = $(CORE_SOURCES:.c=.o) OSmesa/osmesa.o BeOS/GLView.o + + + +##### TARGETS ##### + +default: + @echo "Specify a target configuration" + +clean: + -rm *.o *~ + +targets: $(LIBDIR)/$(GL_LIB) + + +# Make the library +$(LIBDIR)/$(GL_LIB): $(OBJECTS) + $(MAKELIB) $(GL_LIB) $(GL_MAJOR) $(GL_MINOR) $(GL_TINY) $(OBJECTS) + mv $(GL_LIB) $(LIBDIR) + + +include ../Make-config + +include depend + + + +##### RULES ##### + +.c.o: + $(CC) -c -I. -I../ -I$(INCDIR) $(CFLAGS) $< + +OSmesa/osmesa.o: OSmesa/osmesa.c + $(CC) -c -I. -I../ -I$(INCDIR) $(CFLAGS) $< -o $@ + +BeOS/GLView.o: BeOS/GLView.cpp + cd BeOS ; gcc -c -I../../include -g GLView.cpp + +X86/x86.o: X86/x86.c + $(CC) -c -I. -I../ -I$(INCDIR) $(CFLAGS) $< -o $@ + +X86/common_x86.o: X86/common_x86.c + $(CC) -c -I. -I../ -I$(INCDIR) $(CFLAGS) $< -o $@ + +X86/3dnow.o: X86/3dnow.c + $(CC) -c -I. -I../ -I$(INCDIR) $(CFLAGS) $< -o $@ + + +# +# Run 'make depend' to update the dependencies if you change what's included +# by any source file. +# +dep: $(CORE_SOURCES) $(DRIVER_SOURCES) + makedepend -fdepend.BeOS -Y -I../include $(SOURCES) diff --git a/xc/extras/Mesa/src/Makefile.D3D b/xc/extras/Mesa/src/Makefile.D3D new file mode 100644 index 000000000..36408146e --- /dev/null +++ b/xc/extras/Mesa/src/Makefile.D3D @@ -0,0 +1,209 @@ +############################################################################## +# +# Mesa-3.3 Makefile for DirectX 6 build 05 +# +# By Leigh McRae +# +# Copyright (c) 1998-1995 alt.software inc. All Rights Reserved +############################################################################## +NAME=OpenGL32 +TARGET=$(NAME).dll + +D3D_DIR=$(MAKEDIR)\D3D +INSTALL_DIR1=e:\WinNT\System32 +INSTALL_DIR2=N:\Windows\System +INSTALL_DIR3=c:\Windows\System +SDKROOT=f:\mssdk + +SPACE=- +LINKER=link.exe + +INCLUDE=$(SDKROOT)\include;$(INCLUDE) +LIB=$(SDKROOT)\lib;$(LIB) +############################################################################## +CFLAGS= /c /nologo /W1 /G5 /I..\Include \ + /D "_WIN32" /D "WIN32" /D "_WINDOWS" /D "__WIN32__" /D "__MSC__" /D "MESAD3D" +LFLAGS= /INCREMENTAL:NO /PDB:NONE /subsystem:windows /dll /machine:I386 \ + /DEF:$(D3D_DIR)\$(NAME).def /OUT:$(TARGET) + +!IF "$(DEBUG)" == "1" + +CFLAGS= /MTd /Od /Yd /Z7 /D "_DEBUG" /D "D3D_DEBUG" $(CFLAGS) +LFLAGS=$(LFLAGS) /DEBUG /DEBUGTYPE:CV +BUILD_TYPE=debug + +!ELSE + +CFLAGS= /MT /Ox /D "NDEBUG" $(CFLAGS) +LFLAGS=$(LFLAGS) +BUILD_TYPE=release + +!ENDIF +############################################################################## + +SRCS = \ + aatriangle.c \ + accum.c \ + alpha.c \ + alphabuf.c \ + attrib.c \ + bbox.c \ + bitmap.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + copypix.c \ + cva.c \ + debug_xform.c \ + depth.c \ + dispatch.c \ + dlist.c \ + drawpix.c \ + enable.c \ + enums.c \ + eval.c \ + extensions.c \ + feedback.c \ + fog.c \ + get.c \ + glapi.c \ + glapinoop.c \ + glthread.c \ + hash.c \ + hint.c \ + image.c \ + imaging.c \ + light.c \ + lines.c \ + logic.c \ + masking.c \ + matrix.c \ + mem.c \ + mmath.c \ + pb.c \ + pixel.c \ + pixeltex.c \ + pipeline.c \ + points.c \ + polygon.c \ + quads.c \ + rastpos.c \ + readpix.c \ + rect.c \ + scissor.c \ + shade.c \ + span.c \ + stages.c \ + state.c \ + stencil.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texture.c \ + texutil.c \ + translate.c \ + triangle.c \ + varray.c \ + vb.c \ + vbcull.c \ + vbfill.c \ + vbindirect.c \ + vbrender.c \ + vbxform.c \ + vector.c \ + vertices.c \ + winpos.c \ + xform.c \ + zoom.c + +OBJS = $(SRCS:.c=.obj) + +WGL_OBJS= $(D3D_DIR)\wgl.obj \ + $(D3D_DIR)\D3Dvbrender.obj \ + $(D3D_DIR)\DDrawPROCS.obj \ + $(D3D_DIR)\NULLProcs.obj \ + $(D3D_DIR)\Debug.obj +HAL_OBJS= $(D3D_DIR)\D3DInit.obj \ + $(D3D_DIR)\D3DRaster.obj \ + $(D3D_DIR)\D3DTextureMgr.obj \ + $(D3D_DIR)\D3DUtils.obj \ + $(D3D_DIR)\D3DCaps.obj + +WINLIBS = kernel32.lib user32.lib gdi32.lib oldnames.lib rtutils.lib +DXLIBS = ddraw.lib dxguid.lib +LIBS = $(WINLIBS) $(DXLIBS) +############################################################################### +# Primary Targets # +############################################################################## + +default: WGL header $(TARGET) footer + +all: default install + +WGL : forceit + del opengl32.dll + cd $(D3D_DIR) + nmake /$(MAKEFLAGS) + cd $(MAKEDIR) + +$(TARGET) : $(OBJS) + $(LINKER) $(LFLAGS) $(LIBS) $(OBJS) $(WGL_OBJS) $(HAL_OBJS) + +install : forceit + @echo $(SPACE) + @echo ======================================== + @echo Install files created. + @echo ======================================== + @copy *.dll $(INSTALL_DIR1) + @copy *.dll $(INSTALL_DIR2) + @copy *.dll $(INSTALL_DIR3) + +original : forceit + @echo $(SPACE) + @echo ======================================== + @echo Restore original OpenGL32.dll + @echo ======================================== + @copy $(INSTALL_DIR1)\OpenGL32.dll.ori $(INSTALL_DIR1)\OpenGL32.dll + +############################################################################### +# Secondary Targets # +############################################################################### + +clean: + @echo ======================================== + @echo Cleaning $(TARGET) + @del *.obj + @del *.dep + @del *.exp + @del *.ncb + @del *.plg + @del *.lib + @del *.nms + @del *.pch + @del *.map + @echo ======================================== + cd $(D3D_DIR) + nmake clean + cd $(MAKEDIR) + +header: + @echo ============================================================ + @echo Building $(TARGET) ($(BUILD_TYPE) version) + @echo ============================================================ + @echo $(SPACE) + +footer: + @echo $(SPACE) + @echo ============================================================ + @echo DONE building $(TARGET) ($(BUILD_TYPE) version) + @echo ============================================================ + +forceit: + + + + + diff --git a/xc/extras/Mesa/src/Makefile.X11 b/xc/extras/Mesa/src/Makefile.X11 new file mode 100644 index 000000000..8e2a03fca --- /dev/null +++ b/xc/extras/Mesa/src/Makefile.X11 @@ -0,0 +1,257 @@ +# $Id: Makefile.X11,v 1.1 2000/11/30 17:31:32 dawes Exp $ + +# Mesa 3-D graphics library +# Version: 3.3 +# Copyright (C) 1995-2000 Brian Paul + +# Makefile for core library + + +##### MACROS ##### + +GL_MAJOR = 1 +GL_MINOR = 2 +GL_TINY = 0$(MESA_MAJOR)0$(MESA_MINOR)0$(MESA_TINY) + +VPATH = RCS + +INCDIR = ../include +LIBDIR = ../lib + + +CORE_SOURCES = \ + aatriangle.c \ + accum.c \ + alpha.c \ + alphabuf.c \ + attrib.c \ + bbox.c \ + bitmap.c \ + blend.c \ + buffers.c \ + clip.c \ + colortab.c \ + config.c \ + context.c \ + copypix.c \ + cva.c \ + debug_xform.c \ + depth.c \ + dispatch.c \ + dlist.c \ + drawpix.c \ + enable.c \ + enums.c \ + eval.c \ + extensions.c \ + feedback.c \ + fog.c \ + get.c \ + glapi.c \ + glapinoop.c \ + glthread.c \ + hash.c \ + hint.c \ + image.c \ + imaging.c \ + light.c \ + lines.c \ + logic.c \ + masking.c \ + matrix.c \ + mem.c \ + mmath.c \ + pb.c \ + pipeline.c \ + pixel.c \ + pixeltex.c \ + points.c \ + polygon.c \ + quads.c \ + rastpos.c \ + readpix.c \ + rect.c \ + scissor.c \ + shade.c \ + span.c \ + stages.c \ + state.c \ + stencil.c \ + teximage.c \ + texobj.c \ + texstate.c \ + texture.c \ + texutil.c \ + translate.c \ + triangle.c \ + varray.c \ + vb.c \ + vbcull.c \ + vbfill.c \ + vbindirect.c \ + vbrender.c \ + vbxform.c \ + vector.c \ + vertices.c \ + winpos.c \ + xform.c \ + zoom.c \ + X86/x86.c \ + X86/common_x86.c \ + X86/3dnow.c \ + X86/katmai.c + +DRIVER_SOURCES = \ + X/glxapi.c \ + X/fakeglx.c \ + X/xfonts.c \ + X/xmesa1.c \ + X/xmesa2.c \ + X/xmesa3.c \ + X/xmesa4.c \ + OSmesa/osmesa.c \ + SVGA/svgamesa.c \ + SVGA/svgamesa8.c \ + SVGA/svgamesa15.c \ + SVGA/svgamesa16.c \ + SVGA/svgamesa24.c \ + SVGA/svgamesa32.c \ + FX/fxapi.c \ + FX/fxclip.c \ + FX/fxcva.c \ + FX/fxdd.c \ + FX/fxddspan.c \ + FX/fxddtex.c \ + FX/fxfastpath.c \ + FX/fxpipeline.c \ + FX/fxrender.c \ + FX/fxsanity.c \ + FX/fxsetup.c \ + FX/fxtexman.c \ + FX/fxtrifuncs.c \ + FX/fxvsetup.c \ + FX/fxglidew.c + +ASM_SOURCES = + +ADDITIONAL_OBJ = + +OBJECTS = $(ASM_SOURCES:.S=.o) \ + $(CORE_SOURCES:.c=.o) \ + $(DRIVER_SOURCES:.c=.o) \ + $(ADDITIONAL_OBJ) + + +##### RULES ##### + +.c.o: + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ + +.S.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/xmesa1.o: X/xmesa1.c + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ +X/xmesa2.o: X/xmesa2.c + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ +X/xmesa3.o: X/xmesa3.c + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ +X/xmesa4.o: X/xmesa4.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/fxcva.o: FX/fxcva.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 +GGI/ggimesa.o: GGI/ggimesa.c + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ +X86/x86.o: X86/x86.c + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ +X86/common_x86.o: X86/common_x86.c + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ +X86/3dnow.o: X86/3dnow.c + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ +X86/katmai.o: X86/katmai.c + $(CC) -c -I. -I$(INCDIR) $(CFLAGS) $< -o $@ + +##### TARGETS ##### + +#default: +# @echo "Specify a target configuration" + +clean: + -rm *.o *~ */*.o */*~ *.lo *.la + -rm -rf .libs + +targets: $(LIBDIR)/$(GL_LIB) + +# Make the library +$(LIBDIR)/$(GL_LIB): $(OBJECTS) + $(MAKELIB) $(GL_LIB) $(GL_MAJOR) $(GL_MINOR) $(GL_TINY) $(OBJECTS) + rm -f $(LIBDIR)/$(GL_LIB)* + mv $(GL_LIB)* $(LIBDIR) + + +include ../Make-config + +include depend + + + +# +# Run 'make dep' to update the dependencies if you change what's included +# by any source file. +# +dep: $(CORE_SOURCES) $(DRIVER_SOURCES) + makedepend -fdepend -Y -I../include -DGGI -DSVGA -DFX $(CORE_SOURCES) $(DRIVER_SOURCES) + +tags: + etags `find . -name \*.[ch]` `find ../include` diff --git a/xc/extras/Mesa/src/Makefile.am b/xc/extras/Mesa/src/Makefile.am new file mode 100644 index 000000000..c23549e21 --- /dev/null +++ b/xc/extras/Mesa/src/Makefile.am @@ -0,0 +1,241 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include + + +# Build a libtool library for installation in libdir. +lib_LTLIBRARIES = libGL.la + +sysconf_DATA = mesa.conf + +EXTRA_DIST = ddsample.c mesa.conf + +libGL_la_LDFLAGS = -version-info $(LIBGL_VERSION) +libGL_la_SOURCES = \ + aatriangle.c \ + aatriangle.h \ + accum.c \ + accum.h \ + all.h \ + alpha.c \ + alpha.h \ + alphabuf.c \ + alphabuf.h \ + attrib.c \ + attrib.h \ + bbox.c \ + bbox.h \ + bitmap.c \ + bitmap.h \ + blend.c \ + blend.h \ + buffers.c \ + buffers.h \ + clip.c \ + clip.h \ + clip_funcs.h \ + clip_tmp.h \ + colortab.c \ + colortab.h \ + config.c \ + config.h \ + context.c \ + context.h \ + copy_tmp.h \ + copypix.c \ + copypix.h \ + cull_tmp.h \ + cva.c \ + cva.h \ + dd.h \ + debug_xform.c \ + debug_xform.h \ + depth.c \ + depth.h \ + dispatch.c \ + dlist.c \ + dlist.h \ + dotprod_tmp.h \ + drawpix.c \ + drawpix.h \ + enable.c \ + enable.h \ + enums.c \ + enums.h \ + eval.c \ + eval.h \ + extensions.c \ + extensions.h \ + feedback.c \ + feedback.h \ + fixed.h \ + glapi.c \ + glapi.h \ + glapinoop.c \ + glapinoop.h \ + glapioffsets.h \ + glapitable.h \ + glapitemp.h \ + glthread.c \ + glthread.h \ + fog.c \ + fog.h \ + fog_tmp.h \ + general_clip.h \ + get.c \ + get.h \ + glheader.h \ + hash.c \ + hash.h \ + hint.c \ + hint.h \ + imaging.c \ + imaging.h \ + image.c \ + image.h \ + indirect_tmp.h \ + interp_tmp.h \ + light.c \ + light.h \ + lines.c \ + lines.h \ + linetemp.h \ + lnaatemp.h \ + logic.c \ + logic.h \ + macros.h \ + masking.c \ + masking.h \ + matrix.c \ + matrix.h \ + mem.c \ + mem.h \ + mmath.c \ + mmath.h \ + norm_tmp.h \ + pb.c \ + pb.h \ + pipeline.c \ + pipeline.h \ + pixel.c \ + pixel.h \ + pixeltex.c \ + pixeltex.h \ + points.c \ + points.h \ + polygon.c \ + polygon.h \ + quads.c \ + quads.h \ + rastpos.c \ + rastpos.h \ + readpix.c \ + readpix.h \ + rect.c \ + rect.h \ + render_tmp.h \ + scissor.c \ + scissor.h \ + shade.c \ + shade.h \ + shade_tmp.h \ + simple_list.h \ + span.c \ + span.h \ + stages.c \ + stages.h \ + state.c \ + state.h \ + stencil.c \ + stencil.h \ + texgen_tmp.h \ + teximage.c \ + teximage.h \ + texobj.c \ + texobj.h \ + texstate.c \ + texstate.h \ + texture.c \ + texture.h \ + texutil.c \ + texutil.h \ + trans_tmp.h \ + translate.c \ + translate.h \ + triangle.c \ + triangle.h \ + tritemp.h \ + types.h \ + varray.c \ + varray.h \ + vb.c \ + vb.h \ + vbcull.c \ + vbcull.h \ + vbfill.c \ + vbfill.h \ + vbindirect.c \ + vbindirect.h \ + vbrender.c \ + vbrender.h \ + vbxform.c \ + vbxform.h \ + vector.c \ + vector.h \ + vertices.c \ + vertices.h \ + winpos.c \ + winpos.h \ + xform.c \ + xform.h \ + xform_tmp.h \ + zoom.c \ + zoom.h + +if HAVE_X86 +DRV_X86 = X86/libMesaX86.la +SUB_X86 = X86 +endif + +if HAVE_FX +DRV_FX = FX/libMesaFX.la +SUB_FX = FX +if HAVE_X86 +DRV_FX_X86 = FX/X86/libMesaFX_X86.la +endif +endif + +if HAVE_GGI +DRV_GGI = GGI/libMesaGGI.la +SUB_GGI = GGI +endif + +if HAVE_OSMESA +DRV_OSMESA = OSmesa/libMesaOS.la +SUB_OSMESA = OSmesa +endif + +if HAVE_SVGA +DRV_SVGA = SVGA/libMesaSVGA.la +SUB_SVGA = SVGA +endif + +if HAVE_X11 +DRV_X11 = X/libMesaX11.la +SUB_X11 = X +endif + + +SUBDIRS = $(SUB_X86) $(SUB_FX) $(SUB_GGI) $(SUB_OSMESA) $(SUB_SVGA) $(SUB_X11) + + +libGL_la_LIBADD = $(DRV_X86) $(DRV_FX) $(DRV_FX_X86) $(DRV_GGI) $(DRV_OSMESA) \ + $(DRV_SVGA) $(DRV_X11) $(THREAD_LIBS) + +strip: + -if strip -V 2>&1 | grep "GNU" > /dev/null; then \ + strip --strip-unneeded .libs/*.so; \ + strip --strip-debug .libs/*.a; \ + fi diff --git a/xc/extras/Mesa/src/Makefile.fx b/xc/extras/Mesa/src/Makefile.fx new file mode 100644 index 000000000..ae0ef5468 --- /dev/null +++ b/xc/extras/Mesa/src/Makefile.fx @@ -0,0 +1,147 @@ + +#makefile for compiling Mesa with Glide support +#tested with Microsoft tools (nmake & VC++) +#Assembly code support with nasm assembler +# http://www.web-sites.co.uk/nasm/ + + +!include <win32.mak> + + +# Set NASM to the complete path and file name (minus .EXE) +# where you have (0.98 or latter) nasm installed. +# +# Comment out the following to disable using the assembly files +NASM=nasmw + +# Set GLIDE2SDK to have the complete path and file name +# where you have the Glide 2 SDK installed. It will be used +# as the root to build the actual path upon for linkage later. +# +# If you do not set this, then both glide.h and glide2x.lib as +# assumed to be available in the default INCLUDE and LIB search +# paths. +#GLIDE2SDK=\glide2x + +#if you have a Voodoo2 or latter activate the following +#V2_OPTS=/DFX_V2 + +#DO_VTUNE can be used to generate VTUNE compatible +#libraries, they can propably be used for other +#debugging purposes also. +#activating the options should not significantly +#slow down the resulting library +#DO_VTUNE=1 + +#the following option can be used for +#Intel compiler +#CC=icl -Qxi + + + + +!if "$(NASM)" != "" +X86OPT = -DUSE_X86_ASM -DUSE_3DNOW_ASM -DUSE_KATMAI_ASM +!else +X86OPT = +!endif + + +!if "$(DO_VTUNE)" != "" +dlllflags = /NODEFAULTLIB /INCREMENTAL:NO /RELEASE /NOLOGO -entry:_DllMainCRTStartup$(DLLENTRY) -dll +VTUNE_LINK_OPTS = /pdb:..\lib\OpenGL32.pdb /map /fixed:no /debug +VTUNE_CC_OPTS = /Zi +!else +!endif + + + +.SUFFIXES: .S + + +CFLAGS = $(cvarsdll) $(VTUNE_CC_OPTS) /Ox /G6 /Gd /D__i386__ \ + /DBUILD_GL32 /DMESA_FX_DDRAW /DMESA_MINWARN $(X86OPT) \ + /D__MSC__ /DFX $(V2_OPTS) /D__WIN32__ /DWIN32 /I..\include /I. \ + /I$(GLIDE2SDK)\src\include + +!if "$(GLIDE2SDK)" == "" +GLIDE2LIB=glide2x.lib +!else +CFLAGS = $(CFLAGS) /I$(GLIDE2SDK)\src\include +GLIDE2LIB=$(GLIDE2SDK)\src\lib\win32\glide2x.lib +!endif + + +OBJS = aatriangle.obj accum.obj alpha.obj alphabuf.obj \ + attrib.obj bbox.obj bitmap.obj blend.obj buffers.obj \ + clip.obj colortab.obj\ + config.obj context.obj copypix.obj cva.obj depth.obj\ + dispatch.obj dlist.obj\ + drawpix.obj enable.obj enums.obj eval.obj extensions.obj\ + feedback.obj fog.obj glapi.obj glapinoop.obj glthread.obj \ + get.obj hash.obj hint.obj image.obj imaging.obj light.obj\ + lines.obj logic.obj masking.obj matrix.obj mem.obj \ + mmath.obj\ + pb.obj pipeline.obj pixel.obj pixeltex.obj points.obj polygon.obj \ + quads.obj rastpos.obj readpix.obj rect.obj scissor.obj shade.obj\ + span.obj stages.obj state.obj stencil.obj teximage.obj texobj.obj\ + texstate.obj texture.obj texutil.obj translate.obj triangle.obj \ + varray.obj vbindirect.obj winpos.obj vb.obj vbcull.obj vbfill.obj\ + vbrender.obj vbxform.obj vector.obj vertices.obj xform.obj zoom.obj + + +FXOBJS = FX\fxcva.obj FX\fxwgl.obj FX\fxapi.obj \ + FX\fxclip.obj FX\fxdd.obj \ + FX\fxddtex.obj FX\fxfastpath.obj\ + FX\fxglidew.obj FX\fxpipeline.obj \ + FX\fxvsetup.obj FX\fxsetup.obj \ + FX\fxtexman.obj FX\fxrender.obj \ + FX\fxddspan.obj FX\fxtrifuncs.obj + + + + +!if "$(NASM)" != "" +X86OBJS = X86\3dnow.obj X86\3dnow_norm_raw.obj \ + X86\3dnow_xform_masked1.obj\ + X86\3dnow_xform_masked2.obj X86\3dnow_xform_masked3.obj\ + X86\3dnow_xform_masked4.obj X86\3dnow_xform_raw1.obj\ + X86\3dnow_xform_raw2.obj X86\3dnow_xform_raw3.obj\ + X86\3dnow_xform_raw4.obj\ + X86\mmx_blend.obj X86\vertex.obj X86\vertex_3dnow.obj \ + X86\x86a.obj X86\common_x86.obj X86\common_x86_asm.obj X86\x86.obj\ + X86\katmai.obj X86\katmai_norm_raw.obj \ + X86\katmai_xform_masked1.obj X86\katmai_xform_masked2.obj\ + X86\katmai_xform_masked3.obj X86\katmai_xform_masked4.obj\ + X86\katmai_xform_raw1.obj X86\katmai_xform_raw2.obj\ + X86\katmai_xform_raw3.obj X86\katmai_xform_raw4.obj\ + X86\vertex_katmai.obj \ + FX\X86\fx_3dnow_fastpath.obj +!else +X86OBJS = +!endif + + + +OSOBJS = OSmesa\osmesa.obj + +PROGRAM = ..\lib\OpenGL32.DLL + +all: $(PROGRAM) + + +$(PROGRAM): $(OBJS) $(FXOBJS) $(OSOBJS) $(X86OBJS) + $(link) $(dlllflags) /out:$(PROGRAM) $(VTUNE_LINK_OPTS)\ + /def:FX\fxOpenGL.def $(OBJS) $(FXOBJS) $(OSOBJS)\ + $(X86OBJS) $(guilibsdll) $(GLIDE2LIB) >link.log + + + +.c.obj: + $(CC) $(CFLAGS) $< /c /Fo$@ + + + +.S.obj: + $(CC) -DNASM_ASSEMBLER /EP $< >$*.as + $(NASM) -o $@ -f win32 $*.as diff --git a/xc/extras/Mesa/src/Makefile.in b/xc/extras/Mesa/src/Makefile.in new file mode 100644 index 000000000..437c9684d --- /dev/null +++ b/xc/extras/Mesa/src/Makefile.in @@ -0,0 +1,753 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include + +# Build a libtool library for installation in libdir. +lib_LTLIBRARIES = libGL.la + +sysconf_DATA = mesa.conf + +EXTRA_DIST = ddsample.c mesa.conf + +libGL_la_LDFLAGS = -version-info $(LIBGL_VERSION) +libGL_la_SOURCES = aatriangle.c aatriangle.h accum.c accum.h all.h alpha.c alpha.h alphabuf.c alphabuf.h attrib.c attrib.h bbox.c bbox.h bitmap.c bitmap.h blend.c blend.h buffers.c buffers.h clip.c clip.h clip_funcs.h clip_tmp.h colortab.c colortab.h config.c config.h context.c context.h copy_tmp.h copypix.c copypix.h cull_tmp.h cva.c cva.h dd.h debug_xform.c debug_xform.h depth.c depth.h dispatch.c dlist.c dlist.h dotprod_tmp.h drawpix.c drawpix.h enable.c enable.h enums.c enums.h eval.c eval.h extensions.c extensions.h feedback.c feedback.h fixed.h glapi.c glapi.h glapinoop.c glapinoop.h glapioffsets.h glapitable.h glapitemp.h glthread.c glthread.h fog.c fog.h fog_tmp.h general_clip.h get.c get.h glheader.h hash.c hash.h hint.c hint.h imaging.c imaging.h image.c image.h indirect_tmp.h interp_tmp.h light.c light.h lines.c lines.h linetemp.h lnaatemp.h logic.c logic.h macros.h masking.c masking.h matrix.c matrix.h mem.c mem.h mmath.c mmath.h norm_tmp.h pb.c pb.h pipeline.c pipeline.h pixel.c pixel.h pixeltex.c pixeltex.h points.c points.h polygon.c polygon.h quads.c quads.h rastpos.c rastpos.h readpix.c readpix.h rect.c rect.h render_tmp.h scissor.c scissor.h shade.c shade.h shade_tmp.h simple_list.h span.c span.h stages.c stages.h state.c state.h stencil.c stencil.h texgen_tmp.h teximage.c teximage.h texobj.c texobj.h texstate.c texstate.h texture.c texture.h texutil.c texutil.h trans_tmp.h translate.c translate.h triangle.c triangle.h tritemp.h types.h varray.c varray.h vb.c vb.h vbcull.c vbcull.h vbfill.c vbfill.h vbindirect.c vbindirect.h vbrender.c vbrender.h vbxform.c vbxform.h vector.c vector.h vertices.c vertices.h winpos.c winpos.h xform.c xform.h xform_tmp.h zoom.c zoom.h + + +@HAVE_X86_TRUE@DRV_X86 = X86/libMesaX86.la +@HAVE_X86_TRUE@SUB_X86 = X86 + +@HAVE_FX_TRUE@DRV_FX = FX/libMesaFX.la +@HAVE_FX_TRUE@SUB_FX = FX +@HAVE_FX_TRUE@@HAVE_X86_TRUE@DRV_FX_X86 = FX/X86/libMesaFX_X86.la + +@HAVE_GGI_TRUE@DRV_GGI = GGI/libMesaGGI.la +@HAVE_GGI_TRUE@SUB_GGI = GGI + +@HAVE_OSMESA_TRUE@DRV_OSMESA = OSmesa/libMesaOS.la +@HAVE_OSMESA_TRUE@SUB_OSMESA = OSmesa + +@HAVE_SVGA_TRUE@DRV_SVGA = SVGA/libMesaSVGA.la +@HAVE_SVGA_TRUE@SUB_SVGA = SVGA + +@HAVE_X11_TRUE@DRV_X11 = X/libMesaX11.la +@HAVE_X11_TRUE@SUB_X11 = X + +SUBDIRS = $(SUB_X86) $(SUB_FX) $(SUB_GGI) $(SUB_OSMESA) $(SUB_SVGA) $(SUB_X11) + +libGL_la_LIBADD = $(DRV_X86) $(DRV_FX) $(DRV_FX_X86) $(DRV_GGI) $(DRV_OSMESA) $(DRV_SVGA) $(DRV_X11) $(THREAD_LIBS) + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../conf.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(lib_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/X86/libMesaFX_X86.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@GGI/libMesaGGI.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@GGI/libMesaGGI.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/libMesaFX.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@GGI/libMesaGGI.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@GGI/libMesaGGI.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@X86/libMesaX86.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@SVGA/libMesaSVGA.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X86/libMesaX86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/X86/libMesaFX_X86.la \ +@HAVE_FX_TRUE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@GGI/libMesaGGI.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@FX/libMesaFX.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@OSmesa/libMesaOS.la \ +@HAVE_FX_TRUE@@HAVE_X86_FALSE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_FALSE@@HAVE_X11_TRUE@X/libMesaX11.la +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_FALSE@@HAVE_GGI_TRUE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@OSmesa/libMesaOS.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_FALSE@@HAVE_OSMESA_TRUE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@libGL_la_DEPENDENCIES = \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@X86/libMesaX86.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@GGI/libMesaGGI.la \ +@HAVE_FX_FALSE@@HAVE_X86_TRUE@@HAVE_GGI_TRUE@@HAVE_OSMESA_FALSE@@HAVE_SVGA_TRUE@@HAVE_X11_FALSE@SVGA/libMesaSVGA.la +libGL_la_OBJECTS = aatriangle.lo accum.lo alpha.lo alphabuf.lo \ +attrib.lo bbox.lo bitmap.lo blend.lo buffers.lo clip.lo colortab.lo \ +config.lo context.lo copypix.lo cva.lo debug_xform.lo depth.lo \ +dispatch.lo dlist.lo drawpix.lo enable.lo enums.lo eval.lo \ +extensions.lo feedback.lo glapi.lo glapinoop.lo glthread.lo fog.lo \ +get.lo hash.lo hint.lo imaging.lo image.lo light.lo lines.lo logic.lo \ +masking.lo matrix.lo mem.lo mmath.lo pb.lo pipeline.lo pixel.lo \ +pixeltex.lo points.lo polygon.lo quads.lo rastpos.lo readpix.lo rect.lo \ +scissor.lo shade.lo span.lo stages.lo state.lo stencil.lo teximage.lo \ +texobj.lo texstate.lo texture.lo texutil.lo translate.lo triangle.lo \ +varray.lo vb.lo vbcull.lo vbfill.lo vbindirect.lo vbrender.lo \ +vbxform.lo vector.lo vertices.lo winpos.lo xform.lo zoom.lo +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DATA = $(sysconf_DATA) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +DIST_SUBDIRS = X86 FX GGI OSmesa SVGA X +SOURCES = $(libGL_la_SOURCES) +OBJECTS = $(libGL_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-libLTLIBRARIES: + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + +distclean-libLTLIBRARIES: + +maintainer-clean-libLTLIBRARIES: + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(libdir) + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libGL.la: $(libGL_la_OBJECTS) $(libGL_la_DEPENDENCIES) + $(LINK) -rpath $(libdir) $(libGL_la_LDFLAGS) $(libGL_la_OBJECTS) $(libGL_la_LIBADD) $(LIBS) + +install-sysconfDATA: $(sysconf_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(sysconfdir) + @list='$(sysconf_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$p; \ + fi; fi; \ + done + +uninstall-sysconfDATA: + @$(NORMAL_UNINSTALL) + list='$(sysconf_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(sysconfdir)/$$p; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(DIST_SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: install-libLTLIBRARIES install-sysconfDATA +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-libLTLIBRARIES uninstall-sysconfDATA +uninstall: uninstall-recursive +all-am: Makefile $(LTLIBRARIES) $(DATA) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(sysconfdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ + clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-libLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-recursive + +maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + +.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ +clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ +uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ +distclean-compile clean-compile maintainer-clean-compile \ +mostlyclean-libtool distclean-libtool clean-libtool \ +maintainer-clean-libtool uninstall-sysconfDATA install-sysconfDATA \ +install-data-recursive uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +strip: + -if strip -V 2>&1 | grep "GNU" > /dev/null; then \ + strip --strip-unneeded .libs/*.so; \ + strip --strip-debug .libs/*.a; \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/src/MesaGL.def b/xc/extras/Mesa/src/MesaGL.def new file mode 100644 index 000000000..4283a6c55 --- /dev/null +++ b/xc/extras/Mesa/src/MesaGL.def @@ -0,0 +1,409 @@ +DESCRIPTION 'Mesa for Windows DLL'
+EXETYPE WINDOWS
+HEAPSIZE 256000
+
+EXPORTS
+ glAccum
+ glAlphaFunc
+ glAreTexturesResident
+ glAreTexturesResidentEXT
+ glArrayElement
+ glArrayElementEXT
+ glBegin
+ glBindTexture
+ glBindTextureEXT
+ glBitmap
+ glBlendColorEXT
+ glBlendEquationEXT
+ glBlendFunc
+ glCallList
+ glCallLists
+ glClear
+ glClearAccum
+ glClearColor
+ glClearDepth
+ glClearIndex
+ glClearStencil
+ glClipPlane
+ glColor3b
+ glColor3bv
+ glColor3d
+ glColor3dv
+ glColor3f
+ glColor3fv
+ glColor3i
+ glColor3iv
+ glColor3s
+ glColor3sv
+ glColor3ub
+ glColor3ubv
+ glColor3ui
+ glColor3uiv
+ glColor3us
+ glColor3usv
+ glColor4b
+ glColor4bv
+ glColor4d
+ glColor4dv
+ glColor4f
+ glColor4fv
+ glColor4i
+ glColor4iv
+ glColor4s
+ glColor4sv
+ glColor4ub
+ glColor4ubv
+ glColor4ui
+ glColor4uiv
+ glColor4us
+ glColor4usv
+ glColorMask
+ glColorMaterial
+ glColorPointer
+ glColorPointerEXT
+ glColorSubTableEXT
+ glColorTableEXT
+ glCopyPixels
+ glCopyTexImage1D
+ glCopyTexImage2D
+ glCopyTexSubImage1D
+ glCopyTexSubImage2D
+ glCopyTexSubImage3DEXT
+ glCullFace
+ glDeleteLists
+ glDeleteTextures
+ glDeleteTexturesEXT
+ glDepthFunc
+ glDepthMask
+ glDepthRange
+ glDisable
+ glDisableClientState
+ glDrawArrays
+ glDrawArraysEXT
+ glDrawBuffer
+ glDrawElements
+ glDrawPixels
+ glEdgeFlag
+ glEdgeFlagPointer
+ glEdgeFlagPointerEXT
+ glEdgeFlagv
+ glEnable
+ glEnableClientState
+ glEnd
+ glEndList
+ glEvalCoord1d
+ glEvalCoord1dv
+ glEvalCoord1f
+ glEvalCoord1fv
+ glEvalCoord2d
+ glEvalCoord2dv
+ glEvalCoord2f
+ glEvalCoord2fv
+ glEvalMesh1
+ glEvalMesh2
+ glEvalPoint1
+ glEvalPoint2
+ glFeedbackBuffer
+ glFinish
+ glFlush
+ glFogf
+ glFogfv
+ glFogi
+ glFogiv
+ glFrontFace
+ glFrustum
+ glGenLists
+ glGenTextures
+ glGenTexturesEXT
+ glGetBooleanv
+ glGetClipPlane
+ glGetColorTableEXT
+ glGetColorTableParameterfvEXT
+ glGetColorTableParameterivEXT
+ glGetDoublev
+ glGetError
+ glGetFloatv
+ glGetIntegerv
+ glGetLightfv
+ glGetLightiv
+ glGetMapdv
+ glGetMapfv
+ glGetMapiv
+ glGetMaterialfv
+ glGetMaterialiv
+ glGetPixelMapfv
+ glGetPixelMapuiv
+ glGetPixelMapusv
+ glGetPointerv
+ glGetPointervEXT
+ glGetPolygonStipple
+ glGetString
+ glGetTexEnvfv
+ glGetTexEnviv
+ glGetTexGendv
+ glGetTexGenfv
+ glGetTexGeniv
+ glGetTexImage
+ glGetTexLevelParameterfv
+ glGetTexLevelParameteriv
+ glGetTexParameterfv
+ glGetTexParameteriv
+ glHint
+ glIndexd
+ glIndexdv
+ glIndexf
+ glIndexfv
+ glIndexi
+ glIndexiv
+ glIndexMask
+ glIndexPointer
+ glIndexPointerEXT
+ glIndexs
+ glIndexsv
+ glIndexub
+ glIndexubv
+ glInitNames
+ glInterleavedArrays
+ glIsEnabled
+ glIsList
+ glIsTexture
+ glIsTextureEXT
+ glLightf
+ glLightfv
+ glLighti
+ glLightiv
+ glLightModelf
+ glLightModelfv
+ glLightModeli
+ glLightModeliv
+ glLineStipple
+ glLineWidth
+ glListBase
+ glLoadIdentity
+ glLoadMatrixd
+ glLoadMatrixf
+ glLoadName
+ glLogicOp
+ glMap1d
+ glMap1f
+ glMap2d
+ glMap2f
+ glMapGrid1d
+ glMapGrid1f
+ glMapGrid2d
+ glMapGrid2f
+ glMaterialf
+ glMaterialfv
+ glMateriali
+ glMaterialiv
+ glMatrixMode
+ glMultMatrixd
+ glMultMatrixf
+ glNewList
+ glNormal3b
+ glNormal3bv
+ glNormal3d
+ glNormal3dv
+ glNormal3f
+ glNormal3fv
+ glNormal3i
+ glNormal3iv
+ glNormal3s
+ glNormal3sv
+ glNormalPointer
+ glNormalPointerEXT
+ glOrtho
+ glPassThrough
+ glPixelMapfv
+ glPixelMapuiv
+ glPixelMapusv
+ glPixelStoref
+ glPixelStorei
+ glPixelTransferf
+ glPixelTransferi
+ glPixelZoom
+ glPointParameterfEXT
+ glPointParameterfvEXT
+ glPointSize
+ glPolygonMode
+ glPolygonOffset
+ glPolygonOffsetEXT
+ glPolygonStipple
+ glPopAttrib
+ glPopClientAttrib
+ glPopMatrix
+ glPopName
+ glPrioritizeTextures
+ glPrioritizeTexturesEXT
+ glPushAttrib
+ glPushClientAttrib
+ glPushMatrix
+ glPushName
+ glRasterPos2d
+ glRasterPos2dv
+ glRasterPos2f
+ glRasterPos2fv
+ glRasterPos2i
+ glRasterPos2iv
+ glRasterPos2s
+ glRasterPos2sv
+ glRasterPos3d
+ glRasterPos3dv
+ glRasterPos3f
+ glRasterPos3fv
+ glRasterPos3i
+ glRasterPos3iv
+ glRasterPos3s
+ glRasterPos3sv
+ glRasterPos4d
+ glRasterPos4dv
+ glRasterPos4f
+ glRasterPos4fv
+ glRasterPos4i
+ glRasterPos4iv
+ glRasterPos4s
+ glRasterPos4sv
+ glReadBuffer
+ glReadPixels
+ glRectd
+ glRectdv
+ glRectf
+ glRectfv
+ glRecti
+ glRectiv
+ glRects
+ glRectsv
+ glRenderMode
+ glResizeBuffersMESA
+ glRotated
+ glRotatef
+ glScaled
+ glScalef
+ glScissor
+ glSelectBuffer
+ glShadeModel
+ glStencilFunc
+ glStencilMask
+ glStencilOp
+ glTexCoord1d
+ glTexCoord1dv
+ glTexCoord1f
+ glTexCoord1fv
+ glTexCoord1i
+ glTexCoord1iv
+ glTexCoord1s
+ glTexCoord1sv
+ glTexCoord2d
+ glTexCoord2dv
+ glTexCoord2f
+ glTexCoord2fv
+ glTexCoord2i
+ glTexCoord2iv
+ glTexCoord2s
+ glTexCoord2sv
+ glTexCoord3d
+ glTexCoord3dv
+ glTexCoord3f
+ glTexCoord3fv
+ glTexCoord3i
+ glTexCoord3iv
+ glTexCoord3s
+ glTexCoord3sv
+ glTexCoord4d
+ glTexCoord4dv
+ glTexCoord4f
+ glTexCoord4fv
+ glTexCoord4i
+ glTexCoord4iv
+ glTexCoord4s
+ glTexCoord4sv
+ glTexCoordPointer
+ glTexCoordPointerEXT
+ glTexEnvf
+ glTexEnvfv
+ glTexEnvi
+ glTexEnviv
+ glTexGend
+ glTexGendv
+ glTexGenf
+ glTexGenfv
+ glTexGeni
+ glTexGeniv
+ glTexImage1D
+ glTexImage2D
+ glTexImage3DEXT
+ glTexParameterf
+ glTexParameterfv
+ glTexParameteri
+ glTexParameteriv
+ glTexSubImage1D
+ glTexSubImage2D
+ glTexSubImage3DEXT
+ glTranslated
+ glTranslatef
+ glVertex2d
+ glVertex2dv
+ glVertex2f
+ glVertex2fv
+ glVertex2i
+ glVertex2iv
+ glVertex2s
+ glVertex2sv
+ glVertex3d
+ glVertex3dv
+ glVertex3f
+ glVertex3fv
+ glVertex3i
+ glVertex3iv
+ glVertex3s
+ glVertex3sv
+ glVertex4d
+ glVertex4dv
+ glVertex4f
+ glVertex4fv
+ glVertex4i
+ glVertex4iv
+ glVertex4s
+ glVertex4sv
+ glVertexPointer
+ glVertexPointerEXT
+ glViewport
+ glWindowPos2dMESA
+ glWindowPos2dvMESA
+ glWindowPos2fMESA
+ glWindowPos2fvMESA
+ glWindowPos2iMESA
+ glWindowPos2ivMESA
+ glWindowPos2sMESA
+ glWindowPos2svMESA
+ glWindowPos3dMESA
+ glWindowPos3dvMESA
+ glWindowPos3fMESA
+ glWindowPos3fvMESA
+ glWindowPos3iMESA
+ glWindowPos3ivMESA
+ glWindowPos3sMESA
+ glWindowPos3svMESA
+ glWindowPos4dMESA
+ glWindowPos4dvMESA
+ glWindowPos4fMESA
+ glWindowPos4fvMESA
+ glWindowPos4iMESA
+ glWindowPos4ivMESA
+ glWindowPos4sMESA
+ glWindowPos4svMESA
+ WMesaCreateContext
+ WMesaDestroyContext
+ WMesaMakeCurrent
+ WMesaPaletteChange
+ WMesaSwapBuffers
+ OSMesaCreateContext
+ OSMesaDestroyContext
+ OSMesaMakeCurrent
+ OSMesaGetCurrentContext
+ OSMesaPixelStore
+ OSMesaGetIntegerv
+ OSMesaGetDepthBuffer
+
+
+
diff --git a/xc/extras/Mesa/src/OSmesa/Makefile.am b/xc/extras/Mesa/src/OSmesa/Makefile.am new file mode 100644 index 000000000..9f71106c5 --- /dev/null +++ b/xc/extras/Mesa/src/OSmesa/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src + +if HAVE_OSMESA +# Build a libtool convenience library. +noinst_LTLIBRARIES = libMesaOS.la +endif + +libMesaOS_la_SOURCES = osmesa.c diff --git a/xc/extras/Mesa/src/OSmesa/Makefile.in b/xc/extras/Mesa/src/OSmesa/Makefile.in new file mode 100644 index 000000000..a46b7cd8f --- /dev/null +++ b/xc/extras/Mesa/src/OSmesa/Makefile.in @@ -0,0 +1,320 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src + +# Build a libtool convenience library. +@HAVE_OSMESA_TRUE@noinst_LTLIBRARIES = libMesaOS.la + +libMesaOS_la_SOURCES = osmesa.c +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../conf.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I../.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +libMesaOS_la_LDFLAGS = +libMesaOS_la_LIBADD = +libMesaOS_la_OBJECTS = osmesa.lo +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = $(libMesaOS_la_SOURCES) +OBJECTS = $(libMesaOS_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/OSmesa/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLTLIBRARIES: + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + +distclean-noinstLTLIBRARIES: + +maintainer-clean-noinstLTLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libMesaOS.la: $(libMesaOS_la_OBJECTS) $(libMesaOS_la_DEPENDENCIES) + $(LINK) $(libMesaOS_la_LDFLAGS) $(libMesaOS_la_OBJECTS) $(libMesaOS_la_LIBADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src/OSmesa + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LTLIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ + clean-tags clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ +clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/src/X/Makefile.am b/xc/extras/Mesa/src/X/Makefile.am new file mode 100644 index 000000000..bae8b2379 --- /dev/null +++ b/xc/extras/Mesa/src/X/Makefile.am @@ -0,0 +1,23 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src $(X_CFLAGS) $(FX_CFLAGS) + +if HAVE_X11 +# Build a libtool convenience library. +noinst_LTLIBRARIES = libMesaX11.la +endif + +libMesaX11_la_SOURCES = \ + glxapi.c \ + glxapi.h \ + fakeglx.c \ + xfonts.c \ + xmesa1.c \ + xmesa2.c \ + xmesa3.c \ + xmesa4.c \ + xmesaP.h + +libMesaX11_la_LIBADD = $(X_LIBS) $(X_PRE_LIBS) $(X_LIBADD) diff --git a/xc/extras/Mesa/src/X/Makefile.in b/xc/extras/Mesa/src/X/Makefile.in new file mode 100644 index 000000000..f86974fea --- /dev/null +++ b/xc/extras/Mesa/src/X/Makefile.in @@ -0,0 +1,324 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src $(X_CFLAGS) $(FX_CFLAGS) + +# Build a libtool convenience library. +@HAVE_X11_TRUE@noinst_LTLIBRARIES = libMesaX11.la + +libMesaX11_la_SOURCES = glxapi.c glxapi.h fakeglx.c xfonts.c xmesa1.c xmesa2.c xmesa3.c xmesa4.c xmesaP.h + + +libMesaX11_la_LIBADD = $(X_LIBS) $(X_PRE_LIBS) $(X_LIBADD) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../conf.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I../.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +libMesaX11_la_LDFLAGS = +libMesaX11_la_DEPENDENCIES = +libMesaX11_la_OBJECTS = glxapi.lo fakeglx.lo xfonts.lo xmesa1.lo \ +xmesa2.lo xmesa3.lo xmesa4.lo +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = $(libMesaX11_la_SOURCES) +OBJECTS = $(libMesaX11_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/X/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLTLIBRARIES: + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + +distclean-noinstLTLIBRARIES: + +maintainer-clean-noinstLTLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libMesaX11.la: $(libMesaX11_la_OBJECTS) $(libMesaX11_la_DEPENDENCIES) + $(LINK) $(libMesaX11_la_LDFLAGS) $(libMesaX11_la_OBJECTS) $(libMesaX11_la_LIBADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src/X + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LTLIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ + clean-tags clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ +clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/src/X86/Makefile.am b/xc/extras/Mesa/src/X86/Makefile.am new file mode 100644 index 000000000..d4d4f2ebd --- /dev/null +++ b/xc/extras/Mesa/src/X86/Makefile.am @@ -0,0 +1,70 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = no-dependencies + +x3dnow_files = \ + 3dnow.c \ + 3dnow.h \ + 3dnow_norm_raw.S \ + 3dnow_xform_masked1.S \ + 3dnow_xform_masked2.S \ + 3dnow_xform_masked3.S \ + 3dnow_xform_masked4.S \ + 3dnow_xform_raw1.S \ + 3dnow_xform_raw2.S \ + 3dnow_xform_raw3.S \ + 3dnow_xform_raw4.S \ + vertex_3dnow.S + +katmai_files = \ + katmai.c \ + katmai.h \ + katmai_norm_raw.S \ + katmai_xform_raw1.S \ + katmai_xform_masked1.S \ + katmai_xform_raw2.S \ + katmai_xform_masked2.S \ + katmai_xform_raw3.S \ + katmai_xform_masked3.S \ + katmai_xform_raw4.S \ + katmai_xform_masked4.S \ + vertex_katmai.S + +mmx_files = mmx.h mmx_blend.S + +if HAVE_3DNOW +x3dnow_sources = $(x3dnow_files) +CFLAGS_3DNOW = -DUSE_3DNOW_ASM +endif + +if HAVE_SSE +katmai_sources = $(katmai_files) +CFLAGS_KATMAI = -DUSE_KATMAI_ASM +endif + +if HAVE_MMX +mmx_sources = $(mmx_files) +CFLAGS_MMX = -DUSE_MMX_ASM +endif + +if HAVE_X86 +# Build a libtool convenience library. +noinst_LTLIBRARIES = libMesaX86.la +CFLAGS_X86 = -DUSE_X86_ASM +endif + +libMesaX86_la_SOURCES = x86a.S assyntax.h \ + common_x86.c common_x86_asm.S common_x86_asm.h \ + common_x86_features.h glapi_x86.S \ + x86.c x86.h vertex.S $(mmx_sources) $(x3dnow_sources) $(katmai_sources) + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src $(CFLAGS_X86) $(CFLAGS_MMX) $(CFLAGS_3DNOW) $(CFLAGS_KATMAI) + +EXTRA_DIST = x86flatregs.m4 x86a.S.m4 $(x3dnow_files) $(mmx_files) $(katmai_files) + +x86a.S: $(srcdir)/x86flatregs.m4 +x86a.S: $(srcdir)/x86a.S.m4 + m4 $< >$@ + +x86a.asm: x86a.S + gcc -E -P -DNASM_ASSEMBLER $< >$@ diff --git a/xc/extras/Mesa/src/X86/Makefile.in b/xc/extras/Mesa/src/X86/Makefile.in new file mode 100644 index 000000000..31a68c082 --- /dev/null +++ b/xc/extras/Mesa/src/X86/Makefile.in @@ -0,0 +1,472 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +AUTOMAKE_OPTIONS = no-dependencies + +x3dnow_files = 3dnow.c 3dnow.h 3dnow_norm_raw.S 3dnow_xform_masked1.S 3dnow_xform_masked2.S 3dnow_xform_masked3.S 3dnow_xform_masked4.S 3dnow_xform_raw1.S 3dnow_xform_raw2.S 3dnow_xform_raw3.S 3dnow_xform_raw4.S vertex_3dnow.S + + +katmai_files = katmai.c katmai.h katmai_norm_raw.S katmai_xform_raw1.S katmai_xform_masked1.S katmai_xform_raw2.S katmai_xform_masked2.S katmai_xform_raw3.S katmai_xform_masked3.S katmai_xform_raw4.S katmai_xform_masked4.S vertex_katmai.S + + +mmx_files = mmx.h mmx_blend.S + +@HAVE_3DNOW_TRUE@x3dnow_sources = $(x3dnow_files) +@HAVE_3DNOW_TRUE@CFLAGS_3DNOW = -DUSE_3DNOW_ASM + +@HAVE_SSE_TRUE@katmai_sources = $(katmai_files) +@HAVE_SSE_TRUE@CFLAGS_KATMAI = -DUSE_KATMAI_ASM + +@HAVE_MMX_TRUE@mmx_sources = $(mmx_files) +@HAVE_MMX_TRUE@CFLAGS_MMX = -DUSE_MMX_ASM + +# Build a libtool convenience library. +@HAVE_X86_TRUE@noinst_LTLIBRARIES = libMesaX86.la +@HAVE_X86_TRUE@CFLAGS_X86 = -DUSE_X86_ASM + +libMesaX86_la_SOURCES = x86a.S assyntax.h common_x86.c common_x86_asm.S common_x86_asm.h common_x86_features.h glapi_x86.S x86.c x86.h vertex.S $(mmx_sources) $(x3dnow_sources) $(katmai_sources) + + +INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src $(CFLAGS_X86) $(CFLAGS_MMX) $(CFLAGS_3DNOW) $(CFLAGS_KATMAI) + +EXTRA_DIST = x86flatregs.m4 x86a.S.m4 $(x3dnow_files) $(mmx_files) $(katmai_files) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../conf.h +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I../.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +libMesaX86_la_LDFLAGS = +libMesaX86_la_LIBADD = +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@libMesaX86_la_OBJECTS = \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@x86a.lo common_x86.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@common_x86_asm.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@glapi_x86.lo x86.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@vertex.lo mmx_blend.lo +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@libMesaX86_la_OBJECTS = \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@x86a.lo common_x86.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@common_x86_asm.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@glapi_x86.lo x86.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@vertex.lo katmai.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_norm_raw.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_raw1.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_masked1.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_raw2.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_masked2.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_raw3.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_masked3.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_raw4.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_masked4.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@vertex_katmai.lo +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@libMesaX86_la_OBJECTS = \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@x86a.lo common_x86.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@common_x86_asm.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@glapi_x86.lo x86.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@vertex.lo 3dnow.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_norm_raw.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_masked1.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_masked2.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_masked3.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_masked4.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_raw1.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_raw2.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_raw3.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_raw4.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@vertex_3dnow.lo +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@libMesaX86_la_OBJECTS = \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@x86a.lo common_x86.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@common_x86_asm.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@glapi_x86.lo x86.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@vertex.lo 3dnow.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_norm_raw.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_masked1.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_masked2.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_masked3.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_masked4.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_raw1.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_raw2.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_raw3.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_raw4.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@vertex_3dnow.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_norm_raw.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_raw1.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_masked1.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_raw2.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_masked2.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_raw3.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_masked3.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_raw4.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_masked4.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@vertex_katmai.lo +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@libMesaX86_la_OBJECTS = \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@x86a.lo common_x86.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@common_x86_asm.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@glapi_x86.lo x86.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@vertex.lo mmx_blend.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_norm_raw.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_masked1.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_masked2.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_masked3.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_masked4.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_raw1.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_raw2.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_raw3.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@3dnow_xform_raw4.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_FALSE@@HAVE_3DNOW_TRUE@vertex_3dnow.lo +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@libMesaX86_la_OBJECTS = \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@x86a.lo common_x86.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@common_x86_asm.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@glapi_x86.lo x86.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@vertex.lo mmx_blend.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_norm_raw.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_raw1.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_masked1.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_raw2.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_masked2.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_raw3.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_masked3.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_raw4.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@katmai_xform_masked4.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_FALSE@vertex_katmai.lo +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@libMesaX86_la_OBJECTS = \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@x86a.lo common_x86.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@common_x86_asm.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@glapi_x86.lo x86.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@vertex.lo mmx_blend.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_norm_raw.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_masked1.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_masked2.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_masked3.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_masked4.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_raw1.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_raw2.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_raw3.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@3dnow_xform_raw4.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@vertex_3dnow.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_norm_raw.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_raw1.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_masked1.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_raw2.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_masked2.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_raw3.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_masked3.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_raw4.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@katmai_xform_masked4.lo \ +@HAVE_MMX_TRUE@@HAVE_SSE_TRUE@@HAVE_3DNOW_TRUE@vertex_katmai.lo +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@libMesaX86_la_OBJECTS = \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@x86a.lo common_x86.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@common_x86_asm.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@glapi_x86.lo x86.lo \ +@HAVE_MMX_FALSE@@HAVE_SSE_FALSE@@HAVE_3DNOW_FALSE@vertex.lo +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = $(libMesaX86_la_SOURCES) +OBJECTS = $(libMesaX86_la_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/X86/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLTLIBRARIES: + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + +distclean-noinstLTLIBRARIES: + +maintainer-clean-noinstLTLIBRARIES: + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +libMesaX86.la: $(libMesaX86_la_OBJECTS) $(libMesaX86_la_DEPENDENCIES) + $(LINK) $(libMesaX86_la_LDFLAGS) $(libMesaX86_la_OBJECTS) $(libMesaX86_la_LIBADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src/X86 + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile $(LTLIBRARIES) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLTLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ + clean-tags clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ + distclean-libtool distclean-tags distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ +clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +x86a.S: $(srcdir)/x86flatregs.m4 +x86a.S: $(srcdir)/x86a.S.m4 + m4 $< >$@ + +x86a.asm: x86a.S + gcc -E -P -DNASM_ASSEMBLER $< >$@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/src/aamask.c b/xc/extras/Mesa/src/aamask.c new file mode 100644 index 000000000..da84e6fc0 --- /dev/null +++ b/xc/extras/Mesa/src/aamask.c @@ -0,0 +1,39 @@ + + +static void +build_aa_samples(GLint xSamples, GLint ySamples, + GLfloat samples[][2]) +{ + const GLfloat dx = 1.0F / (GLfloat) xSamples; + const GLfloat dy = 1.0F / (GLfloat) ySamples; + GLint x, y; + GLint i; + + i = 4; + for (x = 0; x < xSamples; x++) { + for (y = 0; y < ySamples; y++) { + GLint j; + if (x == 0 && y == 0) { + /* lower left */ + j = 0; + } + else if (x == xSamples - 1 && y == 0) { + /* lower right */ + j = 1; + } + else if (x == 0 && y == ySamples - 1) { + /* upper left */ + j = 2; + } + else if (x == xSamples - 1 && y == ySamples - 1) { + /* upper right */ + j = 3; + } + else { + j = i++; + } + samples[j][0] = x * dx; + samples[j][1] = y * dy; + } + } +} diff --git a/xc/extras/Mesa/src/depend b/xc/extras/Mesa/src/depend new file mode 100644 index 000000000..1e2404b9a --- /dev/null +++ b/xc/extras/Mesa/src/depend @@ -0,0 +1,429 @@ +# DO NOT DELETE + +aatriangle.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h +aatriangle.o: aatriangle.h types.h config.h fixed.h glapitable.h glthread.h +aatriangle.o: macros.h matrix.h vb.h vector.h dd.h span.h aatritemp.h +accum.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h accum.h types.h +accum.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +accum.o: vector.h dd.h context.h glapi.h mem.h masking.h span.h state.h +alpha.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h alpha.h types.h +alpha.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +alpha.o: vector.h dd.h context.h glapi.h mmath.h +alphabuf.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h alphabuf.h +alphabuf.o: types.h config.h fixed.h glapitable.h glthread.h macros.h +alphabuf.o: matrix.h vb.h vector.h dd.h context.h glapi.h mem.h +attrib.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h attrib.h +attrib.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +attrib.o: vb.h vector.h dd.h buffers.h context.h glapi.h enable.h enums.h +attrib.o: mem.h simple_list.h texstate.h +bbox.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h bbox.h types.h +bbox.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +bbox.o: vector.h dd.h xform.h +bitmap.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h bitmap.h +bitmap.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +bitmap.o: vb.h vector.h dd.h context.h glapi.h feedback.h image.h pb.h +bitmap.o: pixel.h state.h vbrender.h +blend.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h alphabuf.h +blend.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +blend.o: vb.h vector.h dd.h blend.h context.h glapi.h enums.h pb.h span.h +buffers.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h accum.h +buffers.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +buffers.o: vb.h vector.h dd.h alphabuf.h buffers.h context.h glapi.h depth.h +buffers.o: enums.h masking.h mem.h stencil.h state.h +clip.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h clip.h types.h +clip.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +clip.o: vector.h dd.h context.h glapi.h mmath.h xform.h interp_tmp.h +clip.o: clip_funcs.h general_clip.h +colortab.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h colortab.h +colortab.o: types.h config.h fixed.h glapitable.h glthread.h macros.h +colortab.o: matrix.h vb.h vector.h dd.h context.h glapi.h image.h mem.h +colortab.o: mmath.h span.h +config.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h config.h +config.o: enums.h extensions.h types.h fixed.h glapitable.h glthread.h +config.o: macros.h matrix.h vb.h vector.h dd.h hint.h simple_list.h mem.h +context.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h accum.h +context.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +context.o: vb.h vector.h dd.h alphabuf.h clip.h colortab.h context.h glapi.h +context.o: cva.h depth.h dlist.h eval.h enums.h extensions.h fog.h get.h +context.o: glapinoop.h hash.h light.h mem.h mmath.h pb.h pipeline.h shade.h +context.o: simple_list.h stencil.h stages.h state.h translate.h teximage.h +context.o: texobj.h texstate.h texture.h varray.h vbcull.h vbrender.h +context.o: vbxform.h vertices.h xform.h +copypix.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +copypix.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +copypix.o: matrix.h vb.h vector.h dd.h copypix.h depth.h feedback.h imaging.h +copypix.o: mem.h mmath.h pixel.h pixeltex.h span.h state.h stencil.h +copypix.o: texture.h zoom.h +cva.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h types.h config.h +cva.o: fixed.h glapitable.h glthread.h macros.h matrix.h vb.h vector.h dd.h +cva.o: cva.h context.h glapi.h mem.h pipeline.h varray.h vbcull.h vbrender.h +cva.o: vbxform.h +debug_xform.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +debug_xform.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h +debug_xform.o: macros.h matrix.h vb.h vector.h dd.h mem.h xform.h +debug_xform.o: debug_xform.h +depth.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +depth.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +depth.o: matrix.h vb.h vector.h dd.h enums.h depth.h mem.h pb.h +dispatch.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h glapi.h +dispatch.o: glapitable.h glapitemp.h +dlist.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h accum.h types.h +dlist.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +dlist.o: vector.h dd.h attrib.h bitmap.h bbox.h blend.h buffers.h clip.h +dlist.o: colortab.h context.h glapi.h copypix.h cva.h depth.h enable.h +dlist.o: enums.h eval.h extensions.h feedback.h get.h hash.h image.h +dlist.o: imaging.h light.h lines.h dlist.h mem.h pipeline.h pixel.h +dlist.o: pixeltex.h points.h polygon.h readpix.h rect.h state.h texobj.h +dlist.o: teximage.h texstate.h varray.h vbfill.h vbxform.h xform.h +drawpix.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +drawpix.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +drawpix.o: matrix.h vb.h vector.h dd.h drawpix.h feedback.h image.h mem.h +drawpix.o: mmath.h pixel.h pixeltex.h span.h state.h stencil.h texture.h +drawpix.o: zoom.h +enable.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +enable.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +enable.o: matrix.h vb.h vector.h dd.h enable.h light.h mmath.h simple_list.h +enable.o: vbfill.h xform.h enums.h +enums.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h enums.h mem.h +eval.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h glapi.h +eval.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +eval.o: vb.h vector.h dd.h eval.h mem.h mmath.h vbcull.h vbfill.h vbxform.h +extensions.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +extensions.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h +extensions.o: macros.h matrix.h vb.h vector.h dd.h extensions.h mem.h +extensions.o: simple_list.h +feedback.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +feedback.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +feedback.o: matrix.h vb.h vector.h dd.h enums.h feedback.h mmath.h triangle.h +fog.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h glapi.h +fog.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +fog.o: vb.h vector.h dd.h fog.h mmath.h xform.h fog_tmp.h +get.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h glapi.h +get.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +get.o: vb.h vector.h dd.h enable.h enums.h extensions.h get.h mmath.h +glapi.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h glapi.h +glapi.o: glapinoop.h glapioffsets.h glapitable.h glthread.h +glapinoop.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h glapi.h +glapinoop.o: glapinoop.h glapitable.h glapitemp.h +glthread.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h glthread.h +hash.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h glthread.h hash.h +hash.o: mem.h +hint.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h enums.h context.h +hint.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +hint.o: matrix.h vb.h vector.h dd.h hint.h state.h +image.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +image.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +image.o: matrix.h vb.h vector.h dd.h image.h imaging.h mem.h mmath.h pixel.h +imaging.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +imaging.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +imaging.o: matrix.h vb.h vector.h dd.h image.h imaging.h mmath.h span.h +light.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +light.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +light.o: matrix.h vb.h vector.h dd.h enums.h light.h mem.h mmath.h +light.o: simple_list.h xform.h +lines.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +lines.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +lines.o: matrix.h vb.h vector.h dd.h depth.h feedback.h lines.h mmath.h pb.h +lines.o: texstate.h linetemp.h lnaatemp.h +logic.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h alphabuf.h +logic.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +logic.o: vb.h vector.h dd.h context.h glapi.h logic.h pb.h span.h +masking.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h alphabuf.h +masking.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +masking.o: vb.h vector.h dd.h context.h glapi.h enums.h masking.h pb.h span.h +matrix.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h buffers.h +matrix.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +matrix.o: vb.h vector.h dd.h context.h glapi.h enums.h mem.h mmath.h +mem.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h macros.h mem.h +mmath.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h mmath.h +pb.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h alpha.h types.h +pb.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +pb.o: vector.h dd.h alphabuf.h blend.h depth.h fog.h logic.h mem.h masking.h +pb.o: pb.h scissor.h stencil.h texture.h +pipeline.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h bbox.h +pipeline.o: types.h config.h fixed.h glapitable.h glthread.h macros.h +pipeline.o: matrix.h vb.h vector.h dd.h clip.h context.h glapi.h cva.h fog.h +pipeline.o: light.h mem.h mmath.h pipeline.h shade.h stages.h state.h +pipeline.o: translate.h vbcull.h vbindirect.h vbrender.h vbxform.h xform.h +pixel.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +pixel.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +pixel.o: matrix.h vb.h vector.h dd.h mem.h pixel.h +pixeltex.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +pixeltex.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +pixeltex.o: matrix.h vb.h vector.h dd.h pixeltex.h +points.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +points.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +points.o: matrix.h vb.h vector.h dd.h feedback.h mmath.h pb.h points.h span.h +points.o: texstate.h +polygon.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +polygon.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +polygon.o: matrix.h vb.h vector.h dd.h image.h enums.h mem.h polygon.h +quads.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h quads.h types.h +quads.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +quads.o: vector.h dd.h +rastpos.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h clip.h types.h +rastpos.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +rastpos.o: vector.h dd.h context.h glapi.h feedback.h light.h mmath.h +rastpos.o: rastpos.h shade.h state.h xform.h +readpix.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h alphabuf.h +readpix.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +readpix.o: vb.h vector.h dd.h context.h glapi.h depth.h feedback.h image.h +readpix.o: mem.h pixel.h readpix.h span.h stencil.h +rect.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h glapi.h +rect.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +rect.o: vb.h vector.h dd.h rect.h varray.h vbfill.h +scissor.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +scissor.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +scissor.o: matrix.h vb.h vector.h dd.h scissor.h +shade.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h light.h types.h +shade.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +shade.o: vector.h dd.h mmath.h pipeline.h shade.h simple_list.h shade_tmp.h +span.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h alpha.h types.h +span.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +span.o: vector.h dd.h alphabuf.h blend.h depth.h fog.h logic.h masking.h +span.o: mem.h scissor.h span.h stencil.h texture.h +stages.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h bbox.h types.h +stages.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +stages.o: vector.h dd.h clip.h context.h glapi.h cva.h fog.h light.h mmath.h +stages.o: pipeline.h shade.h stages.h translate.h vbcull.h vbindirect.h +stages.o: vbrender.h vbxform.h xform.h +state.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h accum.h types.h +state.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +state.o: vector.h dd.h alpha.h attrib.h bitmap.h blend.h buffers.h clip.h +state.o: colortab.h context.h glapi.h copypix.h cva.h depth.h dlist.h +state.o: drawpix.h enable.h eval.h get.h feedback.h fog.h hint.h imaging.h +state.o: light.h lines.h logic.h masking.h mmath.h pipeline.h pixel.h +state.o: pixeltex.h points.h polygon.h quads.h rastpos.h readpix.h rect.h +state.o: scissor.h shade.h state.h stencil.h teximage.h texobj.h texstate.h +state.o: texture.h triangle.h varray.h vbfill.h vbrender.h winpos.h +stencil.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +stencil.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +stencil.o: matrix.h vb.h vector.h dd.h depth.h mem.h pb.h stencil.h enable.h +teximage.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +teximage.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +teximage.o: matrix.h vb.h vector.h dd.h image.h mem.h mmath.h span.h +teximage.o: teximage.h texstate.h +texobj.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h colortab.h +texobj.o: types.h config.h fixed.h glapitable.h glthread.h macros.h matrix.h +texobj.o: vb.h vector.h dd.h context.h glapi.h enums.h hash.h mem.h +texobj.o: teximage.h texstate.h texobj.h +texstate.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +texstate.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +texstate.o: matrix.h vb.h vector.h dd.h enums.h extensions.h texobj.h +texstate.o: teximage.h texstate.h texture.h xform.h +texture.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +texture.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +texture.o: matrix.h vb.h vector.h dd.h mmath.h mem.h pb.h teximage.h +texture.o: texture.h xform.h texgen_tmp.h +texutil.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +texutil.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +texutil.o: matrix.h vb.h vector.h dd.h image.h mem.h texutil.h +translate.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h mem.h +translate.o: mmath.h translate.h types.h config.h fixed.h glapitable.h +translate.o: glthread.h macros.h matrix.h vb.h vector.h dd.h trans_tmp.h +triangle.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h aatriangle.h +triangle.o: types.h config.h fixed.h glapitable.h glthread.h macros.h +triangle.o: matrix.h vb.h vector.h dd.h context.h glapi.h depth.h feedback.h +triangle.o: mem.h mmath.h span.h teximage.h texstate.h triangle.h tritemp.h +varray.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +varray.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +varray.o: matrix.h vb.h vector.h dd.h cva.h enable.h enums.h dlist.h light.h +varray.o: mmath.h pipeline.h state.h texstate.h translate.h varray.h vbfill.h +varray.o: vbrender.h vbindirect.h vbxform.h xform.h +vb.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h mem.h types.h +vb.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +vb.o: vector.h dd.h vbxform.h xform.h +vbcull.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +vbcull.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +vbcull.o: matrix.h vb.h vector.h dd.h mem.h vbcull.h vbrender.h xform.h +vbcull.o: cull_tmp.h +vbfill.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +vbfill.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +vbfill.o: matrix.h vb.h vector.h dd.h enums.h light.h mmath.h state.h +vbfill.o: varray.h vbcull.h vbfill.h vbrender.h vbxform.h xform.h +vbindirect.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h pb.h +vbindirect.o: types.h config.h fixed.h glapitable.h glthread.h macros.h +vbindirect.o: matrix.h vb.h vector.h dd.h pipeline.h stages.h vbcull.h +vbindirect.o: vbindirect.h vbrender.h +vbrender.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h clip.h +vbrender.o: types.h config.h fixed.h glapitable.h glthread.h macros.h +vbrender.o: matrix.h vb.h vector.h dd.h context.h glapi.h light.h lines.h +vbrender.o: pb.h points.h pipeline.h stages.h vbcull.h vbrender.h +vbrender.o: vbindirect.h xform.h render_tmp.h +vbxform.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +vbxform.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +vbxform.o: matrix.h vb.h vector.h dd.h cva.h clip.h eval.h enums.h dlist.h +vbxform.o: fog.h light.h mem.h mmath.h pipeline.h shade.h state.h texture.h +vbxform.o: varray.h vbcull.h vbfill.h vbrender.h vbxform.h xform.h +vector.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h config.h +vector.o: macros.h mem.h vector.h +vertices.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h types.h +vertices.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +vertices.o: vector.h dd.h vertices.h +winpos.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +winpos.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +winpos.o: matrix.h vb.h vector.h dd.h feedback.h mmath.h rastpos.h winpos.h +xform.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +xform.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +xform.o: matrix.h vb.h vector.h dd.h mmath.h xform.h xform_tmp.h clip_tmp.h +xform.o: norm_tmp.h dotprod_tmp.h copy_tmp.h +zoom.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h macros.h span.h +zoom.o: types.h config.h fixed.h glapitable.h glthread.h matrix.h vb.h +zoom.o: vector.h dd.h stencil.h zoom.h +X86/x86.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +X86/x86.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h macros.h +X86/x86.o: matrix.h vb.h vector.h dd.h vertices.h xform.h X86/x86.h +X86/common_x86.o: X86/common_x86_asm.h X86/common_x86_features.h +X86/3dnow.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +X86/3dnow.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h +X86/3dnow.o: macros.h matrix.h vb.h vector.h dd.h vertices.h xform.h +X86/3dnow.o: X86/3dnow.h +X86/katmai.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h context.h +X86/katmai.o: glapi.h types.h config.h fixed.h glapitable.h glthread.h +X86/katmai.o: macros.h matrix.h vb.h vector.h dd.h vertices.h xform.h +X86/katmai.o: X86/katmai.h +X/glxapi.o: glapi.h ../include/GL/gl.h ../include/GL/glext.h X/glxapi.h +X/glxapi.o: ../include/GL/glx.h +X/fakeglx.o: X/glxheader.h glheader.h ../include/GL/gl.h +X/fakeglx.o: ../include/GL/glext.h X/glxapi.h ../include/GL/glx.h +X/fakeglx.o: ../include/GL/xmesa.h ../include/GL/xmesa_x.h context.h glapi.h +X/fakeglx.o: types.h config.h fixed.h glapitable.h glthread.h macros.h +X/fakeglx.o: matrix.h vb.h vector.h dd.h mmath.h X/xfonts.h X/xmesaP.h +X/fakeglx.o: ../include/GL/fxmesa.h FX/fxdrv.h mem.h texture.h xform.h clip.h +X/fakeglx.o: vbrender.h FX/fxglidew.h +X/xfonts.o: ../include/GL/gl.h ../include/GL/glext.h ../include/GL/glx.h +X/xfonts.o: context.h glapi.h types.h glheader.h config.h fixed.h +X/xfonts.o: glapitable.h glthread.h macros.h matrix.h vb.h vector.h dd.h +X/xfonts.o: mem.h X/xfonts.h +X/xmesa1.o: X/glxheader.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +X/xmesa1.o: ../include/GL/xmesa.h ../include/GL/xmesa_x.h X/xmesaP.h types.h +X/xmesa1.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +X/xmesa1.o: vector.h dd.h ../include/GL/fxmesa.h FX/fxdrv.h context.h glapi.h +X/xmesa1.o: mem.h texture.h xform.h clip.h vbrender.h FX/fxglidew.h +X/xmesa1.o: extensions.h +X/xmesa2.o: X/glxheader.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +X/xmesa2.o: context.h glapi.h types.h config.h fixed.h glapitable.h +X/xmesa2.o: glthread.h macros.h matrix.h vb.h vector.h dd.h drawpix.h mem.h +X/xmesa2.o: state.h depth.h X/xmesaP.h ../include/GL/xmesa.h +X/xmesa2.o: ../include/GL/xmesa_x.h ../include/GL/fxmesa.h FX/fxdrv.h +X/xmesa2.o: texture.h xform.h clip.h vbrender.h FX/fxglidew.h extensions.h +X/xmesa3.o: X/glxheader.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +X/xmesa3.o: depth.h types.h config.h fixed.h glapitable.h glthread.h macros.h +X/xmesa3.o: matrix.h vb.h vector.h dd.h X/xmesaP.h ../include/GL/xmesa.h +X/xmesa3.o: ../include/GL/xmesa_x.h ../include/GL/fxmesa.h FX/fxdrv.h +X/xmesa3.o: context.h glapi.h mem.h texture.h xform.h clip.h vbrender.h +X/xmesa3.o: FX/fxglidew.h linetemp.h +X/xmesa4.o: X/glxheader.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +X/xmesa4.o: depth.h types.h config.h fixed.h glapitable.h glthread.h macros.h +X/xmesa4.o: matrix.h vb.h vector.h dd.h X/xmesaP.h ../include/GL/xmesa.h +X/xmesa4.o: ../include/GL/xmesa_x.h ../include/GL/fxmesa.h FX/fxdrv.h +X/xmesa4.o: context.h glapi.h mem.h texture.h xform.h clip.h vbrender.h +X/xmesa4.o: FX/fxglidew.h tritemp.h +OSmesa/osmesa.o: glheader.h ../include/GL/gl.h ../include/GL/glext.h +OSmesa/osmesa.o: ../include/GL/osmesa.h context.h glapi.h types.h config.h +OSmesa/osmesa.o: fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +OSmesa/osmesa.o: vector.h dd.h depth.h mem.h extensions.h linetemp.h +OSmesa/osmesa.o: tritemp.h +SVGA/svgamesa.o: ../include/GL/svgamesa.h ../include/GL/gl.h +SVGA/svgamesa.o: ../include/GL/glext.h context.h glapi.h types.h glheader.h +SVGA/svgamesa.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h +SVGA/svgamesa.o: vb.h vector.h dd.h SVGA/svgapix.h SVGA/svgamesa8.h +SVGA/svgamesa.o: SVGA/svgamesa15.h SVGA/svgamesa16.h SVGA/svgamesa24.h +SVGA/svgamesa.o: SVGA/svgamesa32.h +SVGA/svgamesa8.o: SVGA/svgapix.h ../include/GL/gl.h ../include/GL/glext.h +SVGA/svgamesa8.o: ../include/GL/svgamesa.h context.h glapi.h types.h +SVGA/svgamesa8.o: glheader.h config.h fixed.h glapitable.h glthread.h +SVGA/svgamesa8.o: macros.h matrix.h vb.h vector.h dd.h SVGA/svgamesa8.h +SVGA/svgamesa15.o: SVGA/svgapix.h ../include/GL/gl.h ../include/GL/glext.h +SVGA/svgamesa15.o: ../include/GL/svgamesa.h context.h glapi.h types.h +SVGA/svgamesa15.o: glheader.h config.h fixed.h glapitable.h glthread.h +SVGA/svgamesa15.o: macros.h matrix.h vb.h vector.h dd.h SVGA/svgamesa15.h +SVGA/svgamesa16.o: SVGA/svgapix.h ../include/GL/gl.h ../include/GL/glext.h +SVGA/svgamesa16.o: ../include/GL/svgamesa.h context.h glapi.h types.h +SVGA/svgamesa16.o: glheader.h config.h fixed.h glapitable.h glthread.h +SVGA/svgamesa16.o: macros.h matrix.h vb.h vector.h dd.h SVGA/svgamesa16.h +SVGA/svgamesa24.o: SVGA/svgapix.h ../include/GL/gl.h ../include/GL/glext.h +SVGA/svgamesa24.o: ../include/GL/svgamesa.h context.h glapi.h types.h +SVGA/svgamesa24.o: glheader.h config.h fixed.h glapitable.h glthread.h +SVGA/svgamesa24.o: macros.h matrix.h vb.h vector.h dd.h SVGA/svgamesa24.h +SVGA/svgamesa32.o: SVGA/svgapix.h ../include/GL/gl.h ../include/GL/glext.h +SVGA/svgamesa32.o: ../include/GL/svgamesa.h context.h glapi.h types.h +SVGA/svgamesa32.o: glheader.h config.h fixed.h glapitable.h glthread.h +SVGA/svgamesa32.o: macros.h matrix.h vb.h vector.h dd.h SVGA/svgamesa32.h +FX/fxapi.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxapi.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxapi.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h texture.h +FX/fxapi.o: xform.h clip.h vbrender.h ../include/GL/fxmesa.h FX/fxglidew.h +FX/fxclip.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxclip.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxclip.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h texture.h +FX/fxclip.o: xform.h clip.h vbrender.h ../include/GL/fxmesa.h FX/fxglidew.h +FX/fxclip.o: mmath.h FX/fxcliptmp.h +FX/fxcva.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxcva.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxcva.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h texture.h +FX/fxcva.o: xform.h clip.h vbrender.h ../include/GL/fxmesa.h FX/fxglidew.h +FX/fxcva.o: mmath.h vbindirect.h pb.h FX/fxvsetup.h pipeline.h stages.h +FX/fxcva.o: FX/fxcvatmp.h +FX/fxdd.o: image.h types.h glheader.h ../include/GL/gl.h +FX/fxdd.o: ../include/GL/glext.h config.h fixed.h glapitable.h glthread.h +FX/fxdd.o: macros.h matrix.h vb.h vector.h dd.h FX/fxdrv.h context.h glapi.h +FX/fxdd.o: mem.h texture.h xform.h clip.h vbrender.h ../include/GL/fxmesa.h +FX/fxdd.o: FX/fxglidew.h enums.h extensions.h pb.h +FX/fxddspan.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxddspan.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxddspan.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h +FX/fxddspan.o: texture.h xform.h clip.h vbrender.h ../include/GL/fxmesa.h +FX/fxddspan.o: FX/fxglidew.h +FX/fxddtex.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxddtex.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxddtex.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h texture.h +FX/fxddtex.o: xform.h clip.h vbrender.h ../include/GL/fxmesa.h FX/fxglidew.h +FX/fxddtex.o: image.h texutil.h +FX/fxfastpath.o: types.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxfastpath.o: config.h fixed.h glapitable.h glthread.h macros.h matrix.h +FX/fxfastpath.o: vb.h vector.h dd.h cva.h mmath.h FX/fxdrv.h context.h +FX/fxfastpath.o: glapi.h mem.h texture.h xform.h clip.h vbrender.h +FX/fxfastpath.o: ../include/GL/fxmesa.h FX/fxglidew.h vertices.h +FX/fxfastpath.o: X86/common_x86_asm.h X86/common_x86_features.h +FX/fxfastpath.o: FX/fxfasttmp.h render_tmp.h +FX/fxpipeline.o: FX/fxdrv.h glheader.h ../include/GL/gl.h +FX/fxpipeline.o: ../include/GL/glext.h context.h glapi.h types.h config.h +FX/fxpipeline.o: fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +FX/fxpipeline.o: vector.h dd.h mem.h texture.h xform.h clip.h vbrender.h +FX/fxpipeline.o: ../include/GL/fxmesa.h FX/fxglidew.h vbindirect.h +FX/fxrender.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxrender.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxrender.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h +FX/fxrender.o: texture.h xform.h clip.h vbrender.h ../include/GL/fxmesa.h +FX/fxrender.o: FX/fxglidew.h vbcull.h render_tmp.h +FX/fxsanity.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxsanity.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxsanity.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h +FX/fxsanity.o: texture.h xform.h clip.h vbrender.h ../include/GL/fxmesa.h +FX/fxsanity.o: FX/fxglidew.h +FX/fxsetup.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxsetup.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxsetup.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h texture.h +FX/fxsetup.o: xform.h clip.h vbrender.h ../include/GL/fxmesa.h FX/fxglidew.h +FX/fxsetup.o: enums.h +FX/fxtexman.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxtexman.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxtexman.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h +FX/fxtexman.o: texture.h xform.h clip.h vbrender.h ../include/GL/fxmesa.h +FX/fxtexman.o: FX/fxglidew.h +FX/fxtrifuncs.o: FX/fxdrv.h glheader.h ../include/GL/gl.h +FX/fxtrifuncs.o: ../include/GL/glext.h context.h glapi.h types.h config.h +FX/fxtrifuncs.o: fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +FX/fxtrifuncs.o: vector.h dd.h mem.h texture.h xform.h clip.h vbrender.h +FX/fxtrifuncs.o: ../include/GL/fxmesa.h FX/fxglidew.h mmath.h FX/fxtritmp.h +FX/fxvsetup.o: FX/fxdrv.h glheader.h ../include/GL/gl.h ../include/GL/glext.h +FX/fxvsetup.o: context.h glapi.h types.h config.h fixed.h glapitable.h +FX/fxvsetup.o: glthread.h macros.h matrix.h vb.h vector.h dd.h mem.h +FX/fxvsetup.o: texture.h xform.h clip.h vbrender.h ../include/GL/fxmesa.h +FX/fxvsetup.o: FX/fxglidew.h mmath.h pipeline.h FX/fxvsetup.h FX/fxvs_tmp.h +FX/fxglidew.o: FX/fxglidew.h FX/fxdrv.h glheader.h ../include/GL/gl.h +FX/fxglidew.o: ../include/GL/glext.h context.h glapi.h types.h config.h +FX/fxglidew.o: fixed.h glapitable.h glthread.h macros.h matrix.h vb.h +FX/fxglidew.o: vector.h dd.h mem.h texture.h xform.h clip.h vbrender.h +FX/fxglidew.o: ../include/GL/fxmesa.h diff --git a/xc/extras/Mesa/src/descrip.mms b/xc/extras/Mesa/src/descrip.mms new file mode 100644 index 000000000..78c3b4348 --- /dev/null +++ b/xc/extras/Mesa/src/descrip.mms @@ -0,0 +1,180 @@ +# Makefile for core library for VMS +# contributed by Jouk Jansen joukj@crys.chem.uva.nl +# Last revision : 3 May 1999 + +.first + define gl [-.include.gl] + +.include [-]mms-config. + +##### MACROS ##### + +VPATH = RCS + +INCDIR = [-.include] +LIBDIR = [-.lib] +CFLAGS = /include=($(INCDIR),[])/define=(FBIND=1) + +CORE_SOURCES = aatriangle.c accum.c alpha.c alphabuf.c attrib.c \ +bitmap.c blend.c buffers.c clip.c colortab.c context.c copypix.c depth.c \ +dispatch.c \ +dlist.c drawpix.c enable.c eval.c feedback.c fog.c \ +get.c hash.c hint.c image.c imaging.c light.c lines.c logic.c masking.c matrix.c \ +mem.c glapi.c glapinoop.c \ +mmath.c pb.c pixel.c points.c polygon.c \ +quads.c rastpos.c readpix.c rect.c scissor.c shade.c span.c \ +stencil.c teximage.c texobj.c texstate.c texture.c translate.c triangle.c \ +varray.c winpos.c vb.c vbcull.c vbfill.c vbrender.c vbxform.c xform.c \ +zoom.c bbox.c cva.c vector.c vbindirect.c config.c enums.c extensions.c \ +pipeline.c stages.c state.c vertices.c [.x86]x86.c + +DRIVER_SOURCES = [.x]glxapi.c [.x]fakeglx.c [.x]xfonts.c \ +[.x]xmesa1.c [.x]xmesa2.c [.x]xmesa3.c [.x]xmesa4.c \ +[.osmesa]osmesa.c \ +[.svga]svgamesa.c \ +[.fx]fxapi.c [.fx]fxdd.c [.fx]fxddtex.c [.fx]fxvsetup.c [.fx]fxsetup.c \ +[.fx]fxtrifuncs.c [.fx]fxclip.c [.fx]fxfastpath.c [.fx]fxpipeline.c\ +[.fx]fxrender.c [.fx]fxtexman.c [.fx]fxddspan.c [.fx]fxcva.c [.fx]fxsanity.c\ +[.fx]fxglidew.c + +ASM_SOURCES = + +OBJECTS =aatriangle.obj,\ +accum.obj,alpha.obj,alphabuf.obj,attrib.obj,\ +bitmap.obj,blend.obj,buffers.obj,clip.obj,colortab.obj,context.obj,copypix.obj,depth.obj,\ +dlist.obj,drawpix.obj,enable.obj,eval.obj,feedback.obj,fog.obj + + +OBJECTS3=get.obj,hash.obj,hint.obj,image.obj,light.obj,lines.obj,logic.obj,masking.obj,\ +matrix.obj,glapi.obj,glapinoop.obj,dispatch.obj,imaging.obj,mem.obj,\ +mmath.obj,pb.obj,pixel.obj,points.obj + +OBJECTS7=polygon.obj,\ +quads.obj,rastpos.obj,readpix.obj,rect.obj,scissor.obj,shade.obj,span.obj,\ +pixeltex.obj + +OBJECTS4=stencil.obj,teximage.obj,texobj.obj,texstate.obj,texture.obj,translate.obj,\ +triangle.obj,varray.obj,winpos.obj,vb.obj,vbcull.obj,vbfill.obj,vbrender.obj + +OBJECTS6=vbxform.obj,xform.obj,zoom.obj,bbox.obj,cva.obj,vector.obj,vbindirect.obj,\ + config.obj,enums.obj,extensions.obj,pipeline.obj,stages.obj,state.obj,\ + vertices.obj,[.x86]x86.obj + +OBJECTS2=[.x]glxapi.obj,[.x]fakeglx.obj,[.x]xfonts.obj,\ +[.x]xmesa1.obj,[.x]xmesa2.obj,[.x]xmesa3.obj,[.x]xmesa4.obj,\ +[.osmesa]osmesa.obj,\ +[.svga]svgamesa.obj + +OBJECTS5=[.fx]fxapi.obj,[.fx]fxdd.obj,[.fx]fxddtex.obj,[.fx]fxvsetup.obj,\ +[.fx]fxsetup.obj,[.fx]fxclip.obj,[.fx]fxfastpath.obj,[.fx]fxpipeline.obj + +OBJECTS8=[.fx]fxtrifuncs.obj,[.fx]fxsanity.obj,[.fx]fxglidew.obj,\ +[.fx]fxrender.obj,[.fx]fxtexman.obj,[.fx]fxddspan.obj,[.fx]fxcva.obj + +##### RULES ##### + +VERSION=Mesa V3.1 + +##### TARGETS ##### +# Make the library +$(LIBDIR)$(GL_LIB) : $(OBJECTS),$(OBJECTS2) $(OBJECTS3) $(OBJECTS4)\ + $(OBJECTS5) $(OBJECTS8) $(OBJECTS7) $(OBJECTS6) +.ifdef SHARE + @ WRITE_ SYS$OUTPUT " generating mesagl1.opt" + @ OPEN_/WRITE FILE mesagl1.opt + @ WRITE_ FILE "!" + @ WRITE_ FILE "! mesagl1.opt generated by DESCRIP.$(MMS_EXT)" + @ WRITE_ FILE "!" + @ WRITE_ FILE "IDENTIFICATION=""$(VERSION)""" + @ WRITE_ FILE "GSMATCH=LEQUAL,3,1 + @ WRITE_ FILE "$(OBJECTS)" + @ WRITE_ FILE "$(OBJECTS3)" + @ WRITE_ FILE "$(OBJECTS4)" + @ WRITE_ FILE "$(OBJECTS7)" + @ WRITE_ FILE "$(OBJECTS6)" + @ WRITE_ FILE "$(OBJECTS2)" + @ WRITE_ FILE "$(OBJECTS5)" + @ WRITE_ FILE "$(OBJECTS8)" + @ WRITE_ FILE "SYS$SHARE:DECW$XEXTLIBSHR/SHARE" + @ WRITE_ FILE "SYS$SHARE:DECW$XLIBSHR/SHARE" + @ CLOSE_ FILE + @ WRITE_ SYS$OUTPUT " generating mesagl.map ..." + @ LINK_/NODEB/NOSHARE/NOEXE/MAP=mesagl.map/FULL mesagl1.opt/OPT + @ WRITE_ SYS$OUTPUT " analyzing mesagl.map ..." + @ @[-.vms]ANALYZE_MAP.COM mesagl.map mesagl.opt + @ WRITE_ SYS$OUTPUT " linking $(GL_LIB) ..." + @ LINK_/NODEB/SHARE=$(GL_LIB)/MAP=mesagl.map/FULL mesagl1.opt/opt,mesagl.opt/opt +.else + @ $(MAKELIB) $(GL_LIB) $(OBJECTS) + @ library $(GL_LIB) $(OBJECTS2) + @ library $(GL_LIB) $(OBJECTS3) + @ library $(GL_LIB) $(OBJECTS4) + @ library $(GL_LIB) $(OBJECTS5) + @ library $(GL_LIB) $(OBJECTS8) + @ library $(GL_LIB) $(OBJECTS7) + @ library $(GL_LIB) $(OBJECTS6) +.endif + @ rename $(GL_LIB)* $(LIBDIR) + +clean : + purge + delete *.obj;* + +aatriangle.obj : aatriangle.c + +triangle.obj : triangle.c + +pixeltex.obj : pixeltex.c + +[.x86]x86.obj : [.x86]x86.c + $(CC) $(CFLAGS) /obj=[.x86]x86.obj [.x86]x86.c +[.x]glxapi.obj : [.x]glxapi.c + $(CC) $(CFLAGS) /obj=[.x]glxapi.obj [.x]glxapi.c +[.x]fakeglx.obj : [.x]fakeglx.c + $(CC) $(CFLAGS) /obj=[.x]fakeglx.obj [.x]fakeglx.c +[.x]xfonts.obj : [.x]xfonts.c + $(CC) $(CFLAGS) /obj=[.x]xfonts.obj [.x]xfonts.c +[.x]xmesa1.obj : [.x]xmesa1.c + $(CC) $(CFLAGS) /obj=[.x]xmesa1.obj [.x]xmesa1.c +[.x]xmesa2.obj : [.x]xmesa2.c + $(CC) $(CFLAGS) /obj=[.x]xmesa2.obj [.x]xmesa2.c +[.x]xmesa3.obj : [.x]xmesa3.c + $(CC) $(CFLAGS) /obj=[.x]xmesa3.obj [.x]xmesa3.c +[.x]xmesa4.obj : [.x]xmesa4.c + $(CC) $(CFLAGS) /obj=[.x]xmesa4.obj [.x]xmesa4.c +[.osmesa]osmesa.obj : [.osmesa]osmesa.c + $(CC) $(CFLAGS) /obj=[.osmesa]osmesa.obj [.osmesa]osmesa.c +[.svga]svgamesa.obj : [.svga]svgamesa.c + $(CC) $(CFLAGS) /obj=[.svga]svgamesa.obj [.svga]svgamesa.c +[.fx]fxapi.obj : [.fx]fxapi.c + $(CC) $(CFLAGS) /obj=[.fx]fxapi.obj [.fx]fxapi.c +[.fx]fxclip.obj : [.fx]fxclip.c + $(CC) $(CFLAGS) /obj=[.fx]fxclip.obj [.fx]fxclip.c +[.fx]fxcva.obj : [.fx]fxcva.c + $(CC) $(CFLAGS) /obj=[.fx]fxcva.obj [.fx]fxcva.c +[.fx]fxdd.obj : [.fx]fxdd.c + $(CC) $(CFLAGS) /obj=[.fx]fxdd.obj [.fx]fxdd.c +[.fx]fxddtex.obj : [.fx]fxddtex.c + $(CC) $(CFLAGS) /obj=[.fx]fxddtex.obj [.fx]fxddtex.c +[.fx]fxfastpath.obj : [.fx]fxfastpath.c + $(CC) $(CFLAGS) /obj=[.fx]fxfastpath.obj [.fx]fxfastpath.c +[.fx]fxpipeline.obj : [.fx]fxpipeline.c + $(CC) $(CFLAGS) /obj=[.fx]fxpipeline.obj [.fx]fxpipeline.c +[.fx]fxsanity.obj : [.fx]fxsanity.c + $(CC) $(CFLAGS) /obj=[.fx]fxsanity.obj [.fx]fxsanity.c +[.fx]fxvsetup.obj : [.fx]fxvsetup.c + $(CC) $(CFLAGS) /obj=[.fx]fxvsetup.obj [.fx]fxvsetup.c +[.fx]fxsetup.obj : [.fx]fxsetup.c + $(CC) $(CFLAGS) /obj=[.fx]fxsetup.obj [.fx]fxsetup.c +[.fx]fxtrifuncs.obj : [.fx]fxtrifuncs.c + $(CC) $(CFLAGS) /obj=[.fx]fxtrifuncs.obj [.fx]fxtrifuncs.c +[.fx]fxrender.obj : [.fx]fxrender.c + $(CC) $(CFLAGS) /obj=[.fx]fxrender.obj [.fx]fxrender.c +[.fx]fxtexman.obj : [.fx]fxtexman.c + $(CC) $(CFLAGS) /obj=[.fx]fxtexman.obj [.fx]fxtexman.c +[.fx]fxddspan.obj : [.fx]fxddspan.c + $(CC) $(CFLAGS) /obj=[.fx]fxddspan.obj [.fx]fxddspan.c +[.fx]fxglidew.obj : [.fx]fxglidew.c + $(CC) $(CFLAGS) /obj=[.fx]fxglidew.obj [.fx]fxglidew.c + +.include mms_depend. diff --git a/xc/extras/Mesa/src/drawpix2.c b/xc/extras/Mesa/src/drawpix2.c new file mode 100644 index 000000000..776fc822e --- /dev/null +++ b/xc/extras/Mesa/src/drawpix2.c @@ -0,0 +1,407 @@ + + +/* + * Try to do a fast glDrawPixels. Conditions include: + * not using a display list + * simple pixel unpacking + * no raster ops + * etc.... + * Return: GL_TRUE if success, GL_FALSE if slow path must be used instead + */ +GLboolean gl_direct_DrawPixels( GLcontext *ctx, + const struct gl_pixelstore_attrib *unpack, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ) +{ + GLubyte rgb[MAX_WIDTH][3]; + GLubyte rgba[MAX_WIDTH][4]; + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glDrawPixels", + GL_FALSE); + + + if (ctx->RenderMode != GL_RENDER) + return GL_FALSE; + + if (!ctx->Current.RasterPosValid) { + /* no-op */ + return GL_TRUE; + } + + if (ctx->NewState) { + gl_update_state(ctx); + } + + /* see if device driver can do the drawpix */ + if (ctx->Driver.DrawPixels) { + GLint x = (GLint) (ctx->Current.RasterPos[0] + 0.5F); + GLint y = (GLint) (ctx->Current.RasterPos[1] + 0.5F); + if ((*ctx->Driver.DrawPixels)(ctx, x, y, width, height, format, type, + unpack, pixels)) + return GL_TRUE; + } + + if ((ctx->RasterMask&(~(SCISSOR_BIT|WINCLIP_BIT)))==0 + && ctx->Pixel.RedBias==0.0 && ctx->Pixel.RedScale==1.0 + && ctx->Pixel.GreenBias==0.0 && ctx->Pixel.GreenScale==1.0 + && ctx->Pixel.BlueBias==0.0 && ctx->Pixel.BlueScale==1.0 + && ctx->Pixel.AlphaBias==0.0 && ctx->Pixel.AlphaScale==1.0 + && ctx->Pixel.IndexShift==0 && ctx->Pixel.IndexOffset==0 + && ctx->Pixel.MapColorFlag==0 + && unpack->Alignment==1 + && !unpack->SwapBytes + && !unpack->LsbFirst) { + + GLint destX = (GLint) (ctx->Current.RasterPos[0] + 0.5F); + GLint destY = (GLint) (ctx->Current.RasterPos[1] + 0.5F); + GLint drawWidth = width; /* actual width drawn */ + GLint drawHeight = height; /* actual height drawn */ + GLint skipPixels = unpack->SkipPixels; + GLint skipRows = unpack->SkipRows; + GLint rowLength; + GLdepth zSpan[MAX_WIDTH]; /* only used when zooming */ + GLint zoomY0 = 0; + + if (unpack->RowLength > 0) + rowLength = unpack->RowLength; + else + rowLength = width; + + /* If we're not using pixel zoom then do all clipping calculations + * now. Otherwise, we'll let the gl_write_zoomed_*_span() functions + * handle the clipping. + */ + if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { + /* horizontal clipping */ + if (destX < ctx->Buffer->Xmin) { + skipPixels += (ctx->Buffer->Xmin - destX); + drawWidth -= (ctx->Buffer->Xmin - destX); + destX = ctx->Buffer->Xmin; + } + if (destX + drawWidth > ctx->Buffer->Xmax) + drawWidth -= (destX + drawWidth - ctx->Buffer->Xmax - 1); + if (drawWidth <= 0) + return GL_TRUE; + + /* vertical clipping */ + if (destY < ctx->Buffer->Ymin) { + skipRows += (ctx->Buffer->Ymin - destY); + drawHeight -= (ctx->Buffer->Ymin - destY); + destY = ctx->Buffer->Ymin; + } + if (destY + drawHeight > ctx->Buffer->Ymax) + drawHeight -= (destY + drawHeight - ctx->Buffer->Ymax - 1); + if (drawHeight <= 0) + return GL_TRUE; + } else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { + /* CUED MODIFICATION */ + /* horizontal clipping */ + if (destX < ctx->Buffer->Xmin) { + skipPixels += (ctx->Buffer->Xmin - destX); + drawWidth -= (ctx->Buffer->Xmin - destX); + destX = ctx->Buffer->Xmin; + } + if (destX + drawWidth > ctx->Buffer->Xmax) + drawWidth -= (destX + drawWidth - ctx->Buffer->Xmax - 1); + if (drawWidth <= 0) + return GL_TRUE; + + /* vertical clipping */ + if (destY > ctx->Buffer->Ymax) { + skipRows += (destY - ctx->Buffer->Ymax - 1); + drawHeight -= (destY - ctx->Buffer->Ymax - 1); + destY = ctx->Buffer->Ymax + 1; + } + if (destY - drawHeight < ctx->Buffer->Ymin) + drawHeight -= (ctx->Buffer->Ymin - (destY - drawHeight)); + if (drawHeight <= 0) + return GL_TRUE; + } + else { + /* setup array of fragment Z value to pass to zoom function */ + GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * DEPTH_SCALE); + GLint i; + assert(drawWidth < MAX_WIDTH); + for (i=0; i<drawWidth; i++) + zSpan[i] = z; + + /* save Y value of first row */ + zoomY0 = (GLint) (ctx->Current.RasterPos[1] + 0.5F); + } + + + /* + * Ready to draw! + * The window region at (destX, destY) of size (drawWidth, drawHeight) + * will be written to. + * We'll take pixel data from buffer pointed to by "pixels" but we'll + * skip "skipRows" rows and skip "skipPixels" pixels/row. + */ + + if (format==GL_RGBA && type==GL_UNSIGNED_BYTE) { + if (ctx->Visual->RGBAflag) { + GLubyte *src = (GLubyte *) pixels + + (skipRows * rowLength + skipPixels) * 4; + if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { + /* no zooming */ + GLint row; + for (row=0; row<drawHeight; row++) { + (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, + (void *) src, NULL); + src += rowLength * 4; + destY++; + } + } else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { + /* CUED MODIFICATION */ + GLint row; + for (row=0; row<drawHeight; row++) { + (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY-1, + (void *) src, NULL); + src += rowLength * 4; + destY--; + } + } + else { + /* with zooming */ + GLint row; + for (row=0; row<drawHeight; row++) { + gl_write_zoomed_rgba_span(ctx, drawWidth, destX, destY, + zSpan, (void *) src, zoomY0); + src += rowLength * 4; + destY++; + } + } + } + return GL_TRUE; + } + else if (format==GL_RGB && type==GL_UNSIGNED_BYTE) { + if (ctx->Visual->RGBAflag) { + GLubyte *src = (GLubyte *) pixels + + (skipRows * rowLength + skipPixels) * 3; + if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { + GLint row; + for (row=0; row<drawHeight; row++) { + (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY, + (void *) src, NULL); + src += rowLength * 3; + destY++; + } + } else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { + /* CUED MODIFICATION */ + GLint row; + for (row=0; row<drawHeight; row++) { + (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY-1, + (void *) src, NULL); + src += rowLength * 3; + destY--; + } + } + else { + /* with zooming */ + GLint row; + for (row=0; row<drawHeight; row++) { + gl_write_zoomed_rgb_span(ctx, drawWidth, destX, destY, + zSpan, (void *) src, zoomY0); + src += rowLength * 3; + destY++; + } + } + } + return GL_TRUE; + } + else if (format==GL_LUMINANCE && type==GL_UNSIGNED_BYTE) { + if (ctx->Visual->RGBAflag) { + GLubyte *src = (GLubyte *) pixels + + (skipRows * rowLength + skipPixels); + if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { + /* no zooming */ + GLint row; + assert(drawWidth < MAX_WIDTH); + for (row=0; row<drawHeight; row++) { + GLint i; + for (i=0;i<drawWidth;i++) { + rgb[i][0] = src[i]; + rgb[i][1] = src[i]; + rgb[i][2] = src[i]; + } + (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY, + (void *) rgb, NULL); + src += rowLength; + destY++; + } + } else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { + /* CUED MODIFICATION */ + GLint row; + assert(drawWidth < MAX_WIDTH); + for (row=0; row<drawHeight; row++) { + GLint i; + for (i=0;i<drawWidth;i++) { + rgb[i][0] = src[i]; + rgb[i][1] = src[i]; + rgb[i][2] = src[i]; + } + (*ctx->Driver.WriteRGBSpan)(ctx, drawWidth, destX, destY-1, + (void *) rgb, NULL); + src += rowLength; + destY--; + } + } + else { + /* with zooming */ + GLint row; + assert(drawWidth < MAX_WIDTH); + for (row=0; row<drawHeight; row++) { + GLint i; + for (i=0;i<drawWidth;i++) { + rgb[i][0] = src[i]; + rgb[i][1] = src[i]; + rgb[i][2] = src[i]; + } + gl_write_zoomed_rgb_span(ctx, drawWidth, destX, destY, + zSpan, (void *) rgb, zoomY0); + src += rowLength; + destY++; + } + } + } + return GL_TRUE; + } + else if (format==GL_LUMINANCE_ALPHA && type==GL_UNSIGNED_BYTE) { + if (ctx->Visual->RGBAflag) { + GLubyte *src = (GLubyte *) pixels + + (skipRows * rowLength + skipPixels)*2; + if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { + /* no zooming */ + GLint row; + assert(drawWidth < MAX_WIDTH); + for (row=0; row<drawHeight; row++) { + GLint i; + GLubyte *ptr = src; + for (i=0;i<drawWidth;i++) { + rgba[i][0] = *ptr; + rgba[i][1] = *ptr; + rgba[i][2] = *ptr++; + rgba[i][3] = *ptr++; + } + (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, + (void *) rgba, NULL); + src += rowLength*2; + destY++; + } + } else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { + /* CUED MODIFICATION */ + GLint row; + assert(drawWidth < MAX_WIDTH); + for (row=0; row<drawHeight; row++) { + GLint i; + GLubyte *ptr = src; + for (i=0;i<drawWidth;i++) { + rgba[i][0] = *ptr; + rgba[i][1] = *ptr; + rgba[i][2] = *ptr++; + rgba[i][3] = *ptr++; + } + (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY-1, + (void *) rgba, NULL); + src += rowLength*2; + destY--; + } + } + else { + /* with zooming */ + GLint row; + assert(drawWidth < MAX_WIDTH); + for (row=0; row<drawHeight; row++) { + GLubyte *ptr = src; + GLint i; + for (i=0;i<drawWidth;i++) { + rgba[i][0] = *ptr; + rgba[i][1] = *ptr; + rgba[i][2] = *ptr++; + rgba[i][3] = *ptr++; + } + gl_write_zoomed_rgba_span(ctx, drawWidth, destX, destY, + zSpan, (void *) rgba, zoomY0); + src += rowLength*2; + destY++; + } + } + } + return GL_TRUE; + } + else if (format==GL_COLOR_INDEX && type==GL_UNSIGNED_BYTE) { + GLubyte *src = (GLubyte *) pixels + skipRows * rowLength + skipPixels; + if (ctx->Visual->RGBAflag) { + /* convert CI data to RGBA */ + if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { + /* no zooming */ + GLint row; + for (row=0; row<drawHeight; row++) { + assert(drawWidth < MAX_WIDTH); + gl_map_ci8_to_rgba(ctx, drawWidth, src, rgba); + (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY, + (const GLubyte (*)[4])rgba, + NULL); + src += rowLength; + destY++; + } + return GL_TRUE; + } else if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==-1.0F) { + GLint row; + /* CUED MODIFICATION */ + for (row=0; row<drawHeight; row++) { + assert(drawWidth < MAX_WIDTH); + gl_map_ci8_to_rgba(ctx, drawWidth, src, rgba); + (*ctx->Driver.WriteRGBASpan)(ctx, drawWidth, destX, destY-1, + (const GLubyte (*)[4])rgba, + NULL); + src += rowLength; + destY--; + } + return GL_TRUE; + } + + else { + /* with zooming */ + GLint row; + for (row=0; row<drawHeight; row++) { + assert(drawWidth < MAX_WIDTH); + gl_map_ci8_to_rgba(ctx, drawWidth, src, rgba); + gl_write_zoomed_rgba_span(ctx, drawWidth, destX, destY, + zSpan, (void *) rgba, zoomY0); + src += rowLength; + destY++; + } + return GL_TRUE; + } + } + else { + /* write CI data to CI frame buffer */ + GLint row; + if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) { + /* no zooming */ + for (row=0; row<drawHeight; row++) { + (*ctx->Driver.WriteCI8Span)(ctx, drawWidth, destX, destY, + src, NULL); + src += rowLength; + destY++; + } + return GL_TRUE; + } + else { + /* with zooming */ + return GL_FALSE; + } + } + } + else { + /* can't handle this pixel format and/or data type here */ + return GL_FALSE; + } + } + else { + /* can't do direct render, have to use slow path */ + return GL_FALSE; + } +} diff --git a/xc/extras/Mesa/src/mesa.conf b/xc/extras/Mesa/src/mesa.conf new file mode 100644 index 000000000..d24ee6bd9 --- /dev/null +++ b/xc/extras/Mesa/src/mesa.conf @@ -0,0 +1,74 @@ +;; -*-lisp-*- +;; +;; KW: New mesa configuration file, syntax following a lisp style. +;; +;; valid syntax: +;; +;; (include filename) +;; - not implemented +;; +;; (config-mesa version configs) +;; +;; where: +;; version - is the version number of mesa for which the configuration +;; was written. Future versions will use this to check for upwards +;; compatibility. There is however no guarentee that old configurations +;; will continue to be respected. +;; +;; configs - is a list of valid configuration lists, as specified by: +;; +;; (set-var variable value) - not implemented, use to augment env vars +;; (set-env variable value) - not implemented, use to augment env vars +;; (default-hint variable value) +;; (disable-extension name) +;; +;; Mesa will look for an environment variable MESA_CONFIG, and try to +;; execute that profile. Otherwise, it will fallback to the profile +;; with the same name as the current mesa version. As default +;; profiles should normally be empty or near-empty, this should be +;; sufficiently powerful. +;; + + +;; Default profile - should normally be an empty list of +;; configurations. +;; +(config-mesa mesa3.1beta1 ()) + + + +;; Really is an empty config. +;; +(config-mesa empty ()) + + + +;; Turn off some compliance for the sake of speed. +;; +(config-mesa quake2 + ( + ;; Quake2 likes this extension, but it really hurts performance if + ;; you don't also disable software fallbacks, below. (And do + ;; something else to stop the eye-space calculations too...) + ;; + (disable-extension GL_EXT_point_parameters) + + ;; These hints are honoured only by the 3dfx driver - the X driver + ;; continues to function even if you specify hardware-only + ;; rendering. + ;; + ;(default-hint GL_ALLOW_DRAW_OBJ_HINT_PGI GL_TRUE) ; wishful thinking + ;(default-hint GL_ALLOW_DRAW_WIN_HINT_PGI GL_TRUE) ; allow 3dfx hardware... + ;(default-hint GL_ALLOW_DRAW_SPN_HINT_PGI GL_FALSE) ; no software spans + ;(default-hint GL_ALLOW_DRAW_MEM_HINT_PGI GL_FALSE) ; no softare pixels + + ;; Lock in the hints specified above. + ;; + (disable-extension GL_PGI_misc_hints))) + + + + + + + diff --git a/xc/extras/Mesa/src/mms_depend b/xc/extras/Mesa/src/mms_depend new file mode 100644 index 000000000..39faedadf --- /dev/null +++ b/xc/extras/Mesa/src/mms_depend @@ -0,0 +1,130 @@ +# DO NOT DELETE + +accum.obj : accum.h types.h [-.include.gl]gl.h config.h fixed.h dd.h context.h +accum.obj : macros.h span.h +alpha.obj : alpha.h types.h [-.include.gl]gl.h config.h fixed.h dd.h context.h +alpha.obj : macros.h +alphabuf.obj : alphabuf.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +alphabuf.obj : context.h macros.h +attrib.obj : attrib.h types.h [-.include.gl]gl.h config.h fixed.h dd.h context.h +attrib.obj : 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 pixel.h +blend.obj : alphabuf.h types.h [-.include.gl]gl.h config.h fixed.h dd.h blend.h +blend.obj : context.h macros.h pb.h span.h +clip.obj : clip.h types.h [-.include.gl]gl.h config.h fixed.h dd.h context.h +clip.obj : macros.h matrix.h vb.h xform.h +colortab.obj : colortab.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +colortab.obj : context.h macros.h +context.obj : accum.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +context.obj : alphabuf.h clip.h context.h depth.h eval.h hash.h light.h lines.h +context.obj : dlist.h macros.h mmath.h pb.h points.h quads.h +context.obj : stencil.h triangle.h teximage.h texobj.h texstate.h vb.h vbfill.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 macros.h pixel.h span.h stencil.h +copypix.obj : zoom.h +depth.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h depth.h +depth.obj : 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 colortab.h context.h copypix.h +dlist.obj : depth.h drawpix.h enable.h eval.h feedback.h fog.h hash.h image.h +dlist.obj : light.h lines.h dlist.h logic.h macros.h masking.h matrix.h +dlist.obj : pixel.h points.h polygon.h rastpos.h rect.h scissor.h stencil.h +dlist.obj : texobj.h teximage.h texstate.h vb.h vbfill.h winpos.h +drawpix.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +drawpix.obj : drawpix.h feedback.h image.h macros.h pixel.h span.h stencil.h +drawpix.obj : zoom.h +enable.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h enable.h +enable.obj : light.h macros.h vbfill.h +eval.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h eval.h +eval.obj : macros.h mmath.h vbfill.h +feedback.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +feedback.obj : feedback.h macros.h +fog.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h fog.h +fog.obj : macros.h +get.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h get.h +get.obj : macros.h vb.h +hash.obj : hash.h [-.include.gl]gl.h +image.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h image.h +image.obj : macros.h +light.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h light.h +light.obj : macros.h matrix.h mmath.h vb.h xform.h +lines.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h depth.h +lines.obj : feedback.h lines.h macros.h pb.h texstate.h vb.h linetemp.h +logic.obj : alphabuf.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +logic.obj : context.h logic.h macros.h pb.h span.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 span.h +matrix.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h macros.h +matrix.obj : matrix.h mmath.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 stencil.h +mmath.obj : [-.include.gl]gl.h mmath.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 macros.h +pixel.obj : pixel.h +points.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +points.obj : feedback.h macros.h pb.h span.h texstate.h vb.h mmath.h +polygon.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +polygon.obj : macros.h polygon.h +quads.obj : types.h [-.include.gl]gl.h config.h fixed.h dd.h quads.h +rastpos.obj : clip.h types.h [-.include.gl]gl.h config.h fixed.h dd.h feedback.h +rastpos.obj : light.h macros.h matrix.h mmath.h shade.h xform.h +readpix.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h depth.h +readpix.obj : feedback.h macros.h image.h pixel.h readpix.h span.h stencil.h +rect.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h macros.h +rect.obj : rect.h vbfill.h +scissor.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +scissor.obj : macros.h scissor.h +shade.obj : macros.h mmath.h shade.h types.h [-.include.gl]gl.h config.h fixed.h +shade.obj : dd.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 +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 span.h teximage.h +texobj.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h hash.h +texobj.obj : macros.h teximage.h texobj.h +texstate.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +texstate.obj : macros.h matrix.h texobj.h texstate.h texture.h xform.h +texture.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +texture.obj : macros.h mmath.h pb.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 texstate.h triangle.h vb.h tritemp.h +varray.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h enable.h +varray.obj : dlist.h light.h macros.h varray.h vb.h vbfill.h vbrender.h +varray.obj : vbxform.h xform.h +winpos.obj : [-.include.gl]gl.h rastpos.h types.h config.h fixed.h dd.h winpos.h +vb.obj : types.h [-.include.gl]gl.h config.h fixed.h dd.h vb.h +vbfill.obj : context.h types.h [-.include.gl]gl.h config.h fixed.h dd.h light.h +vbfill.obj : macros.h matrix.h mmath.h pb.h vb.h vbfill.h vbxform.h xform.h +vbrender.obj : clip.h types.h [-.include.gl]gl.h config.h fixed.h dd.h context.h +vbrender.obj : light.h macros.h matrix.h pb.h vb.h vbrender.h xform.h +vbxform.obj : [-.include.gl]gl.h context.h types.h config.h fixed.h +vbxform.obj : dd.h fog.h light.h macros.h matrix.h mmath.h shade.h texture.h +vbxform.obj : vb.h vbrender.h vbxform.h xform.h +xform.obj : mmath.h types.h [-.include.gl]gl.h config.h fixed.h dd.h xform.h +zoom.obj : macros.h span.h types.h [-.include.gl]gl.h config.h fixed.h dd.h +zoom.obj : stencil.h zoom.h +[.x]glxapi.obj : [-.include.gl]glx.h [-.include.gl]gl.h [-.include.gl]xmesa.h +[.x]fakeglx.obj : [-.include.gl]gl.h [-.include.gl]xmesa.h context.h types.h +[.x]fakeglx.obj : config.h fixed.h dd.h [-.include.gl]glx.h macros.h +[.x]fakeglx.obj : [.x]xmesaP.h +[.x]xfonts.obj : [-.include.gl]gl.h [-.include.gl]glx.h [-.include.gl]xmesa.h +[.x]xfonts.obj : macros.h [.x]xmesaP.h types.h config.h fixed.h dd.h context.h +[.x]xmesa1.obj : [-.include.gl]xmesa.h [-.include.gl]gl.h [.x]xmesaP.h types.h +[.x]xmesa1.obj : config.h fixed.h dd.h context.h macros.h matrix.h +[.x]xmesa2.obj : [-.include.gl]xmesa.h [-.include.gl]gl.h context.h types.h +[.x]xmesa2.obj : config.h fixed.h dd.h macros.h [.x]xmesaP.h +[.x]xmesa3.obj : depth.h types.h [-.include.gl]gl.h config.h fixed.h dd.h macros.h +[.x]xmesa3.obj : vb.h [.x]xmesaP.h [-.include.gl]xmesa.h linetemp.h +[.x]xmesa4.obj : depth.h types.h [-.include.gl]gl.h config.h fixed.h dd.h macros.h +[.x]xmesa4.obj : vb.h [.x]xmesaP.h [-.include.gl]xmesa.h tritemp.h +[.osmesa]osmesa.obj : [-.include.gl]osmesa.h [-.include.gl]gl.h context.h types.h +[.osmesa]osmesa.obj : config.h fixed.h dd.h depth.h macros.h matrix.h vb.h +[.osmesa]osmesa.obj : linetemp.h tritemp.h + diff --git a/xc/extras/Mesa/stamp-h.in b/xc/extras/Mesa/stamp-h.in new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/xc/extras/Mesa/stamp-h.in diff --git a/xc/extras/Mesa/util/Makefile.am b/xc/extras/Mesa/util/Makefile.am new file mode 100644 index 000000000..f797d1b20 --- /dev/null +++ b/xc/extras/Mesa/util/Makefile.am @@ -0,0 +1,13 @@ +## Process this file with automake to produce Makefile.in + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include $(GLUT_CFLAGS) + +EXTRA_PROGRAMS = glstate + +LDADD = $(GLUT_LIBS) $(top_builddir)/src-glu/libGLU.la \ + $(top_builddir)/src/libGL.la -lm + +EXTRA_DIST = errcheck.c glstate.h glutskel.c idproj.c mwmborder.c \ + readtex.c showbuffer.c showbuffer.h winpos.c diff --git a/xc/extras/Mesa/util/Makefile.in b/xc/extras/Mesa/util/Makefile.in new file mode 100644 index 000000000..02768dea8 --- /dev/null +++ b/xc/extras/Mesa/util/Makefile.in @@ -0,0 +1,311 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CPP = @CPP@ +DLLTOOL = @DLLTOOL@ +EXEEXT = @EXEEXT@ +FX_CFLAGS = @FX_CFLAGS@ +FX_LIBS = @FX_LIBS@ +GGI_CFLAGS = @GGI_CFLAGS@ +GGI_LIBS = @GGI_LIBS@ +GLUT_CFLAGS = @GLUT_CFLAGS@ +GLUT_LIBS = @GLUT_LIBS@ +LIBGLUT_VERSION = @LIBGLUT_VERSION@ +LIBGLU_VERSION = @LIBGLU_VERSION@ +LIBGL_VERSION = @LIBGL_VERSION@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +SVGA_CFLAGS = @SVGA_CFLAGS@ +SVGA_LIBS = @SVGA_LIBS@ +THREAD_LIBS = @THREAD_LIBS@ +VERSION = @VERSION@ +X_LIBADD = @X_LIBADD@ +ggi_confdir = @ggi_confdir@ +ggi_libdir = @ggi_libdir@ + +AUTOMAKE_OPTIONS = no-dependencies + +INCLUDES = -I$(top_srcdir)/include $(GLUT_CFLAGS) + +EXTRA_PROGRAMS = glstate + +LDADD = $(GLUT_LIBS) $(top_builddir)/src-glu/libGLU.la $(top_builddir)/src/libGL.la -lm + + +EXTRA_DIST = errcheck.c glstate.h glutskel.c idproj.c mwmborder.c readtex.c showbuffer.c showbuffer.h winpos.c + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../conf.h +CONFIG_CLEAN_FILES = + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +glstate_SOURCES = glstate.c +glstate_OBJECTS = glstate.$(OBJEXT) +glstate_LDADD = $(LDADD) +glstate_DEPENDENCIES = $(top_builddir)/src-glu/libGLU.la \ +$(top_builddir)/src/libGL.la +glstate_LDFLAGS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = README Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = gtar +GZIP_ENV = --best +SOURCES = glstate.c +OBJECTS = glstate.$(OBJEXT) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +glstate$(EXEEXT): $(glstate_OBJECTS) $(glstate_DEPENDENCIES) + @rm -f glstate$(EXEEXT) + $(LINK) $(glstate_LDFLAGS) $(glstate_OBJECTS) $(glstate_LDADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = util + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: +uninstall: uninstall-am +all-am: Makefile +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-compile mostlyclean-libtool \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-compile clean-libtool clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-compile distclean-libtool distclean-tags \ + distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/xc/extras/Mesa/util/README b/xc/extras/Mesa/util/README new file mode 100644 index 000000000..35bf675ca --- /dev/null +++ b/xc/extras/Mesa/util/README @@ -0,0 +1,22 @@ + +This directory is a collection of function which may be useful to +OpenGL/Mesa programmers. + + +errcheck.c - an OpenGL error check/report function +glutskel.c - handy skeleton for GLUT programs +idproj.c - setup an identity projection +mwmborder.c - remove Motif window decoration/border +winpos.c - set absolute window raster position +readtex.c - load textures/mipmaps from an .rgb file +showbuffer.[ch] - show depth, alpha, or stencil buffer contents +glstate.[ch] - query/print GL state variables, for debugging, etc. +sampleMakefile - example Makefile for making OpenGL/Mesa apps on Unix +dumpsate.c - dump all OpenGL state, from Stephane Rehel +imagesgi.cpp,.h - read SGI image files + + +more to come... + +---------------------------------------------------------------------- +$Id: README,v 1.1 2000/11/30 17:31:30 dawes Exp $ diff --git a/xc/extras/Mesa/util/dumpstate.c b/xc/extras/Mesa/util/dumpstate.c new file mode 100644 index 000000000..4c039a40f --- /dev/null +++ b/xc/extras/Mesa/util/dumpstate.c @@ -0,0 +1,1959 @@ + +/* + * + * From: Stephane Rehel <rehel@worldnet.fr> + * Date: Mon, 31 May 1999 18:40:54 -0400 + * To: Paul Brian <brianp@ra.avid.com> + * Subject: OpenGL State Dump Function + * + * Here is a function that dumps the current OpenGL state. I wrote it + * some time ago. + * + * In the attachment: + * + the code itself + * + its output + * + * I think Mesa is wrong on some getBooleanv(). For example, GL_VERTEX_ARRAY + * is queried by IsEnabled() (cf. p. 196 of the spec). But on page 193 + * we can read that all the boolean attribs that can be queried by IsEnabled() + * can also be queried by IsEnabled(). + * + * I had duplicated all the enums (LOCAL_*) so that the code can run on any + * OpenGL version, even if an enum is not recognized. + * + * The code can be shipped in the public domain. + * + * Stephane. + */ + + +/* + * Stephane Rehel + * Creation: February 5 1999 + */ + +#include <stdio.h> +#include <GL/gl.h> + +/***************************************************************************/ + +enum { + /* Data types */ + LOCAL_GL_BYTE = 0x1400, + LOCAL_GL_UNSIGNED_BYTE = 0x1401, + LOCAL_GL_SHORT = 0x1402, + LOCAL_GL_UNSIGNED_SHORT = 0x1403, + LOCAL_GL_INT = 0x1404, + LOCAL_GL_UNSIGNED_INT = 0x1405, + LOCAL_GL_FLOAT = 0x1406, + LOCAL_GL_DOUBLE = 0x140A, + LOCAL_GL_2_BYTES = 0x1407, + LOCAL_GL_3_BYTES = 0x1408, + LOCAL_GL_4_BYTES = 0x1409, + + /* Primitives */ + LOCAL_GL_LINES = 0x0001, + LOCAL_GL_POINTS = 0x0000, + LOCAL_GL_LINE_STRIP = 0x0003, + LOCAL_GL_LINE_LOOP = 0x0002, + LOCAL_GL_TRIANGLES = 0x0004, + LOCAL_GL_TRIANGLE_STRIP = 0x0005, + LOCAL_GL_TRIANGLE_FAN = 0x0006, + LOCAL_GL_QUADS = 0x0007, + LOCAL_GL_QUAD_STRIP = 0x0008, + LOCAL_GL_POLYGON = 0x0009, + LOCAL_GL_EDGE_FLAG = 0x0B43, + + /* Vertex Arrays */ + LOCAL_GL_VERTEX_ARRAY = 0x8074, + LOCAL_GL_NORMAL_ARRAY = 0x8075, + LOCAL_GL_COLOR_ARRAY = 0x8076, + LOCAL_GL_INDEX_ARRAY = 0x8077, + LOCAL_GL_TEXTURE_COORD_ARRAY = 0x8078, + LOCAL_GL_EDGE_FLAG_ARRAY = 0x8079, + LOCAL_GL_VERTEX_ARRAY_SIZE = 0x807A, + LOCAL_GL_VERTEX_ARRAY_TYPE = 0x807B, + LOCAL_GL_VERTEX_ARRAY_STRIDE = 0x807C, + LOCAL_GL_NORMAL_ARRAY_TYPE = 0x807E, + LOCAL_GL_NORMAL_ARRAY_STRIDE = 0x807F, + LOCAL_GL_COLOR_ARRAY_SIZE = 0x8081, + LOCAL_GL_COLOR_ARRAY_TYPE = 0x8082, + LOCAL_GL_COLOR_ARRAY_STRIDE = 0x8083, + LOCAL_GL_INDEX_ARRAY_TYPE = 0x8085, + LOCAL_GL_INDEX_ARRAY_STRIDE = 0x8086, + LOCAL_GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088, + LOCAL_GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089, + LOCAL_GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A, + LOCAL_GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C, + LOCAL_GL_VERTEX_ARRAY_POINTER = 0x808E, + LOCAL_GL_NORMAL_ARRAY_POINTER = 0x808F, + LOCAL_GL_COLOR_ARRAY_POINTER = 0x8090, + LOCAL_GL_INDEX_ARRAY_POINTER = 0x8091, + LOCAL_GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092, + LOCAL_GL_EDGE_FLAG_ARRAY_POINTER = 0x8093, + LOCAL_GL_V2F = 0x2A20, + LOCAL_GL_V3F = 0x2A21, + LOCAL_GL_C4UB_V2F = 0x2A22, + LOCAL_GL_C4UB_V3F = 0x2A23, + LOCAL_GL_C3F_V3F = 0x2A24, + LOCAL_GL_N3F_V3F = 0x2A25, + LOCAL_GL_C4F_N3F_V3F = 0x2A26, + LOCAL_GL_T2F_V3F = 0x2A27, + LOCAL_GL_T4F_V4F = 0x2A28, + LOCAL_GL_T2F_C4UB_V3F = 0x2A29, + LOCAL_GL_T2F_C3F_V3F = 0x2A2A, + LOCAL_GL_T2F_N3F_V3F = 0x2A2B, + LOCAL_GL_T2F_C4F_N3F_V3F = 0x2A2C, + LOCAL_GL_T4F_C4F_N3F_V4F = 0x2A2D, + + /* Matrix Mode */ + LOCAL_GL_MATRIX_MODE = 0x0BA0, + LOCAL_GL_MODELVIEW = 0x1700, + LOCAL_GL_PROJECTION = 0x1701, + LOCAL_GL_TEXTURE = 0x1702, + + /* Points */ + LOCAL_GL_POINT_SMOOTH = 0x0B10, + LOCAL_GL_POINT_SIZE = 0x0B11, + LOCAL_GL_POINT_SIZE_GRANULARITY = 0x0B13, + LOCAL_GL_POINT_SIZE_RANGE = 0x0B12, + + /* Lines */ + LOCAL_GL_LINE_SMOOTH = 0x0B20, + LOCAL_GL_LINE_STIPPLE = 0x0B24, + LOCAL_GL_LINE_STIPPLE_PATTERN = 0x0B25, + LOCAL_GL_LINE_STIPPLE_REPEAT = 0x0B26, + LOCAL_GL_LINE_WIDTH = 0x0B21, + LOCAL_GL_LINE_WIDTH_GRANULARITY = 0x0B23, + LOCAL_GL_LINE_WIDTH_RANGE = 0x0B22, + + /* Polygons */ + LOCAL_GL_POINT = 0x1B00, + LOCAL_GL_LINE = 0x1B01, + LOCAL_GL_FILL = 0x1B02, + LOCAL_GL_CCW = 0x0901, + LOCAL_GL_CW = 0x0900, + LOCAL_GL_FRONT = 0x0404, + LOCAL_GL_BACK = 0x0405, + LOCAL_GL_CULL_FACE = 0x0B44, + LOCAL_GL_CULL_FACE_MODE = 0x0B45, + LOCAL_GL_POLYGON_SMOOTH = 0x0B41, + LOCAL_GL_POLYGON_STIPPLE = 0x0B42, + LOCAL_GL_FRONT_FACE = 0x0B46, + LOCAL_GL_POLYGON_MODE = 0x0B40, + LOCAL_GL_POLYGON_OFFSET_FACTOR = 0x8038, + LOCAL_GL_POLYGON_OFFSET_UNITS = 0x2A00, + LOCAL_GL_POLYGON_OFFSET_POINT = 0x2A01, + LOCAL_GL_POLYGON_OFFSET_LINE = 0x2A02, + LOCAL_GL_POLYGON_OFFSET_FILL = 0x8037, + + /* Display Lists */ + LOCAL_GL_COMPILE = 0x1300, + LOCAL_GL_COMPILE_AND_EXECUTE = 0x1301, + LOCAL_GL_LIST_BASE = 0x0B32, + LOCAL_GL_LIST_INDEX = 0x0B33, + LOCAL_GL_LIST_MODE = 0x0B30, + + /* Depth buffer */ + LOCAL_GL_NEVER = 0x0200, + LOCAL_GL_LESS = 0x0201, + LOCAL_GL_GEQUAL = 0x0206, + LOCAL_GL_LEQUAL = 0x0203, + LOCAL_GL_GREATER = 0x0204, + LOCAL_GL_NOTEQUAL = 0x0205, + LOCAL_GL_EQUAL = 0x0202, + LOCAL_GL_ALWAYS = 0x0207, + LOCAL_GL_DEPTH_TEST = 0x0B71, + LOCAL_GL_DEPTH_BITS = 0x0D56, + LOCAL_GL_DEPTH_CLEAR_VALUE = 0x0B73, + LOCAL_GL_DEPTH_FUNC = 0x0B74, + LOCAL_GL_DEPTH_RANGE = 0x0B70, + LOCAL_GL_DEPTH_WRITEMASK = 0x0B72, + LOCAL_GL_DEPTH_COMPONENT = 0x1902, + + /* Lighting */ + LOCAL_GL_LIGHTING = 0x0B50, + LOCAL_GL_LIGHT0 = 0x4000, + LOCAL_GL_LIGHT1 = 0x4001, + LOCAL_GL_LIGHT2 = 0x4002, + LOCAL_GL_LIGHT3 = 0x4003, + LOCAL_GL_LIGHT4 = 0x4004, + LOCAL_GL_LIGHT5 = 0x4005, + LOCAL_GL_LIGHT6 = 0x4006, + LOCAL_GL_LIGHT7 = 0x4007, + LOCAL_GL_SPOT_EXPONENT = 0x1205, + LOCAL_GL_SPOT_CUTOFF = 0x1206, + LOCAL_GL_CONSTANT_ATTENUATION = 0x1207, + LOCAL_GL_LINEAR_ATTENUATION = 0x1208, + LOCAL_GL_QUADRATIC_ATTENUATION = 0x1209, + LOCAL_GL_AMBIENT = 0x1200, + LOCAL_GL_DIFFUSE = 0x1201, + LOCAL_GL_SPECULAR = 0x1202, + LOCAL_GL_SHININESS = 0x1601, + LOCAL_GL_EMISSION = 0x1600, + LOCAL_GL_POSITION = 0x1203, + LOCAL_GL_SPOT_DIRECTION = 0x1204, + LOCAL_GL_AMBIENT_AND_DIFFUSE = 0x1602, + LOCAL_GL_COLOR_INDEXES = 0x1603, + LOCAL_GL_LIGHT_MODEL_TWO_SIDE = 0x0B52, + LOCAL_GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51, + LOCAL_GL_LIGHT_MODEL_AMBIENT = 0x0B53, + LOCAL_GL_FRONT_AND_BACK = 0x0408, + LOCAL_GL_SHADE_MODEL = 0x0B54, + LOCAL_GL_FLAT = 0x1D00, + LOCAL_GL_SMOOTH = 0x1D01, + LOCAL_GL_COLOR_MATERIAL = 0x0B57, + LOCAL_GL_COLOR_MATERIAL_FACE = 0x0B55, + LOCAL_GL_COLOR_MATERIAL_PARAMETER = 0x0B56, + LOCAL_GL_NORMALIZE = 0x0BA1, + + /* User clipping planes */ + LOCAL_GL_CLIP_PLANE0 = 0x3000, + LOCAL_GL_CLIP_PLANE1 = 0x3001, + LOCAL_GL_CLIP_PLANE2 = 0x3002, + LOCAL_GL_CLIP_PLANE3 = 0x3003, + LOCAL_GL_CLIP_PLANE4 = 0x3004, + LOCAL_GL_CLIP_PLANE5 = 0x3005, + + /* Accumulation buffer */ + LOCAL_GL_ACCUM_RED_BITS = 0x0D58, + LOCAL_GL_ACCUM_GREEN_BITS = 0x0D59, + LOCAL_GL_ACCUM_BLUE_BITS = 0x0D5A, + LOCAL_GL_ACCUM_ALPHA_BITS = 0x0D5B, + LOCAL_GL_ACCUM_CLEAR_VALUE = 0x0B80, + LOCAL_GL_ACCUM = 0x0100, + LOCAL_GL_ADD = 0x0104, + LOCAL_GL_LOAD = 0x0101, + LOCAL_GL_MULT = 0x0103, + LOCAL_GL_RETURN = 0x0102, + + /* Alpha testing */ + LOCAL_GL_ALPHA_TEST = 0x0BC0, + LOCAL_GL_ALPHA_TEST_REF = 0x0BC2, + LOCAL_GL_ALPHA_TEST_FUNC = 0x0BC1, + + /* Blending */ + LOCAL_GL_BLEND = 0x0BE2, + LOCAL_GL_BLEND_SRC = 0x0BE1, + LOCAL_GL_BLEND_DST = 0x0BE0, + LOCAL_GL_ZERO = 0, + LOCAL_GL_ONE = 1, + LOCAL_GL_SRC_COLOR = 0x0300, + LOCAL_GL_ONE_MINUS_SRC_COLOR = 0x0301, + LOCAL_GL_DST_COLOR = 0x0306, + LOCAL_GL_ONE_MINUS_DST_COLOR = 0x0307, + LOCAL_GL_SRC_ALPHA = 0x0302, + LOCAL_GL_ONE_MINUS_SRC_ALPHA = 0x0303, + LOCAL_GL_DST_ALPHA = 0x0304, + LOCAL_GL_ONE_MINUS_DST_ALPHA = 0x0305, + LOCAL_GL_SRC_ALPHA_SATURATE = 0x0308, + LOCAL_GL_CONSTANT_COLOR = 0x8001, + LOCAL_GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, + LOCAL_GL_CONSTANT_ALPHA = 0x8003, + LOCAL_GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004, + + /* Render Mode */ + LOCAL_GL_FEEDBACK = 0x1C01, + LOCAL_GL_RENDER = 0x1C00, + LOCAL_GL_SELECT = 0x1C02, + + /* Feedback */ + LOCAL_GL_2D = 0x0600, + LOCAL_GL_3D = 0x0601, + LOCAL_GL_3D_COLOR = 0x0602, + LOCAL_GL_3D_COLOR_TEXTURE = 0x0603, + LOCAL_GL_4D_COLOR_TEXTURE = 0x0604, + LOCAL_GL_POINT_TOKEN = 0x0701, + LOCAL_GL_LINE_TOKEN = 0x0702, + LOCAL_GL_LINE_RESET_TOKEN = 0x0707, + LOCAL_GL_POLYGON_TOKEN = 0x0703, + LOCAL_GL_BITMAP_TOKEN = 0x0704, + LOCAL_GL_DRAW_PIXEL_TOKEN = 0x0705, + LOCAL_GL_COPY_PIXEL_TOKEN = 0x0706, + LOCAL_GL_PASS_THROUGH_TOKEN = 0x0700, + LOCAL_GL_FEEDBACK_BUFFER_POINTER = 0x0DF0, + LOCAL_GL_FEEDBACK_BUFFER_SIZE = 0x0DF1, + LOCAL_GL_FEEDBACK_BUFFER_TYPE = 0x0DF2, + + /* Selection */ + LOCAL_GL_SELECTION_BUFFER_POINTER = 0x0DF3, + LOCAL_GL_SELECTION_BUFFER_SIZE = 0x0DF4, + + /* Fog */ + LOCAL_GL_FOG = 0x0B60, + LOCAL_GL_FOG_MODE = 0x0B65, + LOCAL_GL_FOG_DENSITY = 0x0B62, + LOCAL_GL_FOG_COLOR = 0x0B66, + LOCAL_GL_FOG_INDEX = 0x0B61, + LOCAL_GL_FOG_START = 0x0B63, + LOCAL_GL_FOG_END = 0x0B64, + LOCAL_GL_LINEAR = 0x2601, + LOCAL_GL_EXP = 0x0800, + LOCAL_GL_EXP2 = 0x0801, + + /* Logic Ops */ + LOCAL_GL_LOGIC_OP = 0x0BF1, + LOCAL_GL_INDEX_LOGIC_OP = 0x0BF1, + LOCAL_GL_COLOR_LOGIC_OP = 0x0BF2, + LOCAL_GL_LOGIC_OP_MODE = 0x0BF0, + LOCAL_GL_CLEAR = 0x1500, + LOCAL_GL_SET = 0x150F, + LOCAL_GL_COPY = 0x1503, + LOCAL_GL_COPY_INVERTED = 0x150C, + LOCAL_GL_NOOP = 0x1505, + LOCAL_GL_INVERT = 0x150A, + LOCAL_GL_AND = 0x1501, + LOCAL_GL_NAND = 0x150E, + LOCAL_GL_OR = 0x1507, + LOCAL_GL_NOR = 0x1508, + LOCAL_GL_XOR = 0x1506, + LOCAL_GL_EQUIV = 0x1509, + LOCAL_GL_AND_REVERSE = 0x1502, + LOCAL_GL_AND_INVERTED = 0x1504, + LOCAL_GL_OR_REVERSE = 0x150B, + LOCAL_GL_OR_INVERTED = 0x150D, + + /* Stencil */ + LOCAL_GL_STENCIL_TEST = 0x0B90, + LOCAL_GL_STENCIL_WRITEMASK = 0x0B98, + LOCAL_GL_STENCIL_BITS = 0x0D57, + LOCAL_GL_STENCIL_FUNC = 0x0B92, + LOCAL_GL_STENCIL_VALUE_MASK = 0x0B93, + LOCAL_GL_STENCIL_REF = 0x0B97, + LOCAL_GL_STENCIL_FAIL = 0x0B94, + LOCAL_GL_STENCIL_PASS_DEPTH_PASS = 0x0B96, + LOCAL_GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95, + LOCAL_GL_STENCIL_CLEAR_VALUE = 0x0B91, + LOCAL_GL_STENCIL_INDEX = 0x1901, + LOCAL_GL_KEEP = 0x1E00, + LOCAL_GL_REPLACE = 0x1E01, + LOCAL_GL_INCR = 0x1E02, + LOCAL_GL_DECR = 0x1E03, + + /* Buffers, Pixel Drawing/Reading */ + LOCAL_GL_NONE = 0, + LOCAL_GL_LEFT = 0x0406, + LOCAL_GL_RIGHT = 0x0407, + /*LOCAL_GL_FRONT = 0x0404, */ + /*LOCAL_GL_BACK = 0x0405, */ + /*LOCAL_GL_FRONT_AND_BACK = 0x0408, */ + LOCAL_GL_FRONT_LEFT = 0x0400, + LOCAL_GL_FRONT_RIGHT = 0x0401, + LOCAL_GL_BACK_LEFT = 0x0402, + LOCAL_GL_BACK_RIGHT = 0x0403, + LOCAL_GL_AUX0 = 0x0409, + LOCAL_GL_AUX1 = 0x040A, + LOCAL_GL_AUX2 = 0x040B, + LOCAL_GL_AUX3 = 0x040C, + LOCAL_GL_COLOR_INDEX = 0x1900, + LOCAL_GL_RED = 0x1903, + LOCAL_GL_GREEN = 0x1904, + LOCAL_GL_BLUE = 0x1905, + LOCAL_GL_ALPHA = 0x1906, + LOCAL_GL_LUMINANCE = 0x1909, + LOCAL_GL_LUMINANCE_ALPHA = 0x190A, + LOCAL_GL_ALPHA_BITS = 0x0D55, + LOCAL_GL_RED_BITS = 0x0D52, + LOCAL_GL_GREEN_BITS = 0x0D53, + LOCAL_GL_BLUE_BITS = 0x0D54, + LOCAL_GL_INDEX_BITS = 0x0D51, + LOCAL_GL_SUBPIXEL_BITS = 0x0D50, + LOCAL_GL_AUX_BUFFERS = 0x0C00, + LOCAL_GL_READ_BUFFER = 0x0C02, + LOCAL_GL_DRAW_BUFFER = 0x0C01, + LOCAL_GL_DOUBLEBUFFER = 0x0C32, + LOCAL_GL_STEREO = 0x0C33, + LOCAL_GL_BITMAP = 0x1A00, + LOCAL_GL_COLOR = 0x1800, + LOCAL_GL_DEPTH = 0x1801, + LOCAL_GL_STENCIL = 0x1802, + LOCAL_GL_DITHER = 0x0BD0, + LOCAL_GL_RGB = 0x1907, + LOCAL_GL_RGBA = 0x1908, + + /* Implementation limits */ + LOCAL_GL_MAX_LIST_NESTING = 0x0B31, + LOCAL_GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35, + LOCAL_GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36, + LOCAL_GL_MAX_NAME_STACK_DEPTH = 0x0D37, + LOCAL_GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38, + LOCAL_GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39, + LOCAL_GL_MAX_EVAL_ORDER = 0x0D30, + LOCAL_GL_MAX_LIGHTS = 0x0D31, + LOCAL_GL_MAX_CLIP_PLANES = 0x0D32, + LOCAL_GL_MAX_TEXTURE_SIZE = 0x0D33, + LOCAL_GL_MAX_PIXEL_MAP_TABLE = 0x0D34, + LOCAL_GL_MAX_VIEWPORT_DIMS = 0x0D3A, + LOCAL_GL_MAX_CLIENT_ATTRIB_STACK_DEPTH= 0x0D3B, + + /* Gets */ + LOCAL_GL_ATTRIB_STACK_DEPTH = 0x0BB0, + LOCAL_GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1, + LOCAL_GL_COLOR_CLEAR_VALUE = 0x0C22, + LOCAL_GL_COLOR_WRITEMASK = 0x0C23, + LOCAL_GL_CURRENT_INDEX = 0x0B01, + LOCAL_GL_CURRENT_COLOR = 0x0B00, + LOCAL_GL_CURRENT_NORMAL = 0x0B02, + LOCAL_GL_CURRENT_RASTER_COLOR = 0x0B04, + LOCAL_GL_CURRENT_RASTER_DISTANCE = 0x0B09, + LOCAL_GL_CURRENT_RASTER_INDEX = 0x0B05, + LOCAL_GL_CURRENT_RASTER_POSITION = 0x0B07, + LOCAL_GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06, + LOCAL_GL_CURRENT_RASTER_POSITION_VALID = 0x0B08, + LOCAL_GL_CURRENT_TEXTURE_COORDS = 0x0B03, + LOCAL_GL_INDEX_CLEAR_VALUE = 0x0C20, + LOCAL_GL_INDEX_MODE = 0x0C30, + LOCAL_GL_INDEX_WRITEMASK = 0x0C21, + LOCAL_GL_MODELVIEW_MATRIX = 0x0BA6, + LOCAL_GL_MODELVIEW_STACK_DEPTH = 0x0BA3, + LOCAL_GL_NAME_STACK_DEPTH = 0x0D70, + LOCAL_GL_PROJECTION_MATRIX = 0x0BA7, + LOCAL_GL_PROJECTION_STACK_DEPTH = 0x0BA4, + LOCAL_GL_RENDER_MODE = 0x0C40, + LOCAL_GL_RGBA_MODE = 0x0C31, + LOCAL_GL_TEXTURE_MATRIX = 0x0BA8, + LOCAL_GL_TEXTURE_STACK_DEPTH = 0x0BA5, + LOCAL_GL_VIEWPORT = 0x0BA2, + + + /* Evaluators */ + LOCAL_GL_AUTO_NORMAL = 0x0D80, + LOCAL_GL_MAP1_COLOR_4 = 0x0D90, + LOCAL_GL_MAP1_GRID_DOMAIN = 0x0DD0, + LOCAL_GL_MAP1_GRID_SEGMENTS = 0x0DD1, + LOCAL_GL_MAP1_INDEX = 0x0D91, + LOCAL_GL_MAP1_NORMAL = 0x0D92, + LOCAL_GL_MAP1_TEXTURE_COORD_1 = 0x0D93, + LOCAL_GL_MAP1_TEXTURE_COORD_2 = 0x0D94, + LOCAL_GL_MAP1_TEXTURE_COORD_3 = 0x0D95, + LOCAL_GL_MAP1_TEXTURE_COORD_4 = 0x0D96, + LOCAL_GL_MAP1_VERTEX_3 = 0x0D97, + LOCAL_GL_MAP1_VERTEX_4 = 0x0D98, + LOCAL_GL_MAP2_COLOR_4 = 0x0DB0, + LOCAL_GL_MAP2_GRID_DOMAIN = 0x0DD2, + LOCAL_GL_MAP2_GRID_SEGMENTS = 0x0DD3, + LOCAL_GL_MAP2_INDEX = 0x0DB1, + LOCAL_GL_MAP2_NORMAL = 0x0DB2, + LOCAL_GL_MAP2_TEXTURE_COORD_1 = 0x0DB3, + LOCAL_GL_MAP2_TEXTURE_COORD_2 = 0x0DB4, + LOCAL_GL_MAP2_TEXTURE_COORD_3 = 0x0DB5, + LOCAL_GL_MAP2_TEXTURE_COORD_4 = 0x0DB6, + LOCAL_GL_MAP2_VERTEX_3 = 0x0DB7, + LOCAL_GL_MAP2_VERTEX_4 = 0x0DB8, + LOCAL_GL_COEFF = 0x0A00, + LOCAL_GL_DOMAIN = 0x0A02, + LOCAL_GL_ORDER = 0x0A01, + + /* Hints */ + LOCAL_GL_FOG_HINT = 0x0C54, + LOCAL_GL_LINE_SMOOTH_HINT = 0x0C52, + LOCAL_GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50, + LOCAL_GL_POINT_SMOOTH_HINT = 0x0C51, + LOCAL_GL_POLYGON_SMOOTH_HINT = 0x0C53, + LOCAL_GL_DONT_CARE = 0x1100, + LOCAL_GL_FASTEST = 0x1101, + LOCAL_GL_NICEST = 0x1102, + + /* Scissor box */ + LOCAL_GL_SCISSOR_TEST = 0x0C11, + LOCAL_GL_SCISSOR_BOX = 0x0C10, + + /* Pixel Mode / Transfer */ + LOCAL_GL_MAP_COLOR = 0x0D10, + LOCAL_GL_MAP_STENCIL = 0x0D11, + LOCAL_GL_INDEX_SHIFT = 0x0D12, + LOCAL_GL_INDEX_OFFSET = 0x0D13, + LOCAL_GL_RED_SCALE = 0x0D14, + LOCAL_GL_RED_BIAS = 0x0D15, + LOCAL_GL_GREEN_SCALE = 0x0D18, + LOCAL_GL_GREEN_BIAS = 0x0D19, + LOCAL_GL_BLUE_SCALE = 0x0D1A, + LOCAL_GL_BLUE_BIAS = 0x0D1B, + LOCAL_GL_ALPHA_SCALE = 0x0D1C, + LOCAL_GL_ALPHA_BIAS = 0x0D1D, + LOCAL_GL_DEPTH_SCALE = 0x0D1E, + LOCAL_GL_DEPTH_BIAS = 0x0D1F, + LOCAL_GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1, + LOCAL_GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0, + LOCAL_GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2, + LOCAL_GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3, + LOCAL_GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4, + LOCAL_GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5, + LOCAL_GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6, + LOCAL_GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7, + LOCAL_GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8, + LOCAL_GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9, + LOCAL_GL_PIXEL_MAP_S_TO_S = 0x0C71, + LOCAL_GL_PIXEL_MAP_I_TO_I = 0x0C70, + LOCAL_GL_PIXEL_MAP_I_TO_R = 0x0C72, + LOCAL_GL_PIXEL_MAP_I_TO_G = 0x0C73, + LOCAL_GL_PIXEL_MAP_I_TO_B = 0x0C74, + LOCAL_GL_PIXEL_MAP_I_TO_A = 0x0C75, + LOCAL_GL_PIXEL_MAP_R_TO_R = 0x0C76, + LOCAL_GL_PIXEL_MAP_G_TO_G = 0x0C77, + LOCAL_GL_PIXEL_MAP_B_TO_B = 0x0C78, + LOCAL_GL_PIXEL_MAP_A_TO_A = 0x0C79, + LOCAL_GL_PACK_ALIGNMENT = 0x0D05, + LOCAL_GL_PACK_LSB_FIRST = 0x0D01, + LOCAL_GL_PACK_ROW_LENGTH = 0x0D02, + LOCAL_GL_PACK_SKIP_PIXELS = 0x0D04, + LOCAL_GL_PACK_SKIP_ROWS = 0x0D03, + LOCAL_GL_PACK_SWAP_BYTES = 0x0D00, + LOCAL_GL_UNPACK_ALIGNMENT = 0x0CF5, + LOCAL_GL_UNPACK_LSB_FIRST = 0x0CF1, + LOCAL_GL_UNPACK_ROW_LENGTH = 0x0CF2, + LOCAL_GL_UNPACK_SKIP_PIXELS = 0x0CF4, + LOCAL_GL_UNPACK_SKIP_ROWS = 0x0CF3, + LOCAL_GL_UNPACK_SWAP_BYTES = 0x0CF0, + LOCAL_GL_ZOOM_X = 0x0D16, + LOCAL_GL_ZOOM_Y = 0x0D17, + + /* Texture mapping */ + LOCAL_GL_TEXTURE_ENV = 0x2300, + LOCAL_GL_TEXTURE_ENV_MODE = 0x2200, + LOCAL_GL_TEXTURE_1D = 0x0DE0, + LOCAL_GL_TEXTURE_2D = 0x0DE1, + LOCAL_GL_TEXTURE_WRAP_S = 0x2802, + LOCAL_GL_TEXTURE_WRAP_T = 0x2803, + LOCAL_GL_TEXTURE_MAG_FILTER = 0x2800, + LOCAL_GL_TEXTURE_MIN_FILTER = 0x2801, + LOCAL_GL_TEXTURE_ENV_COLOR = 0x2201, + LOCAL_GL_TEXTURE_GEN_S = 0x0C60, + LOCAL_GL_TEXTURE_GEN_T = 0x0C61, + LOCAL_GL_TEXTURE_GEN_MODE = 0x2500, + LOCAL_GL_TEXTURE_BORDER_COLOR = 0x1004, + LOCAL_GL_TEXTURE_WIDTH = 0x1000, + LOCAL_GL_TEXTURE_HEIGHT = 0x1001, + LOCAL_GL_TEXTURE_BORDER = 0x1005, + LOCAL_GL_TEXTURE_COMPONENTS = 0x1003, + LOCAL_GL_TEXTURE_RED_SIZE = 0x805C, + LOCAL_GL_TEXTURE_GREEN_SIZE = 0x805D, + LOCAL_GL_TEXTURE_BLUE_SIZE = 0x805E, + LOCAL_GL_TEXTURE_ALPHA_SIZE = 0x805F, + LOCAL_GL_TEXTURE_LUMINANCE_SIZE = 0x8060, + LOCAL_GL_TEXTURE_INTENSITY_SIZE = 0x8061, + LOCAL_GL_NEAREST_MIPMAP_NEAREST = 0x2700, + LOCAL_GL_NEAREST_MIPMAP_LINEAR = 0x2702, + LOCAL_GL_LINEAR_MIPMAP_NEAREST = 0x2701, + LOCAL_GL_LINEAR_MIPMAP_LINEAR = 0x2703, + LOCAL_GL_OBJECT_LINEAR = 0x2401, + LOCAL_GL_OBJECT_PLANE = 0x2501, + LOCAL_GL_EYE_LINEAR = 0x2400, + LOCAL_GL_EYE_PLANE = 0x2502, + LOCAL_GL_SPHERE_MAP = 0x2402, + LOCAL_GL_DECAL = 0x2101, + LOCAL_GL_MODULATE = 0x2100, + LOCAL_GL_NEAREST = 0x2600, + LOCAL_GL_REPEAT = 0x2901, + LOCAL_GL_CLAMP = 0x2900, + LOCAL_GL_S = 0x2000, + LOCAL_GL_T = 0x2001, + LOCAL_GL_R = 0x2002, + LOCAL_GL_Q = 0x2003, + LOCAL_GL_TEXTURE_GEN_R = 0x0C62, + LOCAL_GL_TEXTURE_GEN_Q = 0x0C63, + + /* GL 1.1 texturing */ + LOCAL_GL_PROXY_TEXTURE_1D = 0x8063, + LOCAL_GL_PROXY_TEXTURE_2D = 0x8064, + LOCAL_GL_TEXTURE_PRIORITY = 0x8066, + LOCAL_GL_TEXTURE_RESIDENT = 0x8067, + LOCAL_GL_TEXTURE_BINDING_1D = 0x8068, + LOCAL_GL_TEXTURE_BINDING_2D = 0x8069, + LOCAL_GL_TEXTURE_INTERNAL_FORMAT = 0x1003, + + /* GL 1.2 texturing */ + LOCAL_GL_PACK_SKIP_IMAGES = 0x806B, + LOCAL_GL_PACK_IMAGE_HEIGHT = 0x806C, + LOCAL_GL_UNPACK_SKIP_IMAGES = 0x806D, + LOCAL_GL_UNPACK_IMAGE_HEIGHT = 0x806E, + LOCAL_GL_TEXTURE_3D = 0x806F, + LOCAL_GL_PROXY_TEXTURE_3D = 0x8070, + LOCAL_GL_TEXTURE_DEPTH = 0x8071, + LOCAL_GL_TEXTURE_WRAP_R = 0x8072, + LOCAL_GL_MAX_3D_TEXTURE_SIZE = 0x8073, + LOCAL_GL_TEXTURE_BINDING_3D = 0x806A, + + /* Internal texture formats (GL 1.1) */ + LOCAL_GL_ALPHA4 = 0x803B, + LOCAL_GL_ALPHA8 = 0x803C, + LOCAL_GL_ALPHA12 = 0x803D, + LOCAL_GL_ALPHA16 = 0x803E, + LOCAL_GL_LUMINANCE4 = 0x803F, + LOCAL_GL_LUMINANCE8 = 0x8040, + LOCAL_GL_LUMINANCE12 = 0x8041, + LOCAL_GL_LUMINANCE16 = 0x8042, + LOCAL_GL_LUMINANCE4_ALPHA4 = 0x8043, + LOCAL_GL_LUMINANCE6_ALPHA2 = 0x8044, + LOCAL_GL_LUMINANCE8_ALPHA8 = 0x8045, + LOCAL_GL_LUMINANCE12_ALPHA4 = 0x8046, + LOCAL_GL_LUMINANCE12_ALPHA12 = 0x8047, + LOCAL_GL_LUMINANCE16_ALPHA16 = 0x8048, + LOCAL_GL_INTENSITY = 0x8049, + LOCAL_GL_INTENSITY4 = 0x804A, + LOCAL_GL_INTENSITY8 = 0x804B, + LOCAL_GL_INTENSITY12 = 0x804C, + LOCAL_GL_INTENSITY16 = 0x804D, + LOCAL_GL_R3_G3_B2 = 0x2A10, + LOCAL_GL_RGB4 = 0x804F, + LOCAL_GL_RGB5 = 0x8050, + LOCAL_GL_RGB8 = 0x8051, + LOCAL_GL_RGB10 = 0x8052, + LOCAL_GL_RGB12 = 0x8053, + LOCAL_GL_RGB16 = 0x8054, + LOCAL_GL_RGBA2 = 0x8055, + LOCAL_GL_RGBA4 = 0x8056, + LOCAL_GL_RGB5_A1 = 0x8057, + LOCAL_GL_RGBA8 = 0x8058, + LOCAL_GL_RGB10_A2 = 0x8059, + LOCAL_GL_RGBA12 = 0x805A, + LOCAL_GL_RGBA16 = 0x805B, + + /* Utility */ + LOCAL_GL_VENDOR = 0x1F00, + LOCAL_GL_RENDERER = 0x1F01, + LOCAL_GL_VERSION = 0x1F02, + LOCAL_GL_EXTENSIONS = 0x1F03, + + /* Errors */ + LOCAL_GL_INVALID_VALUE = 0x0501, + LOCAL_GL_INVALID_ENUM = 0x0500, + LOCAL_GL_INVALID_OPERATION = 0x0502, + LOCAL_GL_STACK_OVERFLOW = 0x0503, + LOCAL_GL_STACK_UNDERFLOW = 0x0504, + LOCAL_GL_OUT_OF_MEMORY = 0x0505, + + /* + * Extensions + */ + + /* LOCAL_GL_EXT_blend_minmax and LOCAL_GL_EXT_blend_color */ + LOCAL_GL_CONSTANT_COLOR_EXT = 0x8001, + LOCAL_GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002, + LOCAL_GL_CONSTANT_ALPHA_EXT = 0x8003, + LOCAL_GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004, + LOCAL_GL_BLEND_EQUATION_EXT = 0x8009, + LOCAL_GL_MIN_EXT = 0x8007, + LOCAL_GL_MAX_EXT = 0x8008, + LOCAL_GL_FUNC_ADD_EXT = 0x8006, + LOCAL_GL_FUNC_SUBTRACT_EXT = 0x800A, + LOCAL_GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B, + LOCAL_GL_BLEND_COLOR_EXT = 0x8005, + + /* LOCAL_GL_EXT_polygon_offset */ + LOCAL_GL_POLYGON_OFFSET_EXT = 0x8037, + LOCAL_GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038, + LOCAL_GL_POLYGON_OFFSET_BIAS_EXT = 0x8039, + + /* LOCAL_GL_EXT_vertex_array */ + LOCAL_GL_VERTEX_ARRAY_EXT = 0x8074, + LOCAL_GL_NORMAL_ARRAY_EXT = 0x8075, + LOCAL_GL_COLOR_ARRAY_EXT = 0x8076, + LOCAL_GL_INDEX_ARRAY_EXT = 0x8077, + LOCAL_GL_TEXTURE_COORD_ARRAY_EXT = 0x8078, + LOCAL_GL_EDGE_FLAG_ARRAY_EXT = 0x8079, + LOCAL_GL_VERTEX_ARRAY_SIZE_EXT = 0x807A, + LOCAL_GL_VERTEX_ARRAY_TYPE_EXT = 0x807B, + LOCAL_GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C, + LOCAL_GL_VERTEX_ARRAY_COUNT_EXT = 0x807D, + LOCAL_GL_NORMAL_ARRAY_TYPE_EXT = 0x807E, + LOCAL_GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F, + LOCAL_GL_NORMAL_ARRAY_COUNT_EXT = 0x8080, + LOCAL_GL_COLOR_ARRAY_SIZE_EXT = 0x8081, + LOCAL_GL_COLOR_ARRAY_TYPE_EXT = 0x8082, + LOCAL_GL_COLOR_ARRAY_STRIDE_EXT = 0x8083, + LOCAL_GL_COLOR_ARRAY_COUNT_EXT = 0x8084, + LOCAL_GL_INDEX_ARRAY_TYPE_EXT = 0x8085, + LOCAL_GL_INDEX_ARRAY_STRIDE_EXT = 0x8086, + LOCAL_GL_INDEX_ARRAY_COUNT_EXT = 0x8087, + LOCAL_GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088, + LOCAL_GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089, + LOCAL_GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A, + LOCAL_GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B, + LOCAL_GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C, + LOCAL_GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D, + LOCAL_GL_VERTEX_ARRAY_POINTER_EXT = 0x808E, + LOCAL_GL_NORMAL_ARRAY_POINTER_EXT = 0x808F, + LOCAL_GL_COLOR_ARRAY_POINTER_EXT = 0x8090, + LOCAL_GL_INDEX_ARRAY_POINTER_EXT = 0x8091, + LOCAL_GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092, + LOCAL_GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093, + + /* LOCAL_GL_EXT_texture_object */ + LOCAL_GL_TEXTURE_PRIORITY_EXT = 0x8066, + LOCAL_GL_TEXTURE_RESIDENT_EXT = 0x8067, + LOCAL_GL_TEXTURE_1D_BINDING_EXT = 0x8068, + LOCAL_GL_TEXTURE_2D_BINDING_EXT = 0x8069, + + /* LOCAL_GL_EXT_texture3D */ + LOCAL_GL_PACK_SKIP_IMAGES_EXT = 0x806B, + LOCAL_GL_PACK_IMAGE_HEIGHT_EXT = 0x806C, + LOCAL_GL_UNPACK_SKIP_IMAGES_EXT = 0x806D, + LOCAL_GL_UNPACK_IMAGE_HEIGHT_EXT = 0x806E, + LOCAL_GL_TEXTURE_3D_EXT = 0x806F, + LOCAL_GL_PROXY_TEXTURE_3D_EXT = 0x8070, + LOCAL_GL_TEXTURE_DEPTH_EXT = 0x8071, + LOCAL_GL_TEXTURE_WRAP_R_EXT = 0x8072, + LOCAL_GL_MAX_3D_TEXTURE_SIZE_EXT = 0x8073, + LOCAL_GL_TEXTURE_3D_BINDING_EXT = 0x806A, + + /* LOCAL_GL_EXT_paletted_texture */ + LOCAL_GL_TABLE_TOO_LARGE_EXT = 0x8031, + LOCAL_GL_COLOR_TABLE_FORMAT_EXT = 0x80D8, + LOCAL_GL_COLOR_TABLE_WIDTH_EXT = 0x80D9, + LOCAL_GL_COLOR_TABLE_RED_SIZE_EXT = 0x80DA, + LOCAL_GL_COLOR_TABLE_GREEN_SIZE_EXT = 0x80DB, + LOCAL_GL_COLOR_TABLE_BLUE_SIZE_EXT = 0x80DC, + LOCAL_GL_COLOR_TABLE_ALPHA_SIZE_EXT = 0x80DD, + LOCAL_GL_COLOR_TABLE_LUMINANCE_SIZE_EXT = 0x80DE, + LOCAL_GL_COLOR_TABLE_INTENSITY_SIZE_EXT = 0x80DF, + LOCAL_GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED, + LOCAL_GL_COLOR_INDEX1_EXT = 0x80E2, + LOCAL_GL_COLOR_INDEX2_EXT = 0x80E3, + LOCAL_GL_COLOR_INDEX4_EXT = 0x80E4, + LOCAL_GL_COLOR_INDEX8_EXT = 0x80E5, + LOCAL_GL_COLOR_INDEX12_EXT = 0x80E6, + LOCAL_GL_COLOR_INDEX16_EXT = 0x80E7, + + /* LOCAL_GL_EXT_shared_texture_palette */ + LOCAL_GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB, + + /* LOCAL_GL_EXT_point_parameters */ + LOCAL_GL_POINT_SIZE_MIN_EXT = 0x8126, + LOCAL_GL_POINT_SIZE_MAX_EXT = 0x8127, + LOCAL_GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128, + LOCAL_GL_DISTANCE_ATTENUATION_EXT = 0x8129, + + /* LOCAL_GL_EXT_rescale_normal */ + LOCAL_GL_RESCALE_NORMAL_EXT = 0x803A, + + /* LOCAL_GL_EXT_abgr */ + LOCAL_GL_ABGR_EXT = 0x8000, + + /* LOCAL_GL_SGIS_multitexture */ + LOCAL_GL_SELECTED_TEXTURE_SGIS = 0x835C, + LOCAL_GL_SELECTED_TEXTURE_COORD_SET_SGIS = 0x835D, + LOCAL_GL_MAX_TEXTURES_SGIS = 0x835E, + LOCAL_GL_TEXTURE0_SGIS = 0x835F, + LOCAL_GL_TEXTURE1_SGIS = 0x8360, + LOCAL_GL_TEXTURE2_SGIS = 0x8361, + LOCAL_GL_TEXTURE3_SGIS = 0x8362, + LOCAL_GL_TEXTURE_COORD_SET_SOURCE_SGIS = 0x8363, + + /* LOCAL_GL_EXT_multitexture */ + LOCAL_GL_SELECTED_TEXTURE_EXT = 0x83C0, + LOCAL_GL_SELECTED_TEXTURE_COORD_SET_EXT = 0x83C1, + LOCAL_GL_SELECTED_TEXTURE_TRANSFORM_EXT = 0x83C2, + LOCAL_GL_MAX_TEXTURES_EXT = 0x83C3, + LOCAL_GL_MAX_TEXTURE_COORD_SETS_EXT = 0x83C4, + LOCAL_GL_TEXTURE_ENV_COORD_SET_EXT = 0x83C5, + LOCAL_GL_TEXTURE0_EXT = 0x83C6, + LOCAL_GL_TEXTURE1_EXT = 0x83C7, + LOCAL_GL_TEXTURE2_EXT = 0x83C8, + LOCAL_GL_TEXTURE3_EXT = 0x83C9, + + /* LOCAL_GL_SGIS_texture_edge_clamp */ + LOCAL_GL_CLAMP_TO_EDGE_SGIS = 0x812F, + + /* OpenGL 1.2 */ + LOCAL_GL_RESCALE_NORMAL = 0x803A, + LOCAL_GL_CLAMP_TO_EDGE = 0x812F, + LOCAL_GL_MAX_ELEMENTS_VERTICES = 0xF0E8, + LOCAL_GL_MAX_ELEMENTS_INDICES = 0xF0E9, + LOCAL_GL_BGR = 0x80E0, + LOCAL_GL_BGRA = 0x80E1, + LOCAL_GL_UNSIGNED_BYTE_3_3_2 = 0x8032, + LOCAL_GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362, + LOCAL_GL_UNSIGNED_SHORT_5_6_5 = 0x8363, + LOCAL_GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364, + LOCAL_GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033, + LOCAL_GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, + LOCAL_GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034, + LOCAL_GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, + LOCAL_GL_UNSIGNED_INT_8_8_8_8 = 0x8035, + LOCAL_GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367, + LOCAL_GL_UNSIGNED_INT_10_10_10_2 = 0x8036, + LOCAL_GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368, + LOCAL_GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8, + LOCAL_GL_SINGLE_COLOR = 0x81F9, + LOCAL_GL_SEPARATE_SPECULAR_COLOR = 0x81FA, + LOCAL_GL_TEXTURE_MIN_LOD = 0x813A, + LOCAL_GL_TEXTURE_MAX_LOD = 0x813B, + LOCAL_GL_TEXTURE_BASE_LEVEL = 0x813C, + LOCAL_GL_TEXTURE_MAX_LEVEL = 0x813D +}; + +typedef struct { GLenum e; const char* name; } ENUM; +#define EDEF(VAR) { (GLenum)(LOCAL_GL_##VAR), #VAR } + +static ENUM enums[] = + { + EDEF(BYTE), + EDEF(UNSIGNED_BYTE), + EDEF(SHORT), + EDEF(UNSIGNED_SHORT), + EDEF(INT), + EDEF(UNSIGNED_INT), + EDEF(FLOAT), + EDEF(DOUBLE), + EDEF(2_BYTES), + EDEF(3_BYTES), + EDEF(4_BYTES), +/* + EDEF(LINES), + EDEF(POINTS), + EDEF(LINE_STRIP), + EDEF(LINE_LOOP), + EDEF(TRIANGLES), + EDEF(TRIANGLE_STRIP), + EDEF(TRIANGLE_FAN), + EDEF(QUADS), + EDEF(QUAD_STRIP), + EDEF(POLYGON), + EDEF(EDGE_FLAG), +*/ + EDEF(VERTEX_ARRAY), + EDEF(NORMAL_ARRAY), + EDEF(COLOR_ARRAY), + EDEF(INDEX_ARRAY), + EDEF(TEXTURE_COORD_ARRAY), + EDEF(EDGE_FLAG_ARRAY), + EDEF(VERTEX_ARRAY_SIZE), + EDEF(VERTEX_ARRAY_TYPE), + EDEF(VERTEX_ARRAY_STRIDE), + EDEF(NORMAL_ARRAY_TYPE), + EDEF(NORMAL_ARRAY_STRIDE), + EDEF(COLOR_ARRAY_SIZE), + EDEF(COLOR_ARRAY_TYPE), + EDEF(COLOR_ARRAY_STRIDE), + EDEF(INDEX_ARRAY_TYPE), + EDEF(INDEX_ARRAY_STRIDE), + EDEF(TEXTURE_COORD_ARRAY_SIZE), + EDEF(TEXTURE_COORD_ARRAY_TYPE), + EDEF(TEXTURE_COORD_ARRAY_STRIDE), + EDEF(EDGE_FLAG_ARRAY_STRIDE), + EDEF(VERTEX_ARRAY_POINTER), + EDEF(NORMAL_ARRAY_POINTER), + EDEF(COLOR_ARRAY_POINTER), + EDEF(INDEX_ARRAY_POINTER), + EDEF(TEXTURE_COORD_ARRAY_POINTER), + EDEF(EDGE_FLAG_ARRAY_POINTER), + EDEF(V2F), + EDEF(V3F), + EDEF(C4UB_V2F), + EDEF(C4UB_V3F), + EDEF(C3F_V3F), + EDEF(N3F_V3F), + EDEF(C4F_N3F_V3F), + EDEF(T2F_V3F), + EDEF(T4F_V4F), + EDEF(T2F_C4UB_V3F), + EDEF(T2F_C3F_V3F), + EDEF(T2F_N3F_V3F), + EDEF(T2F_C4F_N3F_V3F), + EDEF(T4F_C4F_N3F_V4F), + EDEF(MATRIX_MODE), + EDEF(MODELVIEW), + EDEF(PROJECTION), + EDEF(TEXTURE), + EDEF(POINT_SMOOTH), + EDEF(POINT_SIZE), + EDEF(POINT_SIZE_GRANULARITY), + EDEF(POINT_SIZE_RANGE), + EDEF(LINE_SMOOTH), + EDEF(LINE_STIPPLE), + EDEF(LINE_STIPPLE_PATTERN), + EDEF(LINE_STIPPLE_REPEAT), + EDEF(LINE_WIDTH), + EDEF(LINE_WIDTH_GRANULARITY), + EDEF(LINE_WIDTH_RANGE), + EDEF(POINT), + EDEF(LINE), + EDEF(FILL), + EDEF(CCW), + EDEF(CW), + EDEF(FRONT), + EDEF(BACK), + EDEF(CULL_FACE), + EDEF(CULL_FACE_MODE), + EDEF(POLYGON_SMOOTH), + EDEF(POLYGON_STIPPLE), + EDEF(FRONT_FACE), + EDEF(POLYGON_MODE), + EDEF(POLYGON_OFFSET_FACTOR), + EDEF(POLYGON_OFFSET_UNITS), + EDEF(POLYGON_OFFSET_POINT), + EDEF(POLYGON_OFFSET_LINE), + EDEF(POLYGON_OFFSET_FILL), + EDEF(COMPILE), + EDEF(COMPILE_AND_EXECUTE), + EDEF(LIST_BASE), + EDEF(LIST_INDEX), + EDEF(LIST_MODE), + EDEF(NEVER), + EDEF(LESS), + EDEF(GEQUAL), + EDEF(LEQUAL), + EDEF(GREATER), + EDEF(NOTEQUAL), + EDEF(EQUAL), + EDEF(ALWAYS), + EDEF(DEPTH_TEST), + EDEF(DEPTH_BITS), + EDEF(DEPTH_CLEAR_VALUE), + EDEF(DEPTH_FUNC), + EDEF(DEPTH_RANGE), + EDEF(DEPTH_WRITEMASK), + EDEF(DEPTH_COMPONENT), + EDEF(LIGHTING), + EDEF(LIGHT0), + EDEF(LIGHT1), + EDEF(LIGHT2), + EDEF(LIGHT3), + EDEF(LIGHT4), + EDEF(LIGHT5), + EDEF(LIGHT6), + EDEF(LIGHT7), + EDEF(SPOT_EXPONENT), + EDEF(SPOT_CUTOFF), + EDEF(CONSTANT_ATTENUATION), + EDEF(LINEAR_ATTENUATION), + EDEF(QUADRATIC_ATTENUATION), + EDEF(AMBIENT), + EDEF(DIFFUSE), + EDEF(SPECULAR), + EDEF(SHININESS), + EDEF(EMISSION), + EDEF(POSITION), + EDEF(SPOT_DIRECTION), + EDEF(AMBIENT_AND_DIFFUSE), + EDEF(COLOR_INDEXES), + EDEF(LIGHT_MODEL_TWO_SIDE), + EDEF(LIGHT_MODEL_LOCAL_VIEWER), + EDEF(LIGHT_MODEL_AMBIENT), + EDEF(FRONT_AND_BACK), + EDEF(SHADE_MODEL), + EDEF(FLAT), + EDEF(SMOOTH), + EDEF(COLOR_MATERIAL), + EDEF(COLOR_MATERIAL_FACE), + EDEF(COLOR_MATERIAL_PARAMETER), + EDEF(NORMALIZE), + EDEF(CLIP_PLANE0), + EDEF(CLIP_PLANE1), + EDEF(CLIP_PLANE2), + EDEF(CLIP_PLANE3), + EDEF(CLIP_PLANE4), + EDEF(CLIP_PLANE5), + EDEF(ACCUM_RED_BITS), + EDEF(ACCUM_GREEN_BITS), + EDEF(ACCUM_BLUE_BITS), + EDEF(ACCUM_ALPHA_BITS), + EDEF(ACCUM_CLEAR_VALUE), + EDEF(ACCUM), + EDEF(ADD), + EDEF(LOAD), + EDEF(MULT), + EDEF(RETURN), + EDEF(ALPHA_TEST), + EDEF(ALPHA_TEST_REF), + EDEF(ALPHA_TEST_FUNC), + EDEF(BLEND), + EDEF(BLEND_SRC), + EDEF(BLEND_DST), + EDEF(ZERO), + EDEF(ONE), + EDEF(SRC_COLOR), + EDEF(ONE_MINUS_SRC_COLOR), + EDEF(DST_COLOR), + EDEF(ONE_MINUS_DST_COLOR), + EDEF(SRC_ALPHA), + EDEF(ONE_MINUS_SRC_ALPHA), + EDEF(DST_ALPHA), + EDEF(ONE_MINUS_DST_ALPHA), + EDEF(SRC_ALPHA_SATURATE), + EDEF(CONSTANT_COLOR), + EDEF(ONE_MINUS_CONSTANT_COLOR), + EDEF(CONSTANT_ALPHA), + EDEF(ONE_MINUS_CONSTANT_ALPHA), + EDEF(FEEDBACK), + EDEF(RENDER), + EDEF(SELECT), + EDEF(2D), + EDEF(3D), + EDEF(3D_COLOR), + EDEF(3D_COLOR_TEXTURE), + EDEF(4D_COLOR_TEXTURE), + EDEF(POINT_TOKEN), + EDEF(LINE_TOKEN), + EDEF(LINE_RESET_TOKEN), + EDEF(POLYGON_TOKEN), + EDEF(BITMAP_TOKEN), + EDEF(DRAW_PIXEL_TOKEN), + EDEF(COPY_PIXEL_TOKEN), + EDEF(PASS_THROUGH_TOKEN), + EDEF(FEEDBACK_BUFFER_POINTER), + EDEF(FEEDBACK_BUFFER_SIZE), + EDEF(FEEDBACK_BUFFER_TYPE), + EDEF(SELECTION_BUFFER_POINTER), + EDEF(SELECTION_BUFFER_SIZE), + EDEF(FOG), + EDEF(FOG_MODE), + EDEF(FOG_DENSITY), + EDEF(FOG_COLOR), + EDEF(FOG_INDEX), + EDEF(FOG_START), + EDEF(FOG_END), + EDEF(LINEAR), + EDEF(EXP), + EDEF(EXP2), + EDEF(LOGIC_OP), + EDEF(INDEX_LOGIC_OP), + EDEF(COLOR_LOGIC_OP), + EDEF(LOGIC_OP_MODE), + EDEF(CLEAR), + EDEF(SET), + EDEF(COPY), + EDEF(COPY_INVERTED), + EDEF(NOOP), + EDEF(INVERT), + EDEF(AND), + EDEF(NAND), + EDEF(OR), + EDEF(NOR), + EDEF(XOR), + EDEF(EQUIV), + EDEF(AND_REVERSE), + EDEF(AND_INVERTED), + EDEF(OR_REVERSE), + EDEF(OR_INVERTED), + EDEF(STENCIL_TEST), + EDEF(STENCIL_WRITEMASK), + EDEF(STENCIL_BITS), + EDEF(STENCIL_FUNC), + EDEF(STENCIL_VALUE_MASK), + EDEF(STENCIL_REF), + EDEF(STENCIL_FAIL), + EDEF(STENCIL_PASS_DEPTH_PASS), + EDEF(STENCIL_PASS_DEPTH_FAIL), + EDEF(STENCIL_CLEAR_VALUE), + EDEF(STENCIL_INDEX), + EDEF(KEEP), + EDEF(REPLACE), + EDEF(INCR), + EDEF(DECR), + EDEF(NONE), + EDEF(LEFT), + EDEF(RIGHT), + EDEF(FRONT_LEFT), + EDEF(FRONT_RIGHT), + EDEF(BACK_LEFT), + EDEF(BACK_RIGHT), + EDEF(AUX0), + EDEF(AUX1), + EDEF(AUX2), + EDEF(AUX3), + EDEF(COLOR_INDEX), + EDEF(RED), + EDEF(GREEN), + EDEF(BLUE), + EDEF(ALPHA), + EDEF(LUMINANCE), + EDEF(LUMINANCE_ALPHA), + EDEF(ALPHA_BITS), + EDEF(RED_BITS), + EDEF(GREEN_BITS), + EDEF(BLUE_BITS), + EDEF(INDEX_BITS), + EDEF(SUBPIXEL_BITS), + EDEF(AUX_BUFFERS), + EDEF(READ_BUFFER), + EDEF(DRAW_BUFFER), + EDEF(DOUBLEBUFFER), + EDEF(STEREO), + EDEF(BITMAP), + EDEF(COLOR), + EDEF(DEPTH), + EDEF(STENCIL), + EDEF(DITHER), + EDEF(RGB), + EDEF(RGBA), + EDEF(MAX_LIST_NESTING), + EDEF(MAX_ATTRIB_STACK_DEPTH), + EDEF(MAX_MODELVIEW_STACK_DEPTH), + EDEF(MAX_NAME_STACK_DEPTH), + EDEF(MAX_PROJECTION_STACK_DEPTH), + EDEF(MAX_TEXTURE_STACK_DEPTH), + EDEF(MAX_EVAL_ORDER), + EDEF(MAX_LIGHTS), + EDEF(MAX_CLIP_PLANES), + EDEF(MAX_TEXTURE_SIZE), + EDEF(MAX_PIXEL_MAP_TABLE), + EDEF(MAX_VIEWPORT_DIMS), + EDEF(MAX_CLIENT_ATTRIB_STACK_DEPTH), + EDEF(ATTRIB_STACK_DEPTH), + EDEF(CLIENT_ATTRIB_STACK_DEPTH), + EDEF(COLOR_CLEAR_VALUE), + EDEF(COLOR_WRITEMASK), + EDEF(CURRENT_INDEX), + EDEF(CURRENT_COLOR), + EDEF(CURRENT_NORMAL), + EDEF(CURRENT_RASTER_COLOR), + EDEF(CURRENT_RASTER_DISTANCE), + EDEF(CURRENT_RASTER_INDEX), + EDEF(CURRENT_RASTER_POSITION), + EDEF(CURRENT_RASTER_TEXTURE_COORDS), + EDEF(CURRENT_RASTER_POSITION_VALID), + EDEF(CURRENT_TEXTURE_COORDS), + EDEF(INDEX_CLEAR_VALUE), + EDEF(INDEX_MODE), + EDEF(INDEX_WRITEMASK), + EDEF(MODELVIEW_MATRIX), + EDEF(MODELVIEW_STACK_DEPTH), + EDEF(NAME_STACK_DEPTH), + EDEF(PROJECTION_MATRIX), + EDEF(PROJECTION_STACK_DEPTH), + EDEF(RENDER_MODE), + EDEF(RGBA_MODE), + EDEF(TEXTURE_MATRIX), + EDEF(TEXTURE_STACK_DEPTH), + EDEF(VIEWPORT), + EDEF(AUTO_NORMAL), + EDEF(MAP1_COLOR_4), + EDEF(MAP1_GRID_DOMAIN), + EDEF(MAP1_GRID_SEGMENTS), + EDEF(MAP1_INDEX), + EDEF(MAP1_NORMAL), + EDEF(MAP1_TEXTURE_COORD_1), + EDEF(MAP1_TEXTURE_COORD_2), + EDEF(MAP1_TEXTURE_COORD_3), + EDEF(MAP1_TEXTURE_COORD_4), + EDEF(MAP1_VERTEX_3), + EDEF(MAP1_VERTEX_4), + EDEF(MAP2_COLOR_4), + EDEF(MAP2_GRID_DOMAIN), + EDEF(MAP2_GRID_SEGMENTS), + EDEF(MAP2_INDEX), + EDEF(MAP2_NORMAL), + EDEF(MAP2_TEXTURE_COORD_1), + EDEF(MAP2_TEXTURE_COORD_2), + EDEF(MAP2_TEXTURE_COORD_3), + EDEF(MAP2_TEXTURE_COORD_4), + EDEF(MAP2_VERTEX_3), + EDEF(MAP2_VERTEX_4), + EDEF(COEFF), + EDEF(DOMAIN), + EDEF(ORDER), + EDEF(FOG_HINT), + EDEF(LINE_SMOOTH_HINT), + EDEF(PERSPECTIVE_CORRECTION_HINT), + EDEF(POINT_SMOOTH_HINT), + EDEF(POLYGON_SMOOTH_HINT), + EDEF(DONT_CARE), + EDEF(FASTEST), + EDEF(NICEST), + EDEF(SCISSOR_TEST), + EDEF(SCISSOR_BOX), + EDEF(MAP_COLOR), + EDEF(MAP_STENCIL), + EDEF(INDEX_SHIFT), + EDEF(INDEX_OFFSET), + EDEF(RED_SCALE), + EDEF(RED_BIAS), + EDEF(GREEN_SCALE), + EDEF(GREEN_BIAS), + EDEF(BLUE_SCALE), + EDEF(BLUE_BIAS), + EDEF(ALPHA_SCALE), + EDEF(ALPHA_BIAS), + EDEF(DEPTH_SCALE), + EDEF(DEPTH_BIAS), + EDEF(PIXEL_MAP_S_TO_S_SIZE), + EDEF(PIXEL_MAP_I_TO_I_SIZE), + EDEF(PIXEL_MAP_I_TO_R_SIZE), + EDEF(PIXEL_MAP_I_TO_G_SIZE), + EDEF(PIXEL_MAP_I_TO_B_SIZE), + EDEF(PIXEL_MAP_I_TO_A_SIZE), + EDEF(PIXEL_MAP_R_TO_R_SIZE), + EDEF(PIXEL_MAP_G_TO_G_SIZE), + EDEF(PIXEL_MAP_B_TO_B_SIZE), + EDEF(PIXEL_MAP_A_TO_A_SIZE), + EDEF(PIXEL_MAP_S_TO_S), + EDEF(PIXEL_MAP_I_TO_I), + EDEF(PIXEL_MAP_I_TO_R), + EDEF(PIXEL_MAP_I_TO_G), + EDEF(PIXEL_MAP_I_TO_B), + EDEF(PIXEL_MAP_I_TO_A), + EDEF(PIXEL_MAP_R_TO_R), + EDEF(PIXEL_MAP_G_TO_G), + EDEF(PIXEL_MAP_B_TO_B), + EDEF(PIXEL_MAP_A_TO_A), + EDEF(PACK_ALIGNMENT), + EDEF(PACK_LSB_FIRST), + EDEF(PACK_ROW_LENGTH), + EDEF(PACK_SKIP_PIXELS), + EDEF(PACK_SKIP_ROWS), + EDEF(PACK_SWAP_BYTES), + EDEF(UNPACK_ALIGNMENT), + EDEF(UNPACK_LSB_FIRST), + EDEF(UNPACK_ROW_LENGTH), + EDEF(UNPACK_SKIP_PIXELS), + EDEF(UNPACK_SKIP_ROWS), + EDEF(UNPACK_SWAP_BYTES), + EDEF(ZOOM_X), + EDEF(ZOOM_Y), + EDEF(TEXTURE_ENV), + EDEF(TEXTURE_ENV_MODE), + EDEF(TEXTURE_1D), + EDEF(TEXTURE_2D), + EDEF(TEXTURE_WRAP_S), + EDEF(TEXTURE_WRAP_T), + EDEF(TEXTURE_MAG_FILTER), + EDEF(TEXTURE_MIN_FILTER), + EDEF(TEXTURE_ENV_COLOR), + EDEF(TEXTURE_GEN_S), + EDEF(TEXTURE_GEN_T), + EDEF(TEXTURE_GEN_MODE), + EDEF(TEXTURE_BORDER_COLOR), + EDEF(TEXTURE_WIDTH), + EDEF(TEXTURE_HEIGHT), + EDEF(TEXTURE_BORDER), + EDEF(TEXTURE_COMPONENTS), + EDEF(TEXTURE_RED_SIZE), + EDEF(TEXTURE_GREEN_SIZE), + EDEF(TEXTURE_BLUE_SIZE), + EDEF(TEXTURE_ALPHA_SIZE), + EDEF(TEXTURE_LUMINANCE_SIZE), + EDEF(TEXTURE_INTENSITY_SIZE), + EDEF(NEAREST_MIPMAP_NEAREST), + EDEF(NEAREST_MIPMAP_LINEAR), + EDEF(LINEAR_MIPMAP_NEAREST), + EDEF(LINEAR_MIPMAP_LINEAR), + EDEF(OBJECT_LINEAR), + EDEF(OBJECT_PLANE), + EDEF(EYE_LINEAR), + EDEF(EYE_PLANE), + EDEF(SPHERE_MAP), + EDEF(DECAL), + EDEF(MODULATE), + EDEF(NEAREST), + EDEF(REPEAT), + EDEF(CLAMP), + EDEF(S), + EDEF(T), + EDEF(R), + EDEF(Q), + EDEF(TEXTURE_GEN_R), + EDEF(TEXTURE_GEN_Q), + EDEF(PROXY_TEXTURE_1D), + EDEF(PROXY_TEXTURE_2D), + EDEF(TEXTURE_PRIORITY), + EDEF(TEXTURE_RESIDENT), + EDEF(TEXTURE_BINDING_1D), + EDEF(TEXTURE_BINDING_2D), + EDEF(TEXTURE_INTERNAL_FORMAT), + EDEF(PACK_SKIP_IMAGES), + EDEF(PACK_IMAGE_HEIGHT), + EDEF(UNPACK_SKIP_IMAGES), + EDEF(UNPACK_IMAGE_HEIGHT), + EDEF(TEXTURE_3D), + EDEF(PROXY_TEXTURE_3D), + EDEF(TEXTURE_DEPTH), + EDEF(TEXTURE_WRAP_R), + EDEF(MAX_3D_TEXTURE_SIZE), + EDEF(TEXTURE_BINDING_3D), + EDEF(ALPHA4), + EDEF(ALPHA8), + EDEF(ALPHA12), + EDEF(ALPHA16), + EDEF(LUMINANCE4), + EDEF(LUMINANCE8), + EDEF(LUMINANCE12), + EDEF(LUMINANCE16), + EDEF(LUMINANCE4_ALPHA4), + EDEF(LUMINANCE6_ALPHA2), + EDEF(LUMINANCE8_ALPHA8), + EDEF(LUMINANCE12_ALPHA4), + EDEF(LUMINANCE12_ALPHA12), + EDEF(LUMINANCE16_ALPHA16), + EDEF(INTENSITY), + EDEF(INTENSITY4), + EDEF(INTENSITY8), + EDEF(INTENSITY12), + EDEF(INTENSITY16), + EDEF(R3_G3_B2), + EDEF(RGB4), + EDEF(RGB5), + EDEF(RGB8), + EDEF(RGB10), + EDEF(RGB12), + EDEF(RGB16), + EDEF(RGBA2), + EDEF(RGBA4), + EDEF(RGB5_A1), + EDEF(RGBA8), + EDEF(RGB10_A2), + EDEF(RGBA12), + EDEF(RGBA16), + EDEF(VENDOR), + EDEF(RENDERER), + EDEF(VERSION), + EDEF(EXTENSIONS), + EDEF(INVALID_VALUE), + EDEF(INVALID_ENUM), + EDEF(INVALID_OPERATION), + EDEF(STACK_OVERFLOW), + EDEF(STACK_UNDERFLOW), + EDEF(OUT_OF_MEMORY), + + /* extensions */ + EDEF(CONSTANT_COLOR_EXT), + EDEF(ONE_MINUS_CONSTANT_COLOR_EXT), + EDEF(CONSTANT_ALPHA_EXT), + EDEF(ONE_MINUS_CONSTANT_ALPHA_EXT), + EDEF(BLEND_EQUATION_EXT), + EDEF(MIN_EXT), + EDEF(MAX_EXT), + EDEF(FUNC_ADD_EXT), + EDEF(FUNC_SUBTRACT_EXT), + EDEF(FUNC_REVERSE_SUBTRACT_EXT), + EDEF(BLEND_COLOR_EXT), + EDEF(POLYGON_OFFSET_EXT), + EDEF(POLYGON_OFFSET_FACTOR_EXT), + EDEF(POLYGON_OFFSET_BIAS_EXT), + EDEF(VERTEX_ARRAY_EXT), + EDEF(NORMAL_ARRAY_EXT), + EDEF(COLOR_ARRAY_EXT), + EDEF(INDEX_ARRAY_EXT), + EDEF(TEXTURE_COORD_ARRAY_EXT), + EDEF(EDGE_FLAG_ARRAY_EXT), + EDEF(VERTEX_ARRAY_SIZE_EXT), + EDEF(VERTEX_ARRAY_TYPE_EXT), + EDEF(VERTEX_ARRAY_STRIDE_EXT), + EDEF(VERTEX_ARRAY_COUNT_EXT), + EDEF(NORMAL_ARRAY_TYPE_EXT), + EDEF(NORMAL_ARRAY_STRIDE_EXT), + EDEF(NORMAL_ARRAY_COUNT_EXT), + EDEF(COLOR_ARRAY_SIZE_EXT), + EDEF(COLOR_ARRAY_TYPE_EXT), + EDEF(COLOR_ARRAY_STRIDE_EXT), + EDEF(COLOR_ARRAY_COUNT_EXT), + EDEF(INDEX_ARRAY_TYPE_EXT), + EDEF(INDEX_ARRAY_STRIDE_EXT), + EDEF(INDEX_ARRAY_COUNT_EXT), + EDEF(TEXTURE_COORD_ARRAY_SIZE_EXT), + EDEF(TEXTURE_COORD_ARRAY_TYPE_EXT), + EDEF(TEXTURE_COORD_ARRAY_STRIDE_EXT), + EDEF(TEXTURE_COORD_ARRAY_COUNT_EXT), + EDEF(EDGE_FLAG_ARRAY_STRIDE_EXT), + EDEF(EDGE_FLAG_ARRAY_COUNT_EXT), + EDEF(VERTEX_ARRAY_POINTER_EXT), + EDEF(NORMAL_ARRAY_POINTER_EXT), + EDEF(COLOR_ARRAY_POINTER_EXT), + EDEF(INDEX_ARRAY_POINTER_EXT), + EDEF(TEXTURE_COORD_ARRAY_POINTER_EXT), + EDEF(EDGE_FLAG_ARRAY_POINTER_EXT), + EDEF(TEXTURE_PRIORITY_EXT), + EDEF(TEXTURE_RESIDENT_EXT), + EDEF(TEXTURE_1D_BINDING_EXT), + EDEF(TEXTURE_2D_BINDING_EXT), + EDEF(PACK_SKIP_IMAGES_EXT), + EDEF(PACK_IMAGE_HEIGHT_EXT), + EDEF(UNPACK_SKIP_IMAGES_EXT), + EDEF(UNPACK_IMAGE_HEIGHT_EXT), + EDEF(TEXTURE_3D_EXT), + EDEF(PROXY_TEXTURE_3D_EXT), + EDEF(TEXTURE_DEPTH_EXT), + EDEF(TEXTURE_WRAP_R_EXT), + EDEF(MAX_3D_TEXTURE_SIZE_EXT), + EDEF(TEXTURE_3D_BINDING_EXT), + EDEF(TABLE_TOO_LARGE_EXT), + EDEF(COLOR_TABLE_FORMAT_EXT), + EDEF(COLOR_TABLE_WIDTH_EXT), + EDEF(COLOR_TABLE_RED_SIZE_EXT), + EDEF(COLOR_TABLE_GREEN_SIZE_EXT), + EDEF(COLOR_TABLE_BLUE_SIZE_EXT), + EDEF(COLOR_TABLE_ALPHA_SIZE_EXT), + EDEF(COLOR_TABLE_LUMINANCE_SIZE_EXT), + EDEF(COLOR_TABLE_INTENSITY_SIZE_EXT), + EDEF(TEXTURE_INDEX_SIZE_EXT), + EDEF(COLOR_INDEX1_EXT), + EDEF(COLOR_INDEX2_EXT), + EDEF(COLOR_INDEX4_EXT), + EDEF(COLOR_INDEX8_EXT), + EDEF(COLOR_INDEX12_EXT), + EDEF(COLOR_INDEX16_EXT), + EDEF(SHARED_TEXTURE_PALETTE_EXT), + EDEF(POINT_SIZE_MIN_EXT), + EDEF(POINT_SIZE_MAX_EXT), + EDEF(POINT_FADE_THRESHOLD_SIZE_EXT), + EDEF(DISTANCE_ATTENUATION_EXT), + EDEF(RESCALE_NORMAL_EXT), + EDEF(ABGR_EXT), + EDEF(SELECTED_TEXTURE_SGIS), + EDEF(SELECTED_TEXTURE_COORD_SET_SGIS), + EDEF(MAX_TEXTURES_SGIS), + EDEF(TEXTURE0_SGIS), + EDEF(TEXTURE1_SGIS), + EDEF(TEXTURE2_SGIS), + EDEF(TEXTURE3_SGIS), + EDEF(TEXTURE_COORD_SET_SOURCE_SGIS), + EDEF(SELECTED_TEXTURE_EXT), + EDEF(SELECTED_TEXTURE_COORD_SET_EXT), + EDEF(SELECTED_TEXTURE_TRANSFORM_EXT), + EDEF(MAX_TEXTURES_EXT), + EDEF(MAX_TEXTURE_COORD_SETS_EXT), + EDEF(TEXTURE_ENV_COORD_SET_EXT), + EDEF(TEXTURE0_EXT), + EDEF(TEXTURE1_EXT), + EDEF(TEXTURE2_EXT), + EDEF(TEXTURE3_EXT), + EDEF(CLAMP_TO_EDGE_SGIS), + EDEF(RESCALE_NORMAL), + EDEF(CLAMP_TO_EDGE), + EDEF(MAX_ELEMENTS_VERTICES), + EDEF(MAX_ELEMENTS_INDICES), + EDEF(BGR), + EDEF(BGRA), + EDEF(UNSIGNED_BYTE_3_3_2), + EDEF(UNSIGNED_BYTE_2_3_3_REV), + EDEF(UNSIGNED_SHORT_5_6_5), + EDEF(UNSIGNED_SHORT_5_6_5_REV), + EDEF(UNSIGNED_SHORT_4_4_4_4), + EDEF(UNSIGNED_SHORT_4_4_4_4_REV), + EDEF(UNSIGNED_SHORT_5_5_5_1), + EDEF(UNSIGNED_SHORT_1_5_5_5_REV), + EDEF(UNSIGNED_INT_8_8_8_8), + EDEF(UNSIGNED_INT_8_8_8_8_REV), + EDEF(UNSIGNED_INT_10_10_10_2), + EDEF(UNSIGNED_INT_2_10_10_10_REV), + EDEF(LIGHT_MODEL_COLOR_CONTROL), + EDEF(SINGLE_COLOR), + EDEF(SEPARATE_SPECULAR_COLOR), + EDEF(TEXTURE_MIN_LOD), + EDEF(TEXTURE_MAX_LOD), + EDEF(TEXTURE_BASE_LEVEL), + EDEF(TEXTURE_MAX_LEVEL) +}; + +#undef EDEF + +#define N_ENUMS (sizeof(enums) / sizeof(ENUM)) + +/***************************************************************************/ + +static void print_enum_name( FILE* OUT, GLenum e ) +{ + int i, found= 0; + for( i= 0; i < N_ENUMS; ++i ) + { + if( enums[i].e == e ) + { + if( found ) + fprintf( OUT, "/" ); + found= 1; + fprintf( OUT, "%s", enums[i].name ); + } + } + if( ! found ) + fprintf( OUT, "*UNKNOWN* [%04x]", (int)e ); + fprintf( OUT, "\n" ); +} + +#define BOOL_STRING(b) (b ? "true" : "false") + +#define VAR_ENUM(VAR) \ + { \ + GLint e= 0; \ + glGetIntegerv(GL_##VAR,&e); \ + fprintf( OUT, "%s: ", #VAR ); \ + print_enum_name( OUT, (GLenum) e ); \ + } + +#define VAR_FLOAT4(VAR) \ + { \ + GLfloat f[4]; \ + f[0]= f[1]= f[2]= f[3]= 0.0; \ + glGetFloatv(GL_##VAR,f); \ + fprintf( OUT, "%s: [%f %f %f %f]\n", \ + #VAR, f[0], f[1], f[2], f[3] ); \ + } + +#define VAR_MAT_FLOAT4(VAR) \ + { \ + GLfloat f[4]; \ + f[0]= f[1]= f[2]= f[3]= 0.0; \ + glGetMaterialfv(GL_FRONT,GL_##VAR,f); \ + fprintf( OUT, "FRONT_%s: [%f %f %f %f]\n", \ + #VAR, f[0], f[1], f[2], f[3] ); \ + glGetMaterialfv(GL_BACK,GL_##VAR,f); \ + fprintf( OUT, " BACK_%s: [%f %f %f %f]\n", \ + #VAR, f[0], f[1], f[2], f[3] ); \ + } + +#define VAR_LIGHT_FLOAT4(LIGHT,VAR) \ + { \ + GLfloat f[4]; \ + f[0]= f[1]= f[2]= f[3]= 0.0; \ + glGetLightfv(GL_LIGHT0+LIGHT,GL_##VAR,f); \ + fprintf( OUT, "LIGHT%d.%s: [%f %f %f %f]\n", \ + LIGHT, #VAR, f[0], f[1], f[2], f[3] ); \ + } + +#define VAR_LIGHT_FLOAT3(LIGHT,VAR) \ + { \ + GLfloat f[3]; \ + f[0]= f[1]= f[2]= 0.0; \ + glGetLightfv(GL_LIGHT0+LIGHT,GL_##VAR,f); \ + fprintf( OUT, "LIGHT%d.%s: [%f %f %f]\n", \ + LIGHT, #VAR, f[0], f[1], f[2] ); \ + } + +#define VAR_FLOAT3(VAR) \ + { \ + GLfloat f[3]; \ + f[0]= f[1]= f[2]= 0.0; \ + glGetFloatv(GL_##VAR,f) ; \ + fprintf( OUT, "%s: [%f %f %f]\n", \ + #VAR, f[0], f[1], f[2] ); \ + } +#define VAR_FLOAT2(VAR) \ + { \ + GLfloat f[2]; \ + f[0]= f[1]= 0.0; \ + glGetFloatv(GL_##VAR,f); \ + fprintf( OUT, "%s: [%f %f]\n", \ + #VAR, f[0], f[1] ); \ + } + +#define VAR_COLOR(VAR) VAR_FLOAT4(VAR) +#define VAR_TEXCOORD(VAR) VAR_FLOAT4(VAR) +#define VAR_NORMAL(VAR) VAR_FLOAT3(VAR) + +#define VAR_MAT_COLOR(VAR) VAR_MAT_FLOAT4(VAR) +#define VAR_LIGHT_COLOR(LIGHT,VAR) VAR_LIGHT_FLOAT4(LIGHT,VAR) + +#define VAR_FLOAT(VAR) \ + { \ + GLfloat f= 0.0; \ + glGetFloatv(GL_##VAR,&f); \ + fprintf( OUT, "%s: %f\n", #VAR, f ); \ + } + +#define VAR_MAT_FLOAT(VAR) \ + { \ + GLfloat f= 0.0; \ + glGetMaterialfv(GL_FRONT,GL_##VAR,&f); \ + fprintf( OUT, "FRONT_%s: %f\n", #VAR, f ); \ + glGetMaterialfv(GL_BACK,GL_##VAR,&f); \ + fprintf( OUT, " BACK_%s: %f\n", #VAR, f ); \ + } + +#define VAR_LIGHT_FLOAT(LIGHT,VAR) \ + { \ + GLfloat f= 0.0; \ + glGetLightfv(GL_LIGHT0+LIGHT,GL_##VAR,&f); \ + fprintf( OUT, "LIGHT%d.%s: %f\n", \ + LIGHT, #VAR, f ); \ + } + +#define VAR_INT(VAR) \ + { \ + GLint i= 0; \ + glGetIntegerv(GL_##VAR,&i); \ + fprintf( OUT, "%s: %d\n", #VAR, (int)i ); \ + } +#define VAR_INTEGER(VAR) VAR_INT(VAR) +#define VAR_INDEX(VAR) VAR_INT(VAR) +#define VAR_HEXINT(VAR) \ + { \ + GLint i= 0; \ + glGetIntegerv(GL_##VAR,&i); \ + fprintf( OUT, "%s: 0x%04x\n", #VAR, (int)i ); \ + } +#define VAR_INT4(VAR) \ + { \ + GLint i[4]; \ + i[0]= i[1]= i[2]= i[3]= 0; \ + glGetIntegerv(GL_##VAR,i); \ + fprintf( OUT, "%s: [%d %d %d %d]\n", \ + #VAR, (int)i[0], (int)i[1], (int)i[2], (int)i[3] ); \ + } +#define VAR_BOOL(VAR) \ + { \ + GLboolean b= 0; \ + glGetBooleanv(GL_##VAR,&b); \ + fprintf( OUT, "%s: %s\n", #VAR, BOOL_STRING(b) ); \ + } +#define VAR_BOOL4(VAR) \ + { \ + GLboolean b[4]; \ + b[0]= b[1]= b[2]= b[3]= 0; \ + glGetBooleanv(GL_##VAR,b); \ + fprintf( OUT, "%s: [%s %s %s %s]\n", \ + #VAR, \ + BOOL_STRING(b[0]), \ + BOOL_STRING(b[1]), \ + BOOL_STRING(b[2]), \ + BOOL_STRING(b[3]) ); \ + } +#define VAR_PTR(VAR) \ + { \ + GLvoid* p= 0; \ + glGetPointerv(GL_##VAR,&p); \ + fprintf( OUT, "%s: %p\n", #VAR, p ); \ + } +#define VAR_MATRIX(VAR) \ + { \ + GLfloat m[16]; \ + int i; \ + for( i= 0; i < 16; ++i ) m[i]= 0.0; \ + glGetFloatv(GL_##VAR,m); \ + fprintf( OUT, \ + "%s:\n\t[%+.6f %+.6f %+.6f %+.6f]\n\t[%+.6f %+.6f %+.6f +%+.6f]\n\t[%+.6f %+.6f %+.6f %+.6f]\n\t[%+.6f %+.6f %+.6f %+.6f]\n", \ + #VAR, \ + m[0+0*4], m[0+1*4], m[0+2*4], m[0+3*4], \ + m[1+0*4], m[1+1*4], m[1+2*4], m[1+3*4], \ + m[2+0*4], m[2+1*4], m[2+2*4], m[2+3*4], \ + m[3+0*4], m[3+1*4], m[3+2*4], m[3+3*4] ); \ + } + +/***************************************************************************/ + +/* +#define OUT stderr +*/ +void dump_opengl_state( FILE* OUT ) +{ + int i; + GLint n_lights= 0; + + glGetIntegerv( GL_MAX_LIGHTS, &n_lights ); + + VAR_COLOR(CURRENT_COLOR) + VAR_INDEX(CURRENT_INDEX) + VAR_TEXCOORD(CURRENT_TEXTURE_COORDS) + VAR_NORMAL(CURRENT_NORMAL) + VAR_FLOAT4(CURRENT_RASTER_POSITION) + VAR_FLOAT(CURRENT_RASTER_DISTANCE) + VAR_COLOR(CURRENT_RASTER_COLOR) + VAR_INDEX(CURRENT_RASTER_INDEX) + VAR_TEXCOORD(CURRENT_RASTER_TEXTURE_COORDS) + VAR_BOOL(CURRENT_RASTER_POSITION_VALID) + VAR_BOOL(EDGE_FLAG) + + VAR_BOOL (VERTEX_ARRAY) + VAR_INTEGER(VERTEX_ARRAY_SIZE) + VAR_ENUM (VERTEX_ARRAY_TYPE) + VAR_INTEGER(VERTEX_ARRAY_STRIDE) + VAR_PTR (VERTEX_ARRAY_POINTER) + + VAR_BOOL (NORMAL_ARRAY) + VAR_ENUM (NORMAL_ARRAY_TYPE) + VAR_INTEGER(NORMAL_ARRAY_STRIDE) + VAR_PTR (NORMAL_ARRAY_POINTER) + + VAR_BOOL (COLOR_ARRAY) + VAR_INTEGER(COLOR_ARRAY_SIZE) + VAR_ENUM (COLOR_ARRAY_TYPE) + VAR_INTEGER(COLOR_ARRAY_STRIDE) + VAR_PTR (COLOR_ARRAY_POINTER) + + VAR_BOOL (INDEX_ARRAY) + VAR_ENUM (INDEX_ARRAY_TYPE) + VAR_INTEGER(INDEX_ARRAY_STRIDE) + VAR_PTR (INDEX_ARRAY_POINTER) + + VAR_BOOL (TEXTURE_COORD_ARRAY) + VAR_INTEGER(TEXTURE_COORD_ARRAY_SIZE) + VAR_ENUM (TEXTURE_COORD_ARRAY_TYPE) + VAR_INTEGER(TEXTURE_COORD_ARRAY_STRIDE) + VAR_PTR (TEXTURE_COORD_ARRAY_POINTER) + + VAR_BOOL (EDGE_FLAG_ARRAY) + VAR_INTEGER(EDGE_FLAG_ARRAY_STRIDE) + VAR_PTR (EDGE_FLAG_ARRAY_POINTER) + + VAR_MATRIX(MODELVIEW_MATRIX) + VAR_MATRIX(PROJECTION_MATRIX) + VAR_MATRIX(TEXTURE_MATRIX) + VAR_INT4(VIEWPORT) + VAR_FLOAT2(DEPTH_RANGE) + VAR_INT(MODELVIEW_STACK_DEPTH) + VAR_INT(PROJECTION_STACK_DEPTH) + VAR_INT(TEXTURE_STACK_DEPTH) + VAR_ENUM(MATRIX_MODE) + VAR_BOOL(NORMALIZE) + VAR_BOOL(RESCALE_NORMAL_EXT) + VAR_BOOL(CLIP_PLANE0) + VAR_BOOL(CLIP_PLANE1) + VAR_BOOL(CLIP_PLANE2) + VAR_BOOL(CLIP_PLANE3) + VAR_BOOL(CLIP_PLANE4) + VAR_BOOL(CLIP_PLANE5) + /* + glGetClipPlane() */ + + VAR_COLOR(FOG_COLOR) + VAR_INDEX(FOG_INDEX) + VAR_FLOAT(FOG_DENSITY) + VAR_FLOAT(FOG_START) + VAR_FLOAT(FOG_END) + VAR_ENUM(FOG_MODE) + VAR_BOOL(FOG) + VAR_ENUM(SHADE_MODEL) + + VAR_BOOL(LIGHTING) + VAR_BOOL(COLOR_MATERIAL) + VAR_ENUM(COLOR_MATERIAL_PARAMETER) + VAR_ENUM(COLOR_MATERIAL_FACE) + + VAR_MAT_COLOR(AMBIENT) + VAR_MAT_COLOR(DIFFUSE) + VAR_MAT_COLOR(SPECULAR) + VAR_MAT_COLOR(EMISSION) + VAR_MAT_FLOAT(SHININESS) + + VAR_COLOR(LIGHT_MODEL_AMBIENT) + VAR_BOOL(LIGHT_MODEL_LOCAL_VIEWER) + VAR_BOOL(LIGHT_MODEL_TWO_SIDE) +/* VAR_ENUM(LIGHT_MODEL_COLOR_CONTROL)*/ + + for( i= 0; i < n_lights; ++i ) + { + GLboolean b= 0; + + glGetBooleanv( GL_LIGHT0 + i, &b ); + fprintf( OUT, "LIGHT%d: %s\n", i, BOOL_STRING(b) ); + + if( ! b ) + continue; + + VAR_LIGHT_COLOR(i,AMBIENT) + VAR_LIGHT_COLOR(i,DIFFUSE) + VAR_LIGHT_COLOR(i,SPECULAR) + VAR_LIGHT_FLOAT4(i,POSITION) + VAR_LIGHT_FLOAT(i,CONSTANT_ATTENUATION) + VAR_LIGHT_FLOAT(i,LINEAR_ATTENUATION) + VAR_LIGHT_FLOAT(i,QUADRATIC_ATTENUATION) + VAR_LIGHT_FLOAT3(i,SPOT_DIRECTION) + VAR_LIGHT_FLOAT(i,SPOT_EXPONENT) + VAR_LIGHT_FLOAT(i,SPOT_CUTOFF) + /* COLOR_INDEXES */ + } + + VAR_FLOAT(POINT_SIZE) + VAR_BOOL(POINT_SMOOTH) + VAR_FLOAT(LINE_WIDTH) + VAR_BOOL(LINE_SMOOTH) + VAR_HEXINT(LINE_STIPPLE_PATTERN) + VAR_INT(LINE_STIPPLE_REPEAT) + VAR_BOOL(LINE_STIPPLE) + VAR_BOOL(CULL_FACE) + VAR_ENUM(CULL_FACE_MODE) + VAR_ENUM(FRONT_FACE) + VAR_BOOL(POLYGON_SMOOTH) + VAR_ENUM(POLYGON_MODE) + VAR_FLOAT(POLYGON_OFFSET_FACTOR) + VAR_FLOAT(POLYGON_OFFSET_UNITS) + VAR_BOOL(POLYGON_OFFSET_POINT) + VAR_BOOL(POLYGON_OFFSET_LINE) + VAR_BOOL(POLYGON_OFFSET_FILL) + /* GetPolygonStipple */ + VAR_BOOL(POLYGON_STIPPLE) + + VAR_BOOL(TEXTURE_1D) + VAR_BOOL(TEXTURE_2D) +/* VAR_BOOL(TEXTURE_3D)*/ + + VAR_INT(TEXTURE_BINDING_1D) + VAR_INT(TEXTURE_BINDING_2D) +/* VAR_INT(TEXTURE_BINDING_3D)*/ + + /* GetTexImage() */ + /* GetTexLevelParameter() */ + /* GetTexEnv() */ + + VAR_BOOL(TEXTURE_GEN_S) + VAR_BOOL(TEXTURE_GEN_T) + VAR_BOOL(TEXTURE_GEN_R) + VAR_BOOL(TEXTURE_GEN_Q) + + /* GetTexGen() */ + + VAR_BOOL(SCISSOR_TEST) + VAR_INT4(SCISSOR_BOX) + VAR_BOOL(ALPHA_TEST) + VAR_ENUM(ALPHA_TEST_FUNC) + VAR_FLOAT(ALPHA_TEST_REF) + VAR_BOOL(STENCIL_TEST) + VAR_ENUM(STENCIL_FUNC) + VAR_HEXINT(STENCIL_VALUE_MASK) + VAR_INT(STENCIL_REF) + VAR_ENUM(STENCIL_FAIL) + VAR_ENUM(STENCIL_PASS_DEPTH_FAIL) + VAR_ENUM(STENCIL_PASS_DEPTH_PASS) + VAR_BOOL(DEPTH_TEST) + VAR_ENUM(DEPTH_FUNC) + VAR_BOOL(BLEND) + VAR_ENUM(BLEND_SRC) + VAR_ENUM(BLEND_DST) + + VAR_BOOL(DITHER) + VAR_BOOL(LOGIC_OP) /* INDEX_LOGIC_OP */ + VAR_BOOL(COLOR_LOGIC_OP) + + VAR_ENUM(DRAW_BUFFER) + VAR_INT(INDEX_WRITEMASK) + VAR_BOOL4(COLOR_WRITEMASK) + VAR_BOOL(DEPTH_WRITEMASK) + VAR_HEXINT(STENCIL_WRITEMASK) + VAR_COLOR(COLOR_CLEAR_VALUE) + VAR_INDEX(INDEX_CLEAR_VALUE) + VAR_FLOAT(DEPTH_CLEAR_VALUE) + VAR_INT(STENCIL_CLEAR_VALUE) + VAR_FLOAT(ACCUM_CLEAR_VALUE) + + VAR_BOOL(UNPACK_SWAP_BYTES) + VAR_BOOL(UNPACK_LSB_FIRST) +#ifdef UNPACK_IMAGE_HEIGHT + VAR_INT(UNPACK_IMAGE_HEIGHT) +#endif +#ifdef UNPACK_SKIP_IMAGES + VAR_INT(UNPACK_SKIP_IMAGES) +#endif + VAR_INT(UNPACK_ROW_LENGTH) + VAR_INT(UNPACK_SKIP_ROWS) + VAR_INT(UNPACK_SKIP_PIXELS) + VAR_INT(UNPACK_ALIGNMENT) + + VAR_BOOL(PACK_SWAP_BYTES) + VAR_BOOL(PACK_LSB_FIRST) +#ifdef PACK_IMAGE_HEIGHT + VAR_INT(PACK_IMAGE_HEIGHT) +#endif +#ifdef PACK_SKIP_IMAGES + VAR_INT(PACK_SKIP_IMAGES) +#endif + VAR_INT(PACK_ROW_LENGTH) + VAR_INT(PACK_SKIP_ROWS) + VAR_INT(PACK_SKIP_PIXELS) + VAR_INT(PACK_ALIGNMENT) + + VAR_BOOL(MAP_COLOR) + VAR_BOOL(MAP_STENCIL) + VAR_INT(INDEX_SHIFT) + VAR_INT(INDEX_OFFSET) + VAR_FLOAT(RED_SCALE) + VAR_FLOAT(GREEN_SCALE) + VAR_FLOAT(BLUE_SCALE) + VAR_FLOAT(ALPHA_SCALE) + VAR_FLOAT(DEPTH_SCALE) + VAR_FLOAT(RED_BIAS) + VAR_FLOAT(GREEN_BIAS) + VAR_FLOAT(BLUE_BIAS) + VAR_FLOAT(ALPHA_BIAS) + VAR_FLOAT(DEPTH_BIAS) + + VAR_FLOAT(ZOOM_X) + VAR_FLOAT(ZOOM_Y) + + VAR_ENUM(READ_BUFFER) + + VAR_BOOL(AUTO_NORMAL) + + VAR_ENUM(PERSPECTIVE_CORRECTION_HINT) + VAR_ENUM(POINT_SMOOTH_HINT) + VAR_ENUM(LINE_SMOOTH_HINT) + VAR_ENUM(POLYGON_SMOOTH_HINT) + VAR_ENUM(FOG_HINT) + + VAR_INT(MAX_LIGHTS) + VAR_INT(MAX_CLIP_PLANES) + VAR_INT(MAX_MODELVIEW_STACK_DEPTH) + VAR_INT(MAX_PROJECTION_STACK_DEPTH) + VAR_INT(MAX_TEXTURE_STACK_DEPTH) + VAR_INT(SUBPIXEL_BITS) +#ifdef GL_MAX_3D_TEXTURE_SIZE + VAR_INT(MAX_3D_TEXTURE_SIZE) +#endif + VAR_INT(MAX_TEXTURE_SIZE) + VAR_INT(MAX_PIXEL_MAP_TABLE) + VAR_INT(MAX_NAME_STACK_DEPTH) + VAR_INT(MAX_LIST_NESTING) + VAR_INT(MAX_EVAL_ORDER) + VAR_INT(MAX_VIEWPORT_DIMS) + VAR_INT(MAX_ATTRIB_STACK_DEPTH) + VAR_INT(MAX_CLIENT_ATTRIB_STACK_DEPTH) + VAR_INT(AUX_BUFFERS) + VAR_BOOL(RGBA_MODE) + VAR_BOOL(INDEX_MODE) + VAR_BOOL(DOUBLEBUFFER) + VAR_BOOL(STEREO) +#ifdef GL_ALIASED_POINT_SIZE_RANGE + VAR_FLOAT2(ALIASED_POINT_SIZE_RANGE) +#endif +#ifdef GL_POINT_SIZE_RANGE + VAR_FLOAT2(POINT_SIZE_RANGE) /* SMOOTH_POINT_SIZE_RANGE */ +#endif + VAR_FLOAT(POINT_SIZE_GRANULARITY) /* SMOOTH_POINT_SIZE_GRANULARITY */ +#ifdef GL_ALIASED_LINE_WIDTH_RANGE + VAR_FLOAT2(ALIASED_LINE_WIDTH_RANGE) +#endif + VAR_FLOAT2(LINE_WIDTH_RANGE) /* SMOOTH_LINE_WIDTH_RANGE */ + VAR_FLOAT(LINE_WIDTH_GRANULARITY) /* SMOOTH_LINE_WIDTH_GRANULARITY */ + +#ifdef GL_MAX_ELEMENTS_INDICES + VAR_INT(MAX_ELEMENTS_INDICES) +#endif +#ifdef GL_MAX_ELEMENTS_VERTICES + VAR_INT(MAX_ELEMENTS_VERTICES) +#endif + VAR_INT(RED_BITS) + VAR_INT(GREEN_BITS) + VAR_INT(BLUE_BITS) + VAR_INT(ALPHA_BITS) + VAR_INT(INDEX_BITS) + VAR_INT(DEPTH_BITS) + VAR_INT(STENCIL_BITS) + VAR_INT(ACCUM_RED_BITS) + VAR_INT(ACCUM_GREEN_BITS) + VAR_INT(ACCUM_BLUE_BITS) + VAR_INT(ACCUM_ALPHA_BITS) + + VAR_INT(LIST_BASE) + VAR_INT(LIST_INDEX) + VAR_ENUM(LIST_MODE) + VAR_INT(ATTRIB_STACK_DEPTH) + VAR_INT(CLIENT_ATTRIB_STACK_DEPTH) + VAR_INT(NAME_STACK_DEPTH) + VAR_ENUM(RENDER_MODE) + VAR_PTR(SELECTION_BUFFER_POINTER) + VAR_INT(SELECTION_BUFFER_SIZE) + VAR_PTR(FEEDBACK_BUFFER_POINTER) + VAR_INT(FEEDBACK_BUFFER_SIZE) + VAR_ENUM(FEEDBACK_BUFFER_TYPE) + + /* glGetError() */ +} + +/***************************************************************************/ + +/*#define TEST*/ +#ifdef TEST + +#include <GL/glut.h> + +int main( int argc, char *argv[] ) +{ + glutInit( &argc, argv ); + glutInitWindowPosition(0, 0); + glutInitWindowSize(400, 300); + glutInitDisplayMode(GLUT_RGB); + glutCreateWindow(argv[0]); + dump_opengl_state(stdout); + return 0; +} + +#endif + diff --git a/xc/extras/Mesa/util/errcheck.c b/xc/extras/Mesa/util/errcheck.c new file mode 100644 index 000000000..fe9c2973c --- /dev/null +++ b/xc/extras/Mesa/util/errcheck.c @@ -0,0 +1,27 @@ +/* errcheck.c */ + + +/* + * Call this function in your rendering loop to check for GL errors + * during development. Remove from release code. + * + * Written by Brian Paul and in the public domain. + */ + + +#include <GL/gl.h> +#include <GL/glu.h> +#incldue <stdio.h> + + + +GLboolean CheckError( const char *message ) +{ + GLenum error = glGetError(); + if (error) { + char *err = (char *) gluErrorString( error ); + fprintf( stderr, "GL Error: %s at %s\n", err, message ); + return GL_TRUE; + } + return GL_FALSE; +} diff --git a/xc/extras/Mesa/util/glutskel.c b/xc/extras/Mesa/util/glutskel.c new file mode 100644 index 000000000..9873d7af1 --- /dev/null +++ b/xc/extras/Mesa/util/glutskel.c @@ -0,0 +1,148 @@ +/* $Id: glutskel.c,v 1.1 2000/11/30 17:31:30 dawes Exp $ */ + +/* + * A skeleton/template GLUT program + * + * Written by Brian Paul and in the public domain. + */ + + +/* + * $Log: glutskel.c,v $ + * Revision 1.1 2000/11/30 17:31:30 dawes + * Initial revision + * + * Revision 1.1.1.1 1999/08/19 00:55:42 jtg + * Imported sources + * + * Revision 1.2 1998/11/07 14:20:14 brianp + * added simple rotation, animation of cube + * + * Revision 1.1 1998/11/07 14:14:37 brianp + * Initial revision + * + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <GL/glut.h> + + +static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; +static GLboolean Anim = GL_FALSE; + + +static void Idle( void ) +{ + Xrot += 3.0; + Yrot += 4.0; + Zrot += 2.0; + glutPostRedisplay(); +} + + +static void Display( void ) +{ + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + + glPushMatrix(); + glRotatef(Xrot, 1, 0, 0); + glRotatef(Yrot, 0, 1, 0); + glRotatef(Zrot, 0, 0, 1); + + glutSolidCube(2.0); + + glPopMatrix(); + + glutSwapBuffers(); +} + + +static void Reshape( int width, int height ) +{ + glViewport( 0, 0, width, height ); + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); + glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 25.0 ); + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); + glTranslatef( 0.0, 0.0, -15.0 ); +} + + +static void Key( unsigned char key, int x, int y ) +{ + const GLfloat step = 3.0; + (void) x; + (void) y; + switch (key) { + case 'a': + Anim = !Anim; + if (Anim) + glutIdleFunc(Idle); + else + glutIdleFunc(NULL); + break; + case 'z': + Zrot -= step; + break; + case 'Z': + Zrot += step; + break; + case 27: + exit(0); + break; + } + glutPostRedisplay(); +} + + +static void SpecialKey( int key, int x, int y ) +{ + const GLfloat step = 3.0; + (void) x; + (void) y; + switch (key) { + case GLUT_KEY_UP: + Xrot -= step; + break; + case GLUT_KEY_DOWN: + Xrot += step; + break; + case GLUT_KEY_LEFT: + Yrot -= step; + break; + case GLUT_KEY_RIGHT: + Yrot += step; + break; + } + glutPostRedisplay(); +} + + +static void Init( void ) +{ + /* setup lighting, etc */ + glEnable(GL_DEPTH_TEST); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); +} + + +int main( int argc, char *argv[] ) +{ + glutInit( &argc, argv ); + glutInitWindowPosition( 0, 0 ); + glutInitWindowSize( 400, 400 ); + glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ); + glutCreateWindow(argv[0]); + glutReshapeFunc( Reshape ); + glutKeyboardFunc( Key ); + glutSpecialFunc( SpecialKey ); + glutDisplayFunc( Display ); + Init(); + glutMainLoop(); + return 0; +} diff --git a/xc/extras/Mesa/util/idproj.c b/xc/extras/Mesa/util/idproj.c new file mode 100644 index 000000000..d5ee3409f --- /dev/null +++ b/xc/extras/Mesa/util/idproj.c @@ -0,0 +1,26 @@ +/* idproj.c */ + + +/* + * Setup an identity projection such that glVertex(x,y) maps to + * window coordinate (x,y). + * + * Written by Brian Paul and in the public domain. + */ + + + + + +void IdentityProjection( GLint x, GLint y, GLsizei width, GLsizei height ) +{ + glViewport( x, y, width, height ); + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); + glOrtho( (GLdouble) x, (GLdouble) y, + (GLdouble) width, (GLdouble) height, + -1.0, 1.0 ); + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); +} + diff --git a/xc/extras/Mesa/util/imagesgi.h b/xc/extras/Mesa/util/imagesgi.h new file mode 100644 index 000000000..e5ecece49 --- /dev/null +++ b/xc/extras/Mesa/util/imagesgi.h @@ -0,0 +1,55 @@ +/****************************************************************************** +** Filename : imageSgi.h +** UNCLASSIFIED +** +** Description : Utility to read SGI image format files. This code was +** originally a SGI image loading utility provided with the +** Mesa 3D library @ http://www.mesa3d.org by Brain Paul. +** This has been extended to read all SGI image formats +** (e.g. INT, INTA, RGB, RGBA). +** +** Revision History: +** Date Name Description +** 06/08/99 BRC Initial Release +** +******************************************************************************/ + +#ifndef __IMAGESGI_H +#define __IMAGESGI_H + +#define IMAGE_SGI_TYPE_VERBATIM 0 +#define IMAGE_SGI_TYPE_RLE 1 + +struct sImageSgiHeader // 512 bytes +{ + short magic; // IRIS image file magic number (474) + char type; // Storage format (e.g. RLE or VERBATIM) + char numBytesPerPixelChannel; // Number of bytes per pixel channel + unsigned short dim; // Number of dimensions (1 to 3) + unsigned short xsize; // Width (in pixels) + unsigned short ysize; // Height (in pixels) + unsigned short zsize; // Number of channels (1 to 4) + int minimumPixelValue; // Minimum pixel value (0 to 255) + int maximumPixelValue; // Maximum pixel value (0 to 255) + char padding1[4]; // (ignored) + char imageName[80]; // Image name + int colormap; // colormap ID (0=normal, 0=dithered, + // 2=screen, 3=colormap) + char padding2[404]; // (ignored) +}; + +struct sImageSgi +{ + struct sImageSgiHeader header; + unsigned char *data; +}; + +#ifndef __IMAGESGI_CPP + +// RGB image load utility +extern struct sImageSgi *ImageSgiOpen(char const * const fileName); +extern void ImageSgiClose(struct sImageSgi *image); + +#endif + +#endif /* __IMAGESGI_H */ diff --git a/xc/extras/Mesa/util/mwmborder.c b/xc/extras/Mesa/util/mwmborder.c new file mode 100644 index 000000000..b61ffb50b --- /dev/null +++ b/xc/extras/Mesa/util/mwmborder.c @@ -0,0 +1,91 @@ +/* mwmborder.c */ + + +/* + * This function shows how to remove the border, title bar, resize button, + * etc from a Motif window frame from inside an Xlib-based application. + * + * Brian Paul 19 Sep 1995 brianp@ssec.wisc.edu + * + * This code is in the public domain. + */ + + +#include <X11/Xlib.h> +#include <X11/Xatom.h> + +#define HAVE_MOTIF +#ifdef HAVE_MOTIF + +#include <X11/Xm/MwmUtil.h> + +#else + +/* bit definitions for MwmHints.flags */ +#define MWM_HINTS_FUNCTIONS (1L << 0) +#define MWM_HINTS_DECORATIONS (1L << 1) +#define MWM_HINTS_INPUT_MODE (1L << 2) +#define MWM_HINTS_STATUS (1L << 3) + +/* bit definitions for MwmHints.decorations */ +#define MWM_DECOR_ALL (1L << 0) +#define MWM_DECOR_BORDER (1L << 1) +#define MWM_DECOR_RESIZEH (1L << 2) +#define MWM_DECOR_TITLE (1L << 3) +#define MWM_DECOR_MENU (1L << 4) +#define MWM_DECOR_MINIMIZE (1L << 5) +#define MWM_DECOR_MAXIMIZE (1L << 6) + +typedef struct +{ + unsigned long flags; + unsigned long functions; + unsigned long decorations; + long inputMode; + unsigned long status; +} PropMotifWmHints; + +#define PROP_MOTIF_WM_HINTS_ELEMENTS 5 + +#endif + + + +/* + * Specify which Motif window manager border decorations to put on a + * top-level window. For example, you can specify that a window is not + * resizabe, or omit the titlebar, or completely remove all decorations. + * Input: dpy - the X display + * w - the X window + * flags - bitwise-OR of the MWM_DECOR_xxx symbols in X11/Xm/MwmUtil.h + * indicating what decoration elements to enable. Zero would + * be no decoration. + */ +void set_mwm_border( Display *dpy, Window w, unsigned long flags ) +{ + PropMotifWmHints motif_hints; + Atom prop, proptype; + + /* setup the property */ + motif_hints.flags = MWM_HINTS_DECORATIONS; + motif_hints.decorations = flags; + + /* get the atom for the property */ + prop = XInternAtom( dpy, "_MOTIF_WM_HINTS", True ); + if (!prop) { + /* something went wrong! */ + return; + } + + /* not sure this is correct, seems to work, XA_WM_HINTS didn't work */ + proptype = prop; + + XChangeProperty( dpy, w, /* display, window */ + prop, proptype, /* property, type */ + 32, /* format: 32-bit datums */ + PropModeReplace, /* mode */ + (unsigned char *) &motif_hints, /* data */ + PROP_MOTIF_WM_HINTS_ELEMENTS /* nelements */ + ); +} + diff --git a/xc/extras/Mesa/util/readtex.c b/xc/extras/Mesa/util/readtex.c new file mode 100644 index 000000000..d9a5dc78f --- /dev/null +++ b/xc/extras/Mesa/util/readtex.c @@ -0,0 +1,367 @@ +/* readtex.c */ + +/* + * Read an SGI .rgb image file and generate a mipmap texture set. + * Much of this code was borrowed from SGI's tk OpenGL toolkit. + */ + + + +#include <GL/gl.h> +#include <GL/glu.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "readtex.h" + + +#ifndef SEEK_SET +# define SEEK_SET 0 +#endif + + +/* +** RGB Image Structure +*/ + +typedef struct _TK_RGBImageRec { + GLint sizeX, sizeY; + GLint components; + unsigned char *data; +} TK_RGBImageRec; + + + +/******************************************************************************/ + +typedef struct _rawImageRec { + unsigned short imagic; + unsigned short type; + unsigned short dim; + unsigned short sizeX, sizeY, sizeZ; + unsigned long min, max; + unsigned long wasteBytes; + char name[80]; + unsigned long colorMap; + FILE *file; + unsigned char *tmp, *tmpR, *tmpG, *tmpB, *tmpA; + unsigned long rleEnd; + GLuint *rowStart; + GLint *rowSize; +} rawImageRec; + +/******************************************************************************/ + +static void ConvertShort(unsigned short *array, long length) +{ + unsigned long b1, b2; + unsigned char *ptr; + + ptr = (unsigned char *)array; + while (length--) { + b1 = *ptr++; + b2 = *ptr++; + *array++ = (unsigned short) ((b1 << 8) | (b2)); + } +} + +static void ConvertLong(GLuint *array, long length) +{ + unsigned long b1, b2, b3, b4; + unsigned char *ptr; + + ptr = (unsigned char *)array; + while (length--) { + b1 = *ptr++; + b2 = *ptr++; + b3 = *ptr++; + b4 = *ptr++; + *array++ = (b1 << 24) | (b2 << 16) | (b3 << 8) | (b4); + } +} + +static rawImageRec *RawImageOpen(const char *fileName) +{ + union { + int testWord; + char testByte[4]; + } endianTest; + rawImageRec *raw; + GLenum swapFlag; + int x; + + endianTest.testWord = 1; + if (endianTest.testByte[0] == 1) { + swapFlag = GL_TRUE; + } else { + swapFlag = GL_FALSE; + } + + raw = (rawImageRec *)malloc(sizeof(rawImageRec)); + if (raw == NULL) { + fprintf(stderr, "Out of memory!\n"); + return NULL; + } + if ((raw->file = fopen(fileName, "rb")) == NULL) { + perror(fileName); + return NULL; + } + + fread(raw, 1, 12, raw->file); + + if (swapFlag) { + ConvertShort(&raw->imagic, 6); + } + + raw->tmp = (unsigned char *)malloc(raw->sizeX*256); + raw->tmpR = (unsigned char *)malloc(raw->sizeX*256); + raw->tmpG = (unsigned char *)malloc(raw->sizeX*256); + raw->tmpB = (unsigned char *)malloc(raw->sizeX*256); + if (raw->sizeZ==4) { + raw->tmpA = (unsigned char *)malloc(raw->sizeX*256); + } + if (raw->tmp == NULL || raw->tmpR == NULL || raw->tmpG == NULL || + raw->tmpB == NULL) { + fprintf(stderr, "Out of memory!\n"); + return NULL; + } + + if ((raw->type & 0xFF00) == 0x0100) { + x = raw->sizeY * raw->sizeZ * sizeof(GLuint); + raw->rowStart = (GLuint *)malloc(x); + raw->rowSize = (GLint *)malloc(x); + if (raw->rowStart == NULL || raw->rowSize == NULL) { + fprintf(stderr, "Out of memory!\n"); + return NULL; + } + raw->rleEnd = 512 + (2 * x); + fseek(raw->file, 512, SEEK_SET); + fread(raw->rowStart, 1, x, raw->file); + fread(raw->rowSize, 1, x, raw->file); + if (swapFlag) { + ConvertLong(raw->rowStart, (long) (x/sizeof(GLuint))); + ConvertLong((GLuint *)raw->rowSize, (long) (x/sizeof(GLint))); + } + } + return raw; +} + +static void RawImageClose(rawImageRec *raw) +{ + + fclose(raw->file); + free(raw->tmp); + free(raw->tmpR); + free(raw->tmpG); + free(raw->tmpB); + if (raw->sizeZ>3) { + free(raw->tmpA); + } + free(raw); +} + +static void RawImageGetRow(rawImageRec *raw, unsigned char *buf, int y, int z) +{ + unsigned char *iPtr, *oPtr, pixel; + int count, done = 0; + + if ((raw->type & 0xFF00) == 0x0100) { + fseek(raw->file, (long) raw->rowStart[y+z*raw->sizeY], SEEK_SET); + fread(raw->tmp, 1, (unsigned int)raw->rowSize[y+z*raw->sizeY], + raw->file); + + iPtr = raw->tmp; + oPtr = buf; + while (!done) { + pixel = *iPtr++; + count = (int)(pixel & 0x7F); + if (!count) { + done = 1; + return; + } + if (pixel & 0x80) { + while (count--) { + *oPtr++ = *iPtr++; + } + } else { + pixel = *iPtr++; + while (count--) { + *oPtr++ = pixel; + } + } + } + } else { + fseek(raw->file, 512+(y*raw->sizeX)+(z*raw->sizeX*raw->sizeY), + SEEK_SET); + fread(buf, 1, raw->sizeX, raw->file); + } +} + + +static void RawImageGetData(rawImageRec *raw, TK_RGBImageRec *final) +{ + unsigned char *ptr; + int i, j; + + final->data = (unsigned char *)malloc((raw->sizeX+1)*(raw->sizeY+1)*4); + if (final->data == NULL) { + fprintf(stderr, "Out of memory!\n"); + } + + ptr = final->data; + for (i = 0; i < (int)(raw->sizeY); i++) { + RawImageGetRow(raw, raw->tmpR, i, 0); + RawImageGetRow(raw, raw->tmpG, i, 1); + RawImageGetRow(raw, raw->tmpB, i, 2); + if (raw->sizeZ>3) { + RawImageGetRow(raw, raw->tmpA, i, 3); + } + for (j = 0; j < (int)(raw->sizeX); j++) { + *ptr++ = *(raw->tmpR + j); + *ptr++ = *(raw->tmpG + j); + *ptr++ = *(raw->tmpB + j); + if (raw->sizeZ>3) { + *ptr++ = *(raw->tmpA + j); + } + } + } +} + + +static TK_RGBImageRec *tkRGBImageLoad(const char *fileName) +{ + rawImageRec *raw; + TK_RGBImageRec *final; + + raw = RawImageOpen(fileName); + if (!raw) { + fprintf(stderr, "File not found\n"); + return NULL; + } + final = (TK_RGBImageRec *)malloc(sizeof(TK_RGBImageRec)); + if (final == NULL) { + fprintf(stderr, "Out of memory!\n"); + return NULL; + } + final->sizeX = raw->sizeX; + final->sizeY = raw->sizeY; + final->components = raw->sizeZ; + RawImageGetData(raw, final); + RawImageClose(raw); + return final; +} + + +static void FreeImage( TK_RGBImageRec *image ) +{ + free(image->data); + free(image); +} + + +/* + * Load an SGI .rgb file and generate a set of 2-D mipmaps from it. + * Input: imageFile - name of .rgb to read + * intFormat - internal texture format to use, or number of components + * Return: GL_TRUE if success, GL_FALSE if error. + */ +GLboolean LoadRGBMipmaps( const char *imageFile, GLint intFormat ) +{ + GLint w, h; + return LoadRGBMipmaps2( imageFile, GL_TEXTURE_2D, intFormat, &w, &h ); +} + + + +GLboolean LoadRGBMipmaps2( const char *imageFile, GLenum target, + GLint intFormat, GLint *width, GLint *height ) +{ + GLint error; + GLenum format; + TK_RGBImageRec *image; + + image = tkRGBImageLoad( imageFile ); + if (!image) { + return GL_FALSE; + } + + if (image->components==3) { + format = GL_RGB; + } + else if (image->components==4) { + format = GL_RGBA; + } + else { + /* not implemented */ + fprintf(stderr, + "Error in LoadRGBMipmaps %d-component images not implemented\n", + image->components ); + return GL_FALSE; + } + + error = gluBuild2DMipmaps( target, + intFormat, + image->sizeX, image->sizeY, + format, + GL_UNSIGNED_BYTE, + image->data ); + + *width = image->sizeX; + *height = image->sizeY; + + FreeImage(image); + + return error ? GL_FALSE : GL_TRUE; +} + + + +/* + * Load an SGI .rgb file and return a pointer to the image data. + * Input: imageFile - name of .rgb to read + * Output: width - width of image + * height - height of image + * format - format of image (GL_RGB or GL_RGBA) + * Return: pointer to image data or NULL if error + */ +GLubyte *LoadRGBImage( const char *imageFile, GLint *width, GLint *height, + GLenum *format ) +{ + TK_RGBImageRec *image; + GLint bytes; + GLubyte *buffer; + + image = tkRGBImageLoad( imageFile ); + if (!image) { + return NULL; + } + + if (image->components==3) { + *format = GL_RGB; + } + else if (image->components==4) { + *format = GL_RGBA; + } + else { + /* not implemented */ + fprintf(stderr, + "Error in LoadRGBImage %d-component images not implemented\n", + image->components ); + return NULL; + } + + *width = image->sizeX; + *height = image->sizeY; + + bytes = image->sizeX * image->sizeY * image->components; + buffer = (GLubyte *) malloc(bytes); + if (!buffer) + return NULL; + + memcpy( (void *) buffer, (void *) image->data, bytes ); + + FreeImage(image); + + return buffer; +} + diff --git a/xc/extras/Mesa/util/readtex.h b/xc/extras/Mesa/util/readtex.h new file mode 100644 index 000000000..8e544f1fb --- /dev/null +++ b/xc/extras/Mesa/util/readtex.h @@ -0,0 +1,24 @@ +/* readtex.h */ + +#ifndef READTEX_H +#define READTEX_H + + +#include <GL/gl.h> + + +extern GLboolean +LoadRGBMipmaps( const char *imageFile, GLint intFormat ); + + +extern GLboolean +LoadRGBMipmaps2( const char *imageFile, GLenum target, + GLint intFormat, GLint *width, GLint *height ); + + +extern GLubyte * +LoadRGBImage( const char *imageFile, + GLint *width, GLint *height, GLenum *format ); + + +#endif diff --git a/xc/extras/Mesa/util/sampleMakefile b/xc/extras/Mesa/util/sampleMakefile new file mode 100644 index 000000000..cc9011415 --- /dev/null +++ b/xc/extras/Mesa/util/sampleMakefile @@ -0,0 +1,52 @@ +# $Id: sampleMakefile,v 1.1 2000/11/30 17:31:30 dawes Exp $ + +# Sample makefile for compiling OpenGL/Mesa applications on Unix. +# This example assumes Linux with gcc. + +# This makefile is in the public domain + +# $Log: sampleMakefile,v $ +# Revision 1.1 2000/11/30 17:31:30 dawes +# Initial revision +# +# Revision 1.1.1.1 1999/08/19 00:55:42 jtg +# Imported sources +# +# Revision 1.1 1999/02/24 05:20:45 brianp +# Initial revision +# + + +CC = gcc + +CFLAGS = -c -g -ansi -pedantic -Wall + +INCDIRS = -I. -I../include + +LIBDIRS = -L../lib -L/usr/X11/lib + +LIBS = -lglut -lMesaGLU -lMesaGL -lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lm + +OBJECTS = main.o \ + file1.o \ + file2.o \ + file3.o + + +PROGRAMS = myprogram + + +.c.o: + $(CC) $(CFLAGS) $(INCDIRS) $< -o $@ + + + +default: $(PROGRAMS) + + +dtenvmap: $(OBJECTS) + $(CC) $(OBJECTS) $(LIBDIRS) $(LIBS) -o $@ + + +clean: + rm -f *.o diff --git a/xc/extras/Mesa/util/showbuffer.c b/xc/extras/Mesa/util/showbuffer.c new file mode 100644 index 000000000..17f84dc62 --- /dev/null +++ b/xc/extras/Mesa/util/showbuffer.c @@ -0,0 +1,192 @@ +/* showbuffer.c */ + + +/* + * Copy the depth buffer to the color buffer as a grayscale image. + * Useful for inspecting the depth buffer values. + * + * This program is in the public domain. + * + * Brian Paul November 4, 1998 + */ + + +#include <assert.h> +#include <stdlib.h> +#include <GL/gl.h> +#include "showbuffer.h" + + + +/* + * Copy the depth buffer values into the current color buffer as a + * grayscale image. + * Input: winWidth, winHeight - size of the window + * zBlack - the Z value which should map to black (usually 1) + * zWhite - the Z value which should map to white (usually 0) + */ +void +ShowDepthBuffer( GLsizei winWidth, GLsizei winHeight, + GLfloat zBlack, GLfloat zWhite ) +{ + GLfloat *depthValues; + + assert(zBlack >= 0.0); + assert(zBlack <= 1.0); + assert(zWhite >= 0.0); + assert(zWhite <= 1.0); + assert(zBlack != zWhite); + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + + /* Read depth values */ + depthValues = (GLfloat *) malloc(winWidth * winHeight * sizeof(GLfloat)); + assert(depthValues); + glReadPixels(0, 0, winWidth, winHeight, GL_DEPTH_COMPONENT, + GL_FLOAT, depthValues); + + /* Map Z values from [zBlack, zWhite] to gray levels in [0, 1] */ + /* Not using glPixelTransfer() because it's broke on some systems! */ + if (zBlack != 0.0 || zWhite != 1.0) { + GLfloat scale = 1.0 / (zWhite - zBlack); + GLfloat bias = -zBlack * scale; + int n = winWidth * winHeight; + int i; + for (i = 0; i < n; i++) + depthValues[i] = depthValues[i] * scale + bias; + } + + /* save GL state */ + glPushAttrib(GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | + GL_TRANSFORM_BIT | GL_VIEWPORT_BIT); + + /* setup raster pos for glDrawPixels */ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + + glOrtho(0.0, (GLdouble) winWidth, 0.0, (GLdouble) winHeight, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glDisable(GL_STENCIL_TEST); + glDisable(GL_DEPTH_TEST); + glRasterPos2f(0, 0); + + glDrawPixels(winWidth, winHeight, GL_LUMINANCE, GL_FLOAT, depthValues); + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + free(depthValues); + + glPopAttrib(); +} + + + + +/* + * Copy the alpha channel values into the current color buffer as a + * grayscale image. + * Input: winWidth, winHeight - size of the window + */ +void +ShowAlphaBuffer( GLsizei winWidth, GLsizei winHeight ) +{ + GLubyte *alphaValues; + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + + /* Read alpha values */ + alphaValues = (GLubyte *) malloc(winWidth * winHeight * sizeof(GLubyte)); + assert(alphaValues); + glReadPixels(0, 0, winWidth, winHeight, GL_ALPHA, GL_UNSIGNED_BYTE, alphaValues); + + /* save GL state */ + glPushAttrib(GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL | + GL_TRANSFORM_BIT | GL_VIEWPORT_BIT); + + /* setup raster pos for glDrawPixels */ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + + glOrtho(0.0, (GLdouble) winWidth, 0.0, (GLdouble) winHeight, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glDisable(GL_STENCIL_TEST); + glDisable(GL_DEPTH_TEST); + glRasterPos2f(0, 0); + + glDrawPixels(winWidth, winHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, alphaValues); + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + free(alphaValues); + + glPopAttrib(); +} + + + +/* + * Copy the stencil buffer values into the current color buffer as a + * grayscale image. + * Input: winWidth, winHeight - size of the window + * scale, bias - scale and bias to apply to stencil values for display + */ +void +ShowStencilBuffer( GLsizei winWidth, GLsizei winHeight, + GLfloat scale, GLfloat bias ) +{ + GLubyte *stencilValues; + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glPixelStorei(GL_PACK_ALIGNMENT, 1); + + /* Read stencil values */ + stencilValues = (GLubyte *) malloc(winWidth * winHeight * sizeof(GLubyte)); + assert(stencilValues); + glReadPixels(0, 0, winWidth, winHeight, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, stencilValues); + + /* save GL state */ + glPushAttrib(GL_CURRENT_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | + GL_PIXEL_MODE_BIT | GL_TRANSFORM_BIT | GL_VIEWPORT_BIT); + + /* setup raster pos for glDrawPixels */ + glMatrixMode(GL_PROJECTION); + glPushMatrix(); + glLoadIdentity(); + + glOrtho(0.0, (GLdouble) winWidth, 0.0, (GLdouble) winHeight, -1.0, 1.0); + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + glLoadIdentity(); + + glDisable(GL_STENCIL_TEST); + glDisable(GL_DEPTH_TEST); + glRasterPos2f(0, 0); + + glPixelTransferf(GL_RED_SCALE, scale); + glPixelTransferf(GL_RED_BIAS, bias); + glPixelTransferf(GL_GREEN_SCALE, scale); + glPixelTransferf(GL_GREEN_BIAS, bias); + glPixelTransferf(GL_BLUE_SCALE, scale); + glPixelTransferf(GL_BLUE_BIAS, bias); + + glDrawPixels(winWidth, winHeight, GL_LUMINANCE, GL_UNSIGNED_BYTE, stencilValues); + + glPopMatrix(); + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + free(stencilValues); + + glPopAttrib(); +} diff --git a/xc/extras/Mesa/util/showbuffer.h b/xc/extras/Mesa/util/showbuffer.h new file mode 100644 index 000000000..63533d8e9 --- /dev/null +++ b/xc/extras/Mesa/util/showbuffer.h @@ -0,0 +1,36 @@ +/* showbuffer. h*/ + +/* + * Copy the depth buffer to the color buffer as a grayscale image. + * Useful for inspecting the depth buffer values. + * + * This program is in the public domain. + * + * Brian Paul November 4, 1998 + */ + + +#ifndef SHOWBUFFER_H +#define SHOWBUFFER_H + + +#include <GL/gl.h> + + + +extern void +ShowDepthBuffer( GLsizei winWidth, GLsizei winHeight, + GLfloat zBlack, GLfloat zWhite ); + + +extern void +ShowAlphaBuffer( GLsizei winWidth, GLsizei winHeight ); + + +extern void +ShowStencilBuffer( GLsizei winWidth, GLsizei winHeight, + GLfloat scale, GLfloat bias ); + + + +#endif diff --git a/xc/extras/Mesa/util/winpos.c b/xc/extras/Mesa/util/winpos.c new file mode 100644 index 000000000..5ad98fd27 --- /dev/null +++ b/xc/extras/Mesa/util/winpos.c @@ -0,0 +1,42 @@ +/* winpos.c */ + + +/* + * Set the current raster position to a specific window + * coordinate. Also see the GL_MESA_window_pos extension. + * + * Written by Brian Paul and in the public domain. + */ + + +void WindowPos( GLfloat x, GLfloat y, GLfloat z ) +{ + GLfloat fx, fy; + + /* Push current matrix mode and viewport attributes */ + glPushAttrib( GL_TRANSFORM_BIT | GL_VIEWPORT_BIT ); + + /* Setup projection parameters */ + glMatrixMode( GL_PROJECTION ); + glPushMatrix(); + glLoadIdentity(); + glMatrixMode( GL_MODELVIEW ); + glPushMatrix(); + glLoadIdentity(); + + glDepthRange( z, z ); + glViewport( (int) x - 1, (int) y - 1, 2, 2 ); + + /* set the raster (window) position */ + fx = x - (int) x; + fy = y - (int) y; + glRasterPos3f( fx, fy, 0.0 ); + + /* restore matrices, viewport and matrix mode */ + glPopMatrix(); + glMatrixMode( GL_PROJECTION ); + glPopMatrix(); + + glPopAttrib(); +} + diff --git a/xc/extras/Mesa/vms/analyze_map.com b/xc/extras/Mesa/vms/analyze_map.com new file mode 100644 index 000000000..93d96d685 --- /dev/null +++ b/xc/extras/Mesa/vms/analyze_map.com @@ -0,0 +1,145 @@ +$! Analyze Map for OpenVMS AXP +$! +$! Originally found in the distribution of gv +$! http://wwwthep.physik.uni-mainz.de/~plass/gv/ +$! +$! 1-Jul-1999 : modified to be used with $BSS$ & $READONLY sections in the +$! map-file by J. Jansen (joukj@hrem.stm.tudelft.nl) +$! +$ SET SYMBOL/GENERAL/SCOPE=(NOLOCAL,NOGLOBAL) +$ SAY := "WRITE_ SYS$OUTPUT" +$ +$ IF F$SEARCH("''P1'") .EQS. "" +$ THEN +$ SAY " ANALYZE_MAP.COM: Error, no mapfile provided" +$ EXIT_ +$ ENDIF +$ IF "''P2'" .EQS. "" +$ THEN +$ SAY " ANALYZE_MAP.COM: Error, no output file provided" +$ EXIT_ +$ ENDIF +$ +$ LINK_TMP = F$PARSE(P2,,,"DEVICE")+F$PARSE(P2,,,"DIRECTORY")+F$PARSE(P2,,,"NAME")+".TMP" +$ +$ SAY " checking PSECT list in ''P2'" +$ OPEN_/READ IN 'P1' +$ LOOP_PSECT_SEARCH: +$ READ_/END=EOF_PSECT IN REC +$ LOOP_PSECT_SEARCH0: +$ if F$EXTRACT(0,5,REC) .eqs. "$DATA" .or. F$EXTRACT(0,5,REC) .eqs. - + "$BSS$" .or. f$extract(0,10,rec) .eqs. "$READONLY$" then goto do_data +$ if F$EXTRACT(0,14,REC) .eqs. "$READONLY_ADDR" then goto do_readonly +$ goto LOOP_PSECT_SEARCH +$ do_data: +$ LAST = "" +$ LOOP_PSECT: +$ READ_/END=EOF_PSECT IN REC +$ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,5,REC) .nes. "$DATA" - + .and. F$EXTRACT(0,5,REC) .nes. "$BSS$" .and. f$extract(0,10,rec) - + .nes. "$READONLY$" then goto LOOP_PSECT_SEARCH0 +$ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE, WRT,NOVEC" .nes. REC +$ then +$ J = F$LOCATE(" ",REC) +$ S = F$EXTRACT(0,J,REC) +$ IF S .EQS. LAST THEN GOTO LOOP_PSECT +$ P$_'S= 1 +$ LAST = S +$ endif +$ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC" .nes. REC +$ then +$ J = F$LOCATE(" ",REC) +$ S = F$EXTRACT(0,J,REC) +$ IF S .EQS. LAST THEN GOTO LOOP_PSECT +$ P$_'S= 1 +$ LAST = S +$ endif +$ GOTO LOOP_PSECT +$ +$ do_readonly: +$ LAST = "" +$ LOOP_PSECT3: +$ READ_/END=EOF_PSECT IN REC +$ if F$EXTRACT(0,1,REC) .eqs. "-" .or. F$EXTRACT(0,3,REC) .eqs. "NL:" then - + goto loop_psect3 +$ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,14,REC) .nes. - + "$READONLY_ADDR" then goto LOOP_PSECT_SEARCH0 +$ if REC - "OCTA" .nes. REC +$ then +$ J = F$LOCATE(" ",REC) +$ S = F$EXTRACT(0,J,REC) +$ IF S .EQS. LAST THEN GOTO LOOP_PSECT3 +$ P$_'S= 1 +$ LAST = S +$ endif +$ GOTO LOOP_PSECT3 +$ +$ EOF_PSECT: +$ CLOSE_ IN +$ +$ SAY " appending list of UNIVERSAL procedures to ''P2'" +$ SEARCH_/NOHIGH/WINDOW=(0,0) 'P1' " R-"/OUT='LINK_TMP +$ OPEN_/READ IN 'LINK_TMP +$ OPEN_/write OUT 'P2' +$ WRITE_ OUT "!" +$ WRITE_ OUT "! ### UNIVERSAL procedures and global definitions extracted from ''P1'" +$ WRITE_ OUT "!" +$ LOOP_UNIVERSAL: +$ READ_/END=EOF_UNIVERSAL IN REC +$ J = F$LOCATE(" R-",REC) +$ S = F$EXTRACT(J+3,F$length(rec),REC) +$ PP$_'S= 1 +$ IF F$TYPE(P$_'S').EQS."" +$ THEN +$ WRITE_ OUT "symbol_vector = ("+S+" = PROCEDURE)" +$ ELSE +$ WRITE_ OUT "symbol_vector = ("+S+" = DATA)" +$ ENDIF +$ GOTO LOOP_UNIVERSAL +$ EOF_UNIVERSAL: +$ CLOSE_ IN +$ CLOSE_ OUT +$! +$ SAY " creating PSECT list in ''P2'" +$ OPEN_/READ IN 'P1' +$ OPEN_/append OUT 'P2' +$ WRITE_ OUT "!" +$ WRITE_ OUT "! ### PSECT list extracted from ''P1'" +$ WRITE_ OUT "!" +$ LOOP_PSECT_SEARCH1: +$ READ_/END=EOF_PSECT1 IN REC +$ if F$EXTRACT(0,5,REC) .nes. "$DATA" .and. F$EXTRACT(0,5,REC) .nes. - + "$BSS$" .and. f$extract(0,10,rec) .nes. "$READONLY$" then goto - + LOOP_PSECT_SEARCH1 +$ LAST = "" +$ LOOP_PSECT1: +$ READ_/END=EOF_PSECT1 IN REC +$ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,5,REC) .nes. "$DATA" - + .and. F$EXTRACT(0,5,REC) .nes. "$BSS$" .and. f$extract(0,10,rec) - + .nes. "$READONLY$" then goto LOOP_PSECT_SEARCH1 +$ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE, WRT,NOVEC" .nes. REC +$ then +$ J = F$LOCATE(" ",REC) +$ S = F$EXTRACT(0,J,REC) +$ IF S .EQS. LAST THEN GOTO LOOP_PSECT1 +$ IF F$TYPE(PP$_'S').nes."" then WRITE_ OUT "symbol_vector = (" + S + " = PSECT)" +$ P$_'S= 1 +$ LAST = S +$ endif +$ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC" .nes. REC +$ then +$ J = F$LOCATE(" ",REC) +$ S = F$EXTRACT(0,J,REC) +$ IF S .EQS. LAST THEN GOTO LOOP_PSECT1 +$ IF F$TYPE(PP$_'S').nes."" then WRITE_ OUT "symbol_vector = (" + S + " = PSECT)" +$ P$_'S= 1 +$ LAST = S +$ endif +$ GOTO LOOP_PSECT1 +$ +$ EOF_PSECT1: +$ CLOSE_ IN +$ CLOSE_ OUT +$ if f$search("''LINK_TMP'") .nes. "" then DELETE_/NOLOG/NOCONFIRM 'LINK_TMP';* +$ +$ EXIT_ diff --git a/xc/extras/Mesa/vms/xlib.opt b/xc/extras/Mesa/vms/xlib.opt new file mode 100644 index 000000000..acae358b5 --- /dev/null +++ b/xc/extras/Mesa/vms/xlib.opt @@ -0,0 +1,2 @@ +sys$library:decw$xlibshr.exe/share +sys$library:decw$xmulibshr.exe/share diff --git a/xc/extras/Mesa/vms/xlib_share.opt b/xc/extras/Mesa/vms/xlib_share.opt new file mode 100644 index 000000000..ebd17d462 --- /dev/null +++ b/xc/extras/Mesa/vms/xlib_share.opt @@ -0,0 +1,5 @@ +[-.lib]libmesagl.exe/share +[-.lib]libmesaglu.exe/share +[-.lib]libglut.exe/share +sys$library:decw$xlibshr.exe/share +sys$library:decw$xmulibshr.exe/share diff --git a/xc/extras/Mesa/win32-openstep.sh b/xc/extras/Mesa/win32-openstep.sh new file mode 100755 index 000000000..071c1a5c3 --- /dev/null +++ b/xc/extras/Mesa/win32-openstep.sh @@ -0,0 +1,6 @@ +# This file should be run from the Bourne shell
+# provided for OpenStep implementations under WIN32
+
+mkdir lib
+( cd src; make openstep-win32 )
+( cd src-glu; make openstep-win32 )
diff --git a/xc/extras/Mesa/xlib.opt b/xc/extras/Mesa/xlib.opt new file mode 100644 index 000000000..acae358b5 --- /dev/null +++ b/xc/extras/Mesa/xlib.opt @@ -0,0 +1,2 @@ +sys$library:decw$xlibshr.exe/share +sys$library:decw$xmulibshr.exe/share diff --git a/xc/programs/Xserver/hw/darwin/Imakefile b/xc/programs/Xserver/hw/darwin/Imakefile new file mode 100644 index 000000000..2a1f2430a --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/Imakefile @@ -0,0 +1,28 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/Imakefile,v 1.2 2000/11/16 03:22:18 dawes Exp $ + +#include <Server.tmpl> +#define IHaveSubdirs + +SUBDIRS = utils + +SRCS = darwin.c \ + darwinCursor.c \ + darwinKeyboard.c + +OBJS = darwin.o \ + darwinCursor.o \ + darwinKeyboard.o + +INCLUDES = -I. -I$(SERVERSRC)/mi -I$(SERVERSRC)/mfb -I$(SERVERSRC)/cfb \ + -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(SERVERSRC)/os \ + -I$(INCLUDESRC) -I$(FONTINCSRC) + +NormalLibraryObjectRule() +NormalLibraryTarget(darwin,$(OBJS)) + +InstallManPage(Xdarwin,$(MANDIR)) + +DependTarget() + +MakeSubdirs($(SUBDIRS)) +DependSubdirs($(SUBDIRS)) diff --git a/xc/programs/Xserver/hw/darwin/Xdarwin.man b/xc/programs/Xserver/hw/darwin/Xdarwin.man new file mode 100644 index 000000000..aee06c433 --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/Xdarwin.man @@ -0,0 +1,63 @@ +.\" $XFree86: xc/programs/Xserver/hw/darwin/Xdarwin.man,v 1.1 2000/11/15 01:36:13 dawes Exp $ +.\" +.TH XDARWIN 1 "Release 6.4" "X Version 11" +.SH NAME +Xdarwin \- X window system server for Darwin operating system +.SH SYNOPSIS +.B Xdarwin +[ options ] ... +.SH DESCRIPTION +.I Xdarwin +is the window server for Version 11 of the X window system on the Darwin +operating system. It uses IOKit services to accesss the display framebuffer, +mouse and keyboard and to provide a layer of hardware abstraction. +.I Xdarwin +will normally be started by the \fIxdm(1)\fP display manager or by a script +that runs the program \fIxinit(1)\fP. +.SH OPTIONS +.PP +In addition to the normal server options described in the \fIXserver(1)\fP +manual page, \fIXdarwin\fP accepts the following command line switches: +.TP 8 +.B \-fakebuttons +Emulates a 3 button mouse using the Command and Option keys. Clicking the +first mouse button while holding down Command will act like clicking +button 2. Holding down Option will simulate button 3. +.TP 8 +.B \-nofakebuttons +Do not emulate a 3 button mouse. This is the default. +.TP 8 +.B "\-size \fIwidth\fP \fIheight\fP" +Sets the screeen resolution for the X server to use. +.TP 8 +.B "\-depth \fIdepth\fP" +Specifies the color bit depth to use. Currently only 8, 15, and 24 color bits +per pixel are supported. +.TP 8 +.B "\-refresh \fIrate\fP" +Gives the refresh rate to use in Hz. For LCD displays this should be 0. +.SH "SEE ALSO" +.PP +X(1), Xserver(1), xdm(1), xinit(1) +.SH BUGS +.I Xdarwin +and this man page still have many limitations. Some of the more obvious +ones are: +.br +- Only one display is supported. +.br +- The display mode can not be changed once the X server has started. +.br +- A screen saver is not supported. +.br +- The X server does not wake from sleep correctly. +.br +- The key repeat rate can not be changed. +.PP +.SH AUTHORS +Original Port to Mac OS X Server - John Carmack +.br +Port to Darwin 1.0 - Dave Zarzycki +.br +Improvements and bug fixes - Torrey T. Lyons + diff --git a/xc/programs/Xserver/hw/darwin/darwin.c b/xc/programs/Xserver/hw/darwin/darwin.c new file mode 100644 index 000000000..a28d07d70 --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/darwin.c @@ -0,0 +1,1071 @@ +/************************************************************** + * + * IOKit support for the Darwin X Server + * + * HISTORY: + * Original port to Mac OS X Server by John Carmack + * Port to Darwin 1.0 by Dave Zarzycki + * Significantly rewritten for XFree86 4.0.1 by Torrey Lyons + * + **************************************************************/ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.c,v 1.1 2000/11/15 01:36:13 dawes Exp $ */ + +#define NDEBUG 1 + +#include "X.h" +#include "Xproto.h" +#include "os.h" +#include "servermd.h" +#include "inputstr.h" +#include "scrnintstr.h" +#include "mi.h" +#include "mibstore.h" +#include "mipointer.h" +#include "micmap.h" + +#include <sys/types.h> +#include <sys/time.h> +#include <unistd.h> +#include <fcntl.h> +#include <pthread.h> + +#include <mach/mach_interface.h> + +#define NO_CFPLUGIN +#include <IOKit/IOKitLib.h> +#include <IOKit/hidsystem/IOHIDShared.h> +#include <IOKit/graphics/IOGraphicsLib.h> +#include <drivers/event_status_driver.h> + +// Define this to work around bugs in the display drivers for +// older PowerBook G3's. If the X server starts without this +// #define, you don't need it. +#undef OLD_POWERBOOK_G3 + +#include "darwin.h" + +DarwinFramebufferRec dfb; +unsigned char darwinKeyCommandL = 0, darwinKeyOptionL = 0; + +/* Fake button press/release for scroll wheel move. */ +#define SCROLLWHEELUPFAKE 4 +#define SCROLLWHEELDOWNFAKE 5 + +static int darwinEventFD; +static Bool fake3Buttons = FALSE; +static DeviceIntPtr darwinPointer; +static DeviceIntPtr darwinKeyboard; +static UInt32 darwinDesiredWidth = 0, darwinDesiredHeight = 0; +static IOIndex darwinDesiredDepth = -1; +static SInt32 darwinDesiredRefresh = -1; + +// Common pixmap formats +static PixmapFormatRec formats[] = { + { 1, 1, BITMAP_SCANLINE_PAD }, + { 4, 8, BITMAP_SCANLINE_PAD }, + { 8, 8, BITMAP_SCANLINE_PAD }, + { 15, 16, BITMAP_SCANLINE_PAD }, + { 16, 16, BITMAP_SCANLINE_PAD }, + { 24, 32, BITMAP_SCANLINE_PAD } +}; +const int NUMFORMATS = sizeof(formats)/sizeof(formats[0]); + +static Bool DarwinSaveScreen(ScreenPtr pScreen, int on) +{ // FIXME + if (on == SCREEN_SAVER_FORCER) { + } else if (on == SCREEN_SAVER_ON) { + } else { + } + return TRUE; +} + +/* + * DarwinStoreColors + * This is a callback from X to change the hardware colormap + * when using PsuedoColor + */ +static void DarwinStoreColors( + ColormapPtr pmap, + int numEntries, + xColorItem *pdefs) +{ + kern_return_t kr; + int i; + IOColorEntry *newColors; + + assert( newColors = (IOColorEntry *) + xalloc( numEntries*sizeof(IOColorEntry) )); + + // Convert xColorItem values to IOColorEntry + // assume the colormap is PsuedoColor + // as we do not support DirectColor + for (i = 0; i < numEntries; i++) { + newColors[i].index = pdefs[i].pixel; + newColors[i].red = pdefs[i].red; + newColors[i].green = pdefs[i].green; + newColors[i].blue = pdefs[i].blue; + } + + kr = IOFBSetCLUT( dfb.fbService, 0, numEntries, + kSetCLUTByValue, newColors ); + kern_assert( kr ); + + xfree( newColors ); +} + +/* + * DarwinAddScreen + * This is a callback from X during AddScreen() from InitOutput() + */ +static Bool DarwinAddScreen( + int index, + ScreenPtr pScreen, + int argc, + char **argv ) +{ + int bitsPerRGB, i; + VisualPtr visual; + + /* Communicate the information about our initialized screen back to X. */ + bitsPerRGB = dfb.pixelInfo.bitsPerComponent; + + // reset the visual list + miClearVisualTypes(); + + // setup a single visual appropriate for our pixel type + // Note: Darwin kIORGBDirectPixels = X window TrueColor, not DirectColor + if (dfb.pixelInfo.pixelType == kIORGBDirectPixels) { + if (!miSetVisualTypes( dfb.colorBitsPerPixel, TrueColorMask, + bitsPerRGB, TrueColor )) { + return FALSE; + } + } else if (dfb.pixelInfo.pixelType == kIOCLUTPixels) { + if (!miSetVisualTypes( dfb.colorBitsPerPixel, PseudoColorMask, + bitsPerRGB, PseudoColor )) { + return FALSE; + } + } else if (dfb.pixelInfo.pixelType == kIOFixedCLUTPixels) { + if (!miSetVisualTypes( dfb.colorBitsPerPixel, StaticColorMask, + bitsPerRGB, StaticColor )) { + return FALSE; + } + } else { + return FALSE; + } + + // machine independent screen init + // setup _Screen structure in pScreen + if ( dfb.bitsPerPixel == 32 ) { + if (!cfb32ScreenInit(pScreen, + dfb.framebuffer, + dfb.width, dfb.height, + 75, 75, /* screen size in dpi, which we have no accurate knowledge of */ + dfb.pitch / (dfb.bitsPerPixel/8))) { + return FALSE; + } + } else if ( dfb.bitsPerPixel == 16 ) { + if (!cfb16ScreenInit(pScreen, + dfb.framebuffer, + dfb.width, dfb.height, + 75, 75, /* screen size in dpi, which we have no accurate knowledge of */ + dfb.pitch / (dfb.bitsPerPixel/8))) { + return FALSE; + } + } else if ( dfb.bitsPerPixel == 8 ) { + if (!cfbScreenInit(pScreen, + dfb.framebuffer, + dfb.width, dfb.height, + 75, 75, /* screen size in dpi, which we have no accurate knowledge of */ + dfb.pitch / (dfb.bitsPerPixel/8))) { + return FALSE; + } + } else { + return FALSE; + } + + // set the RGB order correctly for TrueColor, it is byte swapped by X + // FIXME: make work on x86 darwin if it ever gets buildable + if (dfb.bitsPerPixel > 8) { + for (i = 0, visual = pScreen->visuals; // someday we may have more than 1 + i < pScreen->numVisuals; i++, visual++) { + if (visual->class == TrueColor) { + visual->offsetRed = bitsPerRGB * 2; + visual->offsetGreen = bitsPerRGB; + visual->offsetBlue = 0; +#if FALSE + visual->redMask = ((1<<bitsPerRGB)-1) << visual->offsetRed; + visual->greenMask = ((1<<bitsPerRGB)-1) << visual->offsetGreen; + visual->blueMask = ((1<<bitsPerRGB)-1) << visual->offsetBlue; +#else + visual->redMask = dfb.pixelInfo.componentMasks[0]; + visual->greenMask = dfb.pixelInfo.componentMasks[1]; + visual->blueMask = dfb.pixelInfo.componentMasks[2]; +#endif + } + } + } + +#ifdef MITSHM + ShmRegisterFbFuncs(pScreen); +#endif + + // setup cursor support, use hardware if possible + if (!DarwinInitCursor(pScreen)) { + return FALSE; + } + + // this must be initialized (why doesn't X have a default?) + pScreen->SaveScreen = DarwinSaveScreen; + + // initialize colormap handling as needed + if (dfb.pixelInfo.pixelType == kIOCLUTPixels) { + pScreen->StoreColors = DarwinStoreColors; + } + + // create and install the default colormap and + // set pScreen->blackPixel / pScreen->white + if (!miCreateDefColormap( pScreen )) { + return FALSE; + } + + return TRUE; +} + +/* + * DarwinShutdownScreen + */ +void DarwinShutdownScreen( void ) +{ +#if 0 + // we must close the HID System first + // because it is a client of the framebuffer + NXCloseEventStatus( dfb.hidParam ); + IOServiceClose( dfb.hidService ); + IOServiceClose( dfb.fbService ); +#endif +} + +/* + ============================================================================= + + mouse callbacks + + ============================================================================= +*/ + +/* + * Set mouse acceleration and thresholding + * FIXME: We currently ignore the threshold in ctrl->threshold. + */ +static void DarwinChangePointerControl( + DeviceIntPtr device, + PtrCtrl *ctrl ) +{ + kern_return_t kr; + double acceleration; + + acceleration = ctrl->num / ctrl->den; + kr = IOHIDSetMouseAcceleration( dfb.hidParam, acceleration ); + if (kr != KERN_SUCCESS) + ErrorF( "Could not set mouse acceleration with kernel return = 0x%x.\n", kr ); +} + + +/* + * Motion history between events is not required to be supported. + */ +static int DarwinGetMotionEvents( DeviceIntPtr pDevice, xTimecoord *buff, + unsigned long start, unsigned long stop, ScreenPtr pScr) +{ + return 0; +} + + +/* + * DarwinMouseProc -- + * Handle the initialization, etc. of a mouse + */ + +static int DarwinMouseProc( DeviceIntPtr pPointer, int what ) { + + char map[6]; + + switch (what) { + + case DEVICE_INIT: + pPointer->public.on = FALSE; + + map[1] = 1; + map[2] = 2; + map[3] = 3; + map[4] = 4; + map[5] = 5; + InitPointerDeviceStruct( (DevicePtr)pPointer, + map, + 5, // numbuttons (4 & 5 are scroll wheel) + DarwinGetMotionEvents, // miPointerGetMotionEvents ?? + DarwinChangePointerControl, + 0 ); + break; + + case DEVICE_ON: + pPointer->public.on = TRUE; + AddEnabledDevice( darwinEventFD ); + return Success; + + case DEVICE_CLOSE: + case DEVICE_OFF: + pPointer->public.on = FALSE; + RemoveEnabledDevice( darwinEventFD ); + return Success; + } + + return Success; +} + +/* + * DarwinKeybdProc + * callback from X + */ +static int DarwinKeybdProc( DeviceIntPtr pDev, int onoff ) +{ + switch ( onoff ) { + case DEVICE_INIT: + DarwinKeyboardInit( pDev ); + break; + case DEVICE_ON: + pDev->public.on = TRUE; + AddEnabledDevice( darwinEventFD ); + break; + case DEVICE_OFF: + pDev->public.on = FALSE; + RemoveEnabledDevice( darwinEventFD ); + break; + case DEVICE_CLOSE: + break; + } + + return Success; +} + +/* +=========================================================================== + + Functions needed to link against device independent X + +=========================================================================== +*/ + +/* + * ProcessInputEvents + * Read events from the event queue + */ +void ProcessInputEvents(void) +{ + xEvent xe; + NXEvent ev; + int r; + struct timeval tv; + struct timezone tz; + + // try to read from our pipe + r = read( darwinEventFD, &ev, sizeof(ev)); + if ((r == -1) && (errno != EAGAIN)) { + ErrorF("read(darwinEventFD) failed, errno=%d: %s\n", errno, strerror(errno)); + return; + } else if ((r == -1) && (errno == EAGAIN)) { + return; + } else if ( r != sizeof( ev ) ) { + ErrorF( "Only read %i bytes from darwinPipe!", r ); + return; + } + + gettimeofday(&tv, &tz); + + // translate it to an X event and post it + memset(&xe, 0, sizeof(xe)); + + xe.u.keyButtonPointer.rootX = ev.location.x; + xe.u.keyButtonPointer.rootY = ev.location.y; + //xe.u.keyButtonPointer.time = ev.time; + xe.u.keyButtonPointer.time = tv.tv_sec * 1000 + tv.tv_usec / 1000; + + /* A newer kernel generates multi-button events by NX_SYSDEFINED. + See iokit/Families/IOHIDSystem/IOHIDSystem.cpp version 1.1.1.7, + 2000/08/10 00:23:37 or later. */ + + switch( ev.type ) { + case NX_MOUSEMOVED: + xe.u.u.type = MotionNotify; + (darwinPointer->public.processInputProc)( &xe, darwinPointer, 1 ); + break; + + case NX_LMOUSEDOWN: + // Mimic multi-button mouse with Command and Option + if (fake3Buttons && ev.flags & (NX_COMMANDMASK | NX_ALTERNATEMASK)) { + if (ev.flags & NX_COMMANDMASK) { + // first fool X into forgetting about Command key + xe.u.u.type = KeyRelease; + xe.u.u.detail = darwinKeyCommandL; + (darwinKeyboard->public.processInputProc) + ( &xe, darwinKeyboard, 1 ); + // push button 2 + xe.u.u.type = ButtonPress; + xe.u.u.detail = 2; // de.key = button 2 + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + // reset Command key down + xe.u.u.type = KeyPress; + xe.u.u.detail = darwinKeyCommandL; + (darwinKeyboard->public.processInputProc) + ( &xe, darwinKeyboard, 1 ); + } else { + // first fool X into forgetting about Option key + xe.u.u.type = KeyRelease; + xe.u.u.detail = darwinKeyOptionL; + (darwinKeyboard->public.processInputProc) + ( &xe, darwinKeyboard, 1 ); + // push button 3 + xe.u.u.type = ButtonPress; + xe.u.u.detail = 3; // de.key = button 3 + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + // reset Option key down + xe.u.u.type = KeyPress; + xe.u.u.detail = darwinKeyOptionL; + (darwinKeyboard->public.processInputProc) + ( &xe, darwinKeyboard, 1 ); + } + } else { + xe.u.u.detail = 1; //de.key = button 1; + xe.u.u.type = ButtonPress; + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + } + break; + + case NX_LMOUSEUP: + // Mimic multi-button mouse with Command and Option + if (fake3Buttons && ev.flags & (NX_COMMANDMASK | NX_ALTERNATEMASK)) { + if (ev.flags & NX_COMMANDMASK) { + // first fool X into forgetting about Command key + xe.u.u.type = KeyRelease; + xe.u.u.detail = darwinKeyCommandL; + (darwinKeyboard->public.processInputProc) + ( &xe, darwinKeyboard, 1 ); + // push button 2 + xe.u.u.type = ButtonRelease; + xe.u.u.detail = 2; // de.key = button 2 + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + // reset Command key down + xe.u.u.type = KeyPress; + xe.u.u.detail = darwinKeyCommandL; + (darwinKeyboard->public.processInputProc) + ( &xe, darwinKeyboard, 1 ); + } else { + // first fool X into forgetting about Option key + xe.u.u.type = KeyRelease; + xe.u.u.detail = darwinKeyOptionL; + (darwinKeyboard->public.processInputProc) + ( &xe, darwinKeyboard, 1 ); + // push button 3 + xe.u.u.type = ButtonRelease; + xe.u.u.detail = 3; // de.key = button 3 + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + // reset Option key down + xe.u.u.type = KeyPress; + xe.u.u.detail = darwinKeyOptionL; + (darwinKeyboard->public.processInputProc) + ( &xe, darwinKeyboard, 1 ); + } + } else { + xe.u.u.detail = 1; //de.key = button 1; + xe.u.u.type = ButtonRelease; + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + } + break; + +// Button 2 isn't handled correctly by older kernels anyway. Just let +// NX_SYSDEFINED events handle these. + case NX_RMOUSEDOWN: +#if 0 + xe.u.u.detail = 2; //de.key; + xe.u.u.type = ButtonPress; + (darwinPointer->public.processInputProc)( &xe, darwinPointer, 1 ); +#endif + break; + + case NX_RMOUSEUP: +#if 0 + xe.u.u.detail = 2; //de.key; + xe.u.u.type = ButtonRelease; + (darwinPointer->public.processInputProc)( &xe, darwinPointer, 1 ); +#endif + break; + + case NX_KEYDOWN: + xe.u.u.type = KeyPress; + xe.u.u.detail = ev.data.key.keyCode + MIN_KEYCODE; + (darwinKeyboard->public.processInputProc)( &xe, darwinKeyboard, 1 ); + break; + + case NX_KEYUP: + xe.u.u.type = KeyRelease; + xe.u.u.detail = ev.data.key.keyCode + MIN_KEYCODE; + (darwinKeyboard->public.processInputProc)(&xe, darwinKeyboard, 1); + break; + + case NX_FLAGSCHANGED: + { + static int old_state = 0; + int new_on_flags = ~old_state & ev.flags; + int new_off_flags = old_state & ~ev.flags; + old_state = ev.flags; + xe.u.u.detail = ev.data.key.keyCode + MIN_KEYCODE; + + // alphalock is toggled rather than held on, + // so we have to handle it differently + if (new_on_flags & NX_ALPHASHIFTMASK || + new_off_flags & NX_ALPHASHIFTMASK) { + xe.u.u.type = KeyPress; + (darwinKeyboard->public.processInputProc) + (&xe, darwinKeyboard, 1); + xe.u.u.type = KeyRelease; + (darwinKeyboard->public.processInputProc) + (&xe, darwinKeyboard, 1); + break; + } + + if (new_on_flags) { + xe.u.u.type = KeyPress; + } else if (new_off_flags) { + xe.u.u.type = KeyRelease; + } else { + break; + } + (darwinKeyboard->public.processInputProc)(&xe, darwinKeyboard, 1); + break; + } + + case NX_SYSDEFINED: + if (ev.data.compound.subType == 7) { + long hwDelta = ev.data.compound.misc.L[0]; + long hwButtons = ev.data.compound.misc.L[1]; + int i; + + for (i = 1; i < 4; i++) { + if (hwDelta & (1 << i)) { + xe.u.u.detail = i + 1; + if (hwButtons & (1 << i)) { + xe.u.u.type = ButtonPress; + } else { + xe.u.u.type = ButtonRelease; + } + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + } + } + } + break; + + case NX_SCROLLWHEELMOVED: + { + short count = ev.data.scrollWheel.deltaAxis1; + + if (count > 0) { + xe.u.u.detail = SCROLLWHEELUPFAKE; + } else { + xe.u.u.detail = SCROLLWHEELDOWNFAKE; + count = -count; + } + + for (; count; --count) { + xe.u.u.type = ButtonPress; + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + xe.u.u.type = ButtonRelease; + (darwinPointer->public.processInputProc) + ( &xe, darwinPointer, 1 ); + } + break; + } + + default: + ErrorF("unknown event caught: %d\n", ev.type); + ErrorF("\tev.type = %d\n", ev.type); + ErrorF("\tev.location.x,y = %d,%d\n", ev.location.x, ev.location.y); + ErrorF("\tev.time = %ld\n", ev.time); + ErrorF("\tev.flags = 0x%x\n", ev.flags); + ErrorF("\tev.window = %d\n", ev.window); + ErrorF("\tev.data.key.origCharSet = %d\n", ev.data.key.origCharSet); + ErrorF("\tev.data.key.charSet = %d\n", ev.data.key.charSet); + ErrorF("\tev.data.key.charCode = %d\n", ev.data.key.charCode); + ErrorF("\tev.data.key.keyCode = %d\n", ev.data.key.keyCode); + ErrorF("\tev.data.key.origCharCode = %d\n", ev.data.key.origCharCode); + break; + } + + // why isn't this handled automatically by X??? + //miPointerAbsoluteCursor( ev.location.x, ev.location.y, ev.time ); + miPointerAbsoluteCursor( ev.location.x, ev.location.y, + tv.tv_sec * 1000 + tv.tv_usec / 1000 ); + miPointerUpdate(); + +} + +static void *DarwinHIDThread(void *arg); + +/* + * InitInput + * Register the keyboard and mouse devices + */ +void InitInput( int argc, char **argv ) +{ static int initialized = 0; + if (!initialized) { + int fd[2]; + + assert( pipe(fd) == 0 ); + darwinEventFD = fd[0]; + fcntl(darwinEventFD, F_SETFL, O_NONBLOCK); + pthread_create(&dfb.hidThread, NULL, DarwinHIDThread, (void *) fd[1]); + + darwinPointer = AddInputDevice(DarwinMouseProc, TRUE); + RegisterPointerDevice( darwinPointer ); + + darwinKeyboard = AddInputDevice(DarwinKeybdProc, TRUE); + RegisterKeyboardDevice( darwinKeyboard ); + } +} + +EvGlobals * evg; +mach_port_t masterPort; +mach_port_t notificationPort; +IONotificationPortRef NotificationPortRef; + +static void InitIOKit(void) +{ + kern_return_t kr; + + kr = IOMasterPort(bootstrap_port, &masterPort); + kern_assert( kr ); +} + +static void ClearEvent(NXEvent * ep) +{ + static NXEvent nullEvent = {NX_NULLEVENT, {0, 0 }, 0, -1, 0 }; + + *ep = nullEvent; + ep->data.compound.subType = ep->data.compound.misc.L[0] = + ep->data.compound.misc.L[1] = 0; +} + +static void *DarwinHIDThread(void *arg) +{ + int darwinEventWriteFD = (int)arg; + + for (;;) { + IOReturn kr; + NXEvent ev; + NXEQElement *oldHead; + struct { + mach_msg_header_t header; + mach_msg_trailer_t trailer; + } msg; + + kr = mach_msg((mach_msg_header_t*) &msg, MACH_RCV_MSG, 0, + sizeof(msg), notificationPort, 0, MACH_PORT_NULL); + assert(KERN_SUCCESS == kr); + + while (evg->LLEHead != evg->LLETail) { + oldHead = (NXEQElement*)&evg->lleq[evg->LLEHead]; + ev_lock(&oldHead->sema); + ev = oldHead->event; + ClearEvent(&oldHead->event); + evg->LLEHead = oldHead->next; + ev_unlock(&oldHead->sema); + + write(darwinEventWriteFD, &ev, sizeof(ev)); + } + } + return NULL; +} + +void SetupFBandHID(void) +{ + kern_return_t kr; + io_service_t service; + io_iterator_t iter; + io_name_t name; + vm_address_t shmem, vram; + vm_size_t shmemSize; + int i; + UInt32 numModes; + IODisplayModeInformation modeInfo; + IODisplayModeID displayMode, *allModes; + IOIndex displayDepth; + IOFramebufferInformation fbInfo; + StdFBShmem_t *cshmem; + + dfb.fbService = 0; + dfb.hidService = 0; + + // find and open the IOFrameBuffer service + kr = IOServiceGetMatchingServices( masterPort, + IOServiceMatching( IOFRAMEBUFFER_CONFORMSTO ), + &iter ); + kern_assert( kr ); + + assert(service = IOIteratorNext(iter)); + + kr = IOServiceOpen( service, mach_task_self(), + kIOFBServerConnectType, &dfb.fbService ); + if (kr != KERN_SUCCESS) + FatalError("failed to connect as window server!\nMake sure you have quit the Mac OS X window server.\n"); + + IOObjectRelease( service ); + IOObjectRelease( iter ); + + // create the slice of shared memory containing cursor state data + kr = IOFBCreateSharedCursor( dfb.fbService, kIOFBCurrentShmemVersion, + 32, 32 ); + kern_assert( kr ); + + // SET THE SCREEN PARAMETERS + // get the current screen resolution, refresh rate and depth + kr = IOFBGetCurrentDisplayModeAndDepth( dfb.fbService, &displayMode, + &displayDepth ); + kern_assert( kr ); + + // use the current screen resolution if the user + // only wants to change the refresh rate + if (darwinDesiredRefresh != -1 && darwinDesiredWidth == 0) { + kr = IOFBGetDisplayModeInformation( dfb.fbService, displayMode, + &modeInfo ); + kern_assert( kr ); + darwinDesiredWidth = modeInfo.nominalWidth; + darwinDesiredHeight = modeInfo.nominalHeight; + } + + // use the current resolution and refresh rate + // if the user doesn't have a preference + if (darwinDesiredWidth == 0) { + + // change the pixel depth if desired + if (darwinDesiredDepth != -1) { + kr = IOFBGetDisplayModeInformation( dfb.fbService, displayMode, + &modeInfo ); + kern_assert( kr ); + if (modeInfo.maxDepthIndex < darwinDesiredDepth) + FatalError("Current screen resolution does not support desired pixel depth!\n"); + + displayDepth = darwinDesiredDepth; + kr = IOFBSetDisplayModeAndDepth( dfb.fbService, displayMode, + displayDepth ); + kern_assert( kr ); + } + + // look for display mode with correct resolution and refresh rate + } else { + + // get an array of all supported display modes + kr = IOFBGetDisplayModeCount( dfb.fbService, &numModes ); + kern_assert( kr ); + assert(allModes = (IODisplayModeID *) + xalloc( numModes * sizeof(IODisplayModeID) )); + kr = IOFBGetDisplayModes( dfb.fbService, numModes, allModes ); + kern_assert( kr ); + + for (i = 0; i < numModes; i++) { + kr = IOFBGetDisplayModeInformation( dfb.fbService, allModes[i], + &modeInfo ); + kern_assert( kr ); + + if (modeInfo.flags & kDisplayModeValidFlag && + modeInfo.nominalWidth == darwinDesiredWidth && + modeInfo.nominalHeight == darwinDesiredHeight) { + + if (darwinDesiredDepth == -1) + darwinDesiredDepth = modeInfo.maxDepthIndex; + if (modeInfo.maxDepthIndex < darwinDesiredDepth) + FatalError("Desired screen resolution does not support desired pixel depth!\n"); + if ((darwinDesiredRefresh == -1 || + (darwinDesiredRefresh << 16) == modeInfo.refreshRate)) { + displayMode = allModes[i]; + displayDepth = darwinDesiredDepth; + kr = IOFBSetDisplayModeAndDepth( dfb.fbService, displayMode, + displayDepth ); + kern_assert( kr ); + break; + } + } + } + + xfree( allModes ); + if (i >= numModes) + FatalError("Desired screen resolution or refresh rate is not supported!\n"); + } + + kr = IOFBGetPixelInformation( dfb.fbService, displayMode, displayDepth, + kIOFBSystemAperture, &dfb.pixelInfo ); + kern_assert( kr ); + +#ifdef OLD_POWERBOOK_G3 + if (dfb.pixelInfo.pixelType == kIOCLUTPixels) + dfb.pixelInfo.pixelType = kIOFixedCLUTPixels; +#endif + + kr = IOFBGetFramebufferInformationForAperture( dfb.fbService, kIOFBSystemAperture, + &fbInfo ); + kern_assert( kr ); + + kr = IOConnectMapMemory( dfb.fbService, kIOFBCursorMemory, + mach_task_self(), (vm_address_t *) &cshmem, + &shmemSize, kIOMapAnywhere ); + kern_assert( kr ); + dfb.cursorShmem = cshmem; + + kr = IOConnectMapMemory( dfb.fbService, kIOFBSystemAperture, mach_task_self(), + &vram, &shmemSize, kIOMapAnywhere ); + kern_assert( kr ); + + dfb.framebuffer = (void*)vram; + dfb.width = fbInfo.activeWidth; + dfb.height = fbInfo.activeHeight; + dfb.pitch = fbInfo.bytesPerRow; + dfb.bitsPerPixel = fbInfo.bitsPerPixel; + dfb.colorBitsPerPixel = dfb.pixelInfo.componentCount * + dfb.pixelInfo.bitsPerComponent; + + // find and open the HID System Service + kr = IOServiceGetMatchingServices( masterPort, + IOServiceMatching( kIOHIDSystemClass ), + &iter ); + kern_assert( kr ); + + assert( service = IOIteratorNext( iter ) ); + + kr = IORegistryEntryGetName( service, name ); + kern_assert( kr ); + + kr = IOServiceOpen( service, mach_task_self(), kIOHIDServerConnectType, + &dfb.hidService ); + kern_assert( kr ); + + IOObjectRelease( service ); + IOObjectRelease( iter ); + + kr = IOHIDCreateSharedMemory( dfb.hidService, kIOHIDCurrentShmemVersion ); + kern_assert( kr ); + + kr = IOHIDSetEventsEnable(dfb.hidService, TRUE); + kern_assert( kr ); + + // Inform the HID system that the framebuffer is also connected to it + kr = IOConnectAddClient( dfb.hidService, dfb.fbService ); + kern_assert( kr ); + + kr = IOHIDSetCursorEnable(dfb.hidService, TRUE); + kern_assert( kr ); + + kr = IOConnectMapMemory( dfb.hidService, kIOHIDGlobalMemory, mach_task_self(), + &shmem, &shmemSize, kIOMapAnywhere ); + kern_assert( kr ); + + evg = (EvGlobals *)(shmem + ((EvOffsets *)shmem)->evGlobalsOffset); + + assert(sizeof(EvGlobals) == evg->structSize); + + NotificationPortRef = IONotificationPortCreate( masterPort ); + + notificationPort = IONotificationPortGetMachPort(NotificationPortRef); + + kr = IOConnectSetNotificationPort( dfb.hidService, kIOHIDEventNotification, + notificationPort, 0 ); + kern_assert( kr ); + + evg->movedMask |= NX_MOUSEMOVEDMASK; +} + + +/* + * InitOutput -- + * Initialize screenInfo for all actually accessible framebuffers. + * + * FIXME: why does this get called multiple times when a session is starting? + */ +void InitOutput( ScreenInfo *pScreenInfo, int argc, char **argv ) +{ int i; + static int initialized = 0; +// static PixmapFormatRec darwinFormat; + + // perform one-time-only initialization + if ( !initialized ) { + initialized = 1; + // do our appkit or darwin device driver work to open and map a screen + InitIOKit(); + SetupFBandHID(); + } + + pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; + pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; + pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; + pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; + + // list how we want common pixmap formats to be padded + pScreenInfo->numPixmapFormats = NUMFORMATS; + for (i = 0; i < NUMFORMATS; i++) + pScreenInfo->formats[i] = formats[i]; + + + AddScreen( DarwinAddScreen, argc, argv ); +} + +void OsVendorFatalError( void ) +{ ErrorF( " OsVendorFatalError\n" ); +} + +void OsVendorInit(void) +{ +} + +/* + * ddxProcessArgument -- + * Process device-dependent command line args. Returns 0 if argument is + * not device dependent, otherwise Count of number of elements of argv + * that are part of a device dependent commandline option. + */ +int ddxProcessArgument( int argc, char *argv[], int i ) +{ +#if 0 + if ( !strcmp( argv[i], "-screen" ) ) { + if ( i == argc-1 ) { + FatalError( "-screen must be followed by a number" ); + } + darwinScreenNumber = atoi( argv[i+1] ); + ErrorF( "Attempting to use screen number %i\n", darwinScreenNumber ); + return 2; + } +#endif + + if ( !strcmp( argv[i], "-fakebuttons" ) ) { + fake3Buttons = TRUE; + ErrorF( "Faking a three button mouse\n" ); + return 1; + } + + if ( !strcmp( argv[i], "-nofakebuttons" ) ) { + fake3Buttons = FALSE; + ErrorF( "Not faking a three button mouse\n" ); + return 1; + } + + if ( !strcmp( argv[i], "-size" ) ) { + if ( i >= argc-2 ) { + FatalError( "-size must be followed by two numbers" ); + } +#ifdef OLD_POWERBOOK_G3 + ErrorF( "Ignoring unsupported -size option on old PowerBook G3\n"); +#else + darwinDesiredWidth = atoi( argv[i+1] ); + darwinDesiredHeight = atoi( argv[i+2] ); + ErrorF( "Attempting to use width x height = %i x %i\n", + darwinDesiredWidth, darwinDesiredHeight ); +#endif + return 3; + } + + if ( !strcmp( argv[i], "-depth" ) ) { + int bitDepth; + if ( i == argc-1 ) { + FatalError( "-depth must be followed by a number" ); + } +#ifdef OLD_POWERBOOK_G3 + ErrorF( "Ignoring unsupported -depth option on old PowerBook G3\n"); +#else + bitDepth = atoi( argv[i+1] ); + if (bitDepth == 8) + darwinDesiredDepth = 0; + else if (bitDepth == 15) + darwinDesiredDepth = 1; + else if (bitDepth == 24) + darwinDesiredDepth = 2; + else + FatalError( "Unsupported pixel depth. Use 8, 15, or 24 bits" ); + ErrorF( "Attempting to use pixel depth of %i\n", bitDepth ); +#endif + return 2; + } + + if ( !strcmp( argv[i], "-refresh" ) ) { + if ( i == argc-1 ) { + FatalError( "-refresh must be followed by a number" ); + } +#ifdef OLD_POWERBOOK_G3 + ErrorF( "Ignoring unsupported -refresh option on old PowerBook G3\n"); +#else + darwinDesiredRefresh = atoi( argv[i+1] ); + ErrorF( "Attempting to use refresh rate of %i\n", darwinDesiredRefresh ); +#endif + return 2; + } + + return 0; +} + +/* + * ddxUseMsg -- + * Print out correct use of device dependent commandline options. + * Maybe the user now knows what really to do ... + */ +void ddxUseMsg( void ) +{ + ErrorF("\n"); + ErrorF("\n"); + ErrorF("Device Dependent Usage:\n"); + ErrorF("\n"); +#if 0 + ErrorF("-screen <0,1,...> : use this mac screen num.\n" ); +#endif + ErrorF("-fakebuttons : fake a three button mouse with Command and Option keys.\n"); + ErrorF("-nofakebuttons : don't fake a three button mouse.\n"); + ErrorF("-size <height> <width> : use a screen resolution of <height> x <width>.\n"); + ErrorF("-depth <8,15,24> : use this bit depth.\n"); + ErrorF("-refresh <rate> : use a monitor refresh rate of <rate> Hz.\n"); + ErrorF("\n"); +} + +/* + * ddxGiveUp -- + * Device dependent cleanup. Called by dix before normal server death. + */ +void ddxGiveUp( void ) { + ErrorF( " ddxGiveUp\n" ); +} + +/* + * AbortDDX -- + * DDX - specific abort routine. Called by AbortServer(). The attempt is + * made to restore all original setting of the displays. Also all devices + * are closed. + */ +void AbortDDX( void ) { +#if TRUE + ErrorF( " AbortDDX\n" ); + /* + * This is needed for a abnormal server exit, since the normal exit stuff + * MUST also be performed (i.e. the vt must be left in a defined state) + */ + ddxGiveUp(); +#endif +} + +Bool DPMSSupported(void) +{ return 0; +} + +void DPMSSet(void) +{ return; +} diff --git a/xc/programs/Xserver/hw/darwin/darwin.h b/xc/programs/Xserver/hw/darwin/darwin.h new file mode 100644 index 000000000..a114167fa --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/darwin.h @@ -0,0 +1,38 @@ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwin.h,v 1.1 2000/11/15 01:36:13 dawes Exp $ */ + +#ifndef _DARWIN_H +#define _DARWIN_H + +#include <pthread.h> +#include <IOKit/graphics/IOFramebufferShared.h> +#include "inputstr.h" +#include "screenint.h" +#include "extensions/XKB.h" + +typedef struct { + pthread_t hidThread; + io_connect_t fbService; + io_connect_t hidService; + io_connect_t hidParam; + void *framebuffer; + int width; + int height; + int pitch; + int bitsPerPixel; + int colorBitsPerPixel; + IOPixelInformation pixelInfo; + StdFBShmem_t *cursorShmem; +} DarwinFramebufferRec; + +void DarwinKeyboardInit(DeviceIntPtr pDev); +Bool DarwinInitCursor(ScreenPtr pScreen); + +#define assert(x) { if ((x) == 0) \ + FatalError("assert failed on line %d of %s!\n", __LINE__, __FILE__); } +#define kern_assert(x) { if ((x) != KERN_SUCCESS) \ + FatalError("assert failed on line %d of %s with kernel return 0x%x!\n", \ + __LINE__, __FILE__, x); } + +#define MIN_KEYCODE XkbMinLegalKeyCode // unfortunately, this isn't 0... + +#endif /* _DARWIN_H */ diff --git a/xc/programs/Xserver/hw/darwin/darwinCursor.c b/xc/programs/Xserver/hw/darwin/darwinCursor.c new file mode 100644 index 000000000..b6ff35f5b --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/darwinCursor.c @@ -0,0 +1,705 @@ +/************************************************************** + * + * Cursor support for Darwin X Server + * + * Three different cursor modes are possible: + * X (0) - tracking via Darwin kernel, + * display via X machine independent + * Kernel (1) - tracking and display via Darwin kernel + * (not currently supported) + * Hardware (2) - tracking and display via hardware + * + * The X software cursor uses the Darwin software cursor + * routines in IOFramebuffer.cpp to track the cursor, but + * displays the cursor image using the X machine + * independent display cursor routines in midispcur.c. + * + * The kernel cursor uses IOFramebuffer.cpp routines to + * track and display the cursor. This gives better + * performance as the display calls don't have to cross + * the kernel boundary. Unfortunately, this mode has + * synchronization issues with the user land X server + * and isn't currently used. + * + * Hardware cursor support lets the hardware handle these + * details. + * + * Kernel and hardware cursor mode only work for cursors + * up to a certain size, currently 16x16 pixels. If a + * bigger cursor is set, we fallback to X cursor mode. + * + * HISTORY: + * 1.0 by Torrey T. Lyons, October 30, 2000 + * + **************************************************************/ +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinCursor.c,v 1.1 2000/11/15 01:36:13 dawes Exp $ */ + +#include "scrnintstr.h" +#include "cursorstr.h" +#include "micmap.h" +#include <IOKit/graphics/IOGraphicsLib.h> +#include <IOKit/hidsystem/IOHIDLib.h> +#include "darwin.h" +#include "mipointrst.h" + +#define DUMP_DARWIN_CURSOR FALSE + +// The cursors format are documented in IOFramebufferShared.h. +#define RGBto34WithGamma(red, green, blue) \ + ( 0x000F \ + | (((red) & 0xF) << 12) \ + | (((green) & 0xF) << 8) \ + | (((blue) & 0xF) << 4) ) +#define RGBto38WithGamma(red, green, blue) \ + ( 0xFF << 24 \ + | (((red) & 0xFF) << 16) \ + | (((green) & 0xFF) << 8) \ + | (((blue) & 0xFF)) ) +#define HighBitOf32 0x80000000 + +typedef struct { + Bool canHWCursor; + short cursorMode; + RecolorCursorProcPtr RecolorCursor; + InstallColormapProcPtr InstallColormap; + QueryBestSizeProcPtr QueryBestSize; + miPointerSpriteFuncPtr spriteFuncs; + ColormapPtr pInstalledMap; +} DarwinCursorScreenRec, *DarwinCursorScreenPtr; + +extern DarwinFramebufferRec dfb; +static int darwinCursorScreenIndex = -1; +static unsigned long darwinCursorGeneration = 0; + +/* +=========================================================================== + + Pointer sprite functions + +=========================================================================== +*/ + +/* + Realizing the Darwin hardware cursor (ie. converting from the + X representation to the Darwin representation) is complicated + by the fact that we have three different potential cursor + formats to go to, one for each bit depth (8, 15, or 24). + The Darwin formats are documented in IOFramebufferShared.h. + X cursors are represented as two pieces, a source and a mask. + The mask is a bitmap indicating which parts of the cursor are + transparent and which parts are drawn. The source is a bitmap + indicating which parts of the non-transparent portion of the the + cursor should be painted in the foreground color and which should + be painted in the background color. The bitmaps are given in + 32-bit format with least significant byte and bit first. + (This is opposite PowerPC Darwin.) +*/ + +typedef struct { + unsigned char image[CURSORWIDTH*CURSORHEIGHT]; + unsigned char mask[CURSORWIDTH*CURSORHEIGHT]; +} cursorPrivRec, *cursorPrivPtr; + +/* + * DarwinRealizeCursor8 + * Convert the X cursor representation to an 8-bit depth + * format for Darwin. This function assumes the maximum cursor + * width is a multiple of 8. + */ +static Bool +DarwinRealizeCursor8( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + cursorPrivPtr newCursor; + unsigned char *newSourceP, *newMaskP; + CARD32 *oldSourceP, *oldMaskP; + xColorItem fgColor, bgColor; + int index, x, y, rowPad; + int cursorWidth, cursorHeight; + ColormapPtr pmap; + + // check cursor size just to be sure + cursorWidth = pCursor->bits->width; + cursorHeight = pCursor->bits->height; + if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) + return FALSE; + + // get cursor colors in colormap + index = pScreen->myNum; + pmap = miInstalledMaps[index]; + if (!pmap) return FALSE; + + fgColor.red = pCursor->foreRed; + fgColor.green = pCursor->foreGreen; + fgColor.blue = pCursor->foreBlue; + FakeAllocColor(pmap, &fgColor); + bgColor.red = pCursor->backRed; + bgColor.green = pCursor->backGreen; + bgColor.blue = pCursor->backBlue; + FakeAllocColor(pmap, &bgColor); + FakeFreeColor(pmap, fgColor.pixel); + FakeFreeColor(pmap, bgColor.pixel); + + // allocate memory for new cursor image + newCursor = xalloc( sizeof(cursorPrivRec) ); + if (!newCursor) + return FALSE; + memset( newCursor->image, pScreen->blackPixel, CURSORWIDTH*CURSORHEIGHT ); + memset( newCursor->mask, 0, CURSORWIDTH*CURSORHEIGHT ); + + // convert to 8-bit Darwin cursor format + oldSourceP = (CARD32 *) pCursor->bits->source; + oldMaskP = (CARD32 *) pCursor->bits->mask; + newSourceP = newCursor->image; + newMaskP = newCursor->mask; + rowPad = CURSORWIDTH - cursorWidth; + + for (y = 0; y < cursorHeight; y++) { + for (x = 0; x < cursorWidth; x++) { + if (*oldSourceP & (HighBitOf32 >> x)) + *newSourceP = fgColor.pixel; + else + *newSourceP = bgColor.pixel; + if (*oldMaskP & (HighBitOf32 >> x)) + *newMaskP = 255; + else + *newSourceP = pScreen->blackPixel; + newSourceP++; newMaskP++; + } + oldSourceP++; oldMaskP++; + newSourceP += rowPad; newMaskP += rowPad; + } + + // save the result + pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; + return TRUE; +} + + +/* + * DarwinRealizeCursor15 + * Convert the X cursor representation to an 15-bit depth + * format for Darwin. + */ +static Bool +DarwinRealizeCursor15( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + unsigned short *newCursor; + unsigned short fgPixel, bgPixel; + unsigned short *newSourceP; + CARD32 *oldSourceP, *oldMaskP; + int x, y, rowPad; + int cursorWidth, cursorHeight; + + // check cursor size just to be sure + cursorWidth = pCursor->bits->width; + cursorHeight = pCursor->bits->height; + if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) + return FALSE; + + // allocate memory for new cursor image + newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(short) ); + if (!newCursor) + return FALSE; + memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(short) ); + + // calculate pixel values + fgPixel = RGBto34WithGamma( pCursor->foreRed, pCursor->foreGreen, + pCursor->foreBlue ); + bgPixel = RGBto34WithGamma( pCursor->backRed, pCursor->backGreen, + pCursor->backBlue ); + + // convert to 15-bit Darwin cursor format + oldSourceP = (CARD32 *) pCursor->bits->source; + oldMaskP = (CARD32 *) pCursor->bits->mask; + newSourceP = newCursor; + rowPad = CURSORWIDTH - cursorWidth; + + for (y = 0; y < cursorHeight; y++) { + for (x = 0; x < cursorWidth; x++) { + if (*oldMaskP & (HighBitOf32 >> x)) { + if (*oldSourceP & (HighBitOf32 >> x)) + *newSourceP = fgPixel; + else + *newSourceP = bgPixel; + } else { + *newSourceP = 0; + } + newSourceP++; + } + oldSourceP++; oldMaskP++; + newSourceP += rowPad; + } + +#if DUMP_DARWIN_CURSOR + // Write out the cursor + ErrorF("Cursor: 0x%x\n", pCursor); + ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth, + cursorHeight, rowPad); + for (y = 0; y < cursorHeight; y++) { + newSourceP = newCursor + y*CURSORWIDTH; + for (x = 0; x < cursorWidth; x++) { + if (*newSourceP == fgPixel) + ErrorF("x"); + else if (*newSourceP == bgPixel) + ErrorF("o"); + else + ErrorF(" "); + newSourceP++; + } + ErrorF("\n"); + } +#endif + + // save the result + pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; + return TRUE; +} + + +/* + * DarwinRealizeCursor24 + * Convert the X cursor representation to an 24-bit depth + * format for Darwin. This function assumes the maximum cursor + * width is a multiple of 8. + */ +static Bool +DarwinRealizeCursor24( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + unsigned int *newCursor; + unsigned int fgPixel, bgPixel; + unsigned int *newSourceP; + CARD32 *oldSourceP, *oldMaskP; + int x, y, rowPad; + int cursorWidth, cursorHeight; + + // check cursor size just to be sure + cursorWidth = pCursor->bits->width; + cursorHeight = pCursor->bits->height; + if (cursorHeight > CURSORHEIGHT || cursorWidth > CURSORWIDTH) + return FALSE; + + // allocate memory for new cursor image + newCursor = xalloc( CURSORWIDTH*CURSORHEIGHT*sizeof(int) ); + if (!newCursor) + return FALSE; + memset( newCursor, 0, CURSORWIDTH*CURSORHEIGHT*sizeof(int) ); + + // calculate pixel values + fgPixel = RGBto38WithGamma( pCursor->foreRed, pCursor->foreGreen, + pCursor->foreBlue ); + bgPixel = RGBto38WithGamma( pCursor->backRed, pCursor->backGreen, + pCursor->backBlue ); + + // convert to 24-bit Darwin cursor format + oldSourceP = (CARD32 *) pCursor->bits->source; + oldMaskP = (CARD32 *) pCursor->bits->mask; + newSourceP = newCursor; + rowPad = CURSORWIDTH - cursorWidth; + + for (y = 0; y < cursorHeight; y++) { + for (x = 0; x < cursorWidth; x++) { + if (*oldMaskP & (HighBitOf32 >> x)) { + if (*oldSourceP & (HighBitOf32 >> x)) + *newSourceP = fgPixel; + else + *newSourceP = bgPixel; + } else { + *newSourceP = 0; + } + newSourceP++; + } + oldSourceP++; oldMaskP++; + newSourceP += rowPad; + } + +#if DUMP_DARWIN_CURSOR + // Write out the cursor + ErrorF("Cursor: 0x%x\n", pCursor); + ErrorF("Width = %i, Height = %i, RowPad = %i\n", cursorWidth, + cursorHeight, rowPad); + for (y = 0; y < cursorHeight; y++) { + newSourceP = newCursor + y*CURSORWIDTH; + for (x = 0; x < cursorWidth; x++) { + if (*newSourceP == fgPixel) + ErrorF("x"); + else if (*newSourceP == bgPixel) + ErrorF("o"); + else + ErrorF(" "); + newSourceP++; + } + ErrorF("\n"); + } +#endif + + // save the result + pCursor->devPriv[pScreen->myNum] = (pointer) newCursor; + return TRUE; +} + + +/* + * DarwinRealizeCursor + * + */ +static Bool +DarwinRealizeCursor( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + Bool result; + DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr) + pScreen->devPrivates[darwinCursorScreenIndex].ptr; + + if ((pCursor->bits->height > CURSORHEIGHT) || + (pCursor->bits->width > CURSORWIDTH) || + // FIXME: this condition is not needed after kernel cursor works + !ScreenPriv->canHWCursor) { + result = (*ScreenPriv->spriteFuncs->RealizeCursor)(pScreen, pCursor); + } else if (dfb.bitsPerPixel == 8) { + result = DarwinRealizeCursor8(pScreen, pCursor); + } else if (dfb.bitsPerPixel == 16) { + result = DarwinRealizeCursor15(pScreen, pCursor); + } else { + result = DarwinRealizeCursor24(pScreen, pCursor); + } + + return result; +} + + +/* + * DarwinUnrealizeCursor + * + */ +static Bool +DarwinUnrealizeCursor( + ScreenPtr pScreen, + CursorPtr pCursor) +{ + Bool result; + DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr) + pScreen->devPrivates[darwinCursorScreenIndex].ptr; + + if ((pCursor->bits->height > CURSORHEIGHT) || + (pCursor->bits->width > CURSORWIDTH) || + // FIXME: this condition is not needed after kernel cursor works + !ScreenPriv->canHWCursor) { + result = (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pScreen, pCursor); + } else { + xfree( pCursor->devPriv[pScreen->myNum] ); + result = TRUE; + } + + return result; +} + + +/* + * DarwinSetCursor + * Set the cursor sprite and position + * Use hardware cursor if possible + */ +static void +DarwinSetCursor( + ScreenPtr pScreen, + CursorPtr pCursor, + int x, + int y) +{ + kern_return_t kr; + StdFBShmem_t *cshmem = dfb.cursorShmem; + DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr) + pScreen->devPrivates[darwinCursorScreenIndex].ptr; + + // are we supposed to remove the cursor? + if (!pCursor) { + if (ScreenPriv->cursorMode == 0) + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); + else { + if (!cshmem->cursorShow) { + cshmem->cursorShow++; + if (cshmem->hardwareCursorActive) { + kr = IOFBSetCursorVisible(dfb.fbService, FALSE); + kern_assert( kr ); + } + } + } + return; + } + + // can we use the kernel or hardware cursor? + if ((pCursor->bits->height <= CURSORHEIGHT) && + (pCursor->bits->width <= CURSORWIDTH) && + // FIXME: condition not needed when kernel cursor works + ScreenPriv->canHWCursor) { + + if (ScreenPriv->cursorMode == 0) // remove the X cursor + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, 0, x, y); + ScreenPriv->cursorMode = 1; // kernel cursor + + // change the cursor image in shared memory + if (dfb.bitsPerPixel == 8) { + cursorPrivPtr newCursor = + (cursorPrivPtr) pCursor->devPriv[pScreen->myNum]; + memcpy(cshmem->cursor.bw8.image[0], newCursor->image, + CURSORWIDTH*CURSORHEIGHT); + memcpy(cshmem->cursor.bw8.mask[0], newCursor->mask, + CURSORWIDTH*CURSORHEIGHT); + } else if (dfb.bitsPerPixel == 16) { + unsigned short *newCursor = + (unsigned short *) pCursor->devPriv[pScreen->myNum]; + memcpy(cshmem->cursor.rgb.image[0], newCursor, + 2*CURSORWIDTH*CURSORHEIGHT); + } else { + unsigned int *newCursor = + (unsigned int *) pCursor->devPriv[pScreen->myNum]; + memcpy(cshmem->cursor.rgb24.image[0], newCursor, + 4*CURSORWIDTH*CURSORHEIGHT); + } + + // FIXME: We always use a full size cursor, even if the image + // is smaller because I couldn't get the padding to come out + // right otherwise. + cshmem->cursorSize[0].width = CURSORWIDTH; + cshmem->cursorSize[0].height = CURSORHEIGHT; + cshmem->hotSpot[0].x = pCursor->bits->xhot; + cshmem->hotSpot[0].y = pCursor->bits->yhot; + + // try to use a hardware cursor + if (ScreenPriv->canHWCursor) { + kr = IOFBSetNewCursor(dfb.fbService, 0, 0, 0); + // FIXME: this is a fatal error without the kernel cursor + kern_assert( kr ); +#if 0 + if (kr != KERN_SUCCESS) { + ErrorF("Could not set new cursor with kernel return 0x%x.\n", kr); + ScreenPriv->canHWCursor = FALSE; + } +#endif + } + + // make the new cursor visible + if (cshmem->cursorShow) + cshmem->cursorShow--; + + if (!cshmem->cursorShow && ScreenPriv->canHWCursor) { + kr = IOFBSetCursorVisible(dfb.fbService, TRUE); + // FIXME: this is a fatal error without the kernel cursor + kern_assert( kr ); +#if 0 + if (kr != KERN_SUCCESS) { + ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr); + ScreenPriv->canHWCursor = FALSE; + } else +#endif + ScreenPriv->cursorMode = 2; // hardware cursor + } + + return; + } + + // otherwise we use a software cursor + if (ScreenPriv->cursorMode) { + /* remove the kernel or hardware cursor */ + DarwinSetCursor(pScreen, 0, x, y); + } + + ScreenPriv->cursorMode = 0; + (*ScreenPriv->spriteFuncs->SetCursor)(pScreen, pCursor, x, y); +} + + +/* + * DarwinMoveCursor + * Move the cursor. This is a noop for a kernel or hardware cursor. + */ +static void +DarwinMoveCursor( + ScreenPtr pScreen, + int x, + int y) +{ + DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr) + pScreen->devPrivates[darwinCursorScreenIndex].ptr; + + // only the X cursor needs to be explicitly moved + if (!ScreenPriv->cursorMode) + (*ScreenPriv->spriteFuncs->MoveCursor)(pScreen, x, y); +} + +static miPointerSpriteFuncRec darwinSpriteFuncsRec = { + DarwinRealizeCursor, + DarwinUnrealizeCursor, + DarwinSetCursor, + DarwinMoveCursor +}; + + +/* +=========================================================================== + + Pointer screen functions + +=========================================================================== +*/ + +/* + * DarwinCursorOffScreen + */ +static Bool DarwinCursorOffScreen(ScreenPtr *pScreen, int *x, int *y) +{ return FALSE; +} + + +/* + * DarwinCrossScreen + */ +static void DarwinCrossScreen(ScreenPtr pScreen, Bool entering) +{ return; +} + + +/* + * DarwinWarpCursor + * Change the cursor position without generating an event or motion history + */ +static void +DarwinWarpCursor( + ScreenPtr pScreen, + int x, + int y) +{ + kern_return_t kr; + + kr = IOHIDSetMouseLocation( dfb.hidService, x, y ); + if (kr != KERN_SUCCESS) { + ErrorF("Could not set cursor position with kernel return 0x%x.\n", kr); + } + miPointerWarpCursor(pScreen, x, y); +} + +static miPointerScreenFuncRec darwinScreenFuncsRec = { + DarwinCursorOffScreen, + DarwinCrossScreen, + DarwinWarpCursor, +}; + + +/* +=========================================================================== + + Other screen functions + +=========================================================================== +*/ + +/* + * DarwinCursorQueryBestSize + * Handle queries for best cursor size + */ +static void +DarwinCursorQueryBestSize( + int class, + unsigned short *width, + unsigned short *height, + ScreenPtr pScreen) +{ + DarwinCursorScreenPtr ScreenPriv = (DarwinCursorScreenPtr) + pScreen->devPrivates[darwinCursorScreenIndex].ptr; + + if (class == CursorShape) { + *width = CURSORWIDTH; + *height = CURSORHEIGHT; + } else + (*ScreenPriv->QueryBestSize)(class, width, height, pScreen); +} + + +/* + * DarwinInitCursor + * Initialize cursor support + */ +Bool +DarwinInitCursor( + ScreenPtr pScreen) +{ + DarwinCursorScreenPtr ScreenPriv; + miPointerScreenPtr PointPriv; + kern_return_t kr; + + // start with no cursor displayed + if (!dfb.cursorShmem->cursorShow++) { + if (dfb.cursorShmem->hardwareCursorActive) { + kr = IOFBSetCursorVisible(dfb.fbService, FALSE); + kern_assert( kr ); + } + } + + // initialize software cursor handling (always needed as backup) + if (!miDCInitialize(pScreen, &darwinScreenFuncsRec)) { + return FALSE; + } + + // allocate private storage for this screen's hardware cursor info + if (darwinCursorGeneration != serverGeneration) { + if ((darwinCursorScreenIndex = AllocateScreenPrivateIndex()) < 0) + return FALSE; + darwinCursorGeneration = serverGeneration; + } + + ScreenPriv = xcalloc( 1, sizeof(DarwinCursorScreenRec) ); + if (!ScreenPriv) return FALSE; + + pScreen->devPrivates[darwinCursorScreenIndex].ptr = (pointer) ScreenPriv; + + // check if a hardware cursor is supported + if (!dfb.cursorShmem->hardwareCursorCapable) { + ScreenPriv->canHWCursor = FALSE; + ErrorF("Hardware cursor not supported.\n"); + } else { + // we need to make sure that the hardware cursor really works + ScreenPriv->canHWCursor = TRUE; + kr = IOFBSetNewCursor(dfb.fbService, 0, 0, 0); + if (kr != KERN_SUCCESS) { + ErrorF("Could not set hardware cursor with kernel return 0x%x.\n", kr); + ScreenPriv->canHWCursor = FALSE; + } + kr = IOFBSetCursorVisible(dfb.fbService, TRUE); + if (kr != KERN_SUCCESS) { + ErrorF("Couldn't set hardware cursor visible with kernel return 0x%x.\n", kr); + ScreenPriv->canHWCursor = FALSE; + } + IOFBSetCursorVisible(dfb.fbService, FALSE); + } + + ScreenPriv->cursorMode = 0; + ScreenPriv->pInstalledMap = NULL; + + // override some screen procedures + ScreenPriv->QueryBestSize = pScreen->QueryBestSize; + pScreen->QueryBestSize = DarwinCursorQueryBestSize; +// ScreenPriv->ConstrainCursor = pScreen->ConstrainCursor; +// pScreen->ConstrainCursor = DarwinConstrainCursor; + + // initialize hardware cursor handling + PointPriv = (miPointerScreenPtr) + pScreen->devPrivates[miPointerScreenIndex].ptr; + + ScreenPriv->spriteFuncs = PointPriv->spriteFuncs; + PointPriv->spriteFuncs = &darwinSpriteFuncsRec; + + /* Other routines that might be overridden */ +/* + CursorLimitsProcPtr CursorLimits; + RecolorCursorProcPtr RecolorCursor; +*/ + + return TRUE; +} diff --git a/xc/programs/Xserver/hw/darwin/darwinKeyboard.c b/xc/programs/Xserver/hw/darwin/darwinKeyboard.c new file mode 100644 index 000000000..78506587d --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/darwinKeyboard.c @@ -0,0 +1,503 @@ +//============================================================================= +// +// Keyboard support for the Darwin X Server +// +// By Torrey T. Lyons +// +// The code to parse the Darwin keymap is derived from dumpkeymap.c +// by Eric Sunshine, which includes the following license: +// +//----------------------------------------------------------------------------- +// +// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN +// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//============================================================================= + +/* $XFree86: xc/programs/Xserver/hw/darwin/darwinKeyboard.c,v 1.1 2000/11/15 01:36:14 dawes Exp $ */ + +/* +=========================================================================== + + An X keyCode must be in the range XkbMinLegalKeyCode (8) to + XkbMaxLegalKeyCode(255). + + The keyCodes we get from the kernel range from 0 to 127, so we need to + offset the range before passing the keyCode to X. + + An X KeySym is an extended ascii code that is device independent. + + The modifier map is accessed by the keyCode, but the normal map is + accessed by keyCode - MIN_KEYCODE. Sigh. + +=========================================================================== +*/ + +// Define this to get a diagnostic output to stderr which is helpful +// in determining how the X server is interpreting the Darwin keymap. +#undef DUMP_DARWIN_KEYMAP + +#include <drivers/event_status_driver.h> +#include <IOKit/hidsystem/ev_keymap.h> +#include "darwin.h" +extern DarwinFramebufferRec dfb; +extern unsigned char darwinKeyCommandL, darwinKeyOptionL; + +#define XK_TECHNICAL // needed to get XK_Escape +#include "keysym.h" + +#define GLYPHS_PER_KEY 4 +#define NUM_KEYCODES 248 // NX_NUMKEYCODES might be better +#define MAX_KEYCODE NUM_KEYCODES + MIN_KEYCODE - 1 + +#define AltMask Mod1Mask +#define NumLockMask Mod2Mask +#define MetaMask Mod3Mask +#define ScrollLockMask Mod4Mask + +static KeySym const ascii_to_x[256] = { + NoSymbol, NoSymbol, NoSymbol, XK_KP_Enter, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_Delete, XK_Tab, XK_Linefeed, NoSymbol, + NoSymbol, XK_Return, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, XK_Escape, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + XK_space, XK_exclam, XK_quotedbl, XK_numbersign, + XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, + XK_parenleft, XK_parenright, XK_asterisk, XK_plus, + XK_comma, XK_minus, XK_period, XK_slash, + XK_0, XK_1, XK_2, XK_3, + XK_4, XK_5, XK_6, XK_7, + XK_8, XK_9, XK_colon, XK_semicolon, + XK_less, XK_equal, XK_greater, XK_question, + XK_at, XK_A, XK_B, XK_C, + XK_D, XK_E, XK_F, XK_G, + XK_H, XK_I, XK_J, XK_K, + XK_L, XK_M, XK_N, XK_O, + XK_P, XK_Q, XK_R, XK_S, + XK_T, XK_U, XK_V, XK_W, + XK_X, XK_Y, XK_Z, XK_bracketleft, + XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore, + XK_grave, XK_a, XK_b, XK_c, + XK_d, XK_e, XK_f, XK_g, + XK_h, XK_i, XK_j, XK_k, + XK_l, XK_m, XK_n, XK_o, + XK_p, XK_q, XK_r, XK_s, + XK_t, XK_u, XK_v, XK_w, + XK_x, XK_y, XK_z, XK_braceleft, + XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace, +// 128 + XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex, + XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla, + XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis, + XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring, + XK_Eacute, XK_ae, XK_AE, XK_ocircumflex, + XK_odiaeresis, XK_ograve, XK_ntilde, XK_ugrave, + XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent, + XK_sterling, XK_yen, XK_paragraph, XK_section, +// 160 + XK_aacute, XK_degree, XK_cent, XK_sterling, + XK_ntilde, XK_Ntilde, XK_paragraph, XK_Greek_BETA, + XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf, + XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, +// 192 + XK_questiondown,XK_exclamdown, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, XK_AE, XK_ae, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, + NoSymbol, NoSymbol, NoSymbol, NoSymbol, +// 224 + XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi, + XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau, + XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta, + XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection, + XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal, + XK_topintegral, XK_botintegral, XK_division, XK_similarequal, + XK_degree, NoSymbol, NoSymbol, XK_radical, + XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol, + }; + +#define MIN_SYMBOL 0xAC +static KeySym const symbol_to_x[] = { + XK_Left, XK_Up, XK_Right, XK_Down + }; +int const NUM_SYMBOL = sizeof(symbol_to_x) / sizeof(symbol_to_x[0]); + +#define MIN_FUNCKEY 0x20 +static KeySym const funckey_to_x[] = { + XK_F1, XK_F2, XK_F3, XK_F4, + XK_F5, XK_F6, XK_F7, XK_F8, + XK_F9, XK_F10, XK_F11, XK_F12, + XK_Insert, XK_Delete, XK_Home, XK_End, + XK_Page_Up, XK_Page_Down, XK_F13, XK_F14, + XK_F15 + }; +int const NUM_FUNCKEY = sizeof(funckey_to_x) / sizeof(funckey_to_x[0]); + +typedef struct { + KeySym normalSym; + KeySym keypadSym; +} darwinKeyPad_t; + +static darwinKeyPad_t const normal_to_keypad[] = { + { XK_0, XK_KP_0 }, + { XK_1, XK_KP_1 }, + { XK_2, XK_KP_2 }, + { XK_3, XK_KP_3 }, + { XK_4, XK_KP_4 }, + { XK_5, XK_KP_5 }, + { XK_6, XK_KP_6 }, + { XK_7, XK_KP_7 }, + { XK_8, XK_KP_8 }, + { XK_9, XK_KP_9 }, + { XK_equal, XK_KP_Equal }, + { XK_asterisk, XK_KP_Multiply }, + { XK_plus, XK_KP_Add }, + { XK_comma, XK_KP_Separator }, + { XK_minus, XK_KP_Subtract }, + { XK_period, XK_KP_Decimal }, + { XK_slash, XK_KP_Divide } +}; +int const NUM_KEYPAD = sizeof(normal_to_keypad) / sizeof(normal_to_keypad[0]); + +static void DarwinBell( int loud, DeviceIntPtr pDevice, pointer ctrl, int fbclass) { + // FIXME +} + +static void DarwinChangeKeyboardControl( DeviceIntPtr device, KeybdCtrl *ctrl ) { + // keyclick, bell volume / pitch, autorepead, LED's +} + +static CARD8 modMap[MAP_LENGTH]; +static KeySym map[256 * GLYPHS_PER_KEY]; + +//----------------------------------------------------------------------------- +// Data Stream Object +// Can be configured to treat embedded "numbers" as being composed of +// either 1, 2, or 4 bytes, apiece. +//----------------------------------------------------------------------------- +typedef struct _DataStream +{ + unsigned char const *data; + unsigned char const *data_end; + short number_size; // Size in bytes of a "number" in the stream. +} DataStream; + +static DataStream* new_data_stream( unsigned char const* data, int size ) +{ + DataStream* s = (DataStream*)xalloc( sizeof(DataStream) ); + s->data = data; + s->data_end = data + size; + s->number_size = 1; // Default to byte-sized numbers. + return s; +} + +static void destroy_data_stream( DataStream* s ) +{ + xfree(s); +} + +static unsigned char get_byte( DataStream* s ) +{ + assert(s->data + 1 <= s->data_end); + return *s->data++; +} + +static short get_word( DataStream* s ) +{ + short hi, lo; + assert(s->data + 2 <= s->data_end); + hi = *s->data++; + lo = *s->data++; + return ((hi << 8) | lo); +} + +static int get_dword( DataStream* s ) +{ + int b1, b2, b3, b4; + assert(s->data + 4 <= s->data_end); + b4 = *s->data++; + b3 = *s->data++; + b2 = *s->data++; + b1 = *s->data++; + return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1); +} + +static int get_number( DataStream* s ) +{ + switch (s->number_size) { + case 4: return get_dword(s); + case 2: return get_word(s); + default: return get_byte(s); + } +} + +//----------------------------------------------------------------------------- +// Utility functions to help parse Darwin keymap +//----------------------------------------------------------------------------- + +/* + * bits_set + * Calculate number of bits set in the modifier mask. + */ +static short bits_set( short mask ) +{ + short n = 0; + + for ( ; mask != 0; mask >>= 1) + if ((mask & 0x01) != 0) + n++; + return n; +} + +/* + * parse_next_char_code + * Read the next character code from the Darwin keymapping + * and write it to the X keymap. + */ +static void parse_next_char_code( + DataStream *s, + KeySym *k ) +{ + const short charSet = get_number(s); + const short charCode = get_number(s); + + if (charSet == 0) { // ascii character + if (charCode >= 0 && charCode < 256) + *k = ascii_to_x[charCode]; + } else if (charSet == 0x01) { // symbol character + if (charCode >= MIN_SYMBOL && + charCode <= MIN_SYMBOL + NUM_SYMBOL) + *k = symbol_to_x[charCode - MIN_SYMBOL]; + } else if (charSet == 0xFE) { // function key + if (charCode >= MIN_FUNCKEY && + charCode <= MIN_FUNCKEY + NUM_FUNCKEY) + *k = funckey_to_x[charCode - MIN_FUNCKEY]; + } +} + +/* + * DarwinKeyboardInit + * Get the Darwin keyboard map and compute an equivalent + * X keyboard map and modifier map. Set the new keyboard + * device structure. + */ +void DarwinKeyboardInit( + DeviceIntPtr pDev ) +{ + KeySym *k; + int i; + short numMods, numKeys, numPadKeys = 0; + KeySymsRec keySyms; + NXKeyMapping keyMap; + DataStream *keyMapStream; + unsigned char const *numPadStart = 0; + + memset( modMap, NoSymbol, sizeof( modMap ) ); + memset( map, 0, sizeof( map ) ); + + // Open a shared connection to the HID System. + // Note that the Event Status Driver is really just a wrapper + // for a kIOHIDParamConnectType connection. + assert( dfb.hidParam = NXOpenEventStatus() ); + + // get the Darwin keyboard map + keyMap.size = NXKeyMappingLength( dfb.hidParam ); + keyMap.mapping = (char*) xalloc( keyMap.size ); + assert( NXGetKeyMapping( dfb.hidParam, &keyMap )); + keyMapStream = new_data_stream( (unsigned char const*)keyMap.mapping, + keyMap.size ); + + // check the type of map + if (get_word(keyMapStream)) { + keyMapStream->number_size = 2; + ErrorF("Current 16-bit keymapping may not be interpreted correctly.\n"); + } + + // Compute the modifier map and + // insert X modifier KeySyms into keyboard map. + numMods = get_number(keyMapStream); + while (numMods-- > 0) { + int left = 1; // first keycode is left + short const charCode = get_number(keyMapStream); + short numKeyCodes = get_number(keyMapStream); + if (charCode == NX_MODIFIERKEY_NUMERICPAD) { + numPadStart = keyMapStream->data; + numPadKeys = numKeyCodes; + } + while (numKeyCodes-- > 0) { + const short keyCode = get_number(keyMapStream); + if (charCode == NX_MODIFIERKEY_ALPHALOCK) { + modMap[keyCode + MIN_KEYCODE] = LockMask; + map[keyCode * GLYPHS_PER_KEY] = XK_Caps_Lock; + } else if (charCode == NX_MODIFIERKEY_SHIFT) { + modMap[keyCode + MIN_KEYCODE] = ShiftMask; + map[keyCode * GLYPHS_PER_KEY] = + (left ? XK_Shift_L : XK_Shift_R); + } else if (charCode == NX_MODIFIERKEY_CONTROL) { + modMap[keyCode + MIN_KEYCODE] = ControlMask; + map[keyCode * GLYPHS_PER_KEY] = + (left ? XK_Control_L : XK_Control_R); + } else if (charCode == NX_MODIFIERKEY_ALTERNATE) { + modMap[keyCode + MIN_KEYCODE] = AltMask; + if (left) { + map[keyCode * GLYPHS_PER_KEY] = XK_Alt_L; + darwinKeyOptionL = keyCode + MIN_KEYCODE; + } else + map[keyCode * GLYPHS_PER_KEY] = XK_Alt_R; + } else if (charCode == NX_MODIFIERKEY_COMMAND) { + modMap[keyCode + MIN_KEYCODE] = MetaMask; + if (left) { + map[keyCode * GLYPHS_PER_KEY] = XK_Meta_L; + darwinKeyCommandL = keyCode + MIN_KEYCODE; + } else + map[keyCode * GLYPHS_PER_KEY] = XK_Meta_R; + } else if (charCode == NX_MODIFIERKEY_NUMERICPAD) { + continue; + } else if (charCode == NX_MODIFIERKEY_HELP) { + map[keyCode * GLYPHS_PER_KEY] = XK_Help; + } else { + break; + } + left = 0; + } + } + + // Convert the Darwin keyboard map to an X keyboard map. + // A key can have shifted and unshifted character codes. + // Other modifiers are ignored although they are + // present in the Darwin keyboard map. + numKeys = get_number(keyMapStream); + for (i = 0, k = map; i < numKeys; i++, k += GLYPHS_PER_KEY) { + short const charGenMask = get_number(keyMapStream); + if (charGenMask != 0xFF) { // is key bound? + short numKeyCodes = 1 << bits_set(charGenMask); + + // If alphalock and shift modifiers produce different codes, + // we only need the shift case since X handles alphalock. + if (charGenMask & 0x01 && charGenMask & 0x02) { + // record unshifted case + parse_next_char_code( keyMapStream, k ); + // skip alphalock case + get_number(keyMapStream); get_number(keyMapStream); + // record shifted case + parse_next_char_code( keyMapStream, k+1 ); + if (k[1] == k[0]) k[1] = NoSymbol; + numKeyCodes -= 3; + // skip the rest + while (numKeyCodes-- > 0) { + get_number(keyMapStream); get_number(keyMapStream); + } + + // If alphalock and shift modifiers produce same code, use it. + } else if (charGenMask & 0x03) { + // record unshifted case + parse_next_char_code( keyMapStream, k ); + // record shifted case + parse_next_char_code( keyMapStream, k+1 ); + if (k[1] == k[0]) k[1] = NoSymbol; + numKeyCodes -= 2; + // skip the rest + while (numKeyCodes-- > 0) { + get_number(keyMapStream); get_number(keyMapStream); + } + + // If neither alphalock or shift produce characters, + // use only one character code for this key, + // but it can be a special character. + } else { + parse_next_char_code( keyMapStream, k ); + numKeyCodes--; + while (numKeyCodes-- > 0) { // skip the rest + get_number(keyMapStream); get_number(keyMapStream); + + } + } + } + } + + // Now we have to go back through the list of keycodes that are on the + // numeric keypad and update the X keymap. + keyMapStream->data = numPadStart; + while(numPadKeys-- > 0) { + const short keyCode = get_number(keyMapStream); + k = &map[keyCode * GLYPHS_PER_KEY]; + for (i = 0; i < NUM_KEYPAD; i++) { + if (*k == normal_to_keypad[i].normalSym) { + k[0] = normal_to_keypad[i].keypadSym; + break; + } + } + } + + // free Darwin keyboard map + destroy_data_stream( keyMapStream ); + xfree( keyMap.mapping ); + +#ifdef DUMP_DARWIN_KEYMAP + ErrorF("Darwin -> X converted keyboard map\n"); + for (i = 0, k = map; i < NX_NUMKEYCODES; i++, k += GLYPHS_PER_KEY) { + int j; + ErrorF("0x%02x:", i); + for (j = 0; j < GLYPHS_PER_KEY; j++) { + if (k[j] == NoSymbol) { + ErrorF("\tNoSym"); + } else { + ErrorF("\t0x%x", k[j]); + } + } + ErrorF("\n"); + } +#endif + + keySyms.map = map; + keySyms.mapWidth = GLYPHS_PER_KEY; + keySyms.minKeyCode = MIN_KEYCODE; + keySyms.maxKeyCode = MAX_KEYCODE; + + assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms, modMap, + DarwinBell, + DarwinChangeKeyboardControl )); +} + +/* + * LegalModifier + * This allows the driver level to prevent some keys from being remapped + * as modifier keys. + * I have no idea why this is useful. + */ +Bool LegalModifier(unsigned int key, DevicePtr pDev) +{ + return 1; +} diff --git a/xc/programs/Xserver/hw/darwin/utils/Imakefile b/xc/programs/Xserver/hw/darwin/utils/Imakefile new file mode 100644 index 000000000..7947a14ce --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/utils/Imakefile @@ -0,0 +1,11 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/darwin/utils/Imakefile,v 1.2 2000/11/16 03:22:18 dawes Exp $ + + SRCS = dumpkeymap.c + OBJS = dumpkeymap.o +EXTRA_LOAD_FLAGS = -framework IOKit + +AllTarget(ProgramTargetName(dumpkeymap)) + +SingleProgramTarget(dumpkeymap,$(OBJS),NullParameter,NullParameter) +InstallProgram(dumpkeymap,$(BINDIR)) + diff --git a/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c b/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c new file mode 100644 index 000000000..a3b96ea45 --- /dev/null +++ b/xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c @@ -0,0 +1,879 @@ +// $XFree86: xc/programs/Xserver/hw/darwin/utils/dumpkeymap.c,v 1.1 2000/11/15 01:36:14 dawes Exp $ +// +//============================================================================= +// +// Copyright (C) 1999,2000 by Eric Sunshine <sunshine@sunshineco.com> +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN +// NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//============================================================================= +//----------------------------------------------------------------------------- +// dumpkeymap.c +// +// Prints a textual representation of an Apple/NeXT .keymapping file, or +// the currently active key map in use by the WindowServer and the AppKit +// on the local machine. +// +// KEY MAPPING DESCRIPTION +// +// Types and Data +// -------------- +// The following type definitions are employed throughout this +// discussion: +// +// typedef unsigned char byte; +// typedef unsigned short word; +// typedef unsigned long dword; +// +// Additionally, the type definition `number' is used generically to +// indicate a numeric value. The actual size of the `number' type may be +// one or two bytes depending upon how the data is stored in the key map. +// Although most key maps use byte-sized numeric values, word-sized +// values are also allowed. +// +// Multi-byte values in a key mapping file are stored in big-endian byte +// order. +// +// Key Mapping File and Device Mapping +// ----------------------------------- +// A key mapping file begins with a magic-number and continues with a +// variable number of device-specific key mappings. +// +// struct KeyMappingFile { +// char magic_number[4]; // "KYM1" +// DeviceMapping maps[...] // Variable number of maps +// }; +// +// struct DeviceMapping { +// dword interface; // NX_EVS_DEVICE_INTERFACE_ACE, etc. +// dword handler_id; // Interface subtype (0=101, 1=102 key, etc.) +// dword map_size; // Byte count following this address +// KeyMapping map; +// }; +// +// Together, `interface' and `handler_id' identify the exact keyboard +// hardware to which this mapping applies. The `interface' value +// represents a family of keyboard device types (such as Intel, ADB, +// NeXT, Sun Type5, etc.) and `handler_id' represents a specific keyboard +// layout within that family. On MacOS/X and Darwin, `interface' +// constants can be found in IOHIDTypes.h, whereas on MacOS/X Server, +// OpenStep, and NextStep, they can be found in ev_types.h. Programs +// which display a visual representation of a keyboard layout, match +// `interface' and `handler_id' from the .keymapping file against the +// `interface' and `handler_id' values found in each .keyboard file. +// +// Key Mapping +// ----------- +// A key mapping completely defines the relationship of all scan codes +// with their associated functionality. A KeyMapping structure is +// embedded within the DeviceMapping structure in a KeyMappingFile. The +// currently active key mapping in use by the WindowServer and AppKit is +// also represented by a KeyMapping structure, and can be referred to +// directly by calling NXGetKeyMapping() and accessing the `mapping' data +// member of the returned NXKeyMapping structure. +// +// struct KeyMapping { +// word number_size; // 0=1 byte, non-zero=2 bytes +// number num_modifier_groups; // Modifier groups +// ModifierGroup modifier_groups[...]; +// number num_scan_codes; // Scan groups +// ScanGroup scan_table[...]; +// number num_sequence_lists; // Sequence lists +// Sequence sequence_lists[...]; +// number num_special_keys; // Special keys +// SpecialKey special_key[...]; +// }; +// +// The `number_size' flag determines the size, in bytes, of all remaining +// numeric values (denoted by the type definition `number') within the +// key mapping. If its value is zero, then numbers are represented by a +// single byte. If it is non-zero, then numbers are represented by a +// word (two bytes). +// +// Modifier Group +// -------------- +// A modifier group defines all scan codes which map to a particular type +// of modifier, such as "shift", "control", etc. +// +// enum Modifier { +// ALPHALOCK = 0, +// SHIFT, +// CONTROL, +// ALTERNATE, +// COMMAND, +// KEYPAD, +// HELP +// }; +// +// struct ModifierGroup { +// number modifier; // A Modifier constant +// number num_scan_codes; +// number scan_codes[...]; // Variable number of scan codes +// }; +// +// The scan_codes[] array contains a list of all scan codes which map to +// the specified modifier. The "shift", "command", and "alternate" +// modifiers are frequently mapped to two different scan codes, apiece, +// since these modifiers often appear on both the left and right sides of +// the keyboard. +// +// Scan Group +// ---------- +// There is one ScanGroup for each scan code generated by the given +// keyboard. This number is given by KeyMapping::num_scan_codes. The +// first scan group represents hardware scan code 0, the second +// represents scan code 1, etc. +// +// enum ModifierMask { +// ALPHALOCK_MASK = 1 << 0, +// SHIFT_MASK = 1 << 1, +// CONTROL_MASK = 1 << 2, +// ALTERNATE_MASK = 1 << 3, +// CARRIAGE_RETURN_MASK = 1 << 4 +// }; +// #define NOT_BOUND 0xff +// +// struct ScanGroup { +// number mask; +// Character characters[...]; +// }; +// +// For each scan code, `mask' defines which modifier combinations +// generate characters. If `mask' is NOT_BOUND (0xff) then then this +// scan code does not generate any characters ever, and its characters[] +// array is zero length. Otherwise, the characters[] array contains one +// Character record for each modifier combination. +// +// The number of records in characters[] is determined by computing +// (1 << bits_set_in_mask). In other words, if mask is zero, then zero +// bits are set, so characters[] contains only one record. If `mask' is +// (SHIFT_MASK | CONTROL_MASK), then two bits are set, so characters[] +// contains four records. +// +// The first record always represents the character which is generated by +// that key when no modifiers are active. The remaining records +// represent characters generated by the various modifier combinations. +// Using the example with the "shift" and "control" masks set, record two +// would represent the character with the shift modifier active; record +// three, the control modifier active; and record four, both the shift +// and control modifiers active. +// +// As a special case, ALPHALOCK_MASK implies SHIFT_MASK, though only +// ALPHALOCK_MASK appears in `mask'. In this case the same character is +// generated for both the shift and alpha-lock modifiers, but only needs +// to appear once in the characters[] array. +// +// Character +// --------- +// Each Character record indicates the character generated when this key +// is pressed, as well as the character set which contains the character. +// Well known character Sets are "ASCII" and "Symbol". The character set +// can also be one of the meta values FUNCTION_KEY or KEY_SEQUENCE. If +// it is FUNCTION_KEY then `char_code' represents a generally well-known +// function key such as those enumerated by FunctionKey. If the +// character set is KEY_SEQUENCE then `char_code' represents is a +// zero-base index into KeyMapping::sequence_lists[]. +// +// enum CharacterSet { +// ASCII = 0x00, +// SYMBOL = 0x01, +// ... +// FUNCTION_KEY = 0xfe, +// KEY_SEQUENCE = 0xff +// }; +// +// struct Character { +// number set; // CharacterSet of generated character +// number char_code; // Actual character generated +// }; +// +// enum FunctionKey { +// F1 = 0x20, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, +// INSERT, DELETE, HOME, END, PAGE_UP, PAGE_DOWN, PRINT_SCREEN, +// SCROLL_LOCK, PAUSE, SYS_REQUEST, BREAK, RESET, STOP, MENU, USER, +// SYSTEM, PRINT, CLEAR_LINE, CLEAR_DISPLAY, INSERT_LINE, +// DELETE_LINE, INSERT_CHAR, DELETE_CHAR, PREV, NEXT, SELECT +// }; +// +// Sequence +// -------- +// When Character::set contains the meta value KEY_SEQUENCE, the scan +// code is bound to a sequence of keys rather than a single character. A +// sequence is a series of modifiers and characters which are +// automatically generated when the associated key is depressed. Each +// generated Character is represented as previously described, with the +// exception that MODIFIER_KEY may appear in place of KEY_SEQUENCE. When +// the value of Character::set is MODIFIER_KEY then Character::char_code +// represents a modifier key rather than an actual character. If the +// modifier represented by `char_code' is non-zero, then it indicates +// that the associated modifier key has been depressed. In this case, +// the value is one of the constants enumerated by Modifier (SHIFT, +// CONTROL, ALTERNATE, etc.). If the value is zero then it means that +// the modifier keys have been released. +// +// #define MODIFIER_KEY 0xff +// +// struct Sequence { +// number num_chars; +// Character characters[...]; +// }; +// +// Special Key +// ----------- +// A special key is one which is scanned directly by the Mach kernel +// rather than by the WindowServer. In general, events are not generated +// for special keys. +// +// enum SpecialKeyType { +// VOLUME_UP = 0, +// VOLUME_DOWN, +// BRIGHTNESS_UP, +// BRIGHTNESS_DOWN, +// ALPHA_LOCK, +// HELP, +// POWER, +// SECONDARY_ARROW_UP, +// SECONDARY_ARROW_DOWN +// }; +// +// struct SpecialKey { +// number type; // A SpecialKeyType constant +// number scan_code; // Actual scan code +// }; +// +// COMPILATION INSTRUCTIONS +// +// MacOS/X, Darwin +// cc -Wall -o dumpkeymap dumpkeymap.c -framework IOKit +// +// MacOS/X Server, OpenStep, NextStep +// cc -Wall -o dumpkeymap dumpkeymap.c +// +// USAGE INSTRUCTIONS +// +// Usage: dumpkeymap [path-to-keymap ...] +// +// When provided with no arguments, this program dumps the currently +// active key map. Otherwise, it prints out the contents of each +// .keymapping files mentioned as an argument on the command line. +// +// CONCLUSION +// +// This program and its accompanying documentation were written by Eric +// Sunshine and are copyright (C)1999,2000 by Eric Sunshine +// <sunshine@sunshineco.com>. It is based on information gathered on +// September 3, 1997 by Eric Sunshine and Paul S. McCarthy +// <zarnuk@zarnuk.com> while reverse engineering the NeXT .keymapping +// file format. +// +// HISTORY +// +// 2000/11/13 Eric Sunshine <sunshine@sunshineco.com> +// Converted from C++ to plain-C. +// Now parses and takes into account the "number-size" flag stored +// with each key map. This flag indicates the size, in bytes, of +// all remaining numeric values in the mapping. Updated all code +// to respect the this flag. (Previously, the purpose of this +// field was unknown, and it was thus denoted as +// `KeyMapping::fill[2]'.) +// Updated all documentation; especially the "KEY MAPPING +// DESCRIPTION" section. Added discussion of the "number-size" +// flag and revamped all structure definitions to use the generic +// data type `number' instead of `uchar' or 'byte'. Clarified +// several sections of the documentation and added missing +// discussions about type definitions and the relationship of +// `interface' and `handler_id' to .keymapping and .keyboard +// files. +// Updated compilation instructions to include directions for all +// platforms on which this program might be built. +// Now published under the formal BSD license rather than a +// home-grown license. +// +// 1999/09/08 Eric Sunshine <sunshine@sunshineco.com> +// Created. +//----------------------------------------------------------------------------- +#include <ctype.h> +#include <stdio.h> +#include <stdlib.h> +#include <drivers/event_status_driver.h> +#include <sys/stat.h> + +#define PROG_NAME "dumpkeymap" +#define PROG_VERSION 2 +#define AUTHOR_NAME "Eric Sunshine" +#define AUTHOR_EMAIL "sunshine@sunshineco.com" +#define AUTHOR_INFO AUTHOR_NAME " <" AUTHOR_EMAIL ">" +#define COPYRIGHT "Copyright (C) 1999,2000 by " AUTHOR_INFO + +typedef unsigned char byte; +typedef unsigned short word; +typedef unsigned int natural; +typedef unsigned long dword; +typedef dword number; + +#define ASCII_SET 0x00 +#define BIND_FUNCTION 0xfe +#define BIND_SPECIAL 0xff + +//----------------------------------------------------------------------------- +// Translation Tables +//----------------------------------------------------------------------------- +static char const* const SPECIAL_CODE[] = + { + "sound-up", + "sound-down", + "brightness-up", + "brightness-down", + "alpha-lock", + "help", + "power", + "secondary-up-arrow", + "secondary-down-arrow" + }; +#define N_SPECIAL_CODE (sizeof(SPECIAL_CODE) / sizeof(SPECIAL_CODE[0])) + +static char const* const MODIFIER_CODE[] = + { + "alpha-lock", + "shift", + "control", + "alternate", + "command", + "keypad", + "help" + }; +#define N_MODIFIER_CODE (sizeof(MODIFIER_CODE) / sizeof(MODIFIER_CODE[0])) + +static char const* const MODIFIER_MASK[] = + { + "-----", // R = carriage-return + "----L", // A = alternate + "---S-", // C = control + "---SL", // S = shift + "--C--", // L = alpha-lock + "--C-L", + "--CS-", + "--CSL", + "-A---", + "-A--L", + "-A-S-", + "-A-SL", + "-AC--", + "-AC-L", + "-ACS-", + "-ACSL", + "R----", + "R---L", + "R--S-", + "R--SL", + "R-C--", + "R-C-L", + "R-CS-", + "R-CSL", + "RA---", + "RA--L", + "RA-S-", + "RA-SL", + "RAC--", + "RAC-L", + "RACS-", + "RACSL", + }; +#define N_MODIFIER_MASK (sizeof(MODIFIER_MASK) / sizeof(MODIFIER_MASK[0])) + +#define FUNCTION_KEY_FIRST 0x20 +static char const* const FUNCTION_KEY[] = + { + "F1", // 0x20 + "F2", // 0x21 + "F3", // 0x22 + "F4", // 0x23 + "F5", // 0x24 + "F6", // 0x25 + "F7", // 0x26 + "F8", // 0x27 + "F9", // 0x28 + "F10", // 0x29 + "F11", // 0x2a + "F12", // 0x2b + "insert", // 0x2c + "delete", // 0x2d + "home", // 0x2e + "end", // 0x2f + "page up", // 0x30 + "page down", // 0x31 + "print screen", // 0x32 + "scroll lock", // 0x33 + "pause", // 0x34 + "sys-request", // 0x35 + "break", // 0x36 + "reset (HIL)", // 0x37 + "stop (HIL)", // 0x38 + "menu (HIL)", // 0x39 + "user (HIL)", // 0x3a + "system (HIL)", // 0x3b + "print (HIL)", // 0x3c + "clear line (HIL)", // 0x3d + "clear display (HIL)", // 0x3e + "insert line (HIL)", // 0x3f + "delete line (HIL)", // 0x40 + "insert char (HIL)", // 0x41 + "delete char (HIL)", // 0x42 + "prev (HIL)", // 0x43 + "next (HIL)", // 0x44 + "select (HIL)", // 0x45 + }; +#define N_FUNCTION_KEY (sizeof(FUNCTION_KEY) / sizeof(FUNCTION_KEY[0])) + + +//----------------------------------------------------------------------------- +// Data Stream Object +// Can be configured to treat embedded "numbers" as being composed of +// either 1, 2, or 4 bytes, apiece. +//----------------------------------------------------------------------------- +typedef struct _DataStream + { + byte const* data; + byte const* data_end; + natural number_size; // Size in bytes of a "number" in the stream. + } DataStream; + +static DataStream* new_data_stream( byte const* data, int size ) + { + DataStream* s = (DataStream*)malloc( sizeof(DataStream) ); + s->data = data; + s->data_end = data + size; + s->number_size = 1; // Default to byte-sized numbers. + return s; + } + +static void destroy_data_stream( DataStream* s ) + { + free(s); + } + +static int end_of_stream( DataStream* s ) + { + return (s->data >= s->data_end); + } + +static void expect_nbytes( DataStream* s, int nbytes ) + { + if (s->data + nbytes > s->data_end) + { + fprintf( stderr, "Insufficient data in keymapping data stream.\n" ); + exit(-1); + } + } + +static byte get_byte( DataStream* s ) + { + expect_nbytes( s, 1 ); + return *s->data++; + } + +static word get_word( DataStream* s ) + { + word hi, lo; + expect_nbytes( s, 2 ); + hi = *s->data++; + lo = *s->data++; + return ((hi << 8) | lo); + } + +static dword get_dword( DataStream* s ) + { + dword b1, b2, b3, b4; + expect_nbytes( s, 4 ); + b4 = *s->data++; + b3 = *s->data++; + b2 = *s->data++; + b1 = *s->data++; + return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1); + } + +static number get_number( DataStream* s ) + { + switch (s->number_size) + { + case 4: return get_dword(s); + case 2: return get_word(s); + default: return get_byte(s); + } + } + + +//----------------------------------------------------------------------------- +// Translation Utility Functions +//----------------------------------------------------------------------------- +static char const* special_code_desc( number n ) + { + if (n < N_SPECIAL_CODE) + return SPECIAL_CODE[n]; + else + return "invalid"; + } + +static char const* modifier_code_desc( number n ) + { + if (n < N_MODIFIER_CODE) + return MODIFIER_CODE[n]; + else + return "invalid"; + } + +static char const* modifier_mask_desc( number n ) + { + if (n < N_MODIFIER_MASK) + return MODIFIER_MASK[n]; + else + return "?????"; + } + +static char const* function_key_desc( number n ) + { + if (n >= FUNCTION_KEY_FIRST && n < N_FUNCTION_KEY + FUNCTION_KEY_FIRST) + return FUNCTION_KEY[ n - FUNCTION_KEY_FIRST ]; + else + return "unknown"; + } + +static number bits_set( number mask ) + { + number n = 0; + for ( ; mask != 0; mask >>= 1) + if ((mask & 0x01) != 0) + n++; + return n; + } + + +//----------------------------------------------------------------------------- +// Unparse a list of Modifier records. +//----------------------------------------------------------------------------- +static void unparse_modifiers( DataStream* s ) + { + number nmod = get_number(s); // Modifier count + printf( "\nMODIFIERS [%lu]\n", nmod ); + while (nmod-- > 0) + { + number nscan; + number const code = get_number(s); + printf( "%s:", modifier_code_desc(code) ); + nscan = get_number(s); + while (nscan-- > 0) + printf( " 0x%02x", (natural)get_number(s) ); + putchar( '\n' ); + } + } + + +//----------------------------------------------------------------------------- +// Unparse a list of Character records. +//----------------------------------------------------------------------------- +typedef void (*UnparseSpecialFunc)( number code ); + +static void unparse_char_codes( + DataStream* s, number ncodes, UnparseSpecialFunc unparse_special ) + { + if (ncodes != 0) + { + while (ncodes-- > 0) + { + number const char_set = get_number(s); + number const code = get_number(s); + putchar(' '); + switch (char_set) + { + case ASCII_SET: + { + int const c = (int)code; + if (isprint(c)) + printf( "\"%c\"", c ); + else if (code < ' ') + printf( "\"^%c\"", c + '@' ); + else + printf( "%02x", c ); + break; + } + case BIND_FUNCTION: + printf( "[%s]", function_key_desc(code) ); + break; + case BIND_SPECIAL: + unparse_special( code ); + break; + default: + printf( "%02x/%02x", (natural)char_set, (natural)code ); + break; + } + } + } + } + + +//----------------------------------------------------------------------------- +// Unparse a list of scan code bindings. +//----------------------------------------------------------------------------- +static void unparse_key_special( number code ) + { + printf( "{seq#%lu}", code ); + } + +static void unparse_keys( DataStream* s ) + { + number const NOT_BOUND = 0xff; + number const nkeys = get_number(s); + number scan; + printf( "\nKEYS [%lu]\n", nkeys ); + for (scan = 0; scan < nkeys; scan++) + { + number const mask = get_number(s); + printf( "scan 0x%02x: ", (natural)scan ); + if (mask == NOT_BOUND) + printf( "not-bound\n" ); + else + { + number const bits = bits_set( mask ); + number const codes = 1 << bits; + printf( "%s ", modifier_mask_desc(mask) ); + unparse_char_codes( s, codes, unparse_key_special ); + putchar( '\n' ); + } + } + } + + +//----------------------------------------------------------------------------- +// Unparse a list of key sequences. +//----------------------------------------------------------------------------- +static void unparse_sequence_special( number code ) + { + printf( "{%s}", (code == 0 ? "unmodify" : modifier_code_desc(code)) ); + } + +static void unparse_sequences( DataStream* s ) + { + number const nseqs = get_number(s); + number seq; + printf( "\nSEQUENCES [%lu]\n", nseqs ); + for (seq = 0; seq < nseqs; seq++) + { + number const nchars = get_number(s); + printf( "sequence %lu: ", seq ); + unparse_char_codes( s, nchars, unparse_sequence_special ); + putchar( '\n' ); + } + } + + +//----------------------------------------------------------------------------- +// Unparse a list of special keys. +//----------------------------------------------------------------------------- +static void unparse_specials( DataStream* s ) + { + number nspecials = get_number(s); + printf( "\nSPECIALS [%lu]\n", nspecials ); + while (nspecials-- > 0) + { + number const special = get_number(s); + number const scan = get_number(s); + printf( "%s: 0x%02x\n", special_code_desc(special), (natural)scan ); + } + } + + +//----------------------------------------------------------------------------- +// Unparse the number-size flag. +//----------------------------------------------------------------------------- +static void unparse_numeric_size( DataStream* s ) + { + word const numbers_are_shorts = get_word(s); + s->number_size = numbers_are_shorts ? 2 : 1; + } + + +//----------------------------------------------------------------------------- +// Unparse an entire key map. +//----------------------------------------------------------------------------- +static void unparse_keymap_data( DataStream* s ) + { + unparse_numeric_size(s); + unparse_modifiers(s); + unparse_keys(s); + unparse_sequences(s); + unparse_specials(s); + } + + +//----------------------------------------------------------------------------- +// Unparse the active key map. +//----------------------------------------------------------------------------- +static int unparse_active_keymap( void ) + { + int rc = 1; + NXEventHandle const h = NXOpenEventStatus(); + if (h == 0) + fprintf( stderr, "Unable to open event status driver.\n" ); + else + { + NXKeyMapping km; + km.size = NXKeyMappingLength(h); + if (km.size <= 0) + fprintf( stderr, "Bad key mapping length (%d).\n", km.size ); + else + { + km.mapping = (char*)malloc( km.size ); + if (NXGetKeyMapping( h, &km ) == 0) + fprintf( stderr, "Unable to get current key mapping.\n" ); + else + { + DataStream* stream = + new_data_stream( (byte const*)km.mapping, km.size ); + unparse_keymap_data( stream ); + destroy_data_stream( stream ); + rc = 0; + } + free( km.mapping ); + } + NXCloseEventStatus(h); + } + return rc; + } + + +//----------------------------------------------------------------------------- +// Unparse one key map from a keymapping file. +//----------------------------------------------------------------------------- +static void unparse_keymap( DataStream* s ) + { + dword const interface = get_dword(s); + dword const handler_id = get_dword(s); + dword const map_size = get_dword(s); + printf( "interface=0x%02lx handler_id=0x%02lx map_size=%lu bytes\n", + interface, handler_id, map_size ); + unparse_keymap_data(s); + } + + +//----------------------------------------------------------------------------- +// Check the magic number of a keymapping file. +//----------------------------------------------------------------------------- +static int check_magic_number( DataStream* s ) + { + return (get_byte(s) == 'K' && + get_byte(s) == 'Y' && + get_byte(s) == 'M' && + get_byte(s) == '1'); + } + + +//----------------------------------------------------------------------------- +// Unparse all key maps within a keymapping file. +//----------------------------------------------------------------------------- +static int unparse_keymaps( DataStream* s ) + { + int rc = 0; + if (check_magic_number(s)) + { + int n = 0; + while (!end_of_stream(s)) + { + printf( "\nKEYMAP #%d: ", n++ ); + unparse_keymap(s); + } + } + else + { + fprintf( stderr, "Bad magic number.\n" ); + rc = 1; + } + return rc; + } + + +//----------------------------------------------------------------------------- +// Unparse a keymapping file. +//----------------------------------------------------------------------------- +static int unparse_keymap_file( char const* const path ) + { + int rc = 1; + FILE* file; + printf( "\nKEYMAP FILE: %s\n", path ); + file = fopen( path, "rb" ); + if (file == 0) + perror( "Unable to open keymap" ); + else + { + struct stat st; + if (fstat( fileno(file), &st ) != 0) + perror( "Unable to determine file size" ); + else + { + byte* buffer = (byte*)malloc( st.st_size ); + if (fread( buffer, st.st_size, 1, file ) != 1) + perror( "Unable to read keymap" ); + else + { + DataStream* stream = new_data_stream(buffer, (int)st.st_size); + fclose( file ); file = 0; + rc = unparse_keymaps( stream ); + destroy_data_stream( stream ); + } + free( buffer ); + } + if (file != 0) + fclose( file ); + } + return rc; + } + + +//----------------------------------------------------------------------------- +// Print an informational banner. +//----------------------------------------------------------------------------- +static void print_banner( void ) + { + printf( "\n" PROG_NAME " v%d by " AUTHOR_INFO "\n" COPYRIGHT "\n", + PROG_VERSION ); + } + + +//----------------------------------------------------------------------------- +// Master dispatcher. +//----------------------------------------------------------------------------- +int main( int const argc, char const* const argv[] ) + { + int rc = 0; + print_banner(); + if (argc == 1) // No arguments, unparse keymap currently in use. + rc = unparse_active_keymap(); + else // Unparse keymaps specified on command line. + { + int i; + for (i = 1; i < argc; i++) + rc |= unparse_keymap_file( argv[i] ); + } + return rc; + } + diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile b/xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile new file mode 100644 index 000000000..ba5216709 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile @@ -0,0 +1,49 @@ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/Imakefile,v 1.5 2000/11/15 23:13:08 dawes Exp $ +/* + * + * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> + * + */ + +#define IHaveModules +#include <Server.tmpl> + +SRCS = ark_driver.c ark_accel.c + +OBJS = ark_driver.o ark_accel.o + +#if defined(XF86DriverSDK) +INCLUDES = -I. -I../../include +#else +INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \ + -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ + -I$(SERVERSRC)/cfb -I$(XF86SRC)/xaa \ + -I$(XF86SRC)/xf1bpp -I$(XF86SRC)/xf4bpp \ + -I$(XF86SRC)/xf24_32bpp -I$(SERVERSRC)/Xext \ + -I$(XF86SRC)/vgahw -I$(XF86SRC)/ramdac \ + -I$(XF86SRC)/rac -I$(XF86SRC)/int10 \ + -I$(XF86SRC)/fbdevhw -I$(XF86SRC)/ddc \ + -I$(XF86SRC)/i2c \ + -I$(SERVERSRC)/include -I$(XINCLUDESRC) -I$(FONTINCSRC) \ + -I$(EXTINCSRC) -I$(SERVERSRC)/render +#endif + +#if MakeHasPosixVariableSubstitutions +SubdirLibraryRule($(OBJS)) +#endif + +NormalAsmObjectRule() + +ModuleObjectRule() +ObjectModuleTarget(ark, $(OBJS)) + +InstallObjectModule(ark,$(MODULEDIR),drivers) + +DependTarget() + +InstallDriverSDKNonExecFile(Imakefile,$(DRIVERSDKDIR)/drivers/ark) +InstallDriverSDKNonExecFile(ark.h,$(DRIVERSDKDIR)/drivers/ark) +InstallDriverSDKNonExecFile(ark_reg.h,$(DRIVERSDKDIR)/drivers/ark) +InstallDriverSDKNonExecFile(ark_driver.c,$(DRIVERSDKDIR)/drivers/ark) +InstallDriverSDKNonExecFile(ark_accel.c,$(DRIVERSDKDIR)/drivers/ark) + diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark.h b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark.h new file mode 100644 index 000000000..6a95f8039 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark.h @@ -0,0 +1,71 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark.h,v 1.1 2000/11/14 17:28:12 dawes Exp $ */ +/* + * ark + */ + +#ifndef _ARK_H +#define _ARK_H + +#include "xf86.h" +#include "xf86Pci.h" +#include "xf86PciInfo.h" +#include "xaa.h" +#include "xf86_ansic.h" +#include "vgaHW.h" + +typedef struct _ARKRegRec { + unsigned char sr10, sr11, sr12, sr13, sr14, + sr15, sr16, sr17, sr18, sr20, + sr21, sr22, sr23, sr24, sr25, + sr26, sr27, sr28, sr29, sr2a, + sr2b; + unsigned char sr1c, sr1d; + unsigned char cr40, cr41, cr42, cr44, cr46; + unsigned char dac_command; + unsigned char stg_17xx[3]; + unsigned char gendac[6]; +} ARKRegRec, *ARKRegPtr; + + +typedef struct _ARKRec { + pciVideoPtr PciInfo; + PCITAG PciTag; + EntityInfoPtr pEnt; + CARD32 IOAddress; + CARD32 FBAddress; + unsigned char * FBBase; + unsigned char * MMIOBase; + unsigned long videoRam; + OptionInfoPtr Options; + unsigned int Flags; + Bool NoAccel; + CARD32 Bus; + XAAInfoRecPtr pXAA; + int Chipset, ChipRev; + int clock_mult; + int dac_width; + int multiplex_threshold; + int ramdac; + ARKRegRec SavedRegs; /* original mode */ + ARKRegRec ModeRegs; /* current mode */ + Bool (*CloseScreen)(int, ScreenPtr); +} ARKRec, *ARKPtr; + + +#define ARKPTR(p) ((ARKPtr)((p)->driverPrivate)) + + +#define DRIVER_NAME "ark" +#define DRIVER_VERSION "0.5.0" +#define VERSION_MAJOR 0 +#define VERSION_MINOR 5 +#define PATCHLEVEL 0 +#define ARK_VERSION ((VERSION_MAJOR << 24) | \ + (VERSION_MINOR << 16) | \ + PATCHLEVEL) + +#define ZOOMDAC 0x404 +#define ATT490 0x101 + + +#endif /* _ARK_H */ diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c new file mode 100644 index 000000000..c2cefce63 --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c @@ -0,0 +1,227 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_accel.c,v 1.4 2000/11/15 23:13:09 dawes Exp $ */ +/* + * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> + * + * XFree86 4.x driver for ARK Logic chipset + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation and + * that the name of Ani Joshi not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Ani Joshi makes no representations + * about the suitability of this software for any purpose. It is provided + * "as-is" without express or implied warranty. + * + * ANI JOSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ANI JOSHI BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * + * Based on the 3.3.x driver by: + * Harm Hanemaayer <H.Hanemaayer@inter.nl.net> + * + */ + + +#include "Xarch.h" +#include "xf86.h" +#include "xf86_ansic.h" +#include "xf86_OSproc.h" +#include "xaa.h" +#include "xf86PciInfo.h" +#include "compiler.h" + +#include "ark.h" +#include "ark_reg.h" + + +int curx, cury, cmd_flags; + + +static void ARKSync(ScrnInfoPtr pScrn) +{ + for (;;) { + if (!(inb(0x3cb) & 0x40)) + break; + } +} + + +static void ARKSetupForSolidFill(ScrnInfoPtr pScrn, int color, + int rop, unsigned int planemask) +{ + ARKPtr pARK = ARKPTR(pScrn); + + OUTREG16(FG_COLOR, color); + /* ARK color mix matches X raster-ops */ + OUTREG16(COLOR_MIX_SEL, (rop | (rop << 8))); + switch (pScrn->bitsPerPixel) { + case 8: + if ((planemask & 0xff) == 0xff) + cmd_flags = DISABLE_PLANEMASK; + else { + OUTREG16(WRITE_PLANEMASK, planemask); + cmd_flags = 0; + } + break; + case 16: + if ((planemask & 0xffff) == 0xffff) + cmd_flags = DISABLE_PLANEMASK; + else { + OUTREG16(WRITE_PLANEMASK, planemask); + cmd_flags = 0; + } + break; + case 32: + OUTREG16(FG_COLOR_HI, color >> 16); + if ((planemask & 0xffffff) == 0xffffff) + cmd_flags = DISABLE_PLANEMASK; + else { + OUTREG16(WRITE_PLANEMASK, planemask); + cmd_flags = 0; + } + break; + } + + curx = cury = -1; +} + + +static void ARKSubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, + int y, int w, int h) +{ + ARKPtr pARK = ARKPTR(pScrn); + int dst_addr; + + OUTREG(WIDTH, ((h - 1) << 16) | (w - 1)); + if (x != curx || y != cury) { + dst_addr = y * pScrn->displayWidth + x; + OUTREG(DST_ADDR, dst_addr); + curx = x; + cury = y; + } + OUTREG16(COMMAND, SELECT_BG_COLOR | SELECT_FG_COLOR | + STENCIL_ONES | DISABLE_CLIPPING | BITBLT | + cmd_flags); + cury += h; +} + + + +static void ARKSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, + int ydir, int rop, unsigned int planemask, + int trans_color) +{ + ARKPtr pARK = ARKPTR(pScrn); + + cmd_flags = 0; + if (trans_color != -1) { + if (pScrn->bitsPerPixel <= 16) + OUTREG16(TRANS_COLOR, trans_color); + else { + OUTREG16(TRANS_COLOR, trans_color & 0xffff); + OUTREG16(TRANS_COLOR_HI, trans_color >> 16); + } + cmd_flags = STENCIL_GENERATED; + OUTREG16(COLOR_MIX_SEL, rop | 0x0500); + } else { + OUTREG16(COLOR_MIX_SEL, rop | (rop << 8)); + } + + if (ydir < 0) + cmd_flags |= UP; + if (xdir < 0) + cmd_flags |= LEFT; + + /* yes, quite ugly */ + if ((pScrn->bitsPerPixel == 8 && (planemask & 0xff) == 0xff) || + (pScrn->bitsPerPixel == 16 && (planemask & 0xffff) == 0xffff) || + (pScrn->bitsPerPixel == 32 && (planemask & 0xffffff) == 0xffffff)) + cmd_flags |= DISABLE_PLANEMASK; + else + OUTREG16(WRITE_PLANEMASK, planemask); + +} + + + +static void ARKSubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, + int x1, int y1, + int x2, int y2, + int w, int h) +{ + ARKPtr pARK = ARKPTR(pScrn); + int src_addr, dst_addr; + + if (cmd_flags & UP) { + src_addr = (y1 + h - 1) * pScrn->displayWidth; + dst_addr = (y2 + h - 1) * pScrn->displayWidth; + } else { + src_addr = y1 * pScrn->displayWidth; + dst_addr = y2 * pScrn->displayWidth; + } + if (cmd_flags & LEFT) { + src_addr += x1 + w - 1; + dst_addr += x2 + w - 1; + } else { + src_addr += x1; + dst_addr += x2; + } + + OUTREG(SRC_ADDR, src_addr); + OUTREG(DST_ADDR, dst_addr); + OUTREG(WIDTH, ((h - 1) << 16) | (w - 1)); + OUTREG16(COMMAND, BG_BITMAP | FG_BITMAP | DISABLE_CLIPPING | + BITBLT | cmd_flags); +} + + + +Bool ARKAccelInit(ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ARKPtr pARK = ARKPTR(pScrn); + vgaHWPtr hwp = VGAHWPTR(pScrn); + XAAInfoRecPtr pXAA; + + if (!(pXAA = XAACreateInfoRec())) + return FALSE; + + pXAA->Flags = LINEAR_FRAMEBUFFER; + + pXAA->Sync = ARKSync; + pXAA->SetupForSolidFill = ARKSetupForSolidFill; + pXAA->SubsequentSolidFillRect = ARKSubsequentSolidFillRect; + pXAA->ScreenToScreenCopyFlags = 0; + pXAA->SetupForScreenToScreenCopy = ARKSetupForScreenToScreenCopy; + pXAA->SubsequentScreenToScreenCopy = ARKSubsequentScreenToScreenCopy; + + OUTREG16(COLOR_MIX_SEL, 0x0303); + if (pARK->Chipset == PCI_CHIP_1000PV) { + OUTREG16(WRITE_PLANEMASK, 0xffff); + OUTREG16(TRANS_COLOR_MSK, 0xffff); + } else { + OUTREG16(TRANS_COLOR, 0xffff); + OUTREG16(TRANS_COLOR, 0xffffffff >> 16); + } + if (pARK->Chipset == PCI_CHIP_1000PV && pScrn->bitsPerPixel == 32) { + OUTREG16(STENCIL_PITCH, pScrn->displayWidth * 2); + OUTREG16(SRC_PITCH, pScrn->displayWidth * 2); + OUTREG16(DST_PITCH, pScrn->displayWidth * 2); + } else { + OUTREG16(STENCIL_PITCH, pScrn->displayWidth); + OUTREG16(SRC_PITCH, pScrn->displayWidth); + OUTREG16(DST_PITCH, pScrn->displayWidth); + } + + OUTREG16(BITMAP_CONFIG, LINEAR_STENCIL_ADDR | LINEAR_SRC_ADDR | + LINEAR_DST_ADDR); + + return XAAInit(pScreen, pXAA); +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c new file mode 100644 index 000000000..b7e765b5c --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c @@ -0,0 +1,1170 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_driver.c,v 1.8 2000/11/15 23:13:09 dawes Exp $ */ +/* + * Copyright 2000 Ani Joshi <ajoshi@unixbox.com> + * + * XFree86 4.x driver for ARK Logic chipset + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation and + * that the name of Ani Joshi not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Ani Joshi makes no representations + * about the suitability of this software for any purpose. It is provided + * "as-is" without express or implied warranty. + * + * ANI JOSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL ANI JOSHI BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * + * Based on the 3.3.x driver by: + * Harm Hanemaayer <H.Hanemaayer@inter.nl.net> + * + */ + + +#include "xf86.h" +#include "xf86_OSproc.h" +#include "xf86_ansic.h" +#include "xf86Pci.h" +#include "xf86PciInfo.h" +#include "xf86Version.h" +#include "xf86Resources.h" +#include "xf86fbman.h" +#include "xf86cmap.h" +#include "compiler.h" +#include "xaa.h" +#include "mipointer.h" +#include "micmap.h" +#include "mibstore.h" + +#include "ark.h" + + +/* + * prototypes + */ +static OptionInfoPtr ARKAvailableOptions(int chipid, int busid); +static void ARKIdentify(int flags); +static Bool ARKProbe(DriverPtr drv, int flags); +static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags); +static Bool ARKEnterVT(int scrnIndex, int flags); +static void ARKLeaveVT(int scrnIndex, int flags); +static void ARKSave(ScrnInfoPtr pScrn); +static Bool ARKScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, + char **argv); +static Bool ARKMapMem(ScrnInfoPtr pScrn); +static void ARKUnmapMem(ScrnInfoPtr pScrn); +static Bool ARKModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); +static void ARKAdjustFrame(int scrnIndex, int x, int y, int flags); +Bool ARKSwitchMode(int scrnIndex, DisplayModePtr mode, int flags); +Bool ARKCloseScreen(int scrnIndex, ScreenPtr pScreen); +Bool ARKSaveScreen(ScreenPtr pScreen, int mode); +static void ARKFreeScreen(int scrnIndex, int flags); +static void ARKLoadPalette(ScrnInfoPtr pScrn, int numColors, + int *indicies, LOCO *colors, + VisualPtr pVisual); +static void ARKWriteMode(ScrnInfoPtr pScrn, vgaRegPtr pVga, ARKRegPtr new); + +/* helpers */ +static unsigned char get_daccomm(); +static unsigned char set_daccom(unsigned char comm); + + +DriverRec ARK = +{ + ARK_VERSION, + DRIVER_NAME, + ARKIdentify, + ARKProbe, + ARKAvailableOptions, + NULL, + 0 +}; + +/* supported chipsets */ +static SymTabRec ARKChipsets[] = { + { PCI_CHIP_1000PV, "ark1000pv" }, + { PCI_CHIP_2000PV, "ark2000pv" }, + { PCI_CHIP_2000MT, "ark2000mt" }, + { -1, NULL } +}; + +static PciChipsets ARKPciChipsets[] = { + { PCI_CHIP_1000PV, PCI_CHIP_1000PV, RES_SHARED_VGA }, + { PCI_CHIP_2000PV, PCI_CHIP_2000PV, RES_SHARED_VGA }, + { PCI_CHIP_2000MT, PCI_CHIP_2000MT, RES_SHARED_VGA }, + { -1, -1, RES_UNDEFINED } +}; + +typedef enum { + OPTION_NOACCEL +} ARKOpts; + +static OptionInfoRec ARKOptions[] = { + { OPTION_NOACCEL, "noaccel", OPTV_BOOLEAN, {0}, FALSE } +}; + +static const char *fbSymbols[] = { + "fbScreenInit", + NULL +}; + +static const char *vgaHWSymbols[] = { + "vgaHWGetHWRec", + "vgaHWFreeHWRec", + "vgaHWGetIOBase", + "vgaHWSave", + "vgaHWProtect", + "vgaHWRestore", + "vgaHWMapMem", + "vgaHWUnmapMem", + "vgaHWSaveScreen", + "vgaHWLock", + NULL +}; + +static const char *xaaSymbols[] = { + "XAACreateInfoRec", + "XAADestroyInfoRec", + "XAAInit", + "XAAScreenIndex", + NULL +}; + +#ifdef XFree86LOADER + +MODULESETUPPROTO(ARKSetup); + +static XF86ModuleVersionInfo ARKVersRec = { + "ark", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XF86_VERSION_CURRENT, + VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL, + ABI_CLASS_VIDEODRV, + ABI_VIDEODRV_VERSION, + MOD_CLASS_VIDEODRV, + {0, 0, 0, 0} +}; + +XF86ModuleData arkModuleData = { &ARKVersRec, ARKSetup, NULL }; + +pointer ARKSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + static Bool setupDone = FALSE; + + if (!setupDone) { + setupDone = TRUE; + xf86AddDriver(&ARK, module, 0); + LoaderRefSymLists(fbSymbols, vgaHWSymbols, xaaSymbols, NULL); + return (pointer) 1; + } else { + if (errmaj) + *errmaj = LDR_ONCEONLY; + return NULL; + } +} + +#endif /* XFree86LOADER */ + + +static Bool ARKGetRec(ScrnInfoPtr pScrn) +{ + if (pScrn->driverPrivate) + return TRUE; + + pScrn->driverPrivate = xnfcalloc(sizeof(ARKRec), 1); + + return TRUE; +} + +static void ARKFreeRec(ScrnInfoPtr pScrn) +{ + if (!pScrn->driverPrivate) + return; + + xfree(pScrn->driverPrivate); + pScrn->driverPrivate = NULL; +} + +static OptionInfoPtr ARKAvailableOptions(int chipid, int busid) +{ + return ARKOptions; +} + +static void ARKIdentify(int flags) +{ + xf86PrintChipsets("ark", "driver (version " DRIVER_VERSION " for ARK Logic chipset", + ARKChipsets); +} + +static Bool ARKProbe(DriverPtr drv, int flags) +{ + int i; + GDevPtr *devSections = NULL; + int *usedChips; + int numDevSections; + int numUsed; + Bool foundScreen = FALSE; + + /* sanity check */ + if ((numDevSections = xf86MatchDevice("ark", &devSections)) <= 0) + return FALSE; + + /* do ISA later */ + numUsed = xf86MatchPciInstances("ark", PCI_VENDOR_ARK, + ARKChipsets, ARKPciChipsets, + devSections, numDevSections, drv, + &usedChips); + + if (devSections) + xfree(devSections); + + if (numUsed <= 0) + return FALSE; + + if (flags & PROBE_DETECT) + foundScreen = TRUE; + else for (i=0; i<numUsed; i++) { + ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0); + + pScrn->driverVersion = VERSION_MAJOR; + pScrn->driverName = DRIVER_NAME; + pScrn->name = "ark"; + pScrn->Probe = ARKProbe; + pScrn->PreInit = ARKPreInit; + pScrn->ScreenInit = ARKScreenInit; + pScrn->SwitchMode = ARKSwitchMode; + pScrn->AdjustFrame = ARKAdjustFrame; + pScrn->EnterVT = ARKEnterVT; + pScrn->LeaveVT = ARKLeaveVT; + pScrn->FreeScreen = ARKFreeScreen; + foundScreen = TRUE; + xf86ConfigActivePciEntity(pScrn, usedChips[i], ARKPciChipsets, + NULL, NULL, NULL, NULL, NULL); + } + + xfree(usedChips); + + return foundScreen; +} + + +static Bool ARKPreInit(ScrnInfoPtr pScrn, int flags) +{ + EntityInfoPtr pEnt; + ARKPtr pARK; + vgaHWPtr hwp; + MessageType from = X_DEFAULT; + int i; + ClockRangePtr clockRanges; + char *mod = NULL; + const char *reqSym = NULL; + rgb zeros = {0, 0, 0}; + Gamma gzeros = {0.0, 0.0, 0.0}; + unsigned char tmp; + + if (flags & PROBE_DETECT) + return FALSE; + + if (!xf86LoadSubModule(pScrn, "vgahw")) + return FALSE; + + xf86LoaderReqSymLists(vgaHWSymbols, NULL); + + if (!vgaHWGetHWRec(pScrn)) + return FALSE; + + hwp = VGAHWPTR(pScrn); + vgaHWGetIOBase(hwp); + + pScrn->monitor = pScrn->confScreen->monitor; + + if (!xf86SetDepthBpp(pScrn, 8, 8, 8, Support24bppFb | Support32bppFb)) + return FALSE; + else { + switch (pScrn->depth) { + case 8: + case 16: + case 24: + case 32: + /* OK */ + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Given depth (%d) is not supported by this driver\n", + pScrn->depth); + return FALSE; + } + } + + xf86PrintDepthBpp(pScrn); + + if (pScrn->depth > 8) { + if (!xf86SetWeight(pScrn, zeros, zeros)) + return FALSE; + } + + if (pScrn->depth == 8) + pScrn->rgbBits = 8; + + if (!xf86SetDefaultVisual(pScrn, -1)) + return FALSE; + + pScrn->progClock = TRUE; + + if (!ARKGetRec(pScrn)) + return FALSE; + + pARK = ARKPTR(pScrn); + + xf86CollectOptions(pScrn, NULL); + xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ARKOptions); + + if (xf86ReturnOptValBool(ARKOptions, OPTION_NOACCEL, FALSE)) { + pARK->NoAccel = TRUE; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Option: NoAccel - acceleration disabled\n"); + } else + pARK->NoAccel = FALSE; + + if (pScrn->numEntities > 1) { + ARKFreeRec(pScrn); + return FALSE; + } + + pEnt = xf86GetEntityInfo(pScrn->entityList[0]); + if (pEnt->resources) { + xfree(pEnt); + ARKFreeRec(pScrn); + return FALSE; + } + + pARK->PciInfo = xf86GetPciInfoForEntity(pEnt->index); + xf86RegisterResources(pEnt->index, NULL, ResNone); + xf86SetOperatingState(RES_SHARED_VGA, pEnt->index, ResUnusedOpr); + xf86SetOperatingState(resVgaMemShared, pEnt->index, ResDisableOpr); + + if (pEnt->device->chipset && *pEnt->device->chipset) { + pScrn->chipset = pEnt->device->chipset; + pARK->Chipset = xf86StringToToken(ARKChipsets, pScrn->chipset); + } else if (pEnt->device->chipID >= 0) { + pARK->Chipset = pEnt->device->chipID; + pScrn->chipset = (char *)xf86TokenToString(ARKChipsets, + pARK->Chipset); + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipID override: 0x%04X\n", + pARK->Chipset); + } else { + pARK->Chipset = pARK->PciInfo->chipType; + pScrn->chipset = (char *)xf86TokenToString(ARKChipsets, + pARK->Chipset); + } + + if (pEnt->device->chipRev >= 0) { + pARK->ChipRev = pEnt->device->chipRev; + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ChipRev override: %d\n", + pARK->ChipRev); + } else + pARK->ChipRev = pARK->PciInfo->chipRev; + + xfree(pEnt); + + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Chipset: \"%s\"\n", pScrn->chipset); + + pARK->PciTag = pciTag(pARK->PciInfo->bus, pARK->PciInfo->device, + pARK->PciInfo->func); + + /* unlock CRTC[0-7] */ + outb(hwp->IOBase + 4, 0x11); + tmp = inb(hwp->IOBase + 5); + outb(hwp->IOBase + 5, tmp & 0x7f); + modinx(0x3c4, 0x1d, 0x01, 0x01); + + /* use membase's later on ??? */ + pARK->FBAddress = (rdinx(0x3c4, 0x13) << 16) + + (rdinx(0x3c4, 0x14) << 24); + + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Framebuffer @ 0x%x\n", + pARK->FBAddress); + + if (!xf86SetGamma(pScrn, gzeros)) + return FALSE; + + if (!pScrn->videoRam) { + unsigned char sr10; + + sr10 = rdinx(0x3c4, 0x10); + if (pARK->Chipset == PCI_CHIP_1000PV) { + if ((sr10 & 0x40) == 0) + pScrn->videoRam = 1024; + else + pScrn->videoRam = 2048; + } + if (pARK->Chipset == PCI_CHIP_2000PV || + pARK->Chipset == PCI_CHIP_2000MT) { + if ((sr10 & 0xc0) == 0) + pScrn->videoRam = 1024; + else if ((sr10 & 0xc0) == 0x40) + pScrn->videoRam = 2048; + else + pScrn->videoRam = 4096; + } + + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected %d bytes video ram\n", + pScrn->videoRam); + + /* try to detect the RAMDAC */ + { + int man_id, dev_id; + + inb(0x3c6); /* skip command register */ + man_id = inb(0x3c6); /* manufacturer id */ + dev_id = inb(0x3c6); /* device id */ + if (man_id == 0x84 && dev_id == 0x98) { + pARK->ramdac = ZOOMDAC; + pARK->dac_width = 16; + pARK->multiplex_threshold = 40000; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Detected ZOOMDAC\n"); + } + } + + /* hack for this Bali32 */ + pARK->ramdac = ATT490; + pARK->dac_width = 8; + + pARK->clock_mult = 1; + if (pARK->dac_width == 16) { + if (pScrn->bitsPerPixel == 32) + pARK->clock_mult = 2; + } + + pScrn->numClocks = 1; + pScrn->clock[0] = 80000; /* safe */ + + clockRanges = xnfcalloc(sizeof(ClockRange), 1); + clockRanges->next = NULL; + clockRanges->minClock = 20000; + clockRanges->maxClock = 80000; + clockRanges->clockIndex = -1; + clockRanges->interlaceAllowed = FALSE; /* ? */ + clockRanges->doubleScanAllowed = FALSE; /* ? */ + + i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, + pScrn->display->modes, clockRanges, + NULL, 256, 2048, pScrn->bitsPerPixel, + 128, 2048, pScrn->virtualX, + pScrn->display->virtualY, pARK->videoRam * 1024, + LOOKUP_BEST_REFRESH); + if (i == -1) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "no valid modes left\n"); + ARKFreeRec(pScrn); + return FALSE; + } + + xf86PruneDriverModes(pScrn); + + if (i == 0 || pScrn->modes == NULL) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "no valid modes found\n"); + ARKFreeRec(pScrn); + return FALSE; + } + + xf86SetCrtcForModes(pScrn, 0); + pScrn->currentMode = pScrn->modes; + xf86PrintModes(pScrn); + xf86SetDpi(pScrn, 0, 0); + + xf86LoadSubModule(pScrn, "fb"); + xf86LoaderReqSymbols("fbScreenInit", NULL); + + if (!pARK->NoAccel) { + xf86LoadSubModule(pScrn, "xaa"); + xf86LoaderReqSymLists(xaaSymbols, NULL); + } + + return TRUE; +} +} + +static Bool ARKScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, + char **argv) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ARKPtr pARK = ARKPTR(pScrn); + BoxRec MemBox; + int i; + + pScrn->fbOffset = 0; + + if (!ARKMapMem(pScrn)) { + ARKFreeRec(pScrn); + return FALSE; + } + + ARKSave(pScrn); + +/* vgaHWBlankScreen(pScrn, TRUE); */ + + if (!ARKModeInit(pScrn, pScrn->currentMode)) + return FALSE; + + ARKSaveScreen(pScreen, SCREEN_SAVER_ON); + + pScrn->AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + + miClearVisualTypes(); + if (pScrn->bitsPerPixel > 8) { + if (!miSetVisualTypes(pScrn->depth, TrueColorMask, + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + } else { + if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + return FALSE; + } + + if (!fbScreenInit(pScreen, pARK->FBBase, pScrn->virtualX, + pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth, pScrn->bitsPerPixel)) + return FALSE; + + xf86SetBlackWhitePixels(pScreen); + + if (pScrn->bitsPerPixel > 8) { + VisualPtr pVis; + + pVis = pScreen->visuals + pScreen->numVisuals; + while (--pVis >= pScreen->visuals) { + if ((pVis->class | DynamicClass) == DirectColor) { + pVis->offsetRed = pScrn->offset.red; + pVis->offsetGreen = pScrn->offset.green; + pVis->offsetBlue = pScrn->offset.blue; + pVis->redMask = pScrn->mask.red; + pVis->greenMask = pScrn->mask.green; + pVis->blueMask = pScrn->mask.blue; + } + } + } + + + miInitializeBackingStore(pScreen); + xf86SetBackingStore(pScreen); + + if (!pARK->NoAccel) { + if (ARKAccelInit(pScreen)) { + xf86DrvMsg(scrnIndex, X_INFO, "Acceleration enabled\n"); + } else { + xf86DrvMsg(scrnIndex, X_ERROR, "Acceleration initialization failed\n"); + xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n"); + } + } else { + xf86DrvMsg(scrnIndex, X_INFO, "Acceleration disabled\n"); + } + + miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); + + if (!miCreateDefColormap(pScreen)) + return FALSE; + + if (!xf86HandleColormaps(pScreen, 256, 8, ARKLoadPalette, NULL, + CMAP_RELOAD_ON_MODE_SWITCH)) + return FALSE; + +/* vgaHWBlankScreen(pScrn, TRUE); */ + + pScreen->SaveScreen = ARKSaveScreen; + pARK->CloseScreen = pScreen->CloseScreen; + pScreen->CloseScreen = ARKCloseScreen; + + return TRUE; +} + + + +static void ARKSave(ScrnInfoPtr pScrn) +{ + ARKPtr pARK = ARKPTR(pScrn); + ARKRegPtr save = &pARK->SavedRegs; + vgaHWPtr hwp = VGAHWPTR(pScrn); + int vgaIOBase = hwp->IOBase; + + vgaHWUnlock(hwp); + vgaHWSave(pScrn, &hwp->SavedReg, VGA_SR_ALL); + vgaHWLock(hwp); + + /* set read and write aperture index to 0 */ + wrinx(0x3c4, 0x15, 0x00); + wrinx(0x3c4, 0x16, 0x00); + outb(0x3c8, 0); /* reset DAC register access mode */ + + save->sr10 = rdinx(0x3c4, 0x10); + save->sr11 = rdinx(0x3c4, 0x11); + save->sr12 = rdinx(0x3c4, 0x12); + save->sr13 = rdinx(0x3c4, 0x13); + save->sr14 = rdinx(0x3c4, 0x14); + save->sr15 = rdinx(0x3c4, 0x15); + save->sr16 = rdinx(0x3c4, 0x16); + save->sr17 = rdinx(0x3c4, 0x17); + save->sr18 = rdinx(0x3c4, 0x18); + +#if 0 + save->sr1d = rdinx(0x3c4, 0x1d); + save->sr1c = rdinx(0x3c4, 0x1c); + + save->sr20 = rdinx(0x3c4, 0x20); + save->sr21 = rdinx(0x3c4, 0x21); + save->sr22 = rdinx(0x3c4, 0x22); + save->sr23 = rdinx(0x3c4, 0x23); + save->sr24 = rdinx(0x3c4, 0x24); + save->sr25 = rdinx(0x3c4, 0x25); + save->sr26 = rdinx(0x3c4, 0x26); + save->sr27 = rdinx(0x3c4, 0x27); + save->sr29 = rdinx(0x3c4, 0x29); + save->sr2a = rdinx(0x3c4, 0x2a); + if ((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) { + save->sr28 = rdinx(0x3c4, 0x28); + save->sr2b = rdinx(0x3c4, 0x2b); + } +#endif + + save->cr40 = rdinx(vgaIOBase + 4, 0x40); + save->cr41 = rdinx(vgaIOBase + 4, 0x41); + save->cr42 = rdinx(vgaIOBase + 4, 0x42); + save->cr44 = rdinx(vgaIOBase + 4, 0x44); + + if ((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) + save->cr46 = rdinx(vgaIOBase + 4, 0x46); + + /* save RAMDAC regs here, based on type */ + save->dac_command = get_daccomm(); +} + + + +static Bool ARKModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) +{ + ARKPtr pARK = ARKPTR(pScrn); + ARKRegPtr new = &pARK->ModeRegs; + int multiplexing, dac16, modepitch; + vgaHWPtr hwp = VGAHWPTR(pScrn); + vgaRegPtr pVga = &hwp->ModeReg; + int vgaIOBase = hwp->IOBase; + unsigned char tmp; + int offset; + + multiplexing = 0; + + if ((pScrn->bitsPerPixel == 8) && (pARK->dac_width == 16) && + (mode->Clock > pARK->multiplex_threshold)) + multiplexing = 1; + + if (pARK->clock_mult == 2) { + if (!mode->CrtcHAdjusted) { + mode->CrtcHDisplay <<= 1; + mode->CrtcHSyncStart <<= 1; + mode->CrtcHSyncEnd <<= 1; + mode->CrtcHTotal <<= 1; + mode->CrtcHSkew <<= 1; + mode->CrtcHAdjusted = TRUE; + } + } + + if (multiplexing) { + if (!mode->CrtcHAdjusted) { + mode->CrtcHDisplay >>= 1; + mode->CrtcHSyncStart >>= 1; + mode->CrtcHSyncEnd >>= 1; + mode->CrtcHTotal >>= 1; + mode->CrtcHSkew >>= 1; + mode->CrtcHAdjusted = TRUE; + } + } + + if (!vgaHWInit(pScrn, mode)) + return FALSE; + + if ((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) { + new->cr46 = rdinx(vgaIOBase + 4, 0x46) & ~0x04; + dac16 = 0; + if (pScrn->bitsPerPixel > 8) + dac16 = 1; + if (dac16) + new->cr46 |= 0x04; + } + + offset = (pScrn->displayWidth * (pScrn->bitsPerPixel / 8)) >> 3; + pVga->CRTC[0x13] = offset; + pVga->Attribute[0x11] = 0x00; + new->cr41 = (offset & 0x100) >> 5; + + pVga->MiscOutReg |= 0x0c; + + new->sr11 = rdinx(0x3c4, 0x11) & ~0x0f; + switch (pScrn->bitsPerPixel) { + case 8: + new->sr11 |= 0x06; + break; + case 16: + new->sr11 |= 0x0a; + break; + case 24: + new->sr11 |= 0x06; + break; + case 32: + if ((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) + new->sr11 |= 0x0e; + else + new->sr11 |= 0x0a; + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Unsupported screen depth %d\n", + pScrn->bitsPerPixel); + return FALSE; + } + + switch (pScrn->displayWidth) { + case 640: + modepitch = 0; + break; + case 800: + modepitch = 1; + break; + case 1024: + modepitch = 2; + break; + case 1280: + modepitch = 4; + break; + case 1600: + modepitch = 5; + break; + case 2048: + modepitch = 6; + break; + default: + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Unsupported screen width %d\n", + pScrn->displayWidth); + return FALSE; + } + + new->sr17 &= ~0xc7; + new->sr17 |= modepitch; + + new->sr10 = rdinx(0x3c4, 0x10) & ~0x1f; + new->sr10 |= 0x1f; + + new->sr13 = pARK->FBAddress >> 16; + new->sr14 = pARK->FBAddress >> 24; + + new->sr12 = rdinx(0x3c4, 0x12) & ~0x03; + switch (pScrn->videoRam) { + case 1024: + new->sr12 |= 0x01; + break; + case 2048: + new->sr12 |= 0x02; + break; + case 4096: + new->sr12 |= 0x03; + break; + default: + new->sr12 |= 0x01; + break; + } + + new->sr15 = new->sr16 = 0; + + tmp = 0; + if ((mode->CrtcVTotal - 2) & 0x400) + tmp |= 0x80; + if ((mode->CrtcVDisplay - 1) & 0x400) + tmp |= 0x40; + if (mode->CrtcVSyncStart & 0x400) + tmp |= 0x10; + new->cr40 = tmp; + + tmp = new->cr41; /* initialized earlier */ + if ((mode->CrtcHTotal / 8 - 5) & 0x100) + tmp |= 0x80; + if ((mode->CrtcHDisplay / 8 - 1) & 0x100) + tmp |= 0x40; + if ((mode->CrtcHSyncStart / 8 - 1) & 0x100) + tmp |= 0x20; + if ((mode->CrtcHSyncStart / 8) & 0x100) + tmp |= 0x10; + new->cr41 |= tmp; + + new->cr44 = rdinx(vgaIOBase + 4, 0x44) & ~0x34; + new->cr44 &= ~0x01; + new->cr42 = 0; + + /* check interlace here later */ + + /* set display FIFO threshold */ + { + int threshold; + unsigned char tmp; + int bandwidthused, percentused; + + /* mostly guesses here as I would need to know more about + * and from the ramdac... + */ + bandwidthused = (mode->Clock / pARK->clock_mult) * + (pScrn->bitsPerPixel / 8); + /* 120000 is another guess */ + percentused = (bandwidthused * 100) / 120000; + tmp = rdinx(0x3c4, 0x18); + if (pARK->Chipset == PCI_CHIP_1000PV) { + threshold = 4; + tmp |= 0x08; /* enable full FIFO (8 deep) */ + tmp &= ~0x07; + tmp |= threshold; + } + if ((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) { + threshold = 12; + if (percentused >= 45) + threshold = 8; + if (percentused >= 70) + threshold = 4; + tmp &= 0x40; + tmp |= 0x10; + tmp |= (threshold & 0x0e) >> 1; + if (threshold & 0x01) + tmp |= 0x80; + if (threshold & 0x10) + tmp |= 0x20; + } + new->sr18 = tmp; + } + + /* setup the RAMDAC regs */ + if (pARK->ramdac == ZOOMDAC) { + new->dac_command = 0x04; + if ((pScrn->bitsPerPixel == 8) && multiplexing) + new->dac_command = 0x24; + if ((pScrn->bitsPerPixel == 16) && (pARK->dac_width == 16)) + /* assuming green weight is not 5 */ + new->dac_command = 0x34; + if ((pScrn->bitsPerPixel == 16) && (pARK->dac_width == 8)) + new->dac_command = 0x64; + if ((pScrn->bitsPerPixel == 24) && (pARK->dac_width == 16)) + new->dac_command = 0xb4; /* packed */ + if ((pScrn->bitsPerPixel == 32) && (pARK->dac_width == 16)) + new->dac_command = 0x54; + } else if (pARK->ramdac == ATT490) { + new->dac_command = 0x00; + if (pScrn->bitsPerPixel == 16) + /* assuming green weight is 6 */ + new->dac_command = 0xc0; + if (pScrn->bitsPerPixel == 24) + new->dac_command = 0xe0; + } + + /* hrmm... */ + new->dac_command |= 0x02; + +#if 0 + /* hw cursor regs */ + new->sr20 = rdinx(0x3c4, 0x20); + new->sr21 = rdinx(0x3c4, 0x21); + new->sr22 = rdinx(0x3c4, 0x22); + new->sr23 = rdinx(0x3c4, 0x23); + new->sr24 = rdinx(0x3c4, 0x24); + new->sr25 = rdinx(0x3c4, 0x25); + new->sr26 = rdinx(0x3c4, 0x26); + new->sr27 = rdinx(0x3c4, 0x27); + new->sr29 = rdinx(0x3c4, 0x29); + new->sr2a = rdinx(0x3c4, 0x2a); + if ((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) { + new->sr28 = rdinx(0x3c4, 0x28); + new->sr2b = rdinx(0x3c4, 0x3b); + } +#endif + + + ARKWriteMode(pScrn, pVga, new); + + return TRUE; +} + + +static void ARKAdjustFrame(int scrnIndex, int x, int y, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ARKPtr pARK = ARKPTR(pScrn); + vgaHWPtr hwp = VGAHWPTR(pScrn); + int vgaIOBase = hwp->IOBase; + int base; + + base = ((y * pScrn->displayWidth + x) * + (pScrn->bitsPerPixel / 8)); + + if (((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) && + (pScrn->videoRam >= 2048)) + base >>= 3; + else + base >>= 2; + if (pScrn->bitsPerPixel == 24) + base -= base % 3; + + outw(vgaIOBase + 4, (base & 0x00ff00) | 0x0c); + outw(vgaIOBase + 4, ((base & 0x00ff) << 8) | 0x0d); + + modinx(vgaIOBase + 4, 0x40, 0x07, (base & 0x070000) >> 16); +} + + + +static void ARKWriteMode(ScrnInfoPtr pScrn, vgaRegPtr pVga, ARKRegPtr new) +{ + ARKPtr pARK = ARKPTR(pScrn); + vgaHWPtr hwp = VGAHWPTR(pScrn); + int vgaIOBase = hwp->IOBase; + + vgaHWProtect(pScrn, TRUE); + + /* set read and write aperture index to 0 */ + wrinx(0x3c4, 0x15, 0x00); + wrinx(0x3c4, 0x16, 0x00); + + /* write the extended registers first so that textmode font + * restoration can suceed + */ + wrinx(0x3c4, 0x10, new->sr10); + modinx(0x3c4, 0x11, 0x3f, new->sr11); + wrinx(0x3c4, 0x12, new->sr12); + wrinx(0x3c4, 0x13, new->sr13); + wrinx(0x3c4, 0x14, new->sr14); + wrinx(0x3c4, 0x15, new->sr15); + wrinx(0x3c4, 0x16, new->sr16); + wrinx(0x3c4, 0x17, new->sr17); + +#if 0 + wrinx(0x3c4, 0x1c, new->sr1c); + wrinx(0x3c4, 0x1d, new->sr1d); + + /* hw cursor regs */ + wrinx(0x3c4, 0x20, new->sr20); + wrinx(0x3c4, 0x21, new->sr21); + wrinx(0x3c4, 0x22, new->sr22); + wrinx(0x3c4, 0x23, new->sr23); + wrinx(0x3c4, 0x24, new->sr24); + wrinx(0x3c4, 0x25, new->sr25); + wrinx(0x3c4, 0x26, new->sr26); + wrinx(0x3c4, 0x27, new->sr27); + wrinx(0x3c4, 0x29, new->sr29); + wrinx(0x3c4, 0x2a, new->sr2a); +#endif + + if ((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) { + wrinx(0x3c4, 0x28, new->sr28); + wrinx(0x3c4, 0x2B, new->sr2b); + } + + wrinx(vgaIOBase + 4, 0x40, new->cr40); + wrinx(vgaIOBase + 4, 0x41, new->cr41); + wrinx(vgaIOBase + 4, 0x42, new->cr42); + wrinx(vgaIOBase + 4, 0x44, new->cr44); + + if ((pARK->Chipset == PCI_CHIP_2000PV) || + (pARK->Chipset == PCI_CHIP_2000MT)) + wrinx(vgaIOBase + 4, 0x46, new->cr46); + + /* RAMDAC regs */ + if (pARK->ramdac == ZOOMDAC) { + set_daccom(new->dac_command); + } + + if (xf86IsPrimaryPci(pARK->PciInfo)) + vgaHWRestore(pScrn, pVga, VGA_SR_ALL); + else + vgaHWRestore(pScrn, pVga, VGA_SR_MODE); + + inb(0x3c8); + outb(0x3c6, 0xff); + + vgaHWProtect(pScrn, FALSE); + +} + + +static Bool ARKEnterVT(int scrnIndex, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + + if (!ARKModeInit(pScrn, pScrn->currentMode)) + return FALSE; + + ARKAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + + return TRUE; +} + + + +static void ARKLeaveVT(int scrnIndex, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ARKPtr pARK = ARKPTR(pScrn); + ARKRegPtr old = &pARK->SavedRegs; + vgaHWPtr hwp = VGAHWPTR(pScrn); + + ARKWriteMode(pScrn, &hwp->ModeReg, old); + + vgaHWUnlock(hwp); + vgaHWRestore(pScrn, &hwp->SavedReg, VGA_SR_MODE | VGA_SR_FONTS); + vgaHWLock(hwp); + + return; +} + + +static Bool ARKMapMem(ScrnInfoPtr pScrn) +{ + ARKPtr pARK = ARKPTR(pScrn); + vgaHWPtr hwp = VGAHWPTR(pScrn); + + /* extended to cover MMIO space at 0xB8000 */ + hwp->MapSize = 0x20000; + + pARK->MMIOBase = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO, + 0xb8000, 0x8000); + + pARK->FBBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, + pARK->PciTag, pARK->FBAddress, + pScrn->videoRam * 1024); + if (!pARK->FBBase) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Cound not map framebuffer\n"); + return FALSE; + } + + return TRUE; +} + + +static void ARKUnmapMem(ScrnInfoPtr pScrn) +{ + ARKPtr pARK = ARKPTR(pScrn); + + vgaHWUnmapMem(pScrn); + + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pARK->FBBase, + pScrn->videoRam * 1024); + + return; +} + + +Bool ARKCloseScreen(int scrnIndex, ScreenPtr pScreen) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ARKPtr pARK = ARKPTR(pScrn); + vgaHWPtr hwp = VGAHWPTR(pScrn); + + if (pScrn->vtSema) { + vgaHWUnlock(hwp); + ARKWriteMode(pScrn, &hwp->SavedReg, &pARK->SavedRegs); + vgaHWLock(hwp); + ARKUnmapMem(pScrn); + } + + pScrn->vtSema = FALSE; + pScreen->CloseScreen = pARK->CloseScreen; + + return (*pScreen->CloseScreen)(scrnIndex, pScreen); +} + + +Bool ARKSaveScreen(ScreenPtr pScreen, int mode) +{ + return vgaHWSaveScreen(pScreen, mode); +} + + +Bool ARKSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +{ + return ARKModeInit(xf86Screens[scrnIndex], mode); +} + + +static void ARKLoadPalette(ScrnInfoPtr pScrn, int numColors, + int *indicies, LOCO *colors, + VisualPtr pVisual) +{ + int i, index; + + for (i=0; i<numColors; i++) { + index = indicies[i]; + outb(0x3c8, index); + outb(0x3c9, colors[index].red); + outb(0x3c9, colors[index].green); + outb(0x3c9, colors[index].blue); + } +} + + +static void ARKFreeScreen(int scrnIndex, int flags) +{ + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + + vgaHWFreeHWRec(pScrn); + + ARKFreeRec(pScrn); +} + + +static unsigned char get_daccomm() +{ + unsigned char tmp; + + outb(0x3c8, 0); + inb(0x3c6); + inb(0x3c6); + inb(0x3c6); + inb(0x3c6); + tmp = inb(0x3c6); + outb(0x3c8, 0); + + return tmp; +} + + +static unsigned char set_daccom(unsigned char comm) +{ +#if 0 + outb(0x3c8, 0); +#else + inb(0x3c8); +#endif + inb(0x3c6); + inb(0x3c6); + inb(0x3c6); + inb(0x3c6); + outb(0x3c6, comm); +#if 0 + outb(0x3c8, 0); +#else + inb(0x3c8); +#endif + + return inb(0x3c6); +} diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_reg.h new file mode 100644 index 000000000..43bb7838f --- /dev/null +++ b/xc/programs/Xserver/hw/xfree86/drivers/ark/ark_reg.h @@ -0,0 +1,88 @@ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/ark/ark_reg.h,v 1.1 2000/11/14 17:28:13 dawes Exp $ */ + +#ifndef _ARK_REG_H +#define _ARK_REG_H + +/* and let there be no 'u' in color */ +#define BG_COLOR 0x00 +#define FG_COLOR 0x02 +#define BG_COLOR_HI 0x04 +#define FG_COLOR_HI 0x06 +#define TRANS_COLOR 0x08 +#define TRANS_COLOR_MSK 0x0a +#define TRANS_COLOR_HI 0x0c +#define TRANS_COLOR_MSK_HI 0x0e +#define COLOR_MIX_SEL 0x18 +#define WRITE_PLANEMASK 0x1a +#define ERROR_TERM 0x50 +#define AXIAL_ERROR_INC 0x54 +#define STENCIL_PITCH 0x60 +#define SRC_PITCH 0x62 +#define DST_PITCH 0x64 +#define STENCIL_ADDR 0x68 +#define STENCIL_X 0x68 +#define STENCIL_Y 0x6a +#define SRC_ADDR 0x6c +#define SRC_X 0x6c +#define SRC_Y 0x6e +#define DST_ADDR 0x70 +#define DST_X 0x70 +#define DST_Y 0x72 +#define WIDTH 0x74 +#define HEIGHT 0x76 +#define BITMAP_CONFIG 0x7c +#define COMMAND 0x7e + + +/* constants for COMMAND register */ + +#define DRAWSTEP 0x0000 +#define LINEDRAW 0x1000 +#define BITBLT 0x2000 +#define TEXTBITBLT 0x3000 +#define USE_PLANEMASK 0x0000 +#define DISABLE_PLANEMASK 0x0800 +#define PATTERN_8X8 0x0400 +#define SELECT_BG_COLOR 0x0000 +#define BG_BITMAP 0x0200 +#define SELECT_FG_COLOR 0x0000 +#define FG_BITMAP 0x0100 +#define STENCIL_ONES 0x0000 +#define STENCIL_GENERATED 0x0040 +#define STENCIL_BITMAP 0x0080 +#define LINE_DRAWALL 0x0000 +#define LINE_SKIP_FIRST 0x0010 +#define LINE_SKIP_LAST 0x0020 +#define ENABLE_CLIPPING 0x0000 +#define DISABLE_CLIPPING 0x0008 +#undef DOWN +#define DOWN 0x0000 +#undef UP +#define UP 0x0002 +#define RIGHT 0x0000 +#define LEFT 0x0004 +#define DX_GREATER_THAN_DY 0x0000 +#define DY_GREATER_THAN_DX 0x0001 + + +/* constants for bitmap config register */ + +#define SWAP_NIBLES 0x2000 +#define SWAP_BITS 0x1000 +#define SYSTEM_STENCIL 0x0200 +#define LINEAR_STENCIL_ADDR 0x0100 +#define SYSTEM_SRC 0x0020 +#define LINEAR_SRC_ADDR 0x0010 +#define SYSTEM_DST 0x0002 +#define LINEAR_DST_ADDR 0x0001 + + +/* IO macros */ + +#define OUTREG16(offset, value) \ + *(unsigned short *)(pARK->MMIOBase + offset) = value +#define OUTREG(offset, value) \ + *(unsigned int *)(pARK->MMIOBase + offset) = value + + +#endif /* _ARK_REG_H */ |